X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=blender%2Fio_mspgl%2Fmaterial.py;h=ba5fc3e2c6cb7567b0563b391cf8d4a3c0c21cf2;hb=160293feec7b0b976856685153cd24c7f1ce9492;hp=a24c09e3b59dd59a05f9c3ba504afd398a1f7fbf;hpb=03d2f0d7f4673b5262f396fda430e766eec4549b;p=libs%2Fgl.git diff --git a/blender/io_mspgl/material.py b/blender/io_mspgl/material.py index a24c09e3..ba5fc3e2 100644 --- a/blender/io_mspgl/material.py +++ b/blender/io_mspgl/material.py @@ -98,9 +98,9 @@ class Material: self.shader = material.shader if self.render_mode=='EXTERNAL' and not self.technique: - raise Exception("Missing technique with external rendering mode") + raise Exception("Invalid configuration on material {}: No technique for external rendering".format(self.name)) elif self.render_mode=='CUSTOM' and not self.shader: - raise Exception("Missing shader with custom rendering mode") + raise Exception("Invalid configuration on material {}: No shader for custom rendering".format(self.name)) out_node = None for n in material.node_tree.nodes: @@ -109,12 +109,12 @@ class Material: break if not out_node: - raise Exception("No material output node found") + raise Exception("No output node found on material {}".format(self.name)) surface_node, _ = get_linked_node_and_socket(material.node_tree, out_node.inputs["Surface"]) if not surface_node: if self.render_mode=='BUILTIN': - raise Exception("Empty material can't use builtin rendering mode") + raise Exception("Invalid configuration on material {}: Empty material with builtin rendering".format(self.name)) return elif surface_node.type=='BSDF_PRINCIPLED': self.type = "pbr" @@ -137,7 +137,7 @@ class Material: color.set_from_input(material.node_tree, surface_node.inputs["Color"]) else: - raise Exception("Unsupported surface node type "+surface_node.type) + raise Exception("Unsupported surface node type {} on material {}".format(surface_node.type, self.name)) sampler_settings = None for p in self.properties: @@ -146,7 +146,7 @@ class Material: if sampler_settings is None: sampler_settings = settings elif settings!=sampler_settings: - raise Exception("Conflicting sampler settings in material textures") + raise Exception("Material {} has conflicting texture sampler settings".format(self.name)) def create_property(self, *args): prop = None