Commit 93b7b12d authored by MURRAY David's avatar MURRAY David

updated scipts for 2.7 and 2.8, starting principled BSDF in 2.8

parent f8f83ba9
Pipeline #107366 skipped with stage
......@@ -283,7 +283,7 @@ def lib_export_lights(root_node,directory_full_path, directory_relative_path):
for obj in bpy.data.objects:
print(obj.name)
if obj.type != "LAMP" and obj.type != "LIGHT" :
if obj.type != "LAMP" :
continue
if(obj.hide_render):
......
......@@ -147,7 +147,7 @@ def export_meshes(root_node, directory_full_path, directory_relative_path, use_p
add_typed_material(root_node,material_name,'Flat')
elif(material_name.startswith('MRF_ShadowCatcher')):
add_typed_material(root_node,material_name,'ShadowCatcher')
elif(material.node_tree and "Mix Shader" in material.node_tree.nodes):
print("ADD the material (mix) "+material_name)
ratio = material.node_tree.nodes["Mix Shader"].inputs[0].default_value
......@@ -257,7 +257,13 @@ def export_meshes(root_node, directory_full_path, directory_relative_path, use_p
if bpy.data.materials[material_name]["thin_glass"] > 0:
thin_glass = True
add_material_glass(root_node, material_name, ior, extinction, roughness, sharp_glass, thin_glass,directory_full_path, directory_relative_path)
elif(material.node_tree and "Principled BSDF" in material.node_tree.nodes):
r = str( material.node_tree.nodes["Principled BSDF"].inputs[0].default_value[0] )
g = str( material.node_tree.nodes["Principled BSDF"].inputs[0].default_value[1] )
b = str( material.node_tree.nodes["Principled BSDF"].inputs[0].default_value[2] )
add_material_lambert(root_node,material_name,r,g,b,directory_full_path, directory_relative_path)
else:
print("Unrecogized material type or empty material, assigning default lambert to it")
material_name = "default_lambert"
......@@ -279,7 +285,7 @@ def lib_export_lights(root_node,directory_full_path, directory_relative_path):
for obj in bpy.data.objects:
print(obj.name)
if obj.type != "LAMP" and obj.type != "LIGHT" :
if obj.type != "LIGHT" :
continue
if(obj.hide_render):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment