Skip to content

Commit

Permalink
🐛 fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
antirotor committed Nov 20, 2024
1 parent e515c8f commit 2f09a7d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
5 changes: 4 additions & 1 deletion client/ayon_unreal/plugins/create/create_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
1 change: 0 additions & 1 deletion client/ayon_unreal/plugins/publish/collect_render_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"]
)
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 2f09a7d

Please sign in to comment.