Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Added possibility to configure of synchronization of workfile version… #2041

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions openpype/hosts/nuke/plugins/publish/precollect_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -120,11 +120,12 @@ def process(self, context):
# 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,
Expand Down
8 changes: 7 additions & 1 deletion openpype/settings/defaults/project_settings/nuke.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@
},
"publish": {
"PreCollectNukeInstances": {
"sync_workfile_version": true
"sync_workfile_version_on_families": [
"nukenodes",
"camera",
"gizmo",
"source",
"render"
]
},
"ValidateContainers": {
"enabled": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
]
},
Expand Down