Skip to content

Generate Material

Generate Material

An operator to generate material, can choose one out of four options. Intended for creating mesh from scratch.

This operator will automatically import the nodes, there is no need to import the nodes beforehand. This operator will automatically set the shader_type property inside material Custom Properties. Aside from those, this operator will automatically setup the nodes for you, depending on which type you choose, so you would only need to set the texture and setting the outline color (can remove the rgb and value nodes if you do not want outline). Make sure to have blank material slot, otherwise this script will error.

This is intended to be used with Export Material operator.

Please refer to Export Mesh operator to see what each options are for. Choosing Skin will counts as Animation.

material types

Known issue

Generate Material operator, Line 83-89, will attempt to switch area context to shader editor, ungroup the node group, and then finding respective node after ungrouping. However, this will cause error if the first slot of material was not the material generated from this operator. Unfortunately, the Blender API does not have the ungroup function without using bpy.ops (which usually limited to certain context area). This issue is considered as 'cannot fix'.