-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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 ability to create a new inherited scene from code #90057
Add ability to create a new inherited scene from code #90057
Conversation
0f2da51
to
21a4264
Compare
To fix the compilation error, you need to add compatibility method bindings in a new editor_interface.compat.inc file. |
21a4264
to
2097788
Compare
c5f7f93
to
52c716a
Compare
52c716a
to
f387a74
Compare
open_scene_from_path
472b636
to
58007d6
Compare
58007d6
to
124e31d
Compare
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.
Tested, it works. I managed to make a button that creates an inherited scene from gltf at the same path like so:
var path = EditorInterface.get_selected_paths()[0]
var new_path = path.get_basename() + ".tscn"
var main_scene_path = EditorInterface.get_edited_scene_root().scene_file_path
EditorInterface.open_scene_from_path(path, true)
EditorInterface.save_scene_as.call_deferred(new_path, false)
EditorInterface.open_scene_from_path.call_deferred(main_scene_path)
fd87766
to
77a57cb
Compare
77a57cb
to
00275ca
Compare
00275ca
to
0f8ccef
Compare
8535a0f
to
bc395fa
Compare
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.
I wonder if the name of the name parameter should be make_inherited
instead. But I can also see that it's called this way for consistency with the internal methods. Either way it's fine.
doc/classes/EditorInterface.xml
Outdated
<description> | ||
Opens the scene at the given path. | ||
Opens the scene at the given path. If [param set_inherited] is [code]true[/code], a new inherited scene will be created. |
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.
Opens the scene at the given path. If [param set_inherited] is [code]true[/code], a new inherited scene will be created. | |
Opens the scene at the given path. If [param set_inherited] is [code]true[/code], a new inherited scene is created. |
or
Opens the scene at the given path. If [param set_inherited] is [code]true[/code], a new inherited scene will be created. | |
Opens the scene at the given path. If [param set_inherited] is [code]true[/code], creates a new inherited scene. |
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.
2nd one sounds good.
bc395fa
to
98e7ae1
Compare
98e7ae1
to
7f09804
Compare
Rebased to fix 4.3-stable.expected conflict. |
Thanks! |
Closes: #3907
Supersedes: #64217
This is done by adding an inherit parameter to
open_scene_from_path()
This will allow plugins to be able to create new inherited scenes, which can enhance user workflows.