WIP: MaterialX addon #104594

Closed
Bogdan Nagirniak wants to merge 34 commits from BogdanNagirniak/blender-addons:materialx-addon into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Showing only changes of commit eaac854bd1 - Show all commits

View File

@ -73,6 +73,18 @@ class MaterialProperties(MaterialXProperties):
return doc return doc
def get_materialx_data(self, obj: bpy.types.Object):
doc = self.export(obj)
if not doc:
return None, None
mat = self.id_data
mtlx_file = get_temp_file(".mtlx", f'{mat.name}_{self.mx_node_tree.name if self.mx_node_tree else ""}')
mx.writeToXmlFile(doc, str(mtlx_file))
return mtlx_file, doc
def convert_to_materialx(self, obj: bpy.types.Object = None): def convert_to_materialx(self, obj: bpy.types.Object = None):
mat = self.id_data mat = self.id_data
output_node = self.output_node output_node = self.output_node