Zylann / godot_voxel

Voxel module for Godot Engine
Other
2.46k stars 226 forks source link

Cannot "Update from Scene" in latest voxel tools with godot4 #417

Open rcorre opened 1 year ago

rcorre commented 1 year ago

Godot: 8cb51a642e7c34a73e7ed877ab46c041521205e5 Voxel: https://github.com/Zylann/godot_voxel/commit/6f75baebde5e3f4906caae8da0e454bb51ef6683

I clicked on the "Item 1" label, but get_editor_interface()->get_inspector()->get_selected_path(); just returns "library" here:

https://github.com/zylann/godot_voxel/blob/6f75baebde5e3f4906caae8da0e454bb51ef6683/editor/instance_library/voxel_instance_library_editor_plugin.cpp#L178-L180

1659295933 1659295921

Zylann commented 1 year ago

This is a known issue, Godot 4 and sub-inspectors dont provide a way to make this work. The only workaround is to edit the library so that it is not in a sub-inspector. I don't know if there is an issue tracking this problem in Godot's repo though.

MGilleronFJ commented 1 year ago

Tracked here https://github.com/godotengine/godot/issues/54467

Zylann commented 1 year ago

Since 90dbf9418ec3ca45c5c25878e225d76e38dc5639, "Update from scene" has moved to the item inspector itself, so it can work with sub-inspectors too. So this issue should be solved now. I also added a way to reference a scene directly rather that converting it in the editor. It will be converted to multimesh at runtime, but the benefits are that it will update if the scene changes (currently needs a re-generate or reopening of the scene, although if Godot caches the resource it might need an editor restart^^") an will not accidentally embed meshes or textures in the library resource.