X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=blender%2Fio_mspgl%2Fmaterial.py;h=3b79036181d0d45ab6af0da226ef39cecb59e2d6;hb=ed3bfcde8987c646157f5450a24c2f5368b3ec9a;hp=e8a9089adb3ffed538856da4fc3772403a7b018e;hpb=f33612ba5ad6c65cc5cd1c101a816188e5955969;p=libs%2Fgl.git diff --git a/blender/io_mspgl/material.py b/blender/io_mspgl/material.py index e8a9089a..3b790361 100644 --- a/blender/io_mspgl/material.py +++ b/blender/io_mspgl/material.py @@ -48,6 +48,7 @@ class MaterialProperty: class Material: def __init__(self, material): self.name = material.name + self.type = None self.properties = {} self.render_mode = material.render_mode @@ -70,10 +71,14 @@ class Material: surface_node, _ = get_linked_node_and_socket(material.node_tree, out_node.inputs["Surface"]) if not surface_node: - raise Exception("Material has no surface node") + if self.render_mode=='BUILTIN': + raise Exception("Empty material can't use builtin rendering mode") + return elif surface_node.type!='BSDF_PRINCIPLED': raise Exception("Unsupported surface node type "+surface_node.type) + self.type = "pbr" + base_color = self.properties["base_color"] = MaterialProperty((0.8, 0.8, 0.8, 1.0)) metalness = self.properties["metalness"] = MaterialProperty(0.0) roughness = self.properties["roughness"] = MaterialProperty(0.5)