Skip to content

Commit

Permalink
Don't save root node modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaTheFoxgirl committed Aug 3, 2022
1 parent e9668fa commit 7608373
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions source/session/scene/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,21 @@ struct SceneItem {
TrackingBinding[] bindings;

void saveBindings() {
// HACK: (Luna) I should add a function that directly modifies the EXT_SECT instead of these shenannigans.
vec3 tr = puppet.root.localTransform.translation;
vec3 rt = puppet.root.localTransform.rotation;
vec2 sc = puppet.root.localTransform.scale;

puppet.root.localTransform.translation = vec3(0, 0, 0);
puppet.root.localTransform.rotation = vec3(0, 0, 0);
puppet.root.localTransform.scale = vec2(1, 1);
puppet.extData["com.inochi2d.inochi-session.bindings"] = cast(ubyte[])serializeToJson(bindings);

inWriteINPPuppet(puppet, filePath);

puppet.root.localTransform.translation = tr;
puppet.root.localTransform.rotation = rt;
puppet.root.localTransform.scale = sc;
}

bool tryLoadBindings() {
Expand Down

0 comments on commit 7608373

Please sign in to comment.