Skip to content
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 a project setting to import glTF materials from Blender as placeholders #7341

Closed
catprisbrey opened this issue Jul 20, 2023 · 6 comments
Closed

Comments

@catprisbrey
Copy link

catprisbrey commented Jul 20, 2023

Describe the project you are working on

Any 3D game, where your 3D assets have materials in blender (such as ones that help you with sizing/aligning UV measurements and mappings), but you'd rather use in-engine materials once the model is in godot.

Describe the problem or limitation you are having in your project

Currently Godot auto autoimports the .blend file using .gltf, and exported materials. Imports are larger because they have those materials included, and there is no intention to use those materials in the game.

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

By adding a checkbox "Placeholder Materials" to the blender import options in the preferences, it could add to the import flags to use placeholders only. This would reduce import sizes, and speed up workflow.

As it stands currently I either have to export manually my gltfs with placeholders to bring them in myself andnimpoet into Godot, or I have to accept that it's going to automatically import the materials, so I must disconnect the blender materials first before saving into Godot.

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

The simple checkbox in the preferences, could add flags to the export command that Godot uses when calling blender to export the gltf. That way it would by default export without materials and always placeholders.

There are a few proposals here about import materials already, but they're requesting more complex replacements of blender materials with in-game materials. That would be a more complex implementation, this is a nice halfway point.

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

I imagine this would get a lot of use by others making 3D assets that want to get UV measurements/looks correct in blender, but want to use in-game materials to keep their games more performant and sizes down.

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

No, it's more of a core import setting option.

@Calinou Calinou changed the title Blender import option - use placeholders Add an option to import materials as placeholders in the Advanced Import Settings dialog Jul 20, 2023
@Calinou
Copy link
Member

Calinou commented Jul 20, 2023

@catprisbrey
Copy link
Author

catprisbrey commented Jul 20, 2023

This got renamed to reference the advanced import dialogue. I'm not proposing this change be in that importer, but in the global project settings. (Because blender files saved into the project path get auto imported without seeing the advanced import menu)

Screenshot_20230720-134230

@Calinou

This comment was marked as outdated.

@Calinou
Copy link
Member

Calinou commented Jul 20, 2023

Nevermind, I realized you're referring to this option from the Blender glTF export dialog:

image

In the future, I recommend adding a screenshot of the option, as it makes it 100% clear which software you're referring to 🙂

I still think this option needs more granularity, such as being able to specify which files will get this placeholder material treatment.

Out of curiosity, does the Remember Export Settings option in the glTF export dialog have an effect on Godot when it imports Blender scenes? It saves the glTF options to the .blend file. This could allow customizing the behavior on a per-scene basis.

@Calinou Calinou changed the title Add an option to import materials as placeholders in the Advanced Import Settings dialog Add a project setting to import glTF materials from Blender as placeholders Jul 20, 2023
@catprisbrey
Copy link
Author

I apologize for not sending a screenshot, I was away from from my computer (but thanks to the Godot for Android I speedily installed on the go, I was able to get that settings screenshot for my last comment).

If the "remember export settings" options works, then that will eliminate entirely the need for any changes to Godot. I'll test and return here soon to confirm.

@catprisbrey
Copy link
Author

Turns out changing checking the "remember my settings" option in blender does not solve the issue.

But what does solve it is simply double clicking the blend file in godot to open the reimport menu referenced earlier, and under the materials section, changing it to "placeholder." After that setting change, every time you save your blend file, and the export updates in Godot, it remembers your import preference to only use placeholders.

So turns out Godot will remember that import setting so even though i have materials used in blender, Godot knows to strip those at import. The feature I wanted already exists then. :)

Screenshot_20230720_161500

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants