mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
Hound
This commit is contained in:
parent
fe3cfc2442
commit
180035731b
11 changed files with 17 additions and 50 deletions
|
|
@ -1,7 +1,7 @@
|
|||
from avalon import api, photoshop
|
||||
|
||||
from pype.modules.websocket_server.clients.photoshop_client \
|
||||
import PhotoshopClientStub
|
||||
import PhotoshopClientStub
|
||||
|
||||
photoshopClient = PhotoshopClientStub()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
import os
|
||||
|
||||
import pyblish.api
|
||||
from avalon import photoshop
|
||||
|
||||
from pype.modules.websocket_server.clients.photoshop_client import \
|
||||
PhotoshopClientStub
|
||||
PhotoshopClientStub
|
||||
|
||||
|
||||
class CollectCurrentFile(pyblish.api.ContextPlugin):
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
import pythoncom
|
||||
|
||||
from avalon import photoshop
|
||||
|
||||
import pyblish.api
|
||||
|
||||
from pype.modules.websocket_server.clients.photoshop_client \
|
||||
import PhotoshopClientStub
|
||||
import PhotoshopClientStub
|
||||
|
||||
|
||||
class CollectInstances(pyblish.api.ContextPlugin):
|
||||
|
|
@ -30,9 +28,6 @@ class CollectInstances(pyblish.api.ContextPlugin):
|
|||
# can be.
|
||||
pythoncom.CoInitialize()
|
||||
|
||||
from datetime import datetime
|
||||
start = datetime.now()
|
||||
# for timing
|
||||
photoshop_client = PhotoshopClientStub()
|
||||
layers = photoshop_client.get_layers()
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ import pype.api
|
|||
from avalon import photoshop
|
||||
|
||||
from pype.modules.websocket_server.clients.photoshop_client import \
|
||||
PhotoshopClientStub
|
||||
PhotoshopClientStub
|
||||
|
||||
|
||||
class ExtractImage(pype.api.Extractor):
|
||||
"""Produce a flattened image file from instance
|
||||
|
|
@ -65,7 +66,6 @@ class ExtractImage(pype.api.Extractor):
|
|||
extension,
|
||||
True)
|
||||
|
||||
|
||||
representations = []
|
||||
for extension, filename in files.items():
|
||||
representations.append({
|
||||
|
|
|
|||
|
|
@ -4,9 +4,8 @@ import pype.api
|
|||
import pype.lib
|
||||
from avalon import photoshop
|
||||
|
||||
from datetime import datetime
|
||||
from pype.modules.websocket_server.clients.photoshop_client import \
|
||||
PhotoshopClientStub
|
||||
PhotoshopClientStub
|
||||
|
||||
|
||||
class ExtractReview(pype.api.Extractor):
|
||||
|
|
@ -17,7 +16,6 @@ class ExtractReview(pype.api.Extractor):
|
|||
families = ["review"]
|
||||
|
||||
def process(self, instance):
|
||||
start = datetime.now()
|
||||
staging_dir = self.staging_dir(instance)
|
||||
self.log.info("Outputting image to {}".format(staging_dir))
|
||||
|
||||
|
|
@ -34,14 +32,10 @@ class ExtractReview(pype.api.Extractor):
|
|||
os.path.splitext(photoshop_client.get_active_document_name())[0]
|
||||
)
|
||||
output_image_path = os.path.join(staging_dir, output_image)
|
||||
self.log.info(
|
||||
"first part took {}".format(datetime.now() - start))
|
||||
with photoshop.maintained_visibility():
|
||||
# Hide all other layers.
|
||||
start = datetime.now()
|
||||
extract_ids = set([ll.id for ll in photoshop_client.
|
||||
get_layers_in_layers(layers)])
|
||||
self.log.info("extract_ids {}".format(extract_ids))
|
||||
get_layers_in_layers(layers)])
|
||||
|
||||
for layer in photoshop_client.get_layers():
|
||||
# limit unnecessary calls to client
|
||||
|
|
@ -51,19 +45,11 @@ class ExtractReview(pype.api.Extractor):
|
|||
if not layer.visible and layer.id in extract_ids:
|
||||
photoshop_client.set_visible(layer.id,
|
||||
True)
|
||||
self.log.info(
|
||||
"get_layers_in_layers took {}".format(datetime.now() - start))
|
||||
|
||||
start = datetime.now()
|
||||
|
||||
self.log.info("output_image_path {}".format(output_image_path))
|
||||
photoshop_client.saveAs(output_image_path,
|
||||
'jpg',
|
||||
True)
|
||||
self.log.info(
|
||||
"saveAs {} took {}".format('JPG', datetime.now() - start))
|
||||
|
||||
start = datetime.now()
|
||||
ffmpeg_path = pype.lib.get_ffmpeg_tool_path("ffmpeg")
|
||||
|
||||
instance.data["representations"].append({
|
||||
|
|
@ -84,9 +70,6 @@ class ExtractReview(pype.api.Extractor):
|
|||
thumbnail_path
|
||||
]
|
||||
output = pype.lib._subprocess(args)
|
||||
self.log.info(
|
||||
"thumbnail {} took {}".format('JPG', datetime.now() - start))
|
||||
self.log.debug(output)
|
||||
|
||||
instance.data["representations"].append({
|
||||
"name": "thumbnail",
|
||||
|
|
@ -95,7 +78,6 @@ class ExtractReview(pype.api.Extractor):
|
|||
"stagingDir": staging_dir,
|
||||
"tags": ["thumbnail"]
|
||||
})
|
||||
start = datetime.now()
|
||||
# Generate mov.
|
||||
mov_path = os.path.join(staging_dir, "review.mov")
|
||||
args = [
|
||||
|
|
@ -106,10 +88,7 @@ class ExtractReview(pype.api.Extractor):
|
|||
mov_path
|
||||
]
|
||||
output = pype.lib._subprocess(args)
|
||||
self.log.info(
|
||||
"review {} took {}".format('JPG', datetime.now() - start))
|
||||
self.log.debug(output)
|
||||
start = datetime.now()
|
||||
instance.data["representations"].append({
|
||||
"name": "mov",
|
||||
"ext": "mov",
|
||||
|
|
@ -126,6 +105,5 @@ class ExtractReview(pype.api.Extractor):
|
|||
instance.data["frameStart"] = 1
|
||||
instance.data["frameEnd"] = 1
|
||||
instance.data["fps"] = 25
|
||||
self.log.info(
|
||||
"end {} took {}".format('JPG', datetime.now() - start))
|
||||
|
||||
self.log.info(f"Extracted {instance} to {staging_dir}")
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ import pype.api
|
|||
from avalon import photoshop
|
||||
|
||||
from pype.modules.websocket_server.clients.photoshop_client import \
|
||||
PhotoshopClientStub
|
||||
PhotoshopClientStub
|
||||
|
||||
|
||||
from datetime import datetime
|
||||
class ExtractSaveScene(pype.api.Extractor):
|
||||
"""Save scene before extraction."""
|
||||
|
||||
|
|
@ -15,7 +15,4 @@ class ExtractSaveScene(pype.api.Extractor):
|
|||
|
||||
def process(self, instance):
|
||||
photoshop_client = PhotoshopClientStub()
|
||||
start = datetime.now()
|
||||
photoshop_client.save()
|
||||
self.log.info(
|
||||
"ExtractSaveScene took {}".format(datetime.now() - start))
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import pyblish.api
|
||||
from pype.action import get_errored_plugins_from_data
|
||||
from pype.lib import version_up
|
||||
from avalon import photoshop
|
||||
|
||||
from pype.modules.websocket_server.clients.photoshop_client import \
|
||||
PhotoshopClientStub
|
||||
PhotoshopClientStub
|
||||
|
||||
|
||||
class IncrementWorkfile(pyblish.api.InstancePlugin):
|
||||
"""Increment the current workfile.
|
||||
|
|
|
|||
|
|
@ -27,8 +27,6 @@ class ValidateInstanceAssetRepair(pyblish.api.Action):
|
|||
instances = pyblish.api.instances_by_plugin(failed, plugin)
|
||||
photoshop_client = PhotoshopClientStub()
|
||||
for instance in instances:
|
||||
self.log.info("validate_instance_asset instance[0] {}".format(instance[0]))
|
||||
self.log.info("validate_instance_asset instance {}".format(instance))
|
||||
data = photoshop_client.read(instance[0])
|
||||
|
||||
data["asset"] = os.environ["AVALON_ASSET"]
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@ import pype.api
|
|||
from avalon import photoshop
|
||||
|
||||
from pype.modules.websocket_server.clients.photoshop_client import \
|
||||
PhotoshopClientStub
|
||||
PhotoshopClientStub
|
||||
|
||||
|
||||
class ValidateNamingRepair(pyblish.api.Action):
|
||||
"""Repair the instance asset."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue