-
-
Notifications
You must be signed in to change notification settings - Fork 21k
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
Add the ability to expose nodes for direct access in instantiated scenes #84018
base: master
Are you sure you want to change the base?
Conversation
This will work with imported gltf scenes? |
I havn't looked into that aspect, but would be a nice feature to add to this as well |
Also please update your branch by rebasing instead of merging, important skill to get used to with contributing, see the pr workflow for details |
aacbd8c
to
c85dded
Compare
3d44605
to
ac26465
Compare
ac26465
to
2144053
Compare
You have reset your branch and this closes the PR, if you update your branch this can be reopened |
Sorry, still trying to get a grip on correct way of updating my repo from main while keeping my changes. I've pushed my new changes up. This includes a somewhat functional version of this pr. |
3233eac
to
5257a35
Compare
5257a35
to
03e1647
Compare
Here's some minimal project: The setup is convoluted, not sure what exactly is the cause. Might be related to editable children. |
Believe this is fixed now, had to be more specific when to parse owned exposed nodes. is Root instead of just a part of an editable instance: if (nd.type == TYPE_INSTANTIATED && !is_editable_instance) { if (nd.type == TYPE_INSTANTIATED && !root_editable_instance) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The feature looks good and addresses a great deal of proposals. I unliked 2 that I think are not directly related. Once this is merged we can ask in these proposals if this feature satisfies them.
The code looks alright. There are some core changes, so it needs a review from a maintainer of this area.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise code and docs look good
9f1f7b5
to
54b55f4
Compare
|
I found something unexpected. In this project: test-4.zip,
|
Thanks! Appears to simply be an issue of not registering that the previous parent was exposed and now inst. it still technically exists as a child of the slot node, however it no longer belongs to the demo scene. Will see if I can work this kink out. |
54b55f4
to
5593ff8
Compare
|
5593ff8
to
9e74638
Compare
@tetrapod00 |
21cad28
to
462bbfc
Compare
@yahkr That was fast! Actually I would like to try to fix other instances of this behavior. I'll make an issue collecting the ones that I can find. |
da39d0c
to
468f9f8
Compare
468f9f8
to
2d4ad92
Compare
Description
This pull request implements a feature I believe really improves Godot's scene editing capabilities. It adds functionality to expose specific nodes of a scene so that, when this scene is instantiated elsewhere, it allows those nodes to be visible and editable. I feel that "Editable Children" clutters the scene tree far too much if you wanted to use it to create re-usable scenes. It is also pretty inflexible to change when assigning children to an instanced scene's nodes then making changes to that subscene.
This current implementation uses Unique Names to reference where nodes will be saved, as much as I would prefer not. Something like #86960 would be much more preferable where nodes are referenced by unique id. This allows property overrides and child node placement to remain when the underlying instanced scene changes. Please see the Example section for a hopefully better explanation of this.
This pr also adds the ability to expose nodes on import. (or use -exp within blender)
Example
For a simple scene like the following:
This main scene where we add a child node to Mesh and override the Mesh to a prism instead of a box:
Becomes
Where we only save the information relevant to this scene, no need to save the Mesh node from the instantiated scene just to override the mesh.
Since we reference the parent of Child1 and the override via the unique name of the exposed node we gain the following benefits if the Mesh is moved within the subscene:
TODO
I think that this pr addresses the following proposals: