mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge branch 'develop' into feature/nuke-create-backdrop
This commit is contained in:
commit
61978b38cf
9 changed files with 75 additions and 10 deletions
|
|
@ -485,13 +485,16 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
|||
if subset is None:
|
||||
subset_name = instance.data["subset"]
|
||||
self.log.info("Subset '%s' not found, creating.." % subset_name)
|
||||
self.log.debug("families. %s" % instance.data.get('families'))
|
||||
self.log.debug("families. %s" % type(instance.data.get('families')))
|
||||
|
||||
_id = io.insert_one({
|
||||
"schema": "pype:subset-3.0",
|
||||
"type": "subset",
|
||||
"name": subset_name,
|
||||
"families": instance.data.get('families'),
|
||||
"data": {},
|
||||
"data": {
|
||||
"families": instance.data.get('families')
|
||||
},
|
||||
"parent": asset["_id"]
|
||||
}).inserted_id
|
||||
|
||||
|
|
|
|||
|
|
@ -93,6 +93,9 @@ class CollectInstances(pyblish.api.ContextPlugin):
|
|||
parents = self.get_all_parents(members)
|
||||
members_hierarchy = list(set(members + children + parents))
|
||||
|
||||
if 'families' not in data:
|
||||
data['families'] = [data.get('family')]
|
||||
|
||||
# Create the instance
|
||||
instance = context.create_instance(objset)
|
||||
instance[:] = members_hierarchy
|
||||
|
|
@ -100,6 +103,7 @@ class CollectInstances(pyblish.api.ContextPlugin):
|
|||
# Store the exact members of the object set
|
||||
instance.data["setMembers"] = members
|
||||
|
||||
|
||||
# Define nice label
|
||||
name = cmds.ls(objset, long=False)[0] # use short name
|
||||
label = "{0} ({1})".format(name,
|
||||
|
|
@ -117,6 +121,8 @@ class CollectInstances(pyblish.api.ContextPlugin):
|
|||
# Produce diagnostic message for any graphical
|
||||
# user interface interested in visualising it.
|
||||
self.log.info("Found: \"%s\" " % instance.data["name"])
|
||||
self.log.debug("DATA: \"%s\" " % instance.data)
|
||||
|
||||
|
||||
def sort_by_family(instance):
|
||||
"""Sort by family"""
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ class CollectMayaScene(pyblish.api.ContextPlugin):
|
|||
"label": subset,
|
||||
"publish": False,
|
||||
"family": 'workfile',
|
||||
"families": ['workfile'],
|
||||
"setMembers": [current_file]
|
||||
})
|
||||
|
||||
|
|
|
|||
40
pype/plugins/maya/publish/validate_unicode_strings.py
Normal file
40
pype/plugins/maya/publish/validate_unicode_strings.py
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import os
|
||||
from maya import cmds
|
||||
|
||||
import pyblish.api
|
||||
import pype.api
|
||||
import pype.maya.action
|
||||
|
||||
|
||||
class ValidateUnicodeStrings(pyblish.api.Validator):
|
||||
"""Validate all environment variables are string type.
|
||||
|
||||
"""
|
||||
|
||||
order = pype.api.ValidateContentsOrder
|
||||
hosts = ['maya']
|
||||
families = ['review']
|
||||
label = 'Unicode Strings'
|
||||
actions = [pype.api.RepairAction]
|
||||
|
||||
def process(self, instance):
|
||||
invalid = self.get_invalid(instance)
|
||||
if invalid:
|
||||
raise RuntimeError("Found unicode strings in environment variables.")
|
||||
|
||||
@classmethod
|
||||
def get_invalid(cls, instance):
|
||||
invalid = []
|
||||
for key, value in os.environ.items():
|
||||
if type(value) is type(u't'):
|
||||
invalid.append((key, value))
|
||||
|
||||
return invalid
|
||||
|
||||
@classmethod
|
||||
def repair(cls, instance):
|
||||
"""Retype all unicodes to strings."""
|
||||
|
||||
for key, value in os.environ.items():
|
||||
if type(value) is type(u't'):
|
||||
os.environ[key] = str(value)
|
||||
|
|
@ -109,7 +109,7 @@ class CollectContextDataSAPublish(pyblish.api.ContextPlugin):
|
|||
if component["preview"]:
|
||||
instance.data["families"].append("review")
|
||||
instance.data["repreProfiles"] = ["h264"]
|
||||
component["tags"] = ["review", "delete"]
|
||||
component["tags"] = ["review"]
|
||||
self.log.debug("Adding review family")
|
||||
|
||||
instance.data["representations"].append(component)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import os
|
||||
import tempfile
|
||||
|
||||
import pyblish.api
|
||||
from pype.vendor import clique
|
||||
|
|
@ -82,9 +83,10 @@ class ExtractReviewSP(pyblish.api.InstancePlugin):
|
|||
full_input_path = os.path.join(staging_dir, repre["files"])
|
||||
filename = repre["files"].split(".")[0]
|
||||
|
||||
# prepare output file
|
||||
repr_file = filename + "_{0}.{1}".format(name, ext)
|
||||
|
||||
full_output_path = os.path.join(staging_dir, repr_file)
|
||||
out_stagigng_dir = tempfile.mkdtemp(prefix="extract_review_")
|
||||
full_output_path = os.path.join(out_stagigng_dir, repr_file)
|
||||
|
||||
self.log.info("input {}".format(full_input_path))
|
||||
self.log.info("output {}".format(full_output_path))
|
||||
|
|
@ -169,18 +171,25 @@ class ExtractReviewSP(pyblish.api.InstancePlugin):
|
|||
"name": name,
|
||||
"ext": ext,
|
||||
"files": repr_file,
|
||||
"stagingDir": out_stagigng_dir,
|
||||
"tags": new_tags,
|
||||
"outputName": name,
|
||||
"startFrameReview": 1,
|
||||
"endFrameReview": video_len
|
||||
})
|
||||
if repre_new.get("preview"):
|
||||
repre_new.pop("preview")
|
||||
# cleanup thumbnail from new repre
|
||||
if repre_new.get("thumbnail"):
|
||||
repre_new.pop("thumbnail")
|
||||
if "thumbnail" in repre_new["tags"]:
|
||||
repre_new["tags"].remove("thumbnail")
|
||||
|
||||
# adding representation
|
||||
self.log.debug("Adding: {}".format(repre_new))
|
||||
# cleanup repre from preview
|
||||
if "preview" in repre:
|
||||
repre.pop("preview")
|
||||
if "preview" in repre["tags"]:
|
||||
repre["tags"].remove("preview")
|
||||
new_repres.append(repre_new)
|
||||
|
||||
for repre in instance.data["representations"]:
|
||||
|
|
|
|||
|
|
@ -167,6 +167,8 @@ class Window(QtWidgets.QDialog):
|
|||
'''
|
||||
if self.shadow_widget.isVisible():
|
||||
self.shadow_widget.setVisible(False)
|
||||
# Refresh version
|
||||
self.widget_family.on_version_refresh()
|
||||
|
||||
def set_valid_family(self, valid):
|
||||
''' Sets `valid_family` attribute for validation
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from . import Node
|
|||
class TreeModel(QtCore.QAbstractItemModel):
|
||||
|
||||
COLUMNS = list()
|
||||
NodeRole = QtCore.Qt.UserRole + 1
|
||||
ItemRole = QtCore.Qt.UserRole + 1
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super(TreeModel, self).__init__(parent)
|
||||
|
|
@ -35,7 +35,7 @@ class TreeModel(QtCore.QAbstractItemModel):
|
|||
key = self.COLUMNS[column]
|
||||
return node.get(key, None)
|
||||
|
||||
if role == self.NodeRole:
|
||||
if role == self.ItemRole:
|
||||
return index.internalPointer()
|
||||
|
||||
def setData(self, index, value, role=QtCore.Qt.EditRole):
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ class AssetWidget(QtWidgets.QWidget):
|
|||
|
||||
def collect_data(self):
|
||||
project = self.dbcon.find_one({'type': 'project'})
|
||||
asset = self.dbcon.find_one({'_id': self.get_active_asset()})
|
||||
asset = self.get_active_asset()
|
||||
|
||||
try:
|
||||
index = self.task_view.selectedIndexes()[0]
|
||||
|
|
@ -219,6 +219,10 @@ class AssetWidget(QtWidgets.QWidget):
|
|||
return data
|
||||
|
||||
def get_parents(self, entity):
|
||||
ent_parents = entity.get("data", {}).get("parents")
|
||||
if ent_parents is not None and isinstance(ent_parents, list):
|
||||
return ent_parents
|
||||
|
||||
output = []
|
||||
if entity.get('data', {}).get('visualParent', None) is None:
|
||||
return output
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue