-
-
Notifications
You must be signed in to change notification settings - Fork 251
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
Nested voxel modifiers #555
Comments
(Possibly) relevant TODO
|
For
If we have nodes under the terrain update their children when their local transform changes, we might be able to get around subscribing to global transform changes |
Something I find really annoying in this situation, is that the hierarchy seems useless here, it's just in the way and requires the engine to do extra work. What makes it required is the import workflow and the way Godot works I guess? Though I'm not fully understanding why your scripts can't also automate the flattening of hierarchy, so that everything gets setup optimally (Think of it like CollisionShapes of a RigidBody). Optimization aside, nested modifiers are a natural thing to support eventually, but didn't have the need for it before, and the way Godot propagates events has put me off the moment I had the suggestion in mind. In fact I'm not using modifiers much at the moment, I originally added them because it seemed cool to have, as I saw another voxel engine have something similar. But I moved on other things and didnt take time to update them as a result. |
I can see it also being useful for parent/child transforms, but that's also achievable manually. As far as I know, an EditorScenePostImport must return a scene which becomes a packed scene resource which, as far as I know, can only have a single root. So it's impossible to flatten the structure from an EditorScenePostImport In my mind, it wouldn't be ideal to merge meshes into a single mesh SDF as each one has limited bake precision -but that assumption comes from my limited understanding of their implementation. If you don't think it would be too non-trivial, I might have a shot at implementing it. |
Couldn't you import your scene as a terrain? But if you really want this instead, you could try implementing it, as I don't plan to work on it at the moment. |
I think it would work to have a separate terrain for each import as you suggest. Although if this were the case would the data all be separate? It seems like a fun task and a good way to get my feet wetter :) |
I've been thinking more about nesting recently. What concerned me so far is the issue The following will therefore focus on transform changes while already in the scene tree. IntroThis is also happening in godot#77937 and appears to be a recurring pattern, so for the sake of making this readable from both points of view, I will generalize terms:
Example of scene tree we could be dealing with, just for visual reference:
First, all the following approaches have to use Now let's see what we can do in the other cases: Approach 1: naive transform comparisonWhen a Downsides:
Approach 2: instigator conceptWhen a node's transform change starts a cascade of notifications, propagate the relative node depth alongside the notification: Shapes know how far they are from This is my preferred approach. Downsides, mostly not technical:
Note: some notifications actually do have a payload (input events). So it isn't actually that crazy to think about having one. Approach 3: pre-notificationIf adding stuff to Godot notifications is not an option (which is our case, since AFAIK there is no plan yet to change it): When Approach 4: countersStill in case the notification system can't be touched: First, let's clarify an assumption already made since Approach 3: Add counter variables to
It is slightly better than Approach 3, because it does not require to allocate any memory to maintain a list of shapes in I might experiment this at some point in the future, since at this point there has been 2 PRs just to add this (but both doing approach 1) |
Is your feature request related to a problem? Please describe.
I have a post-import script that converts mesh instances into voxel modifier meshes. The modifiers do not work unless they are immediate children of a voxel terrain. If an imported scene contains multiple instances, they cannot be made scene root.
Describe the solution you'd like
For modifiers to work if they are nested children of Node3D nodes
Workaround
Collapse the parent structure of the modifiers after import. However, this only works in runtime and not in editor
The text was updated successfully, but these errors were encountered: