mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 17:04:54 +01:00
created copy of psb bulk plugin but for render mov batch
# Conflicts: # pype/hosts/standalonepublisher/plugins/publish/collect_mov_instances.py
This commit is contained in:
parent
ba4f62a3fb
commit
406c665d1d
2 changed files with 54 additions and 1 deletions
|
|
@ -0,0 +1,54 @@
|
|||
import copy
|
||||
import pyblish.api
|
||||
from pprint import pformat
|
||||
|
||||
|
||||
class CollectMovInstances(pyblish.api.InstancePlugin):
|
||||
"""Collect all available instances from render mov batch."""
|
||||
|
||||
label = "Collect Mov Instances"
|
||||
order = pyblish.api.CollectorOrder + 0.489
|
||||
hosts = ["standalonepublisher"]
|
||||
families = ["render_mov_batch"]
|
||||
|
||||
# presets
|
||||
subsets = {
|
||||
"render": {
|
||||
"task": "compositing",
|
||||
"family": "render"
|
||||
}
|
||||
}
|
||||
unchecked_by_default = []
|
||||
|
||||
def process(self, instance):
|
||||
context = instance.context
|
||||
asset_name = instance.data["asset"]
|
||||
for subset_name, subset_data in self.subsets.items():
|
||||
instance_name = f"{asset_name}_{subset_name}"
|
||||
task_name = subset_data["task"]
|
||||
|
||||
# create new instance
|
||||
new_instance = context.create_instance(instance_name)
|
||||
|
||||
# add original instance data except name key
|
||||
for key, value in instance.data.items():
|
||||
if key not in ["name"]:
|
||||
# Make sure value is copy since value may be object which
|
||||
# can be shared across all new created objects
|
||||
new_instance.data[key] = copy.deepcopy(value)
|
||||
|
||||
# add subset data from preset
|
||||
new_instance.data.update(subset_data)
|
||||
|
||||
new_instance.data["label"] = instance_name
|
||||
new_instance.data["subset"] = subset_name
|
||||
new_instance.data["task"] = task_name
|
||||
|
||||
if subset_name in self.unchecked_by_default:
|
||||
new_instance.data["publish"] = False
|
||||
|
||||
self.log.info(f"Created new instance: {instance_name}")
|
||||
self.log.debug(f"New instance data: {pformat(new_instance.data)}")
|
||||
|
||||
# delete original instance
|
||||
context.remove(instance)
|
||||
|
|
@ -55,7 +55,6 @@ class CollectPsdInstances(pyblish.api.InstancePlugin):
|
|||
new_instance.data["subset"] = subset_name
|
||||
new_instance.data["task"] = task
|
||||
|
||||
|
||||
if subset_name in self.unchecked_by_default:
|
||||
new_instance.data["publish"] = False
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue