Merged in Aardschok/config (pull request #6)

Resolved issue with Vray Object Property sets
This commit is contained in:
Wijnand Koreman 2017-08-07 13:46:54 +00:00 committed by Roy Nieterau
commit 10fd3238ca
2 changed files with 10 additions and 9 deletions

View file

@ -865,7 +865,8 @@ def apply_shaders(relationships, shadernodes, nodes):
Args:
relationships (dict): relationship data
shadernodes (list): list of nodes of the shading engine
shadernodes (list): list of nodes of the shading objectSets (includes
VRayObjectProperties and shadingEngines)
nodes (list): list of nodes to apply shader to
Returns:
@ -875,7 +876,7 @@ def apply_shaders(relationships, shadernodes, nodes):
attributes = relationships.get("attributes", [])
shader_sets = relationships.get("sets", [])
shading_engines = cmds.ls(shadernodes, type="shadingEngine", long=True)
shading_engines = cmds.ls(shadernodes, type="objectSet", long=True)
assert len(shading_engines) > 0, ("Error in retrieving shading engines "
"from reference")
@ -901,7 +902,7 @@ def apply_shaders(relationships, shadernodes, nodes):
shading_engine = shading_engines_by_id[shader_uuid]
assert len(shading_engine) == 1, ("Could not find the correct "
"shading engine with cbId "
"objectSet with cbId "
"'{}'".format(shader_uuid))
cmds.sets(filtered_nodes, forceElement=shading_engine[0])

View file

@ -115,6 +115,8 @@ class CollectLook(pyblish.api.InstancePlugin):
attributes = self.collect_attributes_changed(instance)
looksets = cmds.ls(sets.keys(), absoluteName=True, long=True)
self.log.info("Found the following sets: {}".format(looksets))
# Store data on the instance
instance.data["lookData"] = {"attributes": attributes,
"relationships": sets.values(),
@ -124,7 +126,7 @@ class CollectLook(pyblish.api.InstancePlugin):
history = cmds.listHistory(looksets)
files = cmds.ls(history, type="file", long=True)
# Collect textures,
# Collect textures
resources = [self.collect_resource(n) for n in files]
instance.data["resources"] = resources
@ -318,11 +320,9 @@ class CollectLook(pyblish.api.InstancePlugin):
attribute = "{}.{}".format(node, attr)
node_attributes[attr] = cmds.getAttr(attribute)
data = {"name": node,
"uuid": id_utils.get_id(node),
"attributes": node_attributes}
attributes.append(data)
attributes.append({"name": node,
"uuid": id_utils.get_id(node),
"attributes": node_attributes})
return attributes