Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empties transform doesn't get saved in tours #255

Open
sdumetz opened this issue Feb 28, 2024 · 1 comment
Open

Empties transform doesn't get saved in tours #255

sdumetz opened this issue Feb 28, 2024 · 1 comment

Comments

@sdumetz
Copy link
Contributor

sdumetz commented Feb 28, 2024

Empties (nodes with no "content" but that might have children; eg. the "Lights" node).

I think the relevant code is in CVSnaphots.ts:66,114: Only models and lights gets added. It's more or less a feature given that the features doesn't specify transform as a save target but the more specific lightsand models. However it would be practical to be able to move a bunch of nodes together in a tour.

Regarding a possible fix, aside from finding a way to map this back to the features array, I couldn't get a sense of how to filter the CVNode instances accordingly.

@sdumetz
Copy link
Contributor Author

sdumetz commented Feb 29, 2024

After digging in a bit, I came with a prototype:

@@ -79,16 +86,24 @@ export default class CVSnapshots extends CTweenMachine
 
         const models = this.getGraphComponents(CVModel2);
         models.forEach(model => {
-            this.updateComponentTarget(model.transform, !!features["models"]);
             this.updateComponentTarget(model, !!features["models"]);
         });
 
         const lights = this.getGraphComponents(CLight);
         lights.forEach(light => {
-            this.updateComponentTarget(light.transform, !!features["lights"]);
             this.updateComponentTarget(light, !!features["lights"])
         });
 
+
+        const transforms = this.getGraphComponents(CVNode);
+        for(let transform of transforms){
+            let node = transform.node
+            if(!isNVNode(node)) continue;
+            if(node.camera) continue;
+
+            this.updateComponentTarget(transform, !!features["transforms"]);
+        }
+

The downside is: this introduces another tour "feature" users have to keep in mind, which I very much dislike. Especially since the concept of "transform" being a thing of its own, more or less separated from the underlying data object, while sound from a technical perspective (everybody does it internally) is not intuitive at all for non-technical users.

Leaving this here for later reference but I think I might be able to propose something better in the near future : I'm trying to optimize how the states array gets stored because it gets stupidly large on scenes with multiple objects, a large features set and many tour steps, which is very much the types of scenes I am working on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant