mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
added matchmove and image families, fixed instance version, PEP8 and other fixes
This commit is contained in:
parent
ec3c190af8
commit
90bf2c9611
6 changed files with 77 additions and 40 deletions
|
|
@ -28,7 +28,8 @@ class IntegrateFtrackInstance(pyblish.api.InstancePlugin):
|
|||
'plate': 'img',
|
||||
'audio': 'audio',
|
||||
'workfile': 'scene',
|
||||
'animation': 'cache'
|
||||
'animation': 'cache',
|
||||
'image': 'img'
|
||||
}
|
||||
|
||||
def process(self, instance):
|
||||
|
|
|
|||
|
|
@ -70,7 +70,9 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
|||
"audio",
|
||||
"yetiRig",
|
||||
"yeticache",
|
||||
"source"
|
||||
"source",
|
||||
"matchmove",
|
||||
"image"
|
||||
]
|
||||
exclude_families = ["clip"]
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class MatchmoveLoader(api.Loader):
|
|||
Supported script types are .py and .mel
|
||||
"""
|
||||
|
||||
families = ["rendersetup"]
|
||||
families = ["matchmove"]
|
||||
representations = ["py", "mel"]
|
||||
defaults = ["Camera", "Object", "Mocap"]
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ class MatchmoveLoader(api.Loader):
|
|||
This will run matchmove script to create track in script.
|
||||
"""
|
||||
|
||||
families = ["rendersetup"]
|
||||
families = ["matchmove"]
|
||||
representations = ["py"]
|
||||
defaults = ["Camera", "Object"]
|
||||
|
||||
|
|
|
|||
|
|
@ -45,66 +45,71 @@ class CollectContextDataSAPublish(pyblish.api.ContextPlugin):
|
|||
with open(input_json_path, "r") as f:
|
||||
in_data = json.load(f)
|
||||
|
||||
asset_name = in_data['asset']
|
||||
family_preset_key = in_data.get('family_preset_key', '')
|
||||
family = in_data['family']
|
||||
subset = in_data['subset']
|
||||
asset_name = in_data["asset"]
|
||||
family_preset_key = in_data.get("family_preset_key", "")
|
||||
family = in_data["family"]
|
||||
subset = in_data["subset"]
|
||||
|
||||
# Load presets
|
||||
presets = context.data.get("presets")
|
||||
if not presets:
|
||||
from pypeapp import config
|
||||
|
||||
presets = config.get_presets()
|
||||
|
||||
# Get from presets anatomy key that will be used for getting template
|
||||
# - default integrate new is used if not set
|
||||
anatomy_key = presets.get(
|
||||
"standalone_publish", {}).get(
|
||||
"families", {}).get(
|
||||
family_preset_key, {}).get(
|
||||
"anatomy_template"
|
||||
anatomy_key = (
|
||||
presets.get("standalone_publish", {})
|
||||
.get("families", {})
|
||||
.get(family_preset_key, {})
|
||||
.get("anatomy_template")
|
||||
)
|
||||
|
||||
project = io.find_one({'type': 'project'})
|
||||
asset = io.find_one({
|
||||
'type': 'asset',
|
||||
'name': asset_name
|
||||
})
|
||||
context.data['project'] = project
|
||||
context.data['asset'] = asset
|
||||
project = io.find_one({"type": "project"})
|
||||
asset = io.find_one({"type": "asset", "name": asset_name})
|
||||
context.data["project"] = project
|
||||
context.data["asset"] = asset
|
||||
|
||||
instance = context.create_instance(subset)
|
||||
|
||||
instance.data.update({
|
||||
"subset": subset,
|
||||
"asset": asset_name,
|
||||
"label": subset,
|
||||
"name": subset,
|
||||
"family": family,
|
||||
"frameStart": in_data.get("representations", [None])[0].get("frameStart", None),
|
||||
"frameEnd": in_data.get("representations", [None])[0].get("frameEnd", None),
|
||||
"families": [family, 'ftrack'],
|
||||
})
|
||||
instance.data.update(
|
||||
{
|
||||
"subset": subset,
|
||||
"asset": asset_name,
|
||||
"label": subset,
|
||||
"name": subset,
|
||||
"family": family,
|
||||
"version": in_data.get("version", 1),
|
||||
"frameStart": in_data.get("representations", [None])[0].get(
|
||||
"frameStart", None
|
||||
),
|
||||
"frameEnd": in_data.get("representations", [None])[0].get(
|
||||
"frameEnd", None
|
||||
),
|
||||
"families": [family, "ftrack"],
|
||||
}
|
||||
)
|
||||
self.log.info("collected instance: {}".format(instance.data))
|
||||
self.log.info("parsing data: {}".format(in_data))
|
||||
|
||||
instance.data['destination_list'] = list()
|
||||
instance.data['representations'] = list()
|
||||
instance.data['source'] = 'standalone publisher'
|
||||
instance.data["destination_list"] = list()
|
||||
instance.data["representations"] = list()
|
||||
instance.data["source"] = "standalone publisher"
|
||||
|
||||
for component in in_data['representations']:
|
||||
for component in in_data["representations"]:
|
||||
|
||||
component['destination'] = component['files']
|
||||
component['stagingDir'] = component['stagingDir']
|
||||
component["destination"] = component["files"]
|
||||
component["stagingDir"] = component["stagingDir"]
|
||||
# Do not set anatomy_template if not specified
|
||||
if anatomy_key:
|
||||
component['anatomy_template'] = anatomy_key
|
||||
if isinstance(component['files'], list):
|
||||
collections, remainder = clique.assemble(component['files'])
|
||||
component["anatomy_template"] = anatomy_key
|
||||
if isinstance(component["files"], list):
|
||||
collections, remainder = clique.assemble(component["files"])
|
||||
self.log.debug("collecting sequence: {}".format(collections))
|
||||
instance.data["frameStart"] = int(component["frameStart"])
|
||||
instance.data["frameEnd"] = int(component["frameEnd"])
|
||||
instance.data['fps'] = int(component['fps'])
|
||||
instance.data["fps"] = int(component["fps"])
|
||||
|
||||
if component["preview"]:
|
||||
instance.data["families"].append("review")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
"""
|
||||
Requires:
|
||||
Nothing
|
||||
|
||||
Provides:
|
||||
Instance
|
||||
"""
|
||||
|
||||
import pyblish.api
|
||||
import logging
|
||||
|
||||
|
||||
log = logging.getLogger("collector")
|
||||
|
||||
|
||||
class CollectMatchmovePublish(pyblish.api.InstancePlugin):
|
||||
"""
|
||||
Collector with only one reason for its existence - remove 'ftrack'
|
||||
family implicitly added by Standalone Publisher
|
||||
"""
|
||||
|
||||
label = "Collect Matchmove - SA Publish"
|
||||
order = pyblish.api.CollectorOrder
|
||||
family = ["matchmove"]
|
||||
hosts = ["standalonepublisher"]
|
||||
|
||||
def process(self, instance):
|
||||
if "ftrack" in instance.data["families"]:
|
||||
instance.data["families"].remove("ftrack")
|
||||
Loading…
Add table
Add a link
Reference in a new issue