godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.12k stars 78 forks source link

Revamp material editing on the importer dialog #7238

Open reduz opened 1 year ago

reduz commented 1 year ago

Describe the project you are working on

Godot

Describe the problem or limitation you are having in your project

The long standing problem with 3D in Godot has been the difficulty of editing 3D materials for imported scenes. While there are many ways to do this, most of them has been significantly annoying and don't work smoothly in all workflows.

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

The idea here is to significantly improve the 3D asset importer to make material assigning and simple material editing possible in those scenes.

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

Here is a mockup how how the new 3D asset importer dialog will look like:

image

The idea is to have a simplified view of the 3D viewport made exclusively to select and assign materials and edit imported objects easily. The tool icons are as follows:

Additionally, you can see some changes in the mesh inspector:

Editing Materials

When editing materials (inspected) the user interface will also be a bit different:

image

When you click "enable", we will need to do a small custom logic here with a dialog: It will ask you if you want to select an existing one (file dialog) or customize the one that came with the scene. If you pick customize, a copy of the existing material will be created for you to edit, so the dialog will tell you that further changes to the original material will no longer be tracked (and your customization used instead) until you disable this checkbox.

As mentioned before also, you will be able to do limited material editing directly in the inspector (assigning textures, etc).

FAQ

Q: Why is this type of editing not happening in the Godot main editor itself, like in other engines such as Unity? A: Godot editor is extremely data driven, meaning what you see is what you get. It does not hide much of what's going on under the hood. This is why the importer dialog and the inspector are two separate things. This is done with the belief that its much less confusing for developers to learn how Godot actually works in a transparent way (and it also makes development and the entire codebase much simpler). That said, for this specific case, I believe that having a dedicated UI for this task, which can be very time consuming, is better in the long term.

Q: Where will the customized built-in materials be saved? A: Inside the '.import' file next to your asset.

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

No

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

N/A

JonqsGames commented 1 year ago

Like the idea, that would be usefull for me especially when prototyping and just want to change color on the fly for tests. Related to that, could we have a dedicated node type for imported model root node ? This node could expose a lot of the parameter available in importer but for the local instance.

reduz commented 1 year ago

@JonqsGames You can already override everything in the local instances in Godot.

HotHead007 commented 1 year ago

But .import file is excluded in version control so it will cause problems right? Can't we place it in the same folder as the model?

Kemeros commented 1 year ago

But .import file is excluded in version control so it will cause problems right? Can't we place it in the same folder as the model?

@HotHead007

The .import FILES are in the same folder as your asset files and contain important meta data that must be kept in your repo. Look here for more info.

The .import FOLDER, if i am not mistaken, has changed name. It is now named .godot in Godot 4. It needs to be added in your .gitignore file as it should not be in your repo.

That being said.

Q: Where will the customized built-in materials be saved? A: Inside the '.import' file.

I'm also confused by that part of the Q&A.

@reduz Are we talking about the .godot folder or the .import file of the imported scene? I'm guessing you mean adding new meta data in the .import file? Otherwise the data would indeed be lost if put inside .godot.

reduz commented 1 year ago

@Kemeros I never mentioned the Godot folder, this is the .import file next to your asset. Will clarify in the OP regardless.

rick551a commented 1 year ago

Sadly, making materials shared between models (for example low poly) is now more time-consuming:

See my troubles here: https://github.com/godotengine/godot/issues/79040

reduz commented 1 year ago

@rick551a Just do not use GLTF embedded.