remove colorbleed traces

This commit is contained in:
Milan Kolar 2018-11-12 01:06:04 +01:00
parent b582953552
commit c6d34a5c15
13 changed files with 81 additions and 108 deletions

View file

@ -82,7 +82,9 @@ class SyncToAvalon(BaseAction):
'tasks': [{'name': ''}],
'apps': apps,
# TODO redo work!!!
'template': {'work': '','publish':''}
'template': {
'work': '{root}/{project}/{hierarchy}/{asset}/work/{task}',
'publish':'{root}/{project}/{hierarchy}/{asset}/publish/{family}/{subset}/v{version}/{projectcode}_{asset}_{subset}_v{version}.{representation}'}
}
# Set project template
@ -100,7 +102,7 @@ class SyncToAvalon(BaseAction):
# Store info about project (FtrackId)
io.update_many({'type': 'project','name': entityProj['full_name']},
{'$set':{'data':{'ftrackId':entityProj['id'],'entityType':entityProj.entity_type}}})
{'$set':{'data':{'code':entityProj['name'],'ftrackId':entityProj['id'],'entityType':entityProj.entity_type}}})
# Store project Id
projectId = io.find_one({"type": "project", "name": entityProj["full_name"]})["_id"]
@ -121,7 +123,8 @@ class SyncToAvalon(BaseAction):
folderStruct = []
parentId = None
data = {'visualParent': parentId, 'parents': folderStruct,
'tasks':None, 'ftrackId': None, 'entityType': None}
'tasks':None, 'ftrackId': None, 'entityType': None,
'hierarchy': ''}
for asset in assets:
os.environ['AVALON_ASSET'] = asset['name']
@ -145,7 +148,9 @@ class SyncToAvalon(BaseAction):
print("Asset "+asset["name"]+" - already exist")
parentId = io.find_one({'type': 'asset', 'name': asset['name']})['_id']
data.update({'visualParent': parentId, 'parents': folderStruct})
hierarchy = os.path.sep.join(folderStruct)
data.update({'visualParent': parentId, 'parents': folderStruct,
'hierarchy': hierarchy})
folderStruct.append(asset['name'])
@ -171,7 +176,7 @@ class SyncToAvalon(BaseAction):
try:
print("action <" + self.__class__.__name__ + "> is running")
#TODO It's better to have these env set, are they used anywhere?
os.environ['AVALON_PROJECTS'] = "tmp"
# os.environ['AVALON_PROJECTS'] = "tmp"
os.environ['AVALON_ASSET'] = "tmp"
os.environ['AVALON_SILO'] = "tmp"
importable = []

View file

@ -120,8 +120,8 @@ def on_save(_):
avalon.logger.info("Running callback on save..")
# Update current task for the current scene
update_task_from_path(cmds.file(query=True, sceneName=True))
# # Update current task for the current scene
# update_task_from_path(cmds.file(query=True, sceneName=True))
# Generate ids of the current context on nodes in the scene
nodes = lib.get_id_required_nodes(referenced_nodes=False)

View file

@ -74,7 +74,7 @@ class CollectAssumedDestination(pyblish.api.InstancePlugin):
project = io.find_one({"type": "project",
"name": project_name},
projection={"config": True})
projection={"config": True, "data": True})
template = project["config"]["template"]["publish"]
@ -109,7 +109,7 @@ class CollectAssumedDestination(pyblish.api.InstancePlugin):
template_data = {"root": api.Session["AVALON_PROJECTS"],
"project": project_name,
"projectcode": "prjX",
"projectcode": project['data']['code'],
"silo": silo,
"family": instance.data['family'],
"asset": asset_name,

View file

@ -159,7 +159,6 @@ class IntegrateAsset(pyblish.api.InstancePlugin):
template_publish = project["config"]["template"]["publish"]
anatomy = instance.context.data['anatomy']
self.log.debug(anatomy)
# Find the representations to transfer amongst the files
# Each should be a single representation (as such, a single extension)
@ -192,9 +191,7 @@ class IntegrateAsset(pyblish.api.InstancePlugin):
for fname in collection:
src = os.path.join(stagingdir, fname)
self.log.debug("test: " + src)
anatomy_filled = anatomy.format(template_data)
self.log.debug(anatomy_filled)
dst = anatomy_filled.publish.path
instance.data["transfers"].append([src, dst])
@ -217,16 +214,13 @@ class IntegrateAsset(pyblish.api.InstancePlugin):
template_data["representation"] = ext[1:]
src = os.path.join(stagingdir, fname)
self.log.info("test: " + str(template_data))
anatomy_filled = anatomy.format(template_data)
self.log.info(anatomy_filled)
dst = anatomy_filled.publish.path
self.log.info(dst)
instance.data["transfers"].append([src, dst])
representation = {
"schema": "avalon-core:representation-2.0",
"schema": "pype:representation-2.0",
"type": "representation",
"parent": version_id,
"name": ext[1:],
@ -302,7 +296,7 @@ class IntegrateAsset(pyblish.api.InstancePlugin):
self.log.info("Subset '%s' not found, creating.." % subset_name)
_id = io.insert_one({
"schema": "avalon-core:subset-2.0",
"schema": "pype:subset-2.0",
"type": "subset",
"name": subset_name,
"data": {},
@ -328,7 +322,7 @@ class IntegrateAsset(pyblish.api.InstancePlugin):
version_locations = [location for location in locations if
location is not None]
return {"schema": "avalon-core:version-2.0",
return {"schema": "pype:version-2.0",
"type": "version",
"parent": subset["_id"],
"name": version_number,

View file

@ -123,3 +123,34 @@ class GpuCacheLoader(api.Loader):
deleteNamespaceContent=True)
except RuntimeError:
pass
class AbcModelLoader(pype.maya.plugin.ReferenceLoader):
"""Specific loader of Alembic for the studio.animation family"""
families = ["model"]
representations = ["abc"]
label = "Reference Model"
order = -10
icon = "code-fork"
color = "orange"
def process_reference(self, context, name, namespace, data):
import maya.cmds as cmds
cmds.loadPlugin("AbcImport.mll", quiet=True)
nodes = cmds.file(self.fname,
namespace=namespace,
sharedReferenceFile=False,
groupReference=True,
groupName="{}:{}".format(namespace, name),
reference=True,
returnNewNodes=True)
self[:] = nodes
return nodes
def switch(self, container, representation):
self.update(container, representation)

View file

@ -43,7 +43,11 @@ class CollectAnimationOutputGeometry(pyblish.api.InstancePlugin):
descendants = cmds.ls(descendants, noIntermediate=True, long=True)
# Add members and descendants together for a complete overview
hierarchy = members + descendants
# hierarchy = members + descendants
hierarchy = members
self.log.info(members)
self.log.info(hierarchy)
# Ignore certain node types (e.g. constraints)
ignore = cmds.ls(hierarchy, type=self.ignore_type, long=True)
@ -53,4 +57,3 @@ class CollectAnimationOutputGeometry(pyblish.api.InstancePlugin):
# Store data in the instance for the validator
instance.data["out_hierarchy"] = hierarchy

View file

@ -7,7 +7,7 @@ import pype.api
from pype.maya.lib import extract_alembic
class ExtractColorbleedAnimation(pype.api.Extractor):
class ExtractAnimation(pype.api.Extractor):
"""Produce an alembic of just point positions and normals.
Positions and normals, uvs, creases are preserved, but nothing more,
@ -29,10 +29,12 @@ class ExtractColorbleedAnimation(pype.api.Extractor):
out_set = out_sets[0]
nodes = cmds.sets(out_set, query=True)
self.log.info('nodes to export: {}'.format(str(nodes)))
# Include all descendants
nodes += cmds.listRelatives(nodes,
allDescendents=True,
fullPath=True) or []
# nodes += cmds.listRelatives(nodes,
# allDescendents=True,
# fullPath=True) or []
# Collect the start and end including handles
start = instance.data["startFrame"]
@ -55,7 +57,8 @@ class ExtractColorbleedAnimation(pype.api.Extractor):
"writeVisibility": True,
"writeCreases": True,
"uvWrite": True,
"selection": True
"selection": False,
"root": nodes
}
if int(cmds.about(version=True)) >= 2017:
@ -63,12 +66,12 @@ class ExtractColorbleedAnimation(pype.api.Extractor):
options["writeUVSets"] = True
with avalon.maya.suspended_refresh():
with avalon.maya.maintained_selection():
cmds.select(nodes, noExpand=True)
extract_alembic(file=path,
startFrame=start,
endFrame=end,
**options)
# with avalon.maya.maintained_selection():
cmds.select(nodes, noExpand=True)
extract_alembic(file=path,
startFrame=start,
endFrame=end,
**options)
if "files" not in instance.data:
instance.data["files"] = list()

View file

@ -7,7 +7,7 @@ import pype.api
from pype.maya.lib import extract_alembic
class ExtractColorbleedAlembic(pype.api.Extractor):
class ExtractAlembic(pype.api.Extractor):
"""Produce an alembic of just point positions and normals.
Positions and normals, uvs, creases are preserved, but nothing more,

View file

@ -6,7 +6,7 @@ import avalon.maya
import pype.api
class ExtractColorbleedRig(pype.api.Extractor):
class ExtractRig(pype.api.Extractor):
"""Extract rig as Maya Ascii"""
label = "Extract Rig (Maya ASCII)"

View file

@ -33,7 +33,7 @@ class ExtractSetDress(pype.api.Extractor):
json.dump(instance.data["scenedata"], filepath, ensure_ascii=False)
self.log.info("Extracting point cache ..")
cmds.select(instance.data["hierarchy"])
cmds.select(instance.data["\"])
# Run basic alembic exporter
extract_alembic(file=hierarchy_path,

View file

@ -9,9 +9,9 @@ def get_file_rule(rule):
return mel.eval('workspace -query -fileRuleEntry "{}"'.format(rule))
class ValidateRenderImageRule(pyblish.api.ContextPlugin):
class ValidateRenderImageRule(pyblish.api.InstancePlugin):
"""Validates "images" file rule is set to "renders/"
"""
order = pype.api.ValidateContentsOrder
@ -19,7 +19,7 @@ class ValidateRenderImageRule(pyblish.api.ContextPlugin):
hosts = ["maya"]
families = ["renderlayer"]
def process(self, context):
def process(self, instance):
assert get_file_rule("images") == "renders", (
"Workspace's `images` file rule must be set to: renders"

View file

@ -5,9 +5,9 @@ import pype.api
class ValidateSingleAssembly(pyblish.api.InstancePlugin):
"""Ensure the content of the instance is grouped in a single hierarchy
The instance must have a single root node containing all the content.
The instance must have a single root node containing all the content.
This root node *must* be a top group in the outliner.
Example outliner:
root_GRP
-- geometry_GRP
@ -19,7 +19,7 @@ class ValidateSingleAssembly(pyblish.api.InstancePlugin):
order = pype.api.ValidateContentsOrder
hosts = ['maya']
families = ["rig', 'studio.animation']
families = ['rig', 'studio.animation']
label = 'Single Assembly'
def process(self, instance):

View file

@ -1,74 +1,11 @@
//Maya 2018 Project Definition
workspace -fr "fluidCache" "cache/nCache/fluid";
workspace -fr "JT_ATF" "data";
workspace -fr "images" "renders";
workspace -fr "offlineEdit" "scenes/edits";
workspace -fr "STEP_ATF Export" "data";
workspace -fr "furShadowMap" "renderData/fur/furShadowMap";
workspace -fr "INVENTOR_ATF Export" "data";
workspace -fr "SVG" "data";
workspace -fr "scripts" "scripts";
workspace -fr "STL_ATF" "data";
workspace -fr "DAE_FBX" "data";
workspace -fr "shaders" "renderData/shaders";
workspace -fr "NX_ATF" "data";
workspace -fr "furFiles" "renderData/fur/furFiles";
workspace -fr "CATIAV5_ATF Export" "data";
workspace -fr "OBJ" "data";
workspace -fr "PARASOLID_ATF Export" "data";
workspace -fr "FBX export" "data";
workspace -fr "furEqualMap" "renderData/fur/furEqualMap";
workspace -fr "BIF" "data";
workspace -fr "DAE_FBX export" "data";
workspace -fr "CATIAV5_ATF" "data";
workspace -fr "SAT_ATF Export" "data";
workspace -fr "movie" "movies";
workspace -fr "ASS Export" "data";
workspace -fr "move" "data";
workspace -fr "mayaAscii" "scenes";
workspace -fr "autoSave" "autosave";
workspace -fr "NX_ATF Export" "data";
workspace -fr "sound" "sound";
workspace -fr "mayaBinary" "scenes";
workspace -fr "timeEditor" "Time Editor";
workspace -fr "DWG_ATF" "data";
workspace -fr "JT_ATF Export" "data";
workspace -fr "iprImages" "renderData/iprImages";
workspace -fr "FBX" "data";
workspace -fr "alembicCache" "cache/alembic";
workspace -fr "mayaAscii" "";
workspace -fr "mayaBinary" "";
workspace -fr "renderData" "renderData";
workspace -fr "CATIAV4_ATF" "data";
workspace -fr "fileCache" "cache/nCache";
workspace -fr "eps" "data";
workspace -fr "3dPaintTextures" "sourceimages/3dPaintTextures";
workspace -fr "STL_ATF Export" "data";
workspace -fr "mel" "scripts";
workspace -fr "translatorData" "data";
workspace -fr "particles" "cache/particles";
workspace -fr "scene" "scenes";
workspace -fr "SAT_ATF" "data";
workspace -fr "PROE_ATF" "data";
workspace -fr "WIRE_ATF Export" "data";
workspace -fr "scene" "";
workspace -fr "sourceImages" "sourceimages";
workspace -fr "clips" "clips";
workspace -fr "furImages" "renderData/fur/furImages";
workspace -fr "INVENTOR_ATF" "data";
workspace -fr "STEP_ATF" "data";
workspace -fr "DWG_ATF Export" "data";
workspace -fr "depth" "renderData/depth";
workspace -fr "sceneAssembly" "sceneAssembly";
workspace -fr "IGES_ATF Export" "data";
workspace -fr "PARASOLID_ATF" "data";
workspace -fr "IGES_ATF" "data";
workspace -fr "teClipExports" "Time Editor/Clip Exports";
workspace -fr "ASS" "data";
workspace -fr "audio" "sound";
workspace -fr "bifrostCache" "cache/bifrost";
workspace -fr "Alembic" "data";
workspace -fr "illustrator" "data";
workspace -fr "diskCache" "data";
workspace -fr "WIRE_ATF" "data";
workspace -fr "templates" "assets";
workspace -fr "OBJexport" "data";
workspace -fr "furAttrMap" "renderData/fur/furAttrMap";
workspace -fr "alembicCache" "cache/alembic";
workspace -fr "images" "renders";