mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
fusion: reversing toolSaver back to tool
This commit is contained in:
parent
02279a51c8
commit
425ddc7b2b
8 changed files with 18 additions and 12 deletions
|
|
@ -14,7 +14,7 @@ class FusionRenderInstance(RenderInstance):
|
|||
projectEntity = attr.ib(default=None)
|
||||
stagingDir = attr.ib(default=None)
|
||||
app_version = attr.ib(default=None)
|
||||
toolSaver = attr.ib(default=None)
|
||||
tool = attr.ib(default=None)
|
||||
workfileComp = attr.ib(default=None)
|
||||
publish_attributes = attr.ib(default={})
|
||||
|
||||
|
|
@ -58,7 +58,7 @@ class CollectFusionRender(
|
|||
subset_name = inst.data["subset"]
|
||||
instance = FusionRenderInstance(
|
||||
family="render",
|
||||
toolSaver=tool,
|
||||
tool=tool,
|
||||
workfileComp=comp,
|
||||
families=instance_families,
|
||||
version=version,
|
||||
|
|
@ -111,6 +111,8 @@ class CollectFusionRender(
|
|||
# to skip ExtractReview locally
|
||||
instance.families.remove("review")
|
||||
|
||||
# add new instance to the list and remove the original
|
||||
# instance since it is not needed anymore
|
||||
instances.append(instance)
|
||||
instances_to_remove.append(inst)
|
||||
|
||||
|
|
@ -141,7 +143,7 @@ class CollectFusionRender(
|
|||
end = render_instance.frameEnd + render_instance.handleEnd
|
||||
|
||||
path = (
|
||||
render_instance.toolSaver["Clip"]
|
||||
render_instance.tool["Clip"]
|
||||
[render_instance.workfileComp.TIME_UNDEFINED]
|
||||
)
|
||||
output_dir = os.path.dirname(path)
|
||||
|
|
@ -163,7 +165,11 @@ class CollectFusionRender(
|
|||
return expected_files
|
||||
|
||||
def _update_for_frames(self, instance):
|
||||
"""Update old saved instances to current publishing format"""
|
||||
"""Updating instance for render.frames family
|
||||
|
||||
Adding representation data to the instance. Also setting
|
||||
colorspaceData to the representation based on file rules.
|
||||
"""
|
||||
|
||||
expected_files = instance.data["expectedFiles"]
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class FusionRenderLocal(
|
|||
|
||||
savers_to_render = [
|
||||
# Get the saver tool from the instance
|
||||
instance.data["toolSaver"] for instance in context if
|
||||
instance.data["tool"] for instance in context if
|
||||
# Only active instances
|
||||
instance.data.get("publish", True) and
|
||||
# Only render.local instances
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class ValidateCreateFolderChecked(pyblish.api.InstancePlugin):
|
|||
|
||||
@classmethod
|
||||
def get_invalid(cls, instance):
|
||||
tool = instance.data["toolSaver"]
|
||||
tool = instance.data["tool"]
|
||||
create_dir = tool.GetInput("CreateDir")
|
||||
if create_dir == 0.0:
|
||||
cls.log.error(
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class ValidateLocalFramesExistence(pyblish.api.InstancePlugin):
|
|||
if non_existing_frames is None:
|
||||
non_existing_frames = []
|
||||
|
||||
tool = instance.data["toolSaver"]
|
||||
tool = instance.data["tool"]
|
||||
|
||||
expected_files = instance.data["expectedFiles"]
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ class ValidateLocalFramesExistence(pyblish.api.InstancePlugin):
|
|||
def repair(cls, instance):
|
||||
invalid = cls.get_invalid(instance)
|
||||
if invalid:
|
||||
tool = instance.data["toolSaver"]
|
||||
tool = instance.data["tool"]
|
||||
# Change render target to local to render locally
|
||||
tool.SetData("openpype.creator_attributes.render_target", "local")
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class ValidateFilenameHasExtension(pyblish.api.InstancePlugin):
|
|||
fname, ext = os.path.splitext(path)
|
||||
|
||||
if not ext:
|
||||
tool = instance.data["toolSaver"]
|
||||
tool = instance.data["tool"]
|
||||
cls.log.error("%s has no extension specified" % tool.Name)
|
||||
return [tool]
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class ValidateSaverHasInput(pyblish.api.InstancePlugin):
|
|||
@classmethod
|
||||
def get_invalid(cls, instance):
|
||||
|
||||
saver = instance.data["toolSaver"]
|
||||
saver = instance.data["tool"]
|
||||
if not saver.Input.GetConnectedOutput():
|
||||
return [saver]
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class ValidateSaverPassthrough(pyblish.api.ContextPlugin):
|
|||
|
||||
def is_invalid(self, instance):
|
||||
|
||||
saver = instance.data["toolSaver"]
|
||||
saver = instance.data["tool"]
|
||||
attr = saver.GetAttrs()
|
||||
active = not attr["TOOLB_PassThrough"]
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class ValidateUniqueSubsets(pyblish.api.ContextPlugin):
|
|||
invalid.extend(instances)
|
||||
|
||||
# Return tools for the invalid instances so they can be selected
|
||||
invalid = [instance.data["toolSaver"] for instance in invalid]
|
||||
invalid = [instance.data["tool"] for instance in invalid]
|
||||
|
||||
return invalid
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue