mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
PS - fix hardcoding 'image' family into subset name
This commit is contained in:
parent
5c8a1a0c94
commit
655063e9f6
1 changed files with 13 additions and 2 deletions
|
|
@ -16,7 +16,9 @@ class CreateImage(openpype.api.Creator):
|
|||
create_group = False
|
||||
|
||||
stub = photoshop.stub()
|
||||
useSelection = False
|
||||
if (self.options or {}).get("useSelection"):
|
||||
useSelection = True
|
||||
multiple_instances = False
|
||||
selection = stub.get_selected_layers()
|
||||
self.log.info("selection {}".format(selection))
|
||||
|
|
@ -61,7 +63,9 @@ class CreateImage(openpype.api.Creator):
|
|||
# No selection creates an empty group.
|
||||
create_group = True
|
||||
else:
|
||||
create_group = True
|
||||
stub.select_layers(stub.get_layers())
|
||||
group = stub.group_selected_layers(self.name)
|
||||
groups.append(group)
|
||||
|
||||
if create_group:
|
||||
group = stub.create_group(self.name)
|
||||
|
|
@ -77,13 +81,20 @@ class CreateImage(openpype.api.Creator):
|
|||
group.name = group.name.replace(stub.PUBLISH_ICON, ''). \
|
||||
replace(stub.LOADED_ICON, '')
|
||||
|
||||
if useSelection:
|
||||
clean_subset_name = self.data["subset"].replace("Default", '')
|
||||
subset_name = clean_subset_name + group.name
|
||||
else:
|
||||
# use value provided by user from Creator
|
||||
subset_name = self.data["subset"]
|
||||
|
||||
if group.long_name:
|
||||
for directory in group.long_name[::-1]:
|
||||
name = directory.replace(stub.PUBLISH_ICON, '').\
|
||||
replace(stub.LOADED_ICON, '')
|
||||
long_names.append(name)
|
||||
|
||||
self.data.update({"subset": "image" + group.name})
|
||||
self.data.update({"subset": subset_name})
|
||||
self.data.update({"uuid": str(group.id)})
|
||||
self.data.update({"long_name": "_".join(long_names)})
|
||||
stub.imprint(group, self.data)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue