mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
Added group_selected_layers, get_selected_layers, import_smart_object, replace_smart_object
Fixed imprint for performance
This commit is contained in:
parent
a9f146e2fc
commit
fe3cfc2442
4 changed files with 138 additions and 40 deletions
|
|
@ -1,5 +1,10 @@
|
|||
from avalon import api, photoshop
|
||||
|
||||
from pype.modules.websocket_server.clients.photoshop_client \
|
||||
import PhotoshopClientStub
|
||||
|
||||
photoshopClient = PhotoshopClientStub()
|
||||
|
||||
|
||||
class ImageLoader(api.Loader):
|
||||
"""Load images
|
||||
|
|
@ -28,11 +33,11 @@ class ImageLoader(api.Loader):
|
|||
layer = container.pop("layer")
|
||||
|
||||
with photoshop.maintained_selection():
|
||||
photoshop.replace_smart_object(
|
||||
photoshopClient.replace_smart_object(
|
||||
layer, api.get_representation_path(representation)
|
||||
)
|
||||
|
||||
photoshop.imprint(
|
||||
photoshopClient.imprint(
|
||||
layer, {"representation": str(representation["_id"])}
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,9 @@ from avalon import photoshop
|
|||
|
||||
import pyblish.api
|
||||
|
||||
from pype.modules.websocket_server.clients.photoshop_client import PhotoshopClientStub
|
||||
from pype.modules.websocket_server.clients.photoshop_client \
|
||||
import PhotoshopClientStub
|
||||
|
||||
|
||||
class CollectInstances(pyblish.api.ContextPlugin):
|
||||
"""Gather instances by LayerSet and file metadata
|
||||
|
|
@ -38,7 +40,7 @@ class CollectInstances(pyblish.api.ContextPlugin):
|
|||
layer_data = photoshop_client.read(layer)
|
||||
self.log.info("layer_data {}".format(layer_data))
|
||||
|
||||
photoshop_client.imprint(layer, layer_data)
|
||||
photoshop_client.imprint(layer, layer_data, layers)
|
||||
new_layer_data = photoshop_client.read(layer)
|
||||
assert layer_data == new_layer_data
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue