Skip to content

Commit 0ae49dc

Browse files
authored
Fro #8196, local properties for publish template (#9)
Use local properties for publish template settings to avoid property override.
1 parent fd1f0a4 commit 0ae49dc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

hooks/tk-multi-publish2/tk-maya/basic/publish_fbx.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def accept(self, settings, item):
157157

158158
# We've validated the publish template. add it to the item properties
159159
# for use in subsequent methods
160-
item.properties["publish_template"] = publish_template
160+
item.local_properties["publish_template"] = publish_template
161161

162162
path = _session_path()
163163
if not path:
@@ -226,7 +226,7 @@ def validate(self, settings, item):
226226
# matches. if not, warn the user and provide a way to save the file to
227227
# a different path
228228
work_template = item.properties.get("work_template")
229-
publish_template = item.properties.get("publish_template")
229+
publish_template = item.local_properties.get("publish_template")
230230
if work_template and publish_template:
231231
# Ensure the fields work for the publish template
232232
# This raises an error if the path does not match the template.
@@ -235,7 +235,7 @@ def validate(self, settings, item):
235235
if missing_keys:
236236
error_msg = (
237237
"Work file '%s' missing keys required for the "
238-
"publish template: %s" % (path, missing_keys)
238+
"publish template %s: %s" % (path, publish_template, missing_keys)
239239
)
240240
self.logger.error(error_msg)
241241
return False

hooks/tk-multi-publish2/tk-maya/basic/publish_turntable.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ def accept(self, settings, item):
672672

673673
# We've validated the publish template. add it to the item properties
674674
# for use in subsequent methods
675-
item.properties["publish_template"] = publish_template
675+
item.local_properties["publish_template"] = publish_template
676676

677677
# Because a publish template is configured, disable context change. This
678678
# is a temporary measure until the publisher handles context switching
@@ -721,7 +721,7 @@ def validate(self, settings, item):
721721

722722
# get the configured work file template
723723
work_template = item.properties.get("work_template")
724-
publish_template = item.properties.get("publish_template")
724+
publish_template = item.local_properties.get("publish_template")
725725
if work_template and publish_template:
726726
# get the current scene path and extract fields from it using the work
727727
# template:

0 commit comments

Comments
 (0)