Skip to content

Commit

Permalink
Update for a PxrDisney only build
Browse files Browse the repository at this point in the history
  • Loading branch information
bsavery committed Apr 14, 2017
1 parent df10845 commit be47b37
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 28 deletions.
30 changes: 12 additions & 18 deletions operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,10 @@ def execute(self, context):
continue
output = nt.nodes.new('RendermanOutputNode')
try:
if not convert_cycles_nodetree(mat, output, self.report):
default = nt.nodes.new('PxrSurfaceBxdfNode')
default.location = output.location
default.location[0] -= 300
nt.links.new(default.outputs[0], output.inputs[0])
default = nt.nodes.new('PxrDisneyBxdfNode')
default.location = output.location
default.location[0] -= 300
nt.links.new(default.outputs[0], output.inputs[0])
except Exception as e:
self.report({'ERROR'}, "Error converting " + mat.name)
#self.report({'ERROR'}, str(e))
Expand Down Expand Up @@ -198,7 +197,7 @@ class SHADING_OT_add_renderman_nodetree(bpy.types.Operator):
bl_description = "Add a renderman shader node tree linked to this material"

idtype = StringProperty(name="ID Type", default="material")
bxdf_name = StringProperty(name="Bxdf Name", default="PxrSurface")
bxdf_name = StringProperty(name="Bxdf Name", default="PxrDisney")

def execute(self, context):
idtype = self.properties.idtype
Expand All @@ -218,12 +217,11 @@ def execute(self, context):

if idtype == 'material':
output = nt.nodes.new('RendermanOutputNode')
if not convert_cycles_nodetree(idblock, output, self.report):
default = nt.nodes.new('%sBxdfNode' %
self.properties.bxdf_name)
default.location = output.location
default.location[0] -= 300
nt.links.new(default.outputs[0], output.inputs[0])
default = nt.nodes.new('%sBxdfNode' %
self.properties.bxdf_name)
default.location = output.location
default.location[0] -= 300
nt.links.new(default.outputs[0], output.inputs[0])
elif idtype == 'lamp':
light_type = idblock.type
if light_type == 'SUN':
Expand Down Expand Up @@ -1099,10 +1097,6 @@ class Add_bxdf(bpy.types.Operator):

def get_type_items(self, context):
items = [
("PxrSurface", "PxrSurface",
'PxrSurface Uber shader. For most hard surfaces'),
("PxrLayerSurface", "PxrLayerSurface",
"PxrLayerSurface, creates a surface with two Layers"),
("PxrMarschnerHair", "PxrMarschnerHair", "Hair Shader"),
("PxrDisney", "PxrDisney",
"Disney Bxdf, a simple uber shader with no layering"),
Expand Down Expand Up @@ -1168,14 +1162,14 @@ class New_bxdf(bpy.types.Operator):

def execute(self, context):
ob = context.object
bxdf_name = 'PxrSurface'
bxdf_name = 'PxrDisney'
mat = bpy.data.materials.new(bxdf_name)
ob.active_material = mat
mat.use_nodes = True
nt = mat.node_tree

output = nt.nodes.new('RendermanOutputNode')
default = nt.nodes.new('PxrSurfaceBxdfNode')
default = nt.nodes.new('PxrDisneyBxdfNode')
default.location = output.location
default.location[0] -= 300
nt.links.new(default.outputs[0], output.inputs[0])
Expand Down
8 changes: 4 additions & 4 deletions preview/preview_scene.rib
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Transform [ 5.000000 0.000000 0.000000 0.000000 0.000000 5.000000 0.000000 0.000000 0.000000 0.000000 5.000000 0.000000 -3.000000 0.0 0.000000 1.000000 ]
Pattern "PxrManifold2D" "PxrManifold2D" "float offsetS" [0] "float angle" [0] "string primvarS" [""] "int invertT" [0] "float offsetT" [0] "float scaleS" [1] "__instanceid" ["Material.002.PxrManifold2D"] "float scaleT" [1] "string primvarT" [""]
Pattern "PxrTexture" "PxrTexture" "int linearize" [0] "int atlasStyle" [0] "int invertT" [0] "__instanceid" ["Material.002.PxrTexture"] "int lerp" [1] "reference struct manifold" ["PxrManifold2D:result"] "float blur" [0] "int filter" [1] "float missingAlpha" [1] "string filename" ["ratGrid.tex"] "color missingColor" [1 0 1] "int firstChannel" [0]
Bxdf "PxrSurface" "Material.002.PxrDisney" "__instanceid" ["Material.002.PxrDisney"] "reference color diffuseColor" ["PxrTexture:resultRGB"]
Bxdf "PxrDisney" "Material.002.PxrDisney" "__instanceid" ["Material.002.PxrDisney"] "reference color baseColor" ["PxrTexture:resultRGB"]
SubdivisionMesh "catmull-clark" [4 4] [4 1 3 5 0 4 5 2] ["interpolateboundary"] [0 0] [] [] "P" [-0.0201648 -1 0.807218 1 -1 0 -0.0201648 1 0.807218 1 1 0 -0.0144115 -1 0 -0.0144115 1 0] "facevarying float[2] st" [0 0.5 0 1.0 1.0 1.0 1.0 0.5 0 0 0 0.5 1.0 0.5 1.0 0]
AttributeEnd

Expand All @@ -20,7 +20,7 @@
Transform [ .3 0.000000 0.000000 0.000000 0.000000 .3 0.000000 0.000000 0.000000 0.000000 .3 0.000000 0 -2
0.3 1.000000 ]
Sides 2
Bxdf "PxrPxrSurface" "diffuse"
Bxdf "PxrDisney" "diffuse" "color baseColor" [.18 .18 .18]
Sphere 1 -1 1 360
AttributeEnd

Expand All @@ -29,6 +29,6 @@
Transform [ .3 0.000000 0.000000 0.000000 0.000000 .3 0.000000 0.000000 0.000000 0.000000 .3 0.000000 0 2
0.3 1.000000 ]
Sides 2
Bxdf "PxrSurface" "metal" "float diffuseGain" [0] "int specularFresnelMode" [1] "color specularEdgeColor" [1 1 1] "color specularIor" [4.3696842 2.916713 1.654698] "color specularExtinctionCoeff" [5.20643 4.2313662 3.7549689] "float specularRoughness" [0.1] "integer specularModelType" [1]
Sphere 1 -1 1 360
Bxdf "PxrDisney" "metal" "color baseColor" [1.0 1.0 1.0] "float metallic" [1.0] "float specular" [1.0]
Sphere 1 -1 1 360
AttributeEnd
4 changes: 0 additions & 4 deletions shader_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,7 @@ def class_generate_properties(node, parent_name, shaderparameters):
def update_conditional_visops(node):
for param_name, prop_meta in getattr(node, 'prop_meta').items():
if 'conditionalVisOp' in prop_meta:
<<<<<<< HEAD
try:
=======
try:
>>>>>>> jdent02-master
hidden = not eval(prop_meta['conditionalVisOp'])
prop_meta['hidden'] = hidden
if hasattr(node, 'inputs') and param_name in node.inputs:
Expand Down
4 changes: 2 additions & 2 deletions ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ def draw(self, context):
if mat and not is_renderman_nodetree(mat):
layout.operator(
'shading.add_renderman_nodetree').idtype = "material"
layout.operator('shading.convert_cycles_stuff')
#layout.operator('shading.convert_cycles_stuff')
# self._draw_shader_menu_params(layout, context, rm)


Expand Down Expand Up @@ -930,7 +930,7 @@ def draw(self, context):
if not lamp.renderman.use_renderman_node:
layout.prop(lamp, "type", expand=True)
layout.operator('shading.add_renderman_nodetree').idtype = 'lamp'
layout.operator('shading.convert_cycles_stuff')
#layout.operator('shading.convert_cycles_stuff')
return
else:
if ipr_running:
Expand Down

0 comments on commit be47b37

Please sign in to comment.