mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
Fix select correct layers for multiple images
This commit is contained in:
parent
e551039c12
commit
41e2149d12
3 changed files with 17 additions and 27 deletions
|
|
@ -31,7 +31,7 @@ class CollectInstances(pyblish.api.ContextPlugin):
|
|||
|
||||
photoshop_client = PhotoshopClientStub()
|
||||
layers = photoshop_client.get_layers()
|
||||
layers_meta = photoshop_client._get_layers_metadata()
|
||||
layers_meta = photoshop_client.get_layers_metadata()
|
||||
for layer in layers:
|
||||
layer_data = photoshop_client.read(layer, layers_meta)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,9 @@ import os
|
|||
import pype.api
|
||||
from avalon import photoshop
|
||||
|
||||
from pype.modules.websocket_server.clients.photoshop_client import \
|
||||
PhotoshopClientStub
|
||||
from pype.modules.websocket_server.clients.photoshop_client import (
|
||||
PhotoshopClientStub
|
||||
)
|
||||
|
||||
|
||||
class ExtractImage(pype.api.Extractor):
|
||||
|
|
@ -23,12 +24,6 @@ class ExtractImage(pype.api.Extractor):
|
|||
staging_dir = self.staging_dir(instance)
|
||||
self.log.info("Outputting image to {}".format(staging_dir))
|
||||
|
||||
layers = []
|
||||
for image_instance in instance.context:
|
||||
if image_instance.data["family"] != "image":
|
||||
continue
|
||||
layers.append(image_instance[0])
|
||||
|
||||
# Perform extraction
|
||||
photoshop_client = PhotoshopClientStub()
|
||||
files = {}
|
||||
|
|
@ -37,7 +32,7 @@ class ExtractImage(pype.api.Extractor):
|
|||
with photoshop.maintained_visibility():
|
||||
# Hide all other layers.
|
||||
extract_ids = set([ll.id for ll in photoshop_client.
|
||||
get_layers_in_layers(layers)])
|
||||
get_layers_in_layers([instance[0]])])
|
||||
|
||||
for layer in photoshop_client.get_layers():
|
||||
# limit unnecessary calls to client
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue