godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.16k stars 97 forks source link

Show skeleton bones in the Advanced Import Settings preview #6801

Closed jeronimo-schreyer closed 1 month ago

jeronimo-schreyer commented 1 year ago

Describe the project you are working on

A 3D game where meshes and animations come in different files

Describe the problem or limitation you are having in your project

I need to preview animations with skeleton bones since meshes come in different files. In this case, the 3D preview window shows an empty scene

Describe the feature / enhancement and how it helps to overcome the problem or limitation

copy functionality as it is in the Skeleton3DGizmoPlugin to show bones according to 3D Gizmo Editor Settings values

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

This is a WIP

Screenshot from 2023-05-01 21-51-16

If this enhancement will not be used often, can it be worked around with a few lines of script?

Cant be done using a plugin

Is there a reason why this should be core and not an add-on in the asset library?

This improves the 3D importing experience overall

Calinou commented 1 year ago

On your screenshots, it's interesting how bones appear as thin lines. I thought they appeared as pyramid-like structures with a tip.

jeronimo-schreyer commented 1 year ago

That is because I changed the 3D Gizmo Editor Settings. You can also change how they look if you change editors/3d_gizmos/gizmo_settings/bone_shape (its the option at the end of the list)

jeronimo-schreyer commented 1 year ago

Done added support for editor settings

https://user-images.githubusercontent.com/29764541/236708355-f86d5e22-2bf3-4a00-a085-6769a44f4793.mp4

TokageItLab commented 1 year ago

We have discussed about this and review https://github.com/godotengine/godot/pull/76818 with @lyuma, the main problem is that there is a lot of duplication of code from the SkeletonGizmo.

To begin with, PostImportScene can't display Node3DGizmo. This leads to another usability issue where you select a tree item on the left tree and don't know what it indicates.

It may be necessary to start by making it possible to partially reuse/share Node3DEditor's Gizmo in PostImportScene. (We experienced a similar case in the past when we implemented SkeletonEditor, and implemented SubGizmo as an actual example)

jeronimo-schreyer commented 1 year ago

I see. I dunno how well we can componentize SkeletonGizmo::redraw function for this and even though we did, these two implementations are not exactly the same (even though they use similar mesh creation and shader code)

jeronimo-schreyer commented 1 year ago

PR https://github.com/godotengine/godot/pull/76818 has now a static function in Skeleton3DGizmoPlugin that generates the mesh and that is consumed both by itself (as a gizmo) and by the AIS dialog