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

Commit

Permalink
Subset was not named or validated correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
tokejepsen committed Jun 23, 2020
1 parent a375a6e commit f6aeee3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions pype/plugins/photoshop/create/create_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,5 @@ def process(self):
groups.append(group)

for group in groups:
self.data.update({"subset": "image" + group.Name})
photoshop.imprint(group, self.data)
10 changes: 9 additions & 1 deletion pype/plugins/photoshop/publish/validate_naming.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pyblish.api
import pype.api
from avalon import photoshop


class ValidateNamingRepair(pyblish.api.Action):
Expand All @@ -22,7 +23,11 @@ def process(self, context, plugin):
instances = pyblish.api.instances_by_plugin(failed, plugin)

for instance in instances:
instance[0].Name = instance.data["name"].replace(" ", "_")
name = instance.data["name"].replace(" ", "_")
instance[0].Name = name
data = photoshop.read(instance[0])
data["subset"] = "image" + name
photoshop.imprint(instance[0], data)

return True

Expand All @@ -42,3 +47,6 @@ class ValidateNaming(pyblish.api.InstancePlugin):
def process(self, instance):
msg = "Name \"{}\" is not allowed.".format(instance.data["name"])
assert " " not in instance.data["name"], msg

msg = "Subset \"{}\" is not allowed.".format(instance.data["subset"])
assert " " not in instance.data["subset"], msg

0 comments on commit f6aeee3

Please sign in to comment.