Merge branch 'develop' into bugfix/PYPE-147-fixing-nuke-publishing-write

This commit is contained in:
Milan Kolar 2019-02-07 20:07:29 +01:00
commit 52e1e11835
4 changed files with 77 additions and 12 deletions

View file

@ -134,16 +134,16 @@ def override_toolbox_ui():
parent=parent)
controls.append(control)
control = mc.iconTextButton(
"pype_toolbox",
annotation="Colorbleed",
label="Colorbleed",
image=os.path.join(icons, "pype_logo_36x36.png"),
bgc=background_color,
width=icon_size,
height=icon_size,
parent=parent)
controls.append(control)
# control = mc.iconTextButton(
# "pype_toolbox",
# annotation="Kredenc",
# label="Kredenc",
# image=os.path.join(icons, "kredenc_logo.png"),
# bgc=background_color,
# width=icon_size,
# height=icon_size,
# parent=parent)
# controls.append(control)
# Add the buttons on the bottom and stack
# them above each other with side padding

View file

@ -1,6 +1,7 @@
from avalon import api
import pype.maya.plugin
import os
import pymel.core as pm
class AssProxyLoader(pype.maya.plugin.ReferenceLoader):
@ -37,7 +38,6 @@ class AssProxyLoader(pype.maya.plugin.ReferenceLoader):
# Set attributes
proxyShape = pm.ls(nodes, type="mesh")[0]
proxyShape = pm.ls(nodes, type="mesh")[0]
proxyShape.aiTranslator.set('procedural')
proxyShape.dso.set(path)
@ -51,6 +51,67 @@ class AssProxyLoader(pype.maya.plugin.ReferenceLoader):
def switch(self, container, representation):
self.update(container, representation)
def update(self, container, representation):
import os
from maya import cmds
node = container["objectName"]
path = api.get_representation_path(representation)
# path = self.fname
proxyPath = os.path.splitext(path)[0] + ".ma"
# Get reference node from container members
members = cmds.sets(node, query=True, nodesOnly=True)
reference_node = self._get_reference_node(members)
assert os.path.exists(path), "%s does not exist." % proxyPath
try:
content = cmds.file(proxyPath,
loadReference=reference_node,
type="mayaAscii",
returnNewNodes=True)
# Set attributes
proxyShape = pm.ls(content, type="mesh")[0]
proxyShape.aiTranslator.set('procedural')
proxyShape.dso.set(path)
proxyShape.aiOverrideShaders.set(0)
except RuntimeError as exc:
# When changing a reference to a file that has load errors the
# command will raise an error even if the file is still loaded
# correctly (e.g. when raising errors on Arnold attributes)
# When the file is loaded and has content, we consider it's fine.
if not cmds.referenceQuery(reference_node, isLoaded=True):
raise
content = cmds.referenceQuery(reference_node,
nodes=True,
dagPath=True)
if not content:
raise
self.log.warning("Ignoring file read error:\n%s", exc)
# Add new nodes of the reference to the container
cmds.sets(content, forceElement=node)
# Remove any placeHolderList attribute entries from the set that
# are remaining from nodes being removed from the referenced file.
members = cmds.sets(node, query=True)
invalid = [x for x in members if ".placeHolderList" in x]
if invalid:
cmds.sets(invalid, remove=node)
# Update metadata
cmds.setAttr("{}.representation".format(node),
str(representation["_id"]),
type="string")
class AssStandinLoader(api.Loader):
"""Load .ASS file as standin"""

View file

@ -44,11 +44,15 @@ class CollectReviewData(pyblish.api.InstancePlugin):
for inst in context:
self.log.debug('instance: {}'.format(instance))
if inst.name == reviewable_subset[0]:
inst.data['families'].append('review')
if inst.data.get('families'):
inst.data['families'].append('review')
else:
inst.data['families'] = ['review']
inst.data['review_camera'] = camera
self.log.info('adding review family to {}'.format(reviewable_subset))
cmds.setAttr(str(instance) + '.active', 0)
inst.data['publish'] = 0
inst.data['active'] = 0
else:
instance.data['subset'] = task + 'Review'
instance.data['review_camera'] = camera

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB