mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-27 06:12:19 +01:00
fix(nukestudio): moving some plugins to _unused
This commit is contained in:
parent
3a6871b301
commit
81aab9dfa9
3 changed files with 131 additions and 0 deletions
45
pype/plugins/nukestudio/_unused/collect_subsets.py
Normal file
45
pype/plugins/nukestudio/_unused/collect_subsets.py
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
from pyblish import api
|
||||
|
||||
|
||||
class CollectClipSubsets(api.InstancePlugin):
|
||||
"""Collect Subsets from selected Clips, Tags, Preset."""
|
||||
|
||||
order = api.CollectorOrder + 0.01
|
||||
label = "Collect Subsets"
|
||||
hosts = ["nukestudio"]
|
||||
families = ['clip']
|
||||
|
||||
def process(self, instance):
|
||||
tags = instance.data.get('tags', None)
|
||||
presets = instance.context.data['presets'][
|
||||
instance.context.data['host']]
|
||||
if tags:
|
||||
self.log.info(tags)
|
||||
|
||||
if presets:
|
||||
self.log.info(presets)
|
||||
|
||||
# get presets and tags
|
||||
# iterate tags and get task family
|
||||
# iterate tags and get host family
|
||||
# iterate tags and get handles family
|
||||
|
||||
instance = instance.context.create_instance(instance_name)
|
||||
|
||||
instance.data.update({
|
||||
"subset": subset_name,
|
||||
"stagingDir": staging_dir,
|
||||
"task": task,
|
||||
"representation": ext[1:],
|
||||
"host": host,
|
||||
"asset": asset_name,
|
||||
"label": label,
|
||||
"name": name,
|
||||
# "hierarchy": hierarchy,
|
||||
# "parents": parents,
|
||||
"family": family,
|
||||
"families": [families, 'ftrack'],
|
||||
"publish": True,
|
||||
# "files": files_list
|
||||
})
|
||||
instances.append(instance)
|
||||
40
pype/plugins/nukestudio/_unused/validate_projectroot.py
Normal file
40
pype/plugins/nukestudio/_unused/validate_projectroot.py
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
from pyblish import api
|
||||
|
||||
|
||||
class RepairProjectRoot(api.Action):
|
||||
|
||||
label = "Repair"
|
||||
icon = "wrench"
|
||||
on = "failed"
|
||||
|
||||
def process(self, context, plugin):
|
||||
import os
|
||||
|
||||
project_root = os.path.join(
|
||||
os.path.dirname(context.data["currentFile"])
|
||||
)
|
||||
|
||||
context.data["activeProject"].setProjectRoot(project_root)
|
||||
|
||||
|
||||
class ValidateProjectRoot(api.ContextPlugin):
|
||||
"""Validate the project root to the workspace directory."""
|
||||
|
||||
order = api.ValidatorOrder
|
||||
label = "Project Root"
|
||||
hosts = ["nukestudio"]
|
||||
actions = [RepairProjectRoot]
|
||||
|
||||
def process(self, context):
|
||||
import os
|
||||
|
||||
workspace = os.path.join(
|
||||
os.path.dirname(context.data["currentFile"])
|
||||
)
|
||||
project_root = context.data["activeProject"].projectRoot()
|
||||
|
||||
failure_message = (
|
||||
'The project root needs to be "{0}", its currently: "{1}"'
|
||||
).format(workspace, project_root)
|
||||
|
||||
assert project_root == workspace, failure_message
|
||||
46
pype/plugins/nukestudio/_unused/validate_track_item.py
Normal file
46
pype/plugins/nukestudio/_unused/validate_track_item.py
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
from pyblish import api
|
||||
|
||||
class ValidateClip(api.InstancePlugin):
|
||||
"""Validate the track item to the sequence.
|
||||
|
||||
Exact matching to optimize processing.
|
||||
"""
|
||||
|
||||
order = api.ValidatorOrder
|
||||
families = ["clip"]
|
||||
# match = api.Exact
|
||||
label = "Validate Track Item"
|
||||
hosts = ["nukestudio"]
|
||||
optional = True
|
||||
|
||||
def process(self, instance):
|
||||
|
||||
item = instance.data["item"]
|
||||
self.log.info("__ item: {}".format(item))
|
||||
media_source = item.source().mediaSource()
|
||||
self.log.info("__ media_source: {}".format(media_source))
|
||||
|
||||
msg = (
|
||||
'A setting does not match between track item "{0}" and sequence '
|
||||
'"{1}".'.format(item.name(), item.sequence().name()) +
|
||||
'\n\nSetting: "{0}".''\n\nTrack item: "{1}".\n\nSequence: "{2}".'
|
||||
)
|
||||
|
||||
# Validate format settings.
|
||||
fmt = item.sequence().format()
|
||||
assert fmt.width() == media_source.width(), msg.format(
|
||||
"width", fmt.width(), media_source.width()
|
||||
)
|
||||
assert fmt.height() == media_source.height(), msg.format(
|
||||
"height", fmt.height(), media_source.height()
|
||||
)
|
||||
assert fmt.pixelAspect() == media_source.pixelAspect(), msg.format(
|
||||
"pixelAspect", fmt.pixelAspect(), media_source.pixelAspect()
|
||||
)
|
||||
|
||||
# Validate framerate setting.
|
||||
sequence = item.sequence()
|
||||
source_framerate = media_source.metadata()["foundry.source.framerate"]
|
||||
assert sequence.framerate() == source_framerate, msg.format(
|
||||
"framerate", source_framerate, sequence.framerate()
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue