diff --git a/client/ayon_unreal/plugins/create/create_render.py b/client/ayon_unreal/plugins/create/create_render.py index 27800f38..8af230ac 100644 --- a/client/ayon_unreal/plugins/create/create_render.py +++ b/client/ayon_unreal/plugins/create/create_render.py @@ -330,7 +330,10 @@ def _on_value_changed(self, event): and "folderPath" in changes and instance.creator_identifier == self.identifier ): - instance.data["label"] = f'{instance.data.get("folderPath")} - {instance.data.get("productName")}' + instance.data["label"] = ( + f'{instance.data.get("folderPath")} - ' + f'{instance.data.get("productName")}' + ) def register_callbacks(self): self.create_context.add_value_changed_callback(self._on_value_changed) diff --git a/client/ayon_unreal/plugins/publish/collect_render_files.py b/client/ayon_unreal/plugins/publish/collect_render_files.py index cc6055d7..64eab110 100644 --- a/client/ayon_unreal/plugins/publish/collect_render_files.py +++ b/client/ayon_unreal/plugins/publish/collect_render_files.py @@ -15,7 +15,6 @@ class CollectRenderFiles(pyblish.api.InstancePlugin): add them as representation. """ order = pyblish.api.CollectorOrder + 0.001 - hosts = ["unreal"] families = ["render.local"] label = "Collect Render Files" diff --git a/client/ayon_unreal/plugins/publish/create_farm_render_instances.py b/client/ayon_unreal/plugins/publish/create_farm_render_instances.py index 004c9a69..7c6916ff 100644 --- a/client/ayon_unreal/plugins/publish/create_farm_render_instances.py +++ b/client/ayon_unreal/plugins/publish/create_farm_render_instances.py @@ -36,8 +36,6 @@ class CreateFarmRenderInstances(publish.AbstractCollectRender): order = pyblish.api.CollectorOrder + 0.21 label = "Create Farm Render Instances" - hosts = ["unreal"] - families = ["render"] def preparing_rendering_instance(self, instance): context = instance.context @@ -152,6 +150,10 @@ def get_instances(self, context): if "render.local" in instance_families: continue + if not inst.data.get("farm", False): + self.log.info("Skipping local render instance") + continue + render_queue_path = ( project_settings["unreal"]["render_queue_path"] ) @@ -198,7 +200,10 @@ def get_instances(self, context): publish_attributes = {} - review = bool(inst.data["creator_attributes"].get("review")) + try: + review = bool(inst.data["creator_attributes"].get("review")) + except KeyError: + review = inst.data.get("review", False) new_instance = UnrealRenderInstance( family="render", @@ -234,7 +239,6 @@ def get_instances(self, context): master_level=inst.data["master_level"], render_queue_path=render_queue_path, deadline=inst.data.get("deadline"), - multipartExr=True, ) new_instance.farm = True diff --git a/client/ayon_unreal/plugins/publish/collect_render_target.py b/client/ayon_unreal/plugins/publish/switch_render_target.py similarity index 60% rename from client/ayon_unreal/plugins/publish/collect_render_target.py rename to client/ayon_unreal/plugins/publish/switch_render_target.py index d6c228e8..7c373c52 100644 --- a/client/ayon_unreal/plugins/publish/collect_render_target.py +++ b/client/ayon_unreal/plugins/publish/switch_render_target.py @@ -1,22 +1,19 @@ -"""Collect current project path.""" -import unreal # noqa import pyblish.api -class CollectRenderTarget(pyblish.api.InstancePlugin): - """Inject the current working file into context.""" - - order = pyblish.api.CollectorOrder - 0.5 - label = "Collect Render Target" - hosts = ["unreal"] +class SwitchRenderTargets(pyblish.api.InstancePlugin): + """Switch between farm and local render targets.""" + order = pyblish.api.CollectorOrder - 0.499 families = ["render"] + label = "Switch Render Targets" def process(self, instance): - """Inject the current working file.""" + self.log.debug(instance.data["creator_attributes"]) render_target = (instance.data["creator_attributes"]. get("render_target")) if render_target == "farm": self.log.debug("Rendering on farm") + instance.data["families"].append("render.farm") instance.data["farm"] = True return