mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Added possibility to configure of synchronization of workfile version with selected families
This commit is contained in:
parent
7aa879528a
commit
0a2ff39c4a
3 changed files with 38 additions and 10 deletions
|
|
@ -13,7 +13,7 @@ class PreCollectNukeInstances(pyblish.api.ContextPlugin):
|
|||
hosts = ["nuke", "nukeassist"]
|
||||
|
||||
# presets
|
||||
sync_workfile_version = False
|
||||
sync_workfile_version_on_families = []
|
||||
|
||||
def process(self, context):
|
||||
asset_data = io.find_one({
|
||||
|
|
@ -120,11 +120,12 @@ class PreCollectNukeInstances(pyblish.api.ContextPlugin):
|
|||
# sync workfile version
|
||||
_families_test = [family] + families
|
||||
self.log.debug("__ _families_test: `{}`".format(_families_test))
|
||||
if not next((f for f in _families_test
|
||||
if "prerender" in f),
|
||||
None) and self.sync_workfile_version:
|
||||
# get version to instance for integration
|
||||
instance.data['version'] = instance.context.data['version']
|
||||
for family_test in _families_test:
|
||||
if family_test in self.sync_workfile_version_on_families:
|
||||
self.log.debug("Syncing version with workfile for '{}'"
|
||||
.format(family_test))
|
||||
# get version to instance for integration
|
||||
instance.data['version'] = instance.context.data['version']
|
||||
|
||||
instance.data.update({
|
||||
"subset": subset,
|
||||
|
|
|
|||
|
|
@ -30,7 +30,13 @@
|
|||
},
|
||||
"publish": {
|
||||
"PreCollectNukeInstances": {
|
||||
"sync_workfile_version": true
|
||||
"sync_workfile_version_on_families": [
|
||||
"nukenodes",
|
||||
"camera",
|
||||
"gizmo",
|
||||
"source",
|
||||
"render"
|
||||
]
|
||||
},
|
||||
"ValidateContainers": {
|
||||
"enabled": true,
|
||||
|
|
|
|||
|
|
@ -16,9 +16,30 @@
|
|||
"is_group": true,
|
||||
"children": [
|
||||
{
|
||||
"type": "boolean",
|
||||
"key": "sync_workfile_version",
|
||||
"label": "Sync Version from workfile"
|
||||
"type": "enum",
|
||||
"key": "sync_workfile_version_on_families",
|
||||
"label": "Sync workfile version for families",
|
||||
"multiselection": true,
|
||||
"enum_items": [
|
||||
{
|
||||
"nukenodes": "nukenodes"
|
||||
},
|
||||
{
|
||||
"camera": "camera"
|
||||
},
|
||||
{
|
||||
"gizmo": "gizmo"
|
||||
},
|
||||
{
|
||||
"source": "source"
|
||||
},
|
||||
{
|
||||
"prerender": "prerender"
|
||||
},
|
||||
{
|
||||
"render": "render"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue