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

Commit

Permalink
Merge pull request #2041 from pypeclub/PYPE-1840_Prerender-Version-co…
Browse files Browse the repository at this point in the history
…nsistent-with-Workfile-Version

Added possibility to configure of synchronization of workfile version…
  • Loading branch information
kalisp authored Sep 17, 2021
2 parents 54439dc + 0a2ff39 commit ee23cd5
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 10 deletions.
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

0 comments on commit ee23cd5

Please sign in to comment.