Open Souchy opened 3 months ago
I second this issue—I'm dealing with a similar problem. I use a custom shader on top of a StandardMaterial3D that's been converted to ShaderMaterial. Every time I reimport a model, I have to manually go through the process of converting and reapplying the custom shader. Imagine doing this for a large number of models; it's quite time-consuming. It would be incredibly helpful if there were a way to automate this conversion through code. This feature would not only save a lot of time but also streamline the workflow significantly.
I have the same use cases.
Would it be more user friendly if StandardMaterial and ORMMaterial had a feature to extend shader code?
Was looking at a way to automate it with a tool script but it seems there isnt a clear way of automating a conversion to Shader Material.
Describe the project you are working on
Use case:
Describe the problem or limitation you are having in your project
Currently there is no way to convert a StandardMaterial3D to ShaderMaterial, or to get its shader.
StandardMaterial3DConversionPlugin::convert
is an editor plugin so can't be used.BaseMaterial3D::get_shader_rid
isn't exposed.BaseMaterial3D::get_texture_by_name
isn't exposed.Material::_get_shader_rid
"Only exposed for the purpose of overriding. You cannot call this function directly".Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add public conversion functions to each type of Material. Add public functions to get the shader and textures from Materials so we can do our own conversion logic.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
I'm not sure, adding those bindings to
BaseMaterial3D::_bind_methods
didn't do anything for me.If this enhancement will not be used often, can it be worked around with a few lines of script?
Not as far as I know
Is there a reason why this should be core and not an add-on in the asset library?
^