From cf7f23c9843bcf74db85da049b227df1e9a32594 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Wed, 20 Nov 2024 17:39:58 +0200 Subject: [PATCH 1/6] support render targets for bgeo instnaces --- .../ayon_houdini/plugins/create/create_bgeo.py | 18 ++++++++++++++---- .../plugins/publish/collect_cache_farm.py | 8 +++++--- .../plugins/publish/collect_farm_instances.py | 5 +++-- .../plugins/publish/extract_rop.py | 4 +++- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/client/ayon_houdini/plugins/create/create_bgeo.py b/client/ayon_houdini/plugins/create/create_bgeo.py index be51eda411..57037d29d0 100644 --- a/client/ayon_houdini/plugins/create/create_bgeo.py +++ b/client/ayon_houdini/plugins/create/create_bgeo.py @@ -13,6 +13,9 @@ class CreateBGEO(plugin.HoudiniCreator): product_type = "pointcache" icon = "gears" + # Default render target + render_target = "local" + def get_publish_families(self): return ["pointcache", "bgeo"] @@ -21,7 +24,7 @@ def create(self, product_name, instance_data, pre_create_data): instance_data.update({"node_type": "geometry"}) creator_attributes = instance_data.setdefault( "creator_attributes", dict()) - creator_attributes["farm"] = pre_create_data["farm"] + creator_attributes["render_target"] = pre_create_data["render_target"] instance = super(CreateBGEO, self).create( product_name, @@ -63,10 +66,17 @@ def create(self, product_name, instance_data, pre_create_data): instance_node.setParms(parms) def get_instance_attr_defs(self): + render_target_items = { + "local": "Local machine rendering", + "local_no_render": "Use existing frames (local)", + "farm": "Farm Rendering", + } + return [ - BoolDef("farm", - label="Submitting to Farm", - default=False) + EnumDef("render_target", + items=render_target_items, + label="Render target", + default=self.render_target) ] def get_pre_create_attr_defs(self): diff --git a/client/ayon_houdini/plugins/publish/collect_cache_farm.py b/client/ayon_houdini/plugins/publish/collect_cache_farm.py index 68053cf8fb..de977faed2 100644 --- a/client/ayon_houdini/plugins/publish/collect_cache_farm.py +++ b/client/ayon_houdini/plugins/publish/collect_cache_farm.py @@ -16,9 +16,11 @@ class CollectFarmCacheFamily(plugin.HoudiniInstancePlugin): def process(self, instance): creator_attribute = instance.data["creator_attributes"] - farm_enabled = creator_attribute["farm"] - instance.data["farm"] = farm_enabled - if not farm_enabled: + farm_enabled = creator_attribute.get("farm") + if farm_enabled is not None: + instance.data["farm"] = farm_enabled + + if not instance.data["farm"]: self.log.debug("Caching on farm is disabled. " "Skipping farm collecting.") return diff --git a/client/ayon_houdini/plugins/publish/collect_farm_instances.py b/client/ayon_houdini/plugins/publish/collect_farm_instances.py index f14ff65518..9953dce70d 100644 --- a/client/ayon_houdini/plugins/publish/collect_farm_instances.py +++ b/client/ayon_houdini/plugins/publish/collect_farm_instances.py @@ -5,13 +5,14 @@ class CollectFarmInstances(plugin.HoudiniInstancePlugin): """Collect instances for farm render.""" - order = pyblish.api.CollectorOrder + order = pyblish.api.CollectorOrder - 0.49 families = ["mantra_rop", "karma_rop", "redshift_rop", "arnold_rop", "vray_rop", - "usdrender"] + "usdrender", + "bgeo"] targets = ["local", "remote"] label = "Collect farm instances" diff --git a/client/ayon_houdini/plugins/publish/extract_rop.py b/client/ayon_houdini/plugins/publish/extract_rop.py index 74a5f52154..bb1bb8a253 100644 --- a/client/ayon_houdini/plugins/publish/extract_rop.py +++ b/client/ayon_houdini/plugins/publish/extract_rop.py @@ -19,6 +19,7 @@ def process(self, instance: pyblish.api.Instance): if instance.data.get("farm"): self.log.debug("Should be processed on farm, skipping.") return + creator_attribute = instance.data["creator_attributes"] files = instance.data["frames"] first_file = files[0] if isinstance(files, (list, tuple)) else files @@ -29,7 +30,8 @@ def process(self, instance: pyblish.api.Instance): ) ext = ext.lstrip(".") - self.render_rop(instance) + if creator_attribute.get("render_target") in {None, "local"}: + self.render_rop(instance) self.validate_expected_frames(instance) # In some cases representation name is not the the extension From c51710528da1afd7175446347bd07c2b69a79332 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 21 Nov 2024 13:08:56 +0200 Subject: [PATCH 2/6] remove unused import --- client/ayon_houdini/plugins/create/create_bgeo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_houdini/plugins/create/create_bgeo.py b/client/ayon_houdini/plugins/create/create_bgeo.py index 57037d29d0..884f0d92b5 100644 --- a/client/ayon_houdini/plugins/create/create_bgeo.py +++ b/client/ayon_houdini/plugins/create/create_bgeo.py @@ -3,7 +3,7 @@ from ayon_houdini.api import plugin from ayon_core.pipeline import CreatorError import hou -from ayon_core.lib import EnumDef, BoolDef +from ayon_core.lib import EnumDef class CreateBGEO(plugin.HoudiniCreator): From 6ae167ad0513d113ad90db082fd689af1c14f4c9 Mon Sep 17 00:00:00 2001 From: Mustafa Jafar Date: Thu, 21 Nov 2024 23:05:40 +0200 Subject: [PATCH 3/6] Better condition Co-authored-by: Roy Nieterau --- client/ayon_houdini/plugins/publish/extract_rop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_houdini/plugins/publish/extract_rop.py b/client/ayon_houdini/plugins/publish/extract_rop.py index bb1bb8a253..2e7326db8d 100644 --- a/client/ayon_houdini/plugins/publish/extract_rop.py +++ b/client/ayon_houdini/plugins/publish/extract_rop.py @@ -30,7 +30,7 @@ def process(self, instance: pyblish.api.Instance): ) ext = ext.lstrip(".") - if creator_attribute.get("render_target") in {None, "local"}: + if creator_attribute.get("render_target", "local") == "local": self.render_rop(instance) self.validate_expected_frames(instance) From 1124f995898efcc10741a44e00ce24f278093556 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 22 Nov 2024 17:43:48 +0200 Subject: [PATCH 4/6] Support render targets for other cache instances --- .../plugins/create/create_alembic_camera.py | 25 ++++++++++++++++++ .../plugins/create/create_arnold_ass.py | 20 ++++++++++---- .../plugins/create/create_composite.py | 25 ++++++++++++++++++ .../plugins/create/create_model.py | 20 ++++++++++---- .../plugins/create/create_pointcache.py | 20 ++++++++++---- .../plugins/create/create_redshift_proxy.py | 20 ++++++++++---- .../plugins/create/create_review.py | 24 +++++++++++++++-- .../plugins/create/create_staticmesh.py | 26 +++++++++++++++++-- .../ayon_houdini/plugins/create/create_usd.py | 25 ++++++++++++++++++ .../plugins/create/create_usd_look.py | 25 ++++++++++++++++++ .../plugins/create/create_vbd_cache.py | 20 ++++++++++---- .../plugins/publish/collect_cache_farm.py | 8 +++--- .../plugins/publish/collect_farm_instances.py | 4 ++- 13 files changed, 227 insertions(+), 35 deletions(-) diff --git a/client/ayon_houdini/plugins/create/create_alembic_camera.py b/client/ayon_houdini/plugins/create/create_alembic_camera.py index 5593452d77..fee86e91f1 100644 --- a/client/ayon_houdini/plugins/create/create_alembic_camera.py +++ b/client/ayon_houdini/plugins/create/create_alembic_camera.py @@ -2,6 +2,7 @@ """Creator plugin for creating alembic camera products.""" from ayon_houdini.api import plugin from ayon_core.pipeline import CreatorError +from ayon_core.lib import EnumDef import hou @@ -14,10 +15,16 @@ class CreateAlembicCamera(plugin.HoudiniCreator): product_type = "camera" icon = "camera" + # Default render target + render_target = "local" + def create(self, product_name, instance_data, pre_create_data): import hou instance_data.update({"node_type": "alembic"}) + creator_attributes = instance_data.setdefault( + "creator_attributes", dict()) + creator_attributes["render_target"] = pre_create_data["render_target"] instance = super(CreateAlembicCamera, self).create( product_name, @@ -54,3 +61,21 @@ def get_network_categories(self): hou.ropNodeTypeCategory(), hou.objNodeTypeCategory() ] + + def get_instance_attr_defs(self): + render_target_items = { + "local": "Local machine rendering", + "local_no_render": "Use existing frames (local)", + "farm": "Farm Rendering", + } + + return [ + EnumDef("render_target", + items=render_target_items, + label="Render target", + default=self.render_target) + ] + + def get_pre_create_attr_defs(self): + attrs = super().get_pre_create_attr_defs() + return attrs + self.get_instance_attr_defs() diff --git a/client/ayon_houdini/plugins/create/create_arnold_ass.py b/client/ayon_houdini/plugins/create/create_arnold_ass.py index ec7ba508e0..9adb9a2d28 100644 --- a/client/ayon_houdini/plugins/create/create_arnold_ass.py +++ b/client/ayon_houdini/plugins/create/create_arnold_ass.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Creator plugin for creating Arnold ASS files.""" from ayon_houdini.api import plugin -from ayon_core.lib import BoolDef +from ayon_core.lib import EnumDef class CreateArnoldAss(plugin.HoudiniCreator): @@ -17,13 +17,16 @@ class CreateArnoldAss(plugin.HoudiniCreator): # will override it by the value in the project settings ext = ".ass" + # Default render target + render_target = "local" + def create(self, product_name, instance_data, pre_create_data): import hou instance_data.update({"node_type": "arnold"}) creator_attributes = instance_data.setdefault( "creator_attributes", dict()) - creator_attributes["farm"] = pre_create_data["farm"] + creator_attributes["render_target"] = pre_create_data["render_target"] instance = super(CreateArnoldAss, self).create( product_name, @@ -57,10 +60,17 @@ def create(self, product_name, instance_data, pre_create_data): self.lock_parameters(instance_node, to_lock) def get_instance_attr_defs(self): + render_target_items = { + "local": "Local machine rendering", + "local_no_render": "Use existing frames (local)", + "farm": "Farm Rendering", + } + return [ - BoolDef("farm", - label="Submitting to Farm", - default=False) + EnumDef("render_target", + items=render_target_items, + label="Render target", + default=self.render_target) ] def get_pre_create_attr_defs(self): diff --git a/client/ayon_houdini/plugins/create/create_composite.py b/client/ayon_houdini/plugins/create/create_composite.py index 50fcab5875..ee7ff0e9a6 100644 --- a/client/ayon_houdini/plugins/create/create_composite.py +++ b/client/ayon_houdini/plugins/create/create_composite.py @@ -2,6 +2,7 @@ """Creator plugin for creating composite sequences.""" from ayon_houdini.api import plugin from ayon_core.pipeline import CreatorError +from ayon_core.lib import EnumDef import hou @@ -16,10 +17,16 @@ class CreateCompositeSequence(plugin.HoudiniCreator): ext = ".exr" + # Default render target + render_target = "local" + def create(self, product_name, instance_data, pre_create_data): import hou # noqa instance_data.update({"node_type": "comp"}) + creator_attributes = instance_data.setdefault( + "creator_attributes", dict()) + creator_attributes["render_target"] = pre_create_data["render_target"] instance = super(CreateCompositeSequence, self).create( product_name, @@ -58,3 +65,21 @@ def get_network_categories(self): hou.ropNodeTypeCategory(), hou.cop2NodeTypeCategory() ] + + def get_instance_attr_defs(self): + render_target_items = { + "local": "Local machine rendering", + "local_no_render": "Use existing frames (local)", + "farm": "Farm Rendering", + } + + return [ + EnumDef("render_target", + items=render_target_items, + label="Render target", + default=self.render_target) + ] + + def get_pre_create_attr_defs(self): + attrs = super().get_pre_create_attr_defs() + return attrs + self.get_instance_attr_defs() \ No newline at end of file diff --git a/client/ayon_houdini/plugins/create/create_model.py b/client/ayon_houdini/plugins/create/create_model.py index 92eee306ae..8c5e5aa89a 100644 --- a/client/ayon_houdini/plugins/create/create_model.py +++ b/client/ayon_houdini/plugins/create/create_model.py @@ -12,7 +12,7 @@ """ from ayon_houdini.api import plugin -from ayon_core.lib import BoolDef +from ayon_core.lib import EnumDef import hou @@ -24,6 +24,9 @@ class CreateModel(plugin.HoudiniCreator): product_type = "model" icon = "cube" + # Default render target + render_target = "local" + def get_publish_families(self): return ["model", "abc"] @@ -31,7 +34,7 @@ def create(self, product_name, instance_data, pre_create_data): instance_data.update({"node_type": "alembic"}) creator_attributes = instance_data.setdefault( "creator_attributes", dict()) - creator_attributes["farm"] = pre_create_data["farm"] + creator_attributes["render_target"] = pre_create_data["render_target"] instance = super(CreateModel, self).create( product_name, @@ -130,10 +133,17 @@ def get_obj_output(self, obj_node): key=lambda node: node.evalParm('outputidx')) def get_instance_attr_defs(self): + render_target_items = { + "local": "Local machine rendering", + "local_no_render": "Use existing frames (local)", + "farm": "Farm Rendering", + } + return [ - BoolDef("farm", - label="Submitting to Farm", - default=False) + EnumDef("render_target", + items=render_target_items, + label="Render target", + default=self.render_target) ] def get_pre_create_attr_defs(self): diff --git a/client/ayon_houdini/plugins/create/create_pointcache.py b/client/ayon_houdini/plugins/create/create_pointcache.py index 969e2a65e7..3288c2655b 100644 --- a/client/ayon_houdini/plugins/create/create_pointcache.py +++ b/client/ayon_houdini/plugins/create/create_pointcache.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Creator plugin for creating pointcache alembics.""" from ayon_houdini.api import plugin -from ayon_core.lib import BoolDef +from ayon_core.lib import EnumDef import hou @@ -14,6 +14,9 @@ class CreatePointCache(plugin.HoudiniCreator): product_type = "pointcache" icon = "gears" + # Default render target + render_target = "local" + def get_publish_families(self): return ["pointcache", "abc"] @@ -21,7 +24,7 @@ def create(self, product_name, instance_data, pre_create_data): instance_data.update({"node_type": "alembic"}) creator_attributes = instance_data.setdefault( "creator_attributes", dict()) - creator_attributes["farm"] = pre_create_data["farm"] + creator_attributes["render_target"] = pre_create_data["render_target"] instance = super(CreatePointCache, self).create( product_name, @@ -114,10 +117,17 @@ def get_obj_output(self, obj_node): key=lambda node: node.evalParm('outputidx')) def get_instance_attr_defs(self): + render_target_items = { + "local": "Local machine rendering", + "local_no_render": "Use existing frames (local)", + "farm": "Farm Rendering", + } + return [ - BoolDef("farm", - label="Submitting to Farm", - default=False) + EnumDef("render_target", + items=render_target_items, + label="Render target", + default=self.render_target) ] def get_pre_create_attr_defs(self): diff --git a/client/ayon_houdini/plugins/create/create_redshift_proxy.py b/client/ayon_houdini/plugins/create/create_redshift_proxy.py index d9bfe6cdd2..12dc7fb520 100644 --- a/client/ayon_houdini/plugins/create/create_redshift_proxy.py +++ b/client/ayon_houdini/plugins/create/create_redshift_proxy.py @@ -2,7 +2,7 @@ """Creator plugin for creating Redshift proxies.""" from ayon_houdini.api import plugin import hou -from ayon_core.lib import BoolDef +from ayon_core.lib import EnumDef class CreateRedshiftProxy(plugin.HoudiniCreator): @@ -12,6 +12,9 @@ class CreateRedshiftProxy(plugin.HoudiniCreator): product_type = "redshiftproxy" icon = "magic" + # Default render target + render_target = "local" + def create(self, product_name, instance_data, pre_create_data): # Redshift provides a `Redshift_Proxy_Output` node type which shows @@ -24,7 +27,7 @@ def create(self, product_name, instance_data, pre_create_data): instance_data.update({"node_type": "Redshift_Proxy_Output"}) creator_attributes = instance_data.setdefault( "creator_attributes", dict()) - creator_attributes["farm"] = pre_create_data["farm"] + creator_attributes["render_target"] = pre_create_data["render_target"] instance = super(CreateRedshiftProxy, self).create( product_name, @@ -53,10 +56,17 @@ def get_network_categories(self): ] def get_instance_attr_defs(self): + render_target_items = { + "local": "Local machine rendering", + "local_no_render": "Use existing frames (local)", + "farm": "Farm Rendering", + } + return [ - BoolDef("farm", - label="Submitting to Farm", - default=False) + EnumDef("render_target", + items=render_target_items, + label="Render target", + default=self.render_target) ] def get_pre_create_attr_defs(self): diff --git a/client/ayon_houdini/plugins/create/create_review.py b/client/ayon_houdini/plugins/create/create_review.py index 601349e3ad..cf98294ab0 100644 --- a/client/ayon_houdini/plugins/create/create_review.py +++ b/client/ayon_houdini/plugins/create/create_review.py @@ -16,6 +16,9 @@ class CreateReview(plugin.HoudiniCreator): icon = "video-camera" review_color_space = "" node_type = "opengl" + + # Default render target + render_target = "local" # TODO: Publish families should reflect the node type, # such as `rop.flipbook` for flipbook nodes @@ -35,6 +38,9 @@ def apply_settings(self, project_settings): def create(self, product_name, instance_data, pre_create_data): self.node_type = pre_create_data.get("node_type") + creator_attributes = instance_data.setdefault( + "creator_attributes", dict()) + creator_attributes["render_target"] = pre_create_data["render_target"] instance_data.update({"node_type": self.node_type}) instance_data["imageFormat"] = pre_create_data.get("imageFormat") @@ -121,9 +127,23 @@ def create(self, product_name, instance_data, pre_create_data): to_lock = ["id", "productType"] self.lock_parameters(instance_node, to_lock) + + def get_instance_attr_defs(self): + render_target_items = { + "local": "Local machine rendering", + "local_no_render": "Use existing frames (local)", + "farm": "Farm Rendering", + } + return [ + EnumDef("render_target", + items=render_target_items, + label="Render target", + default=self.render_target) + ] + def get_pre_create_attr_defs(self): - attrs = super(CreateReview, self).get_pre_create_attr_defs() + attrs = super().get_pre_create_attr_defs() image_format_enum = [ "bmp", "cin", "exr", "jpg", "pic", "pic.gz", "png", @@ -165,4 +185,4 @@ def get_pre_create_attr_defs(self): default=1.0, minimum=0.0001, decimals=3) - ] + ] + self.get_instance_attr_defs() diff --git a/client/ayon_houdini/plugins/create/create_staticmesh.py b/client/ayon_houdini/plugins/create/create_staticmesh.py index 17b646040c..6a9fef08ed 100644 --- a/client/ayon_houdini/plugins/create/create_staticmesh.py +++ b/client/ayon_houdini/plugins/create/create_staticmesh.py @@ -16,9 +16,15 @@ class CreateStaticMesh(plugin.HoudiniCreator): default_variants = ["Main"] + # Default render target + render_target = "local" + def create(self, product_name, instance_data, pre_create_data): instance_data.update({"node_type": "filmboxfbx"}) + creator_attributes = instance_data.setdefault( + "creator_attributes", dict()) + creator_attributes["render_target"] = pre_create_data["render_target"] instance = super(CreateStaticMesh, self).create( product_name, @@ -57,11 +63,25 @@ def get_network_categories(self): hou.objNodeTypeCategory(), hou.sopNodeTypeCategory() ] + + def get_instance_attr_defs(self): + render_target_items = { + "local": "Local machine rendering", + "local_no_render": "Use existing frames (local)", + "farm": "Farm Rendering", + } + + return [ + EnumDef("render_target", + items=render_target_items, + label="Render target", + default=self.render_target) + ] def get_pre_create_attr_defs(self): """Add settings for users. """ - attrs = super(CreateStaticMesh, self).get_pre_create_attr_defs() + attrs = super().get_pre_create_attr_defs() createsubnetroot = BoolDef("createsubnetroot", tooltip="Create an extra root for the " "Export node when it's a " @@ -85,7 +105,9 @@ def get_pre_create_attr_defs(self): default=False, label="Convert Units") - return attrs + [createsubnetroot, vcformat, convert_units] + return attrs + [ + createsubnetroot, vcformat, convert_units + ] + self.get_instance_attr_defs() def get_dynamic_data( self, diff --git a/client/ayon_houdini/plugins/create/create_usd.py b/client/ayon_houdini/plugins/create/create_usd.py index 585ba667de..3a0e743bdf 100644 --- a/client/ayon_houdini/plugins/create/create_usd.py +++ b/client/ayon_houdini/plugins/create/create_usd.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- """Creator plugin for creating USDs.""" from ayon_houdini.api import plugin +from ayon_core.lib import EnumDef import hou @@ -14,9 +15,15 @@ class CreateUSD(plugin.HoudiniCreator): enabled = False description = "Create USD" + # Default render target + render_target = "local" + def create(self, product_name, instance_data, pre_create_data): instance_data.update({"node_type": "usd"}) + creator_attributes = instance_data.setdefault( + "creator_attributes", dict()) + creator_attributes["render_target"] = pre_create_data["render_target"] instance = super(CreateUSD, self).create( product_name, @@ -52,3 +59,21 @@ def get_network_categories(self): def get_publish_families(self): return ["usd", "usdrop"] + + def get_instance_attr_defs(self): + render_target_items = { + "local": "Local machine rendering", + "local_no_render": "Use existing frames (local)", + "farm": "Farm Rendering", + } + + return [ + EnumDef("render_target", + items=render_target_items, + label="Render target", + default=self.render_target) + ] + + def get_pre_create_attr_defs(self): + attrs = super().get_pre_create_attr_defs() + return attrs + self.get_instance_attr_defs() \ No newline at end of file diff --git a/client/ayon_houdini/plugins/create/create_usd_look.py b/client/ayon_houdini/plugins/create/create_usd_look.py index 93aa486abb..2e621a0037 100644 --- a/client/ayon_houdini/plugins/create/create_usd_look.py +++ b/client/ayon_houdini/plugins/create/create_usd_look.py @@ -3,6 +3,7 @@ import inspect from ayon_houdini.api import plugin +from ayon_core.lib import EnumDef import hou @@ -17,9 +18,15 @@ class CreateUSDLook(plugin.HoudiniCreator): enabled = True description = "Create USD Look" + # Default render target + render_target = "local" + def create(self, product_name, instance_data, pre_create_data): instance_data.update({"node_type": "usd"}) + creator_attributes = instance_data.setdefault( + "creator_attributes", dict()) + creator_attributes["render_target"] = pre_create_data["render_target"] instance = super(CreateUSDLook, self).create( product_name, @@ -70,3 +77,21 @@ def get_network_categories(self): def get_publish_families(self): return ["usd", "look", "usdrop"] + + def get_instance_attr_defs(self): + render_target_items = { + "local": "Local machine rendering", + "local_no_render": "Use existing frames (local)", + "farm": "Farm Rendering", + } + + return [ + EnumDef("render_target", + items=render_target_items, + label="Render target", + default=self.render_target) + ] + + def get_pre_create_attr_defs(self): + attrs = super().get_pre_create_attr_defs() + return attrs + self.get_instance_attr_defs() \ No newline at end of file diff --git a/client/ayon_houdini/plugins/create/create_vbd_cache.py b/client/ayon_houdini/plugins/create/create_vbd_cache.py index 804865860e..3870f403b5 100644 --- a/client/ayon_houdini/plugins/create/create_vbd_cache.py +++ b/client/ayon_houdini/plugins/create/create_vbd_cache.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Creator plugin for creating VDB Caches.""" from ayon_houdini.api import plugin -from ayon_core.lib import BoolDef +from ayon_core.lib import EnumDef import hou @@ -14,13 +14,16 @@ class CreateVDBCache(plugin.HoudiniCreator): product_type = "vdbcache" icon = "cloud" + # Default render target + render_target = "local" + def create(self, product_name, instance_data, pre_create_data): import hou instance_data.update({"node_type": "geometry"}) creator_attributes = instance_data.setdefault( "creator_attributes", dict()) - creator_attributes["farm"] = pre_create_data["farm"] + creator_attributes["render_target"] = pre_create_data["render_target"] instance = super(CreateVDBCache, self).create( product_name, instance_data, @@ -109,10 +112,17 @@ def get_obj_output(self, obj_node): key=lambda node: node.evalParm('outputidx')) def get_instance_attr_defs(self): + render_target_items = { + "local": "Local machine rendering", + "local_no_render": "Use existing frames (local)", + "farm": "Farm Rendering", + } + return [ - BoolDef("farm", - label="Submitting to Farm", - default=False) + EnumDef("render_target", + items=render_target_items, + label="Render target", + default=self.render_target) ] def get_pre_create_attr_defs(self): diff --git a/client/ayon_houdini/plugins/publish/collect_cache_farm.py b/client/ayon_houdini/plugins/publish/collect_cache_farm.py index de977faed2..53f13af366 100644 --- a/client/ayon_houdini/plugins/publish/collect_cache_farm.py +++ b/client/ayon_houdini/plugins/publish/collect_cache_farm.py @@ -10,15 +10,13 @@ class CollectFarmCacheFamily(plugin.HoudiniInstancePlugin): """Collect publish.hou family for caching on farm as early as possible.""" order = pyblish.api.CollectorOrder - 0.45 - families = ["ass", "pointcache", "redshiftproxy", "vdbcache", "model"] + families = ["ass", "pointcache", "redshiftproxy", + "vdbcache", "model", "staticMesh", + "rop.opengl", "usdrop", "camera"] targets = ["local", "remote"] label = "Collect Data for Cache" def process(self, instance): - creator_attribute = instance.data["creator_attributes"] - farm_enabled = creator_attribute.get("farm") - if farm_enabled is not None: - instance.data["farm"] = farm_enabled if not instance.data["farm"]: self.log.debug("Caching on farm is disabled. " diff --git a/client/ayon_houdini/plugins/publish/collect_farm_instances.py b/client/ayon_houdini/plugins/publish/collect_farm_instances.py index 9953dce70d..d2b39beece 100644 --- a/client/ayon_houdini/plugins/publish/collect_farm_instances.py +++ b/client/ayon_houdini/plugins/publish/collect_farm_instances.py @@ -12,7 +12,9 @@ class CollectFarmInstances(plugin.HoudiniInstancePlugin): "arnold_rop", "vray_rop", "usdrender", - "bgeo"] + "ass","pointcache", "redshiftproxy", + "vdbcache", "model", "staticMesh", + "rop.opengl", "usdrop", "camera"] targets = ["local", "remote"] label = "Collect farm instances" From 5292f6484783f67e4d114f10d1931cb1dcdb4da5 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 22 Nov 2024 17:58:47 +0200 Subject: [PATCH 5/6] revert changes to CreateCompositeSequence --- .../plugins/create/create_composite.py | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/client/ayon_houdini/plugins/create/create_composite.py b/client/ayon_houdini/plugins/create/create_composite.py index ee7ff0e9a6..50fcab5875 100644 --- a/client/ayon_houdini/plugins/create/create_composite.py +++ b/client/ayon_houdini/plugins/create/create_composite.py @@ -2,7 +2,6 @@ """Creator plugin for creating composite sequences.""" from ayon_houdini.api import plugin from ayon_core.pipeline import CreatorError -from ayon_core.lib import EnumDef import hou @@ -17,16 +16,10 @@ class CreateCompositeSequence(plugin.HoudiniCreator): ext = ".exr" - # Default render target - render_target = "local" - def create(self, product_name, instance_data, pre_create_data): import hou # noqa instance_data.update({"node_type": "comp"}) - creator_attributes = instance_data.setdefault( - "creator_attributes", dict()) - creator_attributes["render_target"] = pre_create_data["render_target"] instance = super(CreateCompositeSequence, self).create( product_name, @@ -65,21 +58,3 @@ def get_network_categories(self): hou.ropNodeTypeCategory(), hou.cop2NodeTypeCategory() ] - - def get_instance_attr_defs(self): - render_target_items = { - "local": "Local machine rendering", - "local_no_render": "Use existing frames (local)", - "farm": "Farm Rendering", - } - - return [ - EnumDef("render_target", - items=render_target_items, - label="Render target", - default=self.render_target) - ] - - def get_pre_create_attr_defs(self): - attrs = super().get_pre_create_attr_defs() - return attrs + self.get_instance_attr_defs() \ No newline at end of file From dbcce0b947f15ec002fc8b23031dd888ebbdb89b Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 25 Nov 2024 12:35:39 +0200 Subject: [PATCH 6/6] add a comment about using `local` as a fallback --- client/ayon_houdini/plugins/publish/extract_rop.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/ayon_houdini/plugins/publish/extract_rop.py b/client/ayon_houdini/plugins/publish/extract_rop.py index 2e7326db8d..7e5c5798cd 100644 --- a/client/ayon_houdini/plugins/publish/extract_rop.py +++ b/client/ayon_houdini/plugins/publish/extract_rop.py @@ -30,6 +30,9 @@ def process(self, instance: pyblish.api.Instance): ) ext = ext.lstrip(".") + # Value `local` is used as a fallback if the `render_target` key is missing. + # This key might be absent because render targets are not yet implemented + # for all product types that use this plugin. if creator_attribute.get("render_target", "local") == "local": self.render_rop(instance) self.validate_expected_frames(instance)