From f0ea0fb0f28084cf2bf70c8146b4666055be0cef Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 8 Feb 2024 23:17:59 +0200 Subject: [PATCH 01/86] expose stagingdir in houdini settings --- .../houdini/server/settings/create.py | 57 +++++++++++++------ server_addon/houdini/server/version.py | 2 +- 2 files changed, 40 insertions(+), 19 deletions(-) diff --git a/server_addon/houdini/server/settings/create.py b/server_addon/houdini/server/settings/create.py index 203ca4f9d6..2b5ab237e3 100644 --- a/server_addon/houdini/server/settings/create.py +++ b/server_addon/houdini/server/settings/create.py @@ -8,6 +8,7 @@ class CreatorModel(BaseSettingsModel): title="Default Products", default_factory=list, ) + staging_dir: str = SettingsField(title="Staging Dir") class CreateArnoldAssModel(BaseSettingsModel): @@ -17,6 +18,7 @@ class CreateArnoldAssModel(BaseSettingsModel): default_factory=list, ) ext: str = SettingsField(Title="Extension") + staging_dir: str = SettingsField(title="Staging Dir") class CreateStaticMeshModel(BaseSettingsModel): @@ -30,6 +32,7 @@ class CreateStaticMeshModel(BaseSettingsModel): default_factory=list, title="Collision Prefixes" ) + staging_dir: str = SettingsField(title="Staging Dir") class CreatePluginsModel(BaseSettingsModel): @@ -93,56 +96,69 @@ class CreatePluginsModel(BaseSettingsModel): DEFAULT_HOUDINI_CREATE_SETTINGS = { "CreateAlembicCamera": { "enabled": True, - "default_variants": ["Main"] + "default_variants": ["Main"], + "staging_dir": "$HIP/ayon" }, "CreateArnoldAss": { "enabled": True, "default_variants": ["Main"], - "ext": ".ass" + "ext": ".ass", + "staging_dir": "$HIP/ayon" }, "CreateArnoldRop": { "enabled": True, - "default_variants": ["Main"] + "default_variants": ["Main"], + "staging_dir": "$HIP/ayon" }, "CreateCompositeSequence": { "enabled": True, - "default_variants": ["Main"] + "default_variants": ["Main"], + "staging_dir": "$HIP/ayon" }, "CreateHDA": { "enabled": True, - "default_variants": ["Main"] + "default_variants": ["Main"], + "staging_dir": "$HIP/ayon" }, "CreateKarmaROP": { "enabled": True, - "default_variants": ["Main"] + "default_variants": ["Main"], + "staging_dir": "$HIP/ayon" }, "CreateMantraIFD": { "enabled": True, - "default_variants": ["Main"] + "default_variants": ["Main"], + "staging_dir": "$HIP/ayon" }, "CreateMantraROP": { "enabled": True, - "default_variants": ["Main"] + "default_variants": ["Main"], + "staging_dir": "$HIP/ayon" }, "CreatePointCache": { "enabled": True, - "default_variants": ["Main"] + "default_variants": ["Main"], + "staging_dir": "$HIP/ayon" }, "CreateBGEO": { "enabled": True, - "default_variants": ["Main"] + "default_variants": ["Main"], + "staging_dir": "$HIP/ayon" }, "CreateRedshiftProxy": { "enabled": True, - "default_variants": ["Main"] + "default_variants": ["Main"], + "staging_dir": "$HIP/ayon" }, "CreateRedshiftROP": { "enabled": True, - "default_variants": ["Main"] + "default_variants": ["Main"], + "staging_dir": "$HIP/ayon" }, "CreateReview": { "enabled": True, - "default_variants": ["Main"] + "default_variants": ["Main"], + "staging_dir": "$HIP/ayon" }, "CreateStaticMesh": { "enabled": True, @@ -155,22 +171,27 @@ class CreatePluginsModel(BaseSettingsModel): "UCP", "USP", "UCX" - ] + ], + "staging_dir": "$HIP/ayon" }, "CreateUSD": { "enabled": False, - "default_variants": ["Main"] + "default_variants": ["Main"], + "staging_dir": "$HIP/ayon" }, "CreateUSDRender": { "enabled": False, - "default_variants": ["Main"] + "default_variants": ["Main"], + "staging_dir": "$HIP/ayon" }, "CreateVDBCache": { "enabled": True, - "default_variants": ["Main"] + "default_variants": ["Main"], + "staging_dir": "$HIP/ayon" }, "CreateVrayROP": { "enabled": True, - "default_variants": ["Main"] + "default_variants": ["Main"], + "staging_dir": "$HIP/ayon" }, } diff --git a/server_addon/houdini/server/version.py b/server_addon/houdini/server/version.py index 5635676f6b..b5c9b6cb71 100644 --- a/server_addon/houdini/server/version.py +++ b/server_addon/houdini/server/version.py @@ -1 +1 @@ -__version__ = "0.2.11" +__version__ = "0.2.12" From 9285e0bec0aded7e40f4b60c4f711c6a3210e519 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 8 Feb 2024 23:48:24 +0200 Subject: [PATCH 02/86] better organised file export paths --- .../plugins/create/create_alembic_camera.py | 10 ++++- .../plugins/create/create_arnold_ass.py | 11 ++++-- .../plugins/create/create_arnold_rop.py | 22 ++++++----- .../houdini/plugins/create/create_bgeo.py | 13 ++++--- .../plugins/create/create_composite.py | 11 ++++-- .../houdini/plugins/create/create_hda.py | 12 +++++- .../plugins/create/create_karma_rop.py | 22 ++++++----- .../plugins/create/create_mantra_ifd.py | 9 +++-- .../plugins/create/create_mantra_rop.py | 21 +++++----- .../plugins/create/create_pointcache.py | 10 ++++- .../plugins/create/create_redshift_proxy.py | 8 +++- .../plugins/create/create_redshift_rop.py | 18 ++++++--- .../houdini/plugins/create/create_review.py | 7 ++-- .../plugins/create/create_staticmesh.py | 8 ++-- .../houdini/plugins/create/create_usd.py | 8 +++- .../plugins/create/create_vbd_cache.py | 12 ++++-- .../houdini/plugins/create/create_vray_rop.py | 38 +++++++++---------- 17 files changed, 148 insertions(+), 92 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py b/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py index b6661fe7e4..c6cf5664f8 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py @@ -13,6 +13,7 @@ class CreateAlembicCamera(plugin.HoudiniCreator): label = "Camera (Abc)" family = "camera" icon = "camera" + staging_dir = "$HIP/ayon" def create(self, subset_name, instance_data, pre_create_data): import hou @@ -26,9 +27,14 @@ def create(self, subset_name, instance_data, pre_create_data): pre_create_data) # type: CreatedInstance instance_node = hou.node(instance.get("instance_node")) + + filepath = "{root}/{subset}/{subset}.abc".format( + root=hou.text.expandString(self.staging_dir), + subset=subset_name + ) + parms = { - "filename": hou.text.expandString( - "$HIP/pyblish/{}.abc".format(subset_name)), + "filename": filepath, "use_sop_path": False, } diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py index f60f5bc42f..e3a052812f 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py @@ -16,6 +16,7 @@ class CreateArnoldAss(plugin.HoudiniCreator): # however calling HoudiniCreator.create() # will override it by the value in the project settings ext = ".ass" + staging_dir = "$HIP/ayon" def create(self, subset_name, instance_data, pre_create_data): import hou @@ -38,11 +39,13 @@ def create(self, subset_name, instance_data, pre_create_data): parm_template_group = instance_node.parmTemplateGroup() parm_template_group.hideFolder("Properties", True) instance_node.setParmTemplateGroup(parm_template_group) - - filepath = "{}{}".format( - hou.text.expandString("$HIP/pyblish/"), - "{}.$F4{}".format(subset_name, self.ext) + + filepath = "{root}/{subset}/{subset}.$F4{ext}".format( + root=hou.text.expandString(self.staging_dir), + subset=subset_name, + ext=self.ext ) + parms = { # Render frame range "trange": 1, diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py index 590a92f56f..0d8e95f852 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py @@ -9,6 +9,7 @@ class CreateArnoldRop(plugin.HoudiniCreator): label = "Arnold ROP" family = "arnold_rop" icon = "magic" + staging_dir = "$HIP/ayon" # Default extension ext = "exr" @@ -36,12 +37,13 @@ def create(self, subset_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) ext = pre_create_data.get("image_format") - - filepath = "{renders_dir}{subset_name}/{subset_name}.$F4.{ext}".format( - renders_dir=hou.text.expandString("$HIP/pyblish/renders/"), - subset_name=subset_name, - ext=ext, + + filepath = "{root}/{subset}/{subset}.$F4.{ext}".format( + root=hou.text.expandString(self.staging_dir), + subset=subset_name, + ext=ext ) + parms = { # Render frame range "trange": 1, @@ -52,11 +54,11 @@ def create(self, subset_name, instance_data, pre_create_data): } if pre_create_data.get("export_job"): - ass_filepath = \ - "{export_dir}{subset_name}/{subset_name}.$F4.ass".format( - export_dir=hou.text.expandString("$HIP/pyblish/ass/"), - subset_name=subset_name, - ) + ass_filepath = "{root}/{subset}/ass/{subset}.$F4.ass".format( + root=hou.text.expandString(self.staging_dir), + subset=subset_name + ) + parms["ar_ass_export_enable"] = 1 parms["ar_ass_file"] = ass_filepath diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py b/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py index 135c889b3e..163dc266c1 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py @@ -12,6 +12,7 @@ class CreateBGEO(plugin.HoudiniCreator): label = "PointCache (Bgeo)" family = "pointcache" icon = "gears" + staging_dir = "$HIP/ayon" def create(self, subset_name, instance_data, pre_create_data): @@ -29,14 +30,14 @@ def create(self, subset_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) - file_path = "{}{}".format( - hou.text.expandString("$HIP/pyblish/"), - "{}.$F4.{}".format( - subset_name, - pre_create_data.get("bgeo_type") or "bgeo.sc") + filepath = "{root}/{subset}/{subset}.$F4.{ext}".format( + root=hou.text.expandString(self.staging_dir), + subset=subset_name, + ext=pre_create_data.get("bgeo_type") or "bgeo.sc" ) + parms = { - "sopoutput": file_path + "sopoutput": filepath } instance_node.parm("trange").set(1) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_composite.py b/client/ayon_core/hosts/houdini/plugins/create/create_composite.py index b87e1fd5b1..902071634b 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_composite.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_composite.py @@ -13,7 +13,7 @@ class CreateCompositeSequence(plugin.HoudiniCreator): label = "Composite (Image Sequence)" family = "imagesequence" icon = "gears" - + staging_dir = "$HIP/ayon" ext = ".exr" def create(self, subset_name, instance_data, pre_create_data): @@ -28,10 +28,13 @@ def create(self, subset_name, instance_data, pre_create_data): pre_create_data) # type: CreatedInstance instance_node = hou.node(instance.get("instance_node")) - filepath = "{}{}".format( - hou.text.expandString("$HIP/pyblish/"), - "{}.$F4{}".format(subset_name, self.ext) + + filepath = "{root}/{subset}/{subset}.$F4{ext}".format( + root=hou.text.expandString(self.staging_dir), + subset=subset_name, + ext=self.ext ) + parms = { "trange": 1, "copoutput": filepath diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_hda.py b/client/ayon_core/hosts/houdini/plugins/create/create_hda.py index faddc11b0c..ce72a9458e 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_hda.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_hda.py @@ -16,6 +16,7 @@ class CreateHDA(plugin.HoudiniCreator): family = "hda" icon = "gears" maintain_selection = False + staging_dir = "$HIP/ayon" def _check_existing(self, asset_name, subset_name): # type: (str) -> bool @@ -56,10 +57,17 @@ def create_instance_node( if not to_hda.canCreateDigitalAsset(): raise plugin.OpenPypeCreatorError( "cannot create hda from node {}".format(to_hda)) - + + # for consistency I'm using {subset} as it's + # the same key used in other creators + filepath = "{root}/{subset}/{subset}.hda".format( + root=hou.text.expandString(self.staging_dir), + subset=node_name + ) + hda_node = to_hda.createDigitalAsset( name=node_name, - hda_file_name="$HIP/{}.hda".format(node_name) + hda_file_name=filepath ) hda_node.layoutChildren() elif self._check_existing(asset_name, node_name): diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py index 5211044fea..b9db6d33b5 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py @@ -11,6 +11,7 @@ class CreateKarmaROP(plugin.HoudiniCreator): label = "Karma ROP" family = "karma_rop" icon = "magic" + staging_dir = "$HIP/ayon" def create(self, subset_name, instance_data, pre_create_data): import hou # noqa @@ -31,19 +32,20 @@ def create(self, subset_name, instance_data, pre_create_data): ext = pre_create_data.get("image_format") - filepath = "{renders_dir}{subset_name}/{subset_name}.$F4.{ext}".format( - renders_dir=hou.text.expandString("$HIP/pyblish/renders/"), - subset_name=subset_name, - ext=ext, + filepath = "{root}/{subset}/{subset}.$F4.{ext}".format( + root=hou.text.expandString(self.staging_dir), + subset=subset_name, + ext=ext ) - checkpoint = "{cp_dir}{subset_name}.$F4.checkpoint".format( - cp_dir=hou.text.expandString("$HIP/pyblish/"), - subset_name=subset_name + + checkpoint = "{root}/{subset}/checkpoint/{subset}.$F4.checkpoint".format( + root=hou.text.expandString(self.staging_dir), + subset=subset_name ) - usd_directory = "{usd_dir}{subset_name}_$RENDERID".format( - usd_dir=hou.text.expandString("$HIP/pyblish/renders/usd_renders/"), # noqa - subset_name=subset_name + usd_directory = "{root}/{subset}/usd_render/{subset}_$RENDERID".format( + root=hou.text.expandString(self.staging_dir), + subset=subset_name ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py index 7f1da13d2e..e0ca6d1220 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py @@ -11,6 +11,7 @@ class CreateMantraIFD(plugin.HoudiniCreator): label = "Mantra IFD" family = "mantraifd" icon = "gears" + staging_dir = "$HIP/ayon" def create(self, subset_name, instance_data, pre_create_data): import hou @@ -25,10 +26,12 @@ def create(self, subset_name, instance_data, pre_create_data): pre_create_data) # type: CreatedInstance instance_node = hou.node(instance.get("instance_node")) + + filepath = "{root}/{subset}/{subset}.$F4.ifd".format( + root=hou.text.expandString(self.staging_dir), + subset=subset_name + ) - filepath = "{}{}".format( - hou.text.expandString("$HIP/pyblish/"), - "{}.$F4.ifd".format(subset_name)) parms = { # Render frame range "trange": 1, diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py index 02252f35d1..994f6efa70 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py @@ -11,6 +11,7 @@ class CreateMantraROP(plugin.HoudiniCreator): label = "Mantra ROP" family = "mantra_rop" icon = "magic" + staging_dir = "$HIP/ayon" # Default to split export and render jobs export_job = True @@ -33,11 +34,11 @@ def create(self, subset_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) ext = pre_create_data.get("image_format") - - filepath = "{renders_dir}{subset_name}/{subset_name}.$F4.{ext}".format( - renders_dir=hou.text.expandString("$HIP/pyblish/renders/"), - subset_name=subset_name, - ext=ext, + + filepath = "{root}/{subset}/{subset}.$F4.{ext}".format( + root=hou.text.expandString(self.staging_dir), + subset=subset_name, + ext=ext ) parms = { @@ -48,11 +49,11 @@ def create(self, subset_name, instance_data, pre_create_data): } if pre_create_data.get("export_job"): - ifd_filepath = \ - "{export_dir}{subset_name}/{subset_name}.$F4.ifd".format( - export_dir=hou.text.expandString("$HIP/pyblish/ifd/"), - subset_name=subset_name, - ) + ifd_filepath = "{root}/{subset}/ifd/{subset}.$F4.ifd".format( + root=hou.text.expandString(self.staging_dir), + subset=subset_name + ) + parms["soho_outputmode"] = 1 parms["soho_diskfile"] = ifd_filepath diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py b/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py index 07dcc17f25..4441bdc5dd 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py @@ -13,6 +13,7 @@ class CreatePointCache(plugin.HoudiniCreator): label = "PointCache (Abc)" family = "pointcache" icon = "gears" + staging_dir = "$HIP/ayon" def create(self, subset_name, instance_data, pre_create_data): instance_data.pop("active", None) @@ -27,6 +28,12 @@ def create(self, subset_name, instance_data, pre_create_data): pre_create_data) instance_node = hou.node(instance.get("instance_node")) + + filepath = "{root}/{subset}/{subset}.abc".format( + root=hou.text.expandString(self.staging_dir), + subset=subset_name + ) + parms = { "use_sop_path": True, "build_from_path": True, @@ -34,8 +41,7 @@ def create(self, subset_name, instance_data, pre_create_data): "prim_to_detail_pattern": "cbId", "format": 2, "facesets": 0, - "filename": hou.text.expandString( - "$HIP/pyblish/{}.abc".format(subset_name)) + "filename": filepath } if self.selected_nodes: diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py index fa42411a1c..8de3f79dd1 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py @@ -11,6 +11,7 @@ class CreateRedshiftProxy(plugin.HoudiniCreator): label = "Redshift Proxy" family = "redshiftproxy" icon = "magic" + staging_dir = "$HIP/ayon" def create(self, subset_name, instance_data, pre_create_data): @@ -36,8 +37,13 @@ def create(self, subset_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) + filepath = "{root}/{subset}/{subset}.$F4.rs".format( + root=hou.text.expandString(self.staging_dir), + subset=subset_name + ) + parms = { - "RS_archive_file": '$HIP/pyblish/{}.$F4.rs'.format(subset_name), + "RS_archive_file": filepath, } if self.selected_nodes: diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py index 8e88c690b9..89355c2386 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py @@ -14,6 +14,7 @@ class CreateRedshiftROP(plugin.HoudiniCreator): family = "redshift_rop" icon = "magic" ext = "exr" + staging_dir = "$HIP/ayon" # Default to split export and render jobs split_render = True @@ -56,10 +57,12 @@ def create(self, subset_name, instance_data, pre_create_data): ipr_rop.parm("linked_rop").set(instance_node.path()) ext = pre_create_data.get("image_format") - filepath = "{renders_dir}{subset_name}/{subset_name}.{fmt}".format( - renders_dir=hou.text.expandString("$HIP/pyblish/renders/"), - subset_name=subset_name, - fmt="${aov}.$F4.{ext}".format(aov="AOV", ext=ext) + + filepath = "{root}/{subset}/{subset}.${aov}.$F4.{ext}".format( + root=hou.text.expandString(self.staging_dir), + subset=subset_name, + aov="AOV", + ext=ext ) ext_format_index = {"exr": 0, "tif": 1, "jpg": 2, "png": 3} @@ -82,8 +85,11 @@ def create(self, subset_name, instance_data, pre_create_data): camera = node.path() parms["RS_renderCamera"] = camera or "" - export_dir = hou.text.expandString("$HIP/pyblish/rs/") - rs_filepath = f"{export_dir}{subset_name}/{subset_name}.$F4.rs" + rs_filepath = "{root}/{subset}/rs/{subset}.$F4.rs".format( + root=hou.text.expandString(self.staging_dir), + subset=subset_name + ) + parms["RS_archive_file"] = rs_filepath if pre_create_data.get("split_render", self.split_render): diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_review.py b/client/ayon_core/hosts/houdini/plugins/create/create_review.py index c512a61105..a816391368 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_review.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_review.py @@ -14,6 +14,7 @@ class CreateReview(plugin.HoudiniCreator): label = "Review" family = "review" icon = "video-camera" + staging_dir = "$HIP/ayon" def create(self, subset_name, instance_data, pre_create_data): @@ -32,9 +33,9 @@ def create(self, subset_name, instance_data, pre_create_data): frame_range = hou.playbar.frameRange() filepath = "{root}/{subset}/{subset}.$F4.{ext}".format( - root=hou.text.expandString("$HIP/pyblish"), + root=hou.text.expandString(self.staging_dir), subset="`chs(\"subset\")`", # keep dynamic link to subset - ext=pre_create_data.get("image_format") or "png" + ext=pre_create_data.get("image_format", "png") ) parms = { @@ -134,7 +135,7 @@ def get_pre_create_attr_defs(self): def set_colorcorrect_to_default_view_space(self, instance_node): """Set ociocolorspace to the default output space.""" - from ayon_core.hosts.houdini.api.colorspace import get_default_display_view_colorspace # noqa + from openpype.hosts.houdini.api.colorspace import get_default_display_view_colorspace # noqa # set Color Correction parameter to OpenColorIO instance_node.setParms({"colorcorrect": 2}) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py b/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py index 319be3568d..61501dfe08 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py @@ -15,6 +15,7 @@ class CreateStaticMesh(plugin.HoudiniCreator): icon = "fa5s.cubes" default_variants = ["Main"] + staging_dir = "$HIP/ayon" def create(self, subset_name, instance_data, pre_create_data): @@ -29,13 +30,14 @@ def create(self, subset_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) # prepare parms - output_path = hou.text.expandString( - "$HIP/pyblish/{}.fbx".format(subset_name) + filepath = "{root}/{subset}/{subset}.fbx".format( + root=hou.text.expandString(self.staging_dir), + subset=subset_name ) parms = { "startnode": self.get_selection(), - "sopoutput": output_path, + "sopoutput": filepath, # vertex cache format "vcformat": pre_create_data.get("vcformat"), "convertunits": pre_create_data.get("convertunits"), diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_usd.py b/client/ayon_core/hosts/houdini/plugins/create/create_usd.py index db9c77fffe..3d3e4ca173 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_usd.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_usd.py @@ -13,6 +13,7 @@ class CreateUSD(plugin.HoudiniCreator): family = "usd" icon = "gears" enabled = False + staging_dir = "$HIP/ayon" def create(self, subset_name, instance_data, pre_create_data): @@ -26,8 +27,13 @@ def create(self, subset_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) + filepath = "{root}/{subset}/{subset}.usd".format( + root=hou.text.expandString(self.staging_dir), + subset=subset_name + ) + parms = { - "lopoutput": "$HIP/pyblish/{}.usd".format(subset_name), + "lopoutput": filepath, "enableoutputprocessor_simplerelativepaths": False, } diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py b/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py index 507917b7a5..488d28ca68 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py @@ -14,6 +14,7 @@ class CreateVDBCache(plugin.HoudiniCreator): label = "VDB Cache" family = "vdbcache" icon = "cloud" + staging_dir = "$HIP/ayon" def create(self, subset_name, instance_data, pre_create_data): import hou @@ -29,11 +30,14 @@ def create(self, subset_name, instance_data, pre_create_data): pre_create_data) # type: CreatedInstance instance_node = hou.node(instance.get("instance_node")) - file_path = "{}{}".format( - hou.text.expandString("$HIP/pyblish/"), - "{}.$F4.vdb".format(subset_name)) + + filepath = "{root}/{subset}/{subset}.$F4.vdb".format( + root=hou.text.expandString(self.staging_dir), + subset=subset_name + ) + parms = { - "sopoutput": file_path, + "sopoutput": filepath, "initsim": True, "trange": 1 } diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py index 609828e201..47a3af8412 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py @@ -15,6 +15,7 @@ class CreateVrayROP(plugin.HoudiniCreator): family = "vray_rop" icon = "magic" ext = "exr" + staging_dir = "$HIP/ayon" # Default to split export and render jobs export_job = True @@ -56,11 +57,11 @@ def create(self, subset_name, instance_data, pre_create_data): } if pre_create_data.get("export_job"): - scene_filepath = \ - "{export_dir}{subset_name}/{subset_name}.$F4.vrscene".format( - export_dir=hou.text.expandString("$HIP/pyblish/vrscene/"), - subset_name=subset_name, - ) + + scene_filepath = "{root}/{subset}/vrscene/{subset}.$F4.vrscene".format( + root=hou.text.expandString(self.staging_dir), + subset=subset_name + ) # Setting render_export_mode to "2" because that's for # "Export only" ("1" is for "Export & Render") parms["render_export_mode"] = "2" @@ -81,19 +82,13 @@ def create(self, subset_name, instance_data, pre_create_data): instance_data["RenderElement"] = pre_create_data.get("render_element_enabled") # noqa if pre_create_data.get("render_element_enabled", True): # Vray has its own tag for AOV file output - filepath = "{renders_dir}{subset_name}/{subset_name}.{fmt}".format( - renders_dir=hou.text.expandString("$HIP/pyblish/renders/"), - subset_name=subset_name, - fmt="${aov}.$F4.{ext}".format(aov="AOV", - ext=ext) - ) - filepath = "{}{}".format( - hou.text.expandString("$HIP/pyblish/renders/"), - "{}/{}.${}.$F4.{}".format(subset_name, - subset_name, - "AOV", - ext) + filepath = "{root}/{subset}/{subset}.${aov}.$F4.{ext}".format( + root=hou.text.expandString(self.staging_dir), + subset=subset_name, + aov="AOV", + ext=ext ) + re_rop = instance_node.parent().createNode( "vray_render_channels", node_name=basename + "_render_element" @@ -108,11 +103,12 @@ def create(self, subset_name, instance_data, pre_create_data): }) else: - filepath = "{renders_dir}{subset_name}/{subset_name}.{fmt}".format( - renders_dir=hou.text.expandString("$HIP/pyblish/renders/"), - subset_name=subset_name, - fmt="$F4.{ext}".format(ext=ext) + filepath = "{root}/{subset}/{subset}.$F4.{ext}".format( + root=hou.text.expandString(self.staging_dir), + subset=subset_name, + ext=ext ) + parms.update({ "use_render_channels": 0, "SettingsOutput_img_file_path": filepath From 24fd0cb749c71aecaa0883bab2e26bd9e30590ca Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 9 Feb 2024 00:34:33 +0200 Subject: [PATCH 03/86] add collector: CollectStagingDirsForCleaningUp --- .../collect_staging_dirs_for_cleaning_up.py | 90 +++++++++++++++++++ .../houdini/server/settings/publish.py | 9 ++ 2 files changed, 99 insertions(+) create mode 100644 client/ayon_core/hosts/houdini/plugins/publish/collect_staging_dirs_for_cleaning_up.py diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_staging_dirs_for_cleaning_up.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_staging_dirs_for_cleaning_up.py new file mode 100644 index 0000000000..9af475849f --- /dev/null +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_staging_dirs_for_cleaning_up.py @@ -0,0 +1,90 @@ +import pyblish.api + +from ayon_core.pipeline import AYONPyblishPluginMixin + + +class CollectStagingDirsForCleaningUp(pyblish.api.InstancePlugin, + AYONPyblishPluginMixin): + """Collect Staging Directories For Cleaning Up. + + This collector collects staging directories + and adds them to file remove list. + + CAUTION: + This collector deletes the parent folder of the exported files. + It works fine with the default filepaths in the creators. + Artist should be aware with that fact so they take care when + changing the file path in the ROP node. + Developers should be aware when changing the filepath pattern + in creator plugins. + """ + + order = pyblish.api.CollectorOrder + + hosts = ["houdini"] + label = "Collect Staging Directories For Cleaning Up" + + def process(self, instance): + + import hou + + node = hou.node(instance.data["instance_node"]) + + # Get sop path + node_type = node.type().name() + if node_type == "geometry": + filepath = node.evalParm("sopoutput") + + elif node_type == "comp": + filepath = node.evalParm("copoutput") + + elif node_type == "alembic": + filepath = node.evalParm("filename") + + elif node_type == "ifd": + filepath = node.evalParm("vm_picture") + # vm_picture is empty when mantra node is + # used to export .ifd files only. + if not filepath: + filepath = node.evalParm("soho_diskfile") + + elif node_type == "Redshift_Proxy_Output": + filepath = node.evalParm("RS_archive_file") + + elif node_type == "Redshift_ROP": + filepath = node.evalParm("RS_outputFileNamePrefix") + + elif node_type == "opengl": + filepath = node.evalParm("picture") + + elif node_type == "filmboxfbx": + filepath = node.evalParm("sopoutput") + + elif node_type == "usd": + filepath = node.evalParm("lopoutput") + + elif node_type == "karma": + filepath = node.evalParm("picture") + + elif node_type == "arnold": + filepath = node.evalParm("ar_picture") + # ar_picture is empty when arnold node is + # used to export .ass files only. + if not filepath: + filepath = node.evalParm("ar_ass_file") + + elif node_type == "vray_renderer": + filepath = node.evalParm("SettingsOutput_img_file_path") + + else: + self.log.debug( + "ROP node type '{}' is not supported for cleaning up." + .format(node_type) + ) + + if not filepath: + self.log.warning("No filepath value to collect.") + return + + self.log.debug("Add to clean up list: {}".format(filepath)) + instance.context.data["cleanupFullPaths"] = filepath diff --git a/server_addon/houdini/server/settings/publish.py b/server_addon/houdini/server/settings/publish.py index 1741568d63..55bb70cba4 100644 --- a/server_addon/houdini/server/settings/publish.py +++ b/server_addon/houdini/server/settings/publish.py @@ -49,6 +49,10 @@ class PublishPluginsModel(BaseSettingsModel): default_factory=CollectChunkSizeModel, title="Collect Chunk Size." ) + CollectStagingDirsForCleaningUp:BasicValidateModel = SettingsField( + default_factory=BasicValidateModel, + title="Collect Staging Directories For Cleaning Up." + ) ValidateContainers: BasicValidateModel = SettingsField( default_factory=BasicValidateModel, title="Validate Latest Containers.", @@ -79,6 +83,11 @@ class PublishPluginsModel(BaseSettingsModel): "optional": True, "chunk_size": 999999 }, + "CollectStagingDirsForCleaningUp": { + "enabled": True, + "optional": True, + "active": True + }, "ValidateContainers": { "enabled": True, "optional": True, From 8113d7419f7def8e9d665acccc0e33d9ab03db08 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 9 Feb 2024 22:22:21 +0200 Subject: [PATCH 04/86] fix faulty logic --- .../plugins/publish/collect_staging_dirs_for_cleaning_up.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_staging_dirs_for_cleaning_up.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_staging_dirs_for_cleaning_up.py index 9af475849f..35605efe8a 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_staging_dirs_for_cleaning_up.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_staging_dirs_for_cleaning_up.py @@ -1,5 +1,5 @@ import pyblish.api - +import os from ayon_core.pipeline import AYONPyblishPluginMixin @@ -85,6 +85,6 @@ def process(self, instance): if not filepath: self.log.warning("No filepath value to collect.") return - + filepath = os.path.dirname(filepath) self.log.debug("Add to clean up list: {}".format(filepath)) - instance.context.data["cleanupFullPaths"] = filepath + instance.context.data["cleanupFullPaths"].append(filepath) From 4e3d15fb4b0b7dc75fbda4b1b8c31d68349954ba Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 9 Feb 2024 22:44:54 +0200 Subject: [PATCH 05/86] apply cleaning up for some product types only --- .../publish/collect_staging_dirs_for_cleaning_up.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_staging_dirs_for_cleaning_up.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_staging_dirs_for_cleaning_up.py index 35605efe8a..c835c74708 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_staging_dirs_for_cleaning_up.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_staging_dirs_for_cleaning_up.py @@ -22,6 +22,18 @@ class CollectStagingDirsForCleaningUp(pyblish.api.InstancePlugin, order = pyblish.api.CollectorOrder hosts = ["houdini"] + families = [ + "camera", + "ass", + "pointcache", + "imagesequence", + "mantraifd", + "redshiftproxy", + "review", + "staticMesh", + "usd", + "vdbcache", + ] label = "Collect Staging Directories For Cleaning Up" def process(self, instance): From a8d35912920184794a94dc59e14cfea1d243057f Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Wed, 14 Feb 2024 17:36:48 +0200 Subject: [PATCH 06/86] add default value for filepath, add one more return --- .../plugins/publish/collect_staging_dirs_for_cleaning_up.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_staging_dirs_for_cleaning_up.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_staging_dirs_for_cleaning_up.py index c835c74708..1917e3ae26 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_staging_dirs_for_cleaning_up.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_staging_dirs_for_cleaning_up.py @@ -44,6 +44,7 @@ def process(self, instance): # Get sop path node_type = node.type().name() + filepath = None if node_type == "geometry": filepath = node.evalParm("sopoutput") @@ -93,6 +94,7 @@ def process(self, instance): "ROP node type '{}' is not supported for cleaning up." .format(node_type) ) + return if not filepath: self.log.warning("No filepath value to collect.") From 060d826909ac93ec30eccae7019bd5d51977e19e Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Wed, 14 Feb 2024 17:38:21 +0200 Subject: [PATCH 07/86] disable CollectStagingDirsForCleaningUp by default --- server_addon/houdini/server/settings/publish.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/houdini/server/settings/publish.py b/server_addon/houdini/server/settings/publish.py index 55bb70cba4..c0ac6e4118 100644 --- a/server_addon/houdini/server/settings/publish.py +++ b/server_addon/houdini/server/settings/publish.py @@ -84,7 +84,7 @@ class PublishPluginsModel(BaseSettingsModel): "chunk_size": 999999 }, "CollectStagingDirsForCleaningUp": { - "enabled": True, + "enabled": False, "optional": True, "active": True }, From 2413a76e9cd00db18f614322bf4a28192d61ec72 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 15 Feb 2024 11:05:40 +0200 Subject: [PATCH 08/86] BigRoy comment - add expoted files to 'cleanupFullPaths and staging dirs to 'cleanupEmptyDirs' --- ...up.py => collect_files_for_cleaning_up.py} | 66 +++++++++++-------- .../houdini/server/settings/publish.py | 6 +- 2 files changed, 40 insertions(+), 32 deletions(-) rename client/ayon_core/hosts/houdini/plugins/publish/{collect_staging_dirs_for_cleaning_up.py => collect_files_for_cleaning_up.py} (58%) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_staging_dirs_for_cleaning_up.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py similarity index 58% rename from client/ayon_core/hosts/houdini/plugins/publish/collect_staging_dirs_for_cleaning_up.py rename to client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py index 1917e3ae26..215e3fb2ed 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_staging_dirs_for_cleaning_up.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -3,23 +3,20 @@ from ayon_core.pipeline import AYONPyblishPluginMixin -class CollectStagingDirsForCleaningUp(pyblish.api.InstancePlugin, - AYONPyblishPluginMixin): - """Collect Staging Directories For Cleaning Up. +class CollectFilesForCleaningUp(pyblish.api.InstancePlugin, + AYONPyblishPluginMixin): + """Collect Files For Cleaning Up. - This collector collects staging directories + This collector collects output files and adds them to file remove list. CAUTION: - This collector deletes the parent folder of the exported files. - It works fine with the default filepaths in the creators. - Artist should be aware with that fact so they take care when - changing the file path in the ROP node. - Developers should be aware when changing the filepath pattern - in creator plugins. + This collector deletes the exported files and + deletes the parent folder if it was empty. + Artists are free to change the file path in the ROP node. """ - order = pyblish.api.CollectorOrder + order = pyblish.api.CollectorOrder + 0.2 # it should run after CollectFrames hosts = ["houdini"] families = [ @@ -32,16 +29,35 @@ class CollectStagingDirsForCleaningUp(pyblish.api.InstancePlugin, "review", "staticMesh", "usd", - "vdbcache", + "vdbcache" ] - label = "Collect Staging Directories For Cleaning Up" + label = "Collect Files For Cleaning Up" def process(self, instance): import hou node = hou.node(instance.data["instance_node"]) + filepath = self.get_filepath(node) + if not filepath: + self.log.warning("No filepath value to collect.") + return + + staging_dir, _ = os.path.split(filepath) + files = instance.data.get("frames", []) + if files: + files = ["{}/{}".format(staging_dir, f) for f in files] + else: + files = [filepath] + + self.log.debug("Add directories to 'cleanupEmptyDir': {}".format(staging_dir)) + instance.context.data["cleanupEmptyDirs"].append(staging_dir) + + self.log.debug("Add files to 'cleanupFullPaths': {}".format(files)) + instance.context.data["cleanupFullPaths"] += files + + def get_filepath(self, node): # Get sop path node_type = node.type().name() filepath = None @@ -55,11 +71,10 @@ def process(self, instance): filepath = node.evalParm("filename") elif node_type == "ifd": - filepath = node.evalParm("vm_picture") - # vm_picture is empty when mantra node is - # used to export .ifd files only. - if not filepath: + if node.evalParm("soho_outputmode"): filepath = node.evalParm("soho_diskfile") + else: + filepath = node.evalParm("vm_picture") elif node_type == "Redshift_Proxy_Output": filepath = node.evalParm("RS_archive_file") @@ -80,11 +95,10 @@ def process(self, instance): filepath = node.evalParm("picture") elif node_type == "arnold": - filepath = node.evalParm("ar_picture") - # ar_picture is empty when arnold node is - # used to export .ass files only. - if not filepath: + if node.evalParm("ar_ass_export_enable"): filepath = node.evalParm("ar_ass_file") + else: + filepath = node.evalParm("ar_picture") elif node_type == "vray_renderer": filepath = node.evalParm("SettingsOutput_img_file_path") @@ -94,11 +108,5 @@ def process(self, instance): "ROP node type '{}' is not supported for cleaning up." .format(node_type) ) - return - - if not filepath: - self.log.warning("No filepath value to collect.") - return - filepath = os.path.dirname(filepath) - self.log.debug("Add to clean up list: {}".format(filepath)) - instance.context.data["cleanupFullPaths"].append(filepath) + + return filepath \ No newline at end of file diff --git a/server_addon/houdini/server/settings/publish.py b/server_addon/houdini/server/settings/publish.py index c0ac6e4118..eb895b429e 100644 --- a/server_addon/houdini/server/settings/publish.py +++ b/server_addon/houdini/server/settings/publish.py @@ -49,9 +49,9 @@ class PublishPluginsModel(BaseSettingsModel): default_factory=CollectChunkSizeModel, title="Collect Chunk Size." ) - CollectStagingDirsForCleaningUp:BasicValidateModel = SettingsField( + CollectFilesForCleaningUp:BasicValidateModel = SettingsField( default_factory=BasicValidateModel, - title="Collect Staging Directories For Cleaning Up." + title="Collect Files For Cleaning Up." ) ValidateContainers: BasicValidateModel = SettingsField( default_factory=BasicValidateModel, @@ -83,7 +83,7 @@ class PublishPluginsModel(BaseSettingsModel): "optional": True, "chunk_size": 999999 }, - "CollectStagingDirsForCleaningUp": { + "CollectFilesForCleaningUp": { "enabled": False, "optional": True, "active": True From 28ace5313c3826f619fa2f65bae6c2d9ab28a501 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 15 Feb 2024 17:44:16 +0200 Subject: [PATCH 09/86] Use full staging path in houdini create settings --- .../plugins/create/create_alembic_camera.py | 7 +- .../plugins/create/create_arnold_ass.py | 9 +- .../plugins/create/create_arnold_rop.py | 14 +-- .../houdini/plugins/create/create_bgeo.py | 7 +- .../plugins/create/create_composite.py | 9 +- .../houdini/plugins/create/create_hda.py | 9 +- .../plugins/create/create_karma_rop.py | 19 ++- .../plugins/create/create_mantra_ifd.py | 7 +- .../plugins/create/create_mantra_rop.py | 13 +- .../plugins/create/create_pointcache.py | 7 +- .../plugins/create/create_redshift_proxy.py | 5 +- .../plugins/create/create_redshift_rop.py | 14 +-- .../houdini/plugins/create/create_review.py | 7 +- .../plugins/create/create_staticmesh.py | 7 +- .../houdini/plugins/create/create_usd.py | 7 +- .../plugins/create/create_vbd_cache.py | 7 +- .../houdini/plugins/create/create_vray_rop.py | 21 ++-- .../houdini/server/settings/create.py | 113 +++++++++++++----- 18 files changed, 161 insertions(+), 121 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py b/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py index c6cf5664f8..61d903e875 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py @@ -13,7 +13,7 @@ class CreateAlembicCamera(plugin.HoudiniCreator): label = "Camera (Abc)" family = "camera" icon = "camera" - staging_dir = "$HIP/ayon" + staging_dir = "$HIP/ayon/{product_name}/{product_name}.abc" def create(self, subset_name, instance_data, pre_create_data): import hou @@ -28,9 +28,8 @@ def create(self, subset_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) - filepath = "{root}/{subset}/{subset}.abc".format( - root=hou.text.expandString(self.staging_dir), - subset=subset_name + filepath = self.staging_dir.format( + product_name="`chs(\"subset\")`" # keep dynamic link to subset ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py index e3a052812f..265f591513 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py @@ -16,7 +16,7 @@ class CreateArnoldAss(plugin.HoudiniCreator): # however calling HoudiniCreator.create() # will override it by the value in the project settings ext = ".ass" - staging_dir = "$HIP/ayon" + staging_dir = "$HIP/ayon/{product_name}/{product_name}.{ext}" def create(self, subset_name, instance_data, pre_create_data): import hou @@ -40,10 +40,9 @@ def create(self, subset_name, instance_data, pre_create_data): parm_template_group.hideFolder("Properties", True) instance_node.setParmTemplateGroup(parm_template_group) - filepath = "{root}/{subset}/{subset}.$F4{ext}".format( - root=hou.text.expandString(self.staging_dir), - subset=subset_name, - ext=self.ext + filepath = self.staging_dir.format( + product_name="`chs(\"subset\")`", # keep dynamic link to subset + ext=self.ext.lstrip(".") ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py index 0d8e95f852..50a3bafa41 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py @@ -9,7 +9,8 @@ class CreateArnoldRop(plugin.HoudiniCreator): label = "Arnold ROP" family = "arnold_rop" icon = "magic" - staging_dir = "$HIP/ayon" + render_staging_dir = "$HIP/ayon/{product_name}/render/{product_name}.$F4.{ext}" + ass_dir = "$HIP/ayon/{product_name}/ass/{product_name}.$F4.{ext}" # Default extension ext = "exr" @@ -38,9 +39,8 @@ def create(self, subset_name, instance_data, pre_create_data): ext = pre_create_data.get("image_format") - filepath = "{root}/{subset}/{subset}.$F4.{ext}".format( - root=hou.text.expandString(self.staging_dir), - subset=subset_name, + filepath = self.render_staging_dir.format( + product_name="`chs(\"subset\")`", # keep dynamic link to subset ext=ext ) @@ -54,9 +54,9 @@ def create(self, subset_name, instance_data, pre_create_data): } if pre_create_data.get("export_job"): - ass_filepath = "{root}/{subset}/ass/{subset}.$F4.ass".format( - root=hou.text.expandString(self.staging_dir), - subset=subset_name + ass_filepath = self.ass_dir.format( + product_name="`chs(\"subset\")`", # keep dynamic link to subset + ext="ass" ) parms["ar_ass_export_enable"] = 1 diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py b/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py index 163dc266c1..57c71fe9ec 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py @@ -12,7 +12,7 @@ class CreateBGEO(plugin.HoudiniCreator): label = "PointCache (Bgeo)" family = "pointcache" icon = "gears" - staging_dir = "$HIP/ayon" + staging_dir = "$HIP/ayon/{product_name}/{product_name}.$F4.{ext}" def create(self, subset_name, instance_data, pre_create_data): @@ -30,9 +30,8 @@ def create(self, subset_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) - filepath = "{root}/{subset}/{subset}.$F4.{ext}".format( - root=hou.text.expandString(self.staging_dir), - subset=subset_name, + filepath = self.staging_dir.format( + product_name="`chs(\"subset\")`", # keep dynamic link to subset ext=pre_create_data.get("bgeo_type") or "bgeo.sc" ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_composite.py b/client/ayon_core/hosts/houdini/plugins/create/create_composite.py index 902071634b..c76acdf58e 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_composite.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_composite.py @@ -13,8 +13,8 @@ class CreateCompositeSequence(plugin.HoudiniCreator): label = "Composite (Image Sequence)" family = "imagesequence" icon = "gears" - staging_dir = "$HIP/ayon" - ext = ".exr" + staging_dir = "$HIP/ayon/{product_name}/{product_name}.$F4.{ext}" + ext = "exr" def create(self, subset_name, instance_data, pre_create_data): import hou # noqa @@ -29,9 +29,8 @@ def create(self, subset_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) - filepath = "{root}/{subset}/{subset}.$F4{ext}".format( - root=hou.text.expandString(self.staging_dir), - subset=subset_name, + filepath = self.staging_dir.format( + product_name="`chs(\"subset\")`", # keep dynamic link to subset ext=self.ext ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_hda.py b/client/ayon_core/hosts/houdini/plugins/create/create_hda.py index ce72a9458e..97347f432a 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_hda.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_hda.py @@ -16,7 +16,8 @@ class CreateHDA(plugin.HoudiniCreator): family = "hda" icon = "gears" maintain_selection = False - staging_dir = "$HIP/ayon" + staging_dir = "$HIP/ayon/{product_name}/{product_name}.{ext}" + ext = "hda" def _check_existing(self, asset_name, subset_name): # type: (str) -> bool @@ -60,9 +61,9 @@ def create_instance_node( # for consistency I'm using {subset} as it's # the same key used in other creators - filepath = "{root}/{subset}/{subset}.hda".format( - root=hou.text.expandString(self.staging_dir), - subset=node_name + filepath = self.staging_dir.format( + product_name=node_name, + ext=self.ext ) hda_node = to_hda.createDigitalAsset( diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py index b9db6d33b5..a00b48a7e0 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py @@ -11,7 +11,9 @@ class CreateKarmaROP(plugin.HoudiniCreator): label = "Karma ROP" family = "karma_rop" icon = "magic" - staging_dir = "$HIP/ayon" + render_staging_dir = "$HIP/ayon/{product_name}/render/{product_name}.$F4.{ext}" + checkpoint_dir = "$HIP/ayon/{product_name}/checkpoint/{product_name}.$F4.checkpoint" + usd_dir = "$HIP/ayon/{product_name}/usd/{product_name}_$RENDERID" def create(self, subset_name, instance_data, pre_create_data): import hou # noqa @@ -32,20 +34,17 @@ def create(self, subset_name, instance_data, pre_create_data): ext = pre_create_data.get("image_format") - filepath = "{root}/{subset}/{subset}.$F4.{ext}".format( - root=hou.text.expandString(self.staging_dir), - subset=subset_name, + filepath = self.render_staging_dir.format( + product_name="`chs(\"subset\")`", # keep dynamic link to subset ext=ext ) - checkpoint = "{root}/{subset}/checkpoint/{subset}.$F4.checkpoint".format( - root=hou.text.expandString(self.staging_dir), - subset=subset_name + checkpoint = self.checkpoint_dir.format( + product_name="`chs(\"subset\")`" # keep dynamic link to subset ) - usd_directory = "{root}/{subset}/usd_render/{subset}_$RENDERID".format( - root=hou.text.expandString(self.staging_dir), - subset=subset_name + usd_directory = self.usd_dir.format( + product_name="`chs(\"subset\")`" # keep dynamic link to subset ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py index e0ca6d1220..ad74ad0fb0 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py @@ -11,7 +11,7 @@ class CreateMantraIFD(plugin.HoudiniCreator): label = "Mantra IFD" family = "mantraifd" icon = "gears" - staging_dir = "$HIP/ayon" + staging_dir = "$HIP/ayon/{product_name}/{product_name}.$F4.ifd" def create(self, subset_name, instance_data, pre_create_data): import hou @@ -27,9 +27,8 @@ def create(self, subset_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) - filepath = "{root}/{subset}/{subset}.$F4.ifd".format( - root=hou.text.expandString(self.staging_dir), - subset=subset_name + filepath = self.staging_dir.format( + product_name="`chs(\"subset\")`" # keep dynamic link to subset ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py index 994f6efa70..4c41020eed 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py @@ -11,7 +11,8 @@ class CreateMantraROP(plugin.HoudiniCreator): label = "Mantra ROP" family = "mantra_rop" icon = "magic" - staging_dir = "$HIP/ayon" + render_staging_dir = "$HIP/ayon/{product_name}/render/{product_name}.$F4.{ext}", + ifd_dir = "$HIP/ayon/{product_name}/ifd/{product_name}.$F4.ifd" # Default to split export and render jobs export_job = True @@ -35,9 +36,8 @@ def create(self, subset_name, instance_data, pre_create_data): ext = pre_create_data.get("image_format") - filepath = "{root}/{subset}/{subset}.$F4.{ext}".format( - root=hou.text.expandString(self.staging_dir), - subset=subset_name, + filepath = self.render_staging_dir.format( + product_name="`chs(\"subset\")`", # keep dynamic link to subset ext=ext ) @@ -49,9 +49,8 @@ def create(self, subset_name, instance_data, pre_create_data): } if pre_create_data.get("export_job"): - ifd_filepath = "{root}/{subset}/ifd/{subset}.$F4.ifd".format( - root=hou.text.expandString(self.staging_dir), - subset=subset_name + ifd_filepath = self.ifd_dir.format( + product_name="`chs(\"subset\")`" # keep dynamic link to subset ) parms["soho_outputmode"] = 1 diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py b/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py index 4441bdc5dd..b7c1df6bed 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py @@ -13,7 +13,7 @@ class CreatePointCache(plugin.HoudiniCreator): label = "PointCache (Abc)" family = "pointcache" icon = "gears" - staging_dir = "$HIP/ayon" + staging_dir = "$HIP/ayon/{product_name}/{product_name}.abc" def create(self, subset_name, instance_data, pre_create_data): instance_data.pop("active", None) @@ -29,9 +29,8 @@ def create(self, subset_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) - filepath = "{root}/{subset}/{subset}.abc".format( - root=hou.text.expandString(self.staging_dir), - subset=subset_name + filepath = self.staging_dir.format( + product_name="`chs(\"subset\")`" # keep dynamic link to subset ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py index 8de3f79dd1..0e307ae53f 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py @@ -37,9 +37,8 @@ def create(self, subset_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) - filepath = "{root}/{subset}/{subset}.$F4.rs".format( - root=hou.text.expandString(self.staging_dir), - subset=subset_name + filepath = self.staging_dir.format( + product_name="`chs(\"subset\")`" # keep dynamic link to subset ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py index 89355c2386..f33caec5a2 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py @@ -14,7 +14,8 @@ class CreateRedshiftROP(plugin.HoudiniCreator): family = "redshift_rop" icon = "magic" ext = "exr" - staging_dir = "$HIP/ayon" + render_staging_dir = "$HIP/ayon/{product_name}/render/{product_name}.$AOV.$F4.{ext}" + rs_dir = "$HIP/ayon/{product_name}/rs/{product_name}.$F4.rs" # Default to split export and render jobs split_render = True @@ -58,10 +59,8 @@ def create(self, subset_name, instance_data, pre_create_data): ext = pre_create_data.get("image_format") - filepath = "{root}/{subset}/{subset}.${aov}.$F4.{ext}".format( - root=hou.text.expandString(self.staging_dir), - subset=subset_name, - aov="AOV", + filepath = self.render_staging_dir.format( + product_name="`chs(\"subset\")`", # keep dynamic link to subset ext=ext ) @@ -85,9 +84,8 @@ def create(self, subset_name, instance_data, pre_create_data): camera = node.path() parms["RS_renderCamera"] = camera or "" - rs_filepath = "{root}/{subset}/rs/{subset}.$F4.rs".format( - root=hou.text.expandString(self.staging_dir), - subset=subset_name + rs_filepath = self.rs_dir.format( + product_name="`chs(\"subset\")`" # keep dynamic link to subset ) parms["RS_archive_file"] = rs_filepath diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_review.py b/client/ayon_core/hosts/houdini/plugins/create/create_review.py index a816391368..ab579fe6a6 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_review.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_review.py @@ -14,7 +14,7 @@ class CreateReview(plugin.HoudiniCreator): label = "Review" family = "review" icon = "video-camera" - staging_dir = "$HIP/ayon" + staging_dir = "$HIP/ayon/{product_name}/{product_name}.$F4.{ext}" def create(self, subset_name, instance_data, pre_create_data): @@ -32,9 +32,8 @@ def create(self, subset_name, instance_data, pre_create_data): frame_range = hou.playbar.frameRange() - filepath = "{root}/{subset}/{subset}.$F4.{ext}".format( - root=hou.text.expandString(self.staging_dir), - subset="`chs(\"subset\")`", # keep dynamic link to subset + filepath = self.staging_dir.format( + product_name="`chs(\"subset\")`", # keep dynamic link to subset ext=pre_create_data.get("image_format", "png") ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py b/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py index 61501dfe08..c13b8a339b 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py @@ -15,7 +15,7 @@ class CreateStaticMesh(plugin.HoudiniCreator): icon = "fa5s.cubes" default_variants = ["Main"] - staging_dir = "$HIP/ayon" + staging_dir = "$HIP/ayon/{product_name}/{product_name}.fbx" def create(self, subset_name, instance_data, pre_create_data): @@ -30,9 +30,8 @@ def create(self, subset_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) # prepare parms - filepath = "{root}/{subset}/{subset}.fbx".format( - root=hou.text.expandString(self.staging_dir), - subset=subset_name + filepath = self.staging_dir.format( + product_name="`chs(\"subset\")`" # keep dynamic link to subset ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_usd.py b/client/ayon_core/hosts/houdini/plugins/create/create_usd.py index 3d3e4ca173..69e8688ae2 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_usd.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_usd.py @@ -13,7 +13,7 @@ class CreateUSD(plugin.HoudiniCreator): family = "usd" icon = "gears" enabled = False - staging_dir = "$HIP/ayon" + staging_dir = "$HIP/ayon/{product_name}/{product_name}.usd" def create(self, subset_name, instance_data, pre_create_data): @@ -27,9 +27,8 @@ def create(self, subset_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) - filepath = "{root}/{subset}/{subset}.usd".format( - root=hou.text.expandString(self.staging_dir), - subset=subset_name + filepath = self.staging_dir.format( + product_name="`chs(\"subset\")`" # keep dynamic link to subset ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py b/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py index 488d28ca68..f883489574 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py @@ -14,7 +14,7 @@ class CreateVDBCache(plugin.HoudiniCreator): label = "VDB Cache" family = "vdbcache" icon = "cloud" - staging_dir = "$HIP/ayon" + staging_dir = "$HIP/ayon/{product_name}/{product_name}.$F4.vdb" def create(self, subset_name, instance_data, pre_create_data): import hou @@ -31,9 +31,8 @@ def create(self, subset_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) - filepath = "{root}/{subset}/{subset}.$F4.vdb".format( - root=hou.text.expandString(self.staging_dir), - subset=subset_name + filepath = self.staging_dir.format( + product_name="`chs(\"subset\")`" # keep dynamic link to subset ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py index 47a3af8412..84f268b920 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py @@ -15,7 +15,8 @@ class CreateVrayROP(plugin.HoudiniCreator): family = "vray_rop" icon = "magic" ext = "exr" - staging_dir = "$HIP/ayon" + render_staging_dir = "$HIP/ayon/{product_name}/render/{product_name}.$AOV.$F4.{ext}", + vrscene_dir = "$HIP/ayon/{product_name}/vrscene/{product_name}.$F4.vrscene" # Default to split export and render jobs export_job = True @@ -58,9 +59,8 @@ def create(self, subset_name, instance_data, pre_create_data): if pre_create_data.get("export_job"): - scene_filepath = "{root}/{subset}/vrscene/{subset}.$F4.vrscene".format( - root=hou.text.expandString(self.staging_dir), - subset=subset_name + scene_filepath = self.vrscene_dir.format( + product_name="`chs(\"subset\")`" # keep dynamic link to subset ) # Setting render_export_mode to "2" because that's for # "Export only" ("1" is for "Export & Render") @@ -82,10 +82,8 @@ def create(self, subset_name, instance_data, pre_create_data): instance_data["RenderElement"] = pre_create_data.get("render_element_enabled") # noqa if pre_create_data.get("render_element_enabled", True): # Vray has its own tag for AOV file output - filepath = "{root}/{subset}/{subset}.${aov}.$F4.{ext}".format( - root=hou.text.expandString(self.staging_dir), - subset=subset_name, - aov="AOV", + filepath = self.render_staging_dir.format( + product_name="`chs(\"subset\")`", # keep dynamic link to subset ext=ext ) @@ -103,11 +101,10 @@ def create(self, subset_name, instance_data, pre_create_data): }) else: - filepath = "{root}/{subset}/{subset}.$F4.{ext}".format( - root=hou.text.expandString(self.staging_dir), - subset=subset_name, + filepath = self.render_staging_dir.format( + product_name="`chs(\"subset\")`", # keep dynamic link to subset ext=ext - ) + ).replace(".$AOV", "") parms.update({ "use_render_channels": 0, diff --git a/server_addon/houdini/server/settings/create.py b/server_addon/houdini/server/settings/create.py index 2b5ab237e3..136e2c5f45 100644 --- a/server_addon/houdini/server/settings/create.py +++ b/server_addon/houdini/server/settings/create.py @@ -8,7 +8,7 @@ class CreatorModel(BaseSettingsModel): title="Default Products", default_factory=list, ) - staging_dir: str = SettingsField(title="Staging Dir") + staging_dir: str = SettingsField(title="Staging Directory") class CreateArnoldAssModel(BaseSettingsModel): @@ -18,7 +18,58 @@ class CreateArnoldAssModel(BaseSettingsModel): default_factory=list, ) ext: str = SettingsField(Title="Extension") - staging_dir: str = SettingsField(title="Staging Dir") + staging_dir: str = SettingsField(title="Staging Directory") + + +class CreateArnoldRopModel(BaseSettingsModel): + enabled: bool = SettingsField(title="Enabled") + default_variants: list[str] = SettingsField( + title="Default Products", + default_factory=list, + ) + render_staging_dir: str = SettingsField(title="Render Staging Directory") + ass_dir: str = SettingsField(title="Ass Directory") + + +class CreateKarmaROPModel(BaseSettingsModel): + enabled: bool = SettingsField(title="Enabled") + default_variants: list[str] = SettingsField( + title="Default Products", + default_factory=list, + ) + render_staging_dir: str = SettingsField(title="Render Staging Directory") + checkpoint_dir: str = SettingsField(title="Checkpoint Directory") + usd_dir: str = SettingsField(title="USD Directory") + + +class CreateMantraROPModel(BaseSettingsModel): + enabled: bool = SettingsField(title="Enabled") + default_variants: list[str] = SettingsField( + title="Default Products", + default_factory=list, + ) + render_staging_dir: str = SettingsField(title="Render Staging Directory") + ifd_dir: str = SettingsField(title="IFD Directory") + + +class CreateRedshiftROPModel(BaseSettingsModel): + enabled: bool = SettingsField(title="Enabled") + default_variants: list[str] = SettingsField( + title="Default Products", + default_factory=list, + ) + render_staging_dir: str = SettingsField(title="Render Staging Directory") + rs_dir: str = SettingsField(title="RS Directory") + + +class CreateVrayROPModel(BaseSettingsModel): + enabled: bool = SettingsField(title="Enabled") + default_variants: list[str] = SettingsField( + title="Default Products", + default_factory=list, + ) + render_staging_dir: str = SettingsField(title="Render Staging Directory") + vrscene_dir: str = SettingsField(title="VRay scene Directory") class CreateStaticMeshModel(BaseSettingsModel): @@ -32,7 +83,7 @@ class CreateStaticMeshModel(BaseSettingsModel): default_factory=list, title="Collision Prefixes" ) - staging_dir: str = SettingsField(title="Staging Dir") + staging_dir: str = SettingsField(title="Staging Directory") class CreatePluginsModel(BaseSettingsModel): @@ -42,8 +93,8 @@ class CreatePluginsModel(BaseSettingsModel): CreateArnoldAss: CreateArnoldAssModel = SettingsField( default_factory=CreateArnoldAssModel, title="Create Arnold Ass") - CreateArnoldRop: CreatorModel = SettingsField( - default_factory=CreatorModel, + CreateArnoldRop: CreateArnoldRopModel = SettingsField( + default_factory=CreateArnoldRopModel, title="Create Arnold ROP") CreateCompositeSequence: CreatorModel = SettingsField( default_factory=CreatorModel, @@ -51,14 +102,14 @@ class CreatePluginsModel(BaseSettingsModel): CreateHDA: CreatorModel = SettingsField( default_factory=CreatorModel, title="Create Houdini Digital Asset") - CreateKarmaROP: CreatorModel = SettingsField( - default_factory=CreatorModel, + CreateKarmaROP: CreateKarmaROPModel = SettingsField( + default_factory=CreateKarmaROPModel, title="Create Karma ROP") CreateMantraIFD: CreatorModel = SettingsField( default_factory=CreatorModel, title="Create Mantra IFD") - CreateMantraROP: CreatorModel = SettingsField( - default_factory=CreatorModel, + CreateMantraROP: CreateMantraROPModel = SettingsField( + default_factory=CreateMantraROPModel, title="Create Mantra ROP") CreatePointCache: CreatorModel = SettingsField( default_factory=CreatorModel, @@ -88,8 +139,8 @@ class CreatePluginsModel(BaseSettingsModel): CreateVDBCache: CreatorModel = SettingsField( default_factory=CreatorModel, title="Create VDB Cache") - CreateVrayROP: CreatorModel = SettingsField( - default_factory=CreatorModel, + CreateVrayROP: CreateVrayROPModel = SettingsField( + default_factory=CreateVrayROPModel, title="Create VRay ROP") @@ -97,68 +148,73 @@ class CreatePluginsModel(BaseSettingsModel): "CreateAlembicCamera": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon" + "staging_dir": "$HIP/ayon/{product_name}/{product_name}.abc" }, "CreateArnoldAss": { "enabled": True, "default_variants": ["Main"], "ext": ".ass", - "staging_dir": "$HIP/ayon" + "staging_dir": "$HIP/ayon/{product_name}/{product_name}.$F4.{ext}" }, "CreateArnoldRop": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon" + "render_staging_dir": "$HIP/ayon/{product_name}/render/{product_name}.$F4.{ext}", + "ass_dir": "$HIP/ayon/{product_name}/ass/{product_name}.$F4.{ext}" }, "CreateCompositeSequence": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon" + "staging_dir": "$HIP/ayon/{product_name}/{product_name}.$F4.{ext}" }, "CreateHDA": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon" + "staging_dir": "$HIP/ayon/{product_name}/{product_name}.{ext}" }, "CreateKarmaROP": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon" + "render_staging_dir": "$HIP/ayon/{product_name}/render/{product_name}.$F4.{ext}", + "checkpoint_dir": "$HIP/ayon/{product_name}/checkpoint/{product_name}.$F4.checkpoint", + "usd_dir": "$HIP/ayon/{product_name}/usd/{product_name}_$RENDERID" }, "CreateMantraIFD": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon" + "staging_dir": "$HIP/ayon/{product_name}/{product_name}.$F4.ifd" }, "CreateMantraROP": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon" + "render_staging_dir": "$HIP/ayon/{product_name}/render/{product_name}.$F4.{ext}", + "ifd_dir": "$HIP/ayon/{product_name}/ifd/{product_name}.$F4.ifd" }, "CreatePointCache": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon" + "staging_dir": "$HIP/ayon/{product_name}/{product_name}.abc" }, "CreateBGEO": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon" + "staging_dir": "$HIP/ayon/{product_name}/{product_name}.$F4.{ext}" }, "CreateRedshiftProxy": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon" + "staging_dir": "$HIP/ayon/{product_name}/{product_name}.$F4.rs" }, "CreateRedshiftROP": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon" + "render_staging_dir": "$HIP/ayon/{product_name}/render/{product_name}.$AOV.$F4.{ext}", + "rs_dir": "$HIP/ayon/{product_name}/rs/{product_name}.$F4.rs" }, "CreateReview": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon" + "staging_dir": "$HIP/ayon/{product_name}/{product_name}.$F4.{ext}" }, "CreateStaticMesh": { "enabled": True, @@ -172,12 +228,12 @@ class CreatePluginsModel(BaseSettingsModel): "USP", "UCX" ], - "staging_dir": "$HIP/ayon" + "staging_dir": "$HIP/ayon/{product_name}/{product_name}.fbx" }, "CreateUSD": { "enabled": False, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon" + "staging_dir": "$HIP/ayon/{product_name}/{product_name}.usd" }, "CreateUSDRender": { "enabled": False, @@ -187,11 +243,12 @@ class CreatePluginsModel(BaseSettingsModel): "CreateVDBCache": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon" + "staging_dir": "$HIP/ayon/{product_name}/{product_name}.$F4.vdb" }, "CreateVrayROP": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon" + "render_staging_dir": "$HIP/ayon/{product_name}/render/{product_name}.$AOV.$F4.{ext}", + "vrscene_dir": "$HIP/ayon/{product_name}/vrscene/{product_name}.$F4.vrscene" }, } From fa8a3146a35970fa357adec40b907ed5de9194cf Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 15 Feb 2024 21:28:28 +0200 Subject: [PATCH 10/86] use standard keys --- .../plugins/create/create_alembic_camera.py | 4 +- .../plugins/create/create_arnold_ass.py | 4 +- .../plugins/create/create_arnold_rop.py | 8 ++-- .../houdini/plugins/create/create_bgeo.py | 4 +- .../plugins/create/create_composite.py | 4 +- .../houdini/plugins/create/create_hda.py | 4 +- .../plugins/create/create_karma_rop.py | 10 ++-- .../plugins/create/create_mantra_ifd.py | 4 +- .../plugins/create/create_mantra_rop.py | 8 ++-- .../plugins/create/create_pointcache.py | 4 +- .../plugins/create/create_redshift_proxy.py | 4 +- .../plugins/create/create_redshift_rop.py | 8 ++-- .../houdini/plugins/create/create_review.py | 4 +- .../plugins/create/create_staticmesh.py | 4 +- .../houdini/plugins/create/create_usd.py | 4 +- .../plugins/create/create_vbd_cache.py | 4 +- .../houdini/plugins/create/create_vray_rop.py | 10 ++-- .../houdini/server/settings/create.py | 46 +++++++++---------- 18 files changed, 69 insertions(+), 69 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py b/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py index 61d903e875..84cfed1ed6 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py @@ -13,7 +13,7 @@ class CreateAlembicCamera(plugin.HoudiniCreator): label = "Camera (Abc)" family = "camera" icon = "camera" - staging_dir = "$HIP/ayon/{product_name}/{product_name}.abc" + staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.abc" def create(self, subset_name, instance_data, pre_create_data): import hou @@ -29,7 +29,7 @@ def create(self, subset_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) filepath = self.staging_dir.format( - product_name="`chs(\"subset\")`" # keep dynamic link to subset + product={"name": subset_name} ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py index 265f591513..54cb12e3f2 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py @@ -16,7 +16,7 @@ class CreateArnoldAss(plugin.HoudiniCreator): # however calling HoudiniCreator.create() # will override it by the value in the project settings ext = ".ass" - staging_dir = "$HIP/ayon/{product_name}/{product_name}.{ext}" + staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.{ext}" def create(self, subset_name, instance_data, pre_create_data): import hou @@ -41,7 +41,7 @@ def create(self, subset_name, instance_data, pre_create_data): instance_node.setParmTemplateGroup(parm_template_group) filepath = self.staging_dir.format( - product_name="`chs(\"subset\")`", # keep dynamic link to subset + product={"name": subset_name}, ext=self.ext.lstrip(".") ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py index 50a3bafa41..cc7c05613f 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py @@ -9,8 +9,8 @@ class CreateArnoldRop(plugin.HoudiniCreator): label = "Arnold ROP" family = "arnold_rop" icon = "magic" - render_staging_dir = "$HIP/ayon/{product_name}/render/{product_name}.$F4.{ext}" - ass_dir = "$HIP/ayon/{product_name}/ass/{product_name}.$F4.{ext}" + render_staging_dir = "$HIP/ayon/{product[name]}/render/{product[name]}.$F4.{ext}" + ass_dir = "$HIP/ayon/{product[name]}/ass/{product[name]}.$F4.{ext}" # Default extension ext = "exr" @@ -40,7 +40,7 @@ def create(self, subset_name, instance_data, pre_create_data): ext = pre_create_data.get("image_format") filepath = self.render_staging_dir.format( - product_name="`chs(\"subset\")`", # keep dynamic link to subset + product={"name": subset_name}, ext=ext ) @@ -55,7 +55,7 @@ def create(self, subset_name, instance_data, pre_create_data): if pre_create_data.get("export_job"): ass_filepath = self.ass_dir.format( - product_name="`chs(\"subset\")`", # keep dynamic link to subset + product={"name": subset_name}, ext="ass" ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py b/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py index 57c71fe9ec..2e791510be 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py @@ -12,7 +12,7 @@ class CreateBGEO(plugin.HoudiniCreator): label = "PointCache (Bgeo)" family = "pointcache" icon = "gears" - staging_dir = "$HIP/ayon/{product_name}/{product_name}.$F4.{ext}" + staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" def create(self, subset_name, instance_data, pre_create_data): @@ -31,7 +31,7 @@ def create(self, subset_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) filepath = self.staging_dir.format( - product_name="`chs(\"subset\")`", # keep dynamic link to subset + product={"name": subset_name}, ext=pre_create_data.get("bgeo_type") or "bgeo.sc" ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_composite.py b/client/ayon_core/hosts/houdini/plugins/create/create_composite.py index c76acdf58e..bc72a08a44 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_composite.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_composite.py @@ -13,7 +13,7 @@ class CreateCompositeSequence(plugin.HoudiniCreator): label = "Composite (Image Sequence)" family = "imagesequence" icon = "gears" - staging_dir = "$HIP/ayon/{product_name}/{product_name}.$F4.{ext}" + staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" ext = "exr" def create(self, subset_name, instance_data, pre_create_data): @@ -30,7 +30,7 @@ def create(self, subset_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) filepath = self.staging_dir.format( - product_name="`chs(\"subset\")`", # keep dynamic link to subset + product={"name": subset_name}, ext=self.ext ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_hda.py b/client/ayon_core/hosts/houdini/plugins/create/create_hda.py index 97347f432a..66163cb0d8 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_hda.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_hda.py @@ -16,7 +16,7 @@ class CreateHDA(plugin.HoudiniCreator): family = "hda" icon = "gears" maintain_selection = False - staging_dir = "$HIP/ayon/{product_name}/{product_name}.{ext}" + staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.{ext}" ext = "hda" def _check_existing(self, asset_name, subset_name): @@ -62,7 +62,7 @@ def create_instance_node( # for consistency I'm using {subset} as it's # the same key used in other creators filepath = self.staging_dir.format( - product_name=node_name, + product={"name": node_name}, ext=self.ext ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py index a00b48a7e0..dacbb3bf3b 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py @@ -11,8 +11,8 @@ class CreateKarmaROP(plugin.HoudiniCreator): label = "Karma ROP" family = "karma_rop" icon = "magic" - render_staging_dir = "$HIP/ayon/{product_name}/render/{product_name}.$F4.{ext}" - checkpoint_dir = "$HIP/ayon/{product_name}/checkpoint/{product_name}.$F4.checkpoint" + render_staging_dir = "$HIP/ayon/{product[name]}/render/{product[name]}.$F4.{ext}" + checkpoint_dir = "$HIP/ayon/{product[name]}/checkpoint/{product[name]}.$F4.checkpoint" usd_dir = "$HIP/ayon/{product_name}/usd/{product_name}_$RENDERID" def create(self, subset_name, instance_data, pre_create_data): @@ -35,16 +35,16 @@ def create(self, subset_name, instance_data, pre_create_data): ext = pre_create_data.get("image_format") filepath = self.render_staging_dir.format( - product_name="`chs(\"subset\")`", # keep dynamic link to subset + product={"name": subset_name}, ext=ext ) checkpoint = self.checkpoint_dir.format( - product_name="`chs(\"subset\")`" # keep dynamic link to subset + product={"name": subset_name} ) usd_directory = self.usd_dir.format( - product_name="`chs(\"subset\")`" # keep dynamic link to subset + product={"name": subset_name} ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py index ad74ad0fb0..3298c73028 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py @@ -11,7 +11,7 @@ class CreateMantraIFD(plugin.HoudiniCreator): label = "Mantra IFD" family = "mantraifd" icon = "gears" - staging_dir = "$HIP/ayon/{product_name}/{product_name}.$F4.ifd" + staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.$F4.ifd" def create(self, subset_name, instance_data, pre_create_data): import hou @@ -28,7 +28,7 @@ def create(self, subset_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) filepath = self.staging_dir.format( - product_name="`chs(\"subset\")`" # keep dynamic link to subset + product={"name": subset_name} ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py index 4c41020eed..dcf7d8efa1 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py @@ -11,8 +11,8 @@ class CreateMantraROP(plugin.HoudiniCreator): label = "Mantra ROP" family = "mantra_rop" icon = "magic" - render_staging_dir = "$HIP/ayon/{product_name}/render/{product_name}.$F4.{ext}", - ifd_dir = "$HIP/ayon/{product_name}/ifd/{product_name}.$F4.ifd" + render_staging_dir = "$HIP/ayon/{product[name]}/render/{product[name]}.$F4.{ext}", + ifd_dir = "$HIP/ayon/{product[name]}/ifd/{product[name]}.$F4.ifd" # Default to split export and render jobs export_job = True @@ -37,7 +37,7 @@ def create(self, subset_name, instance_data, pre_create_data): ext = pre_create_data.get("image_format") filepath = self.render_staging_dir.format( - product_name="`chs(\"subset\")`", # keep dynamic link to subset + product={"name": subset_name}, ext=ext ) @@ -50,7 +50,7 @@ def create(self, subset_name, instance_data, pre_create_data): if pre_create_data.get("export_job"): ifd_filepath = self.ifd_dir.format( - product_name="`chs(\"subset\")`" # keep dynamic link to subset + product={"name": subset_name} ) parms["soho_outputmode"] = 1 diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py b/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py index b7c1df6bed..108ff7744a 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py @@ -13,7 +13,7 @@ class CreatePointCache(plugin.HoudiniCreator): label = "PointCache (Abc)" family = "pointcache" icon = "gears" - staging_dir = "$HIP/ayon/{product_name}/{product_name}.abc" + staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.abc" def create(self, subset_name, instance_data, pre_create_data): instance_data.pop("active", None) @@ -30,7 +30,7 @@ def create(self, subset_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) filepath = self.staging_dir.format( - product_name="`chs(\"subset\")`" # keep dynamic link to subset + product={"name": subset_name} ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py index 0e307ae53f..1e559f6fc5 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py @@ -11,7 +11,7 @@ class CreateRedshiftProxy(plugin.HoudiniCreator): label = "Redshift Proxy" family = "redshiftproxy" icon = "magic" - staging_dir = "$HIP/ayon" + staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.$F4.rs" def create(self, subset_name, instance_data, pre_create_data): @@ -38,7 +38,7 @@ def create(self, subset_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) filepath = self.staging_dir.format( - product_name="`chs(\"subset\")`" # keep dynamic link to subset + product={"name": subset_name}, ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py index f33caec5a2..b3280754bf 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py @@ -14,8 +14,8 @@ class CreateRedshiftROP(plugin.HoudiniCreator): family = "redshift_rop" icon = "magic" ext = "exr" - render_staging_dir = "$HIP/ayon/{product_name}/render/{product_name}.$AOV.$F4.{ext}" - rs_dir = "$HIP/ayon/{product_name}/rs/{product_name}.$F4.rs" + render_staging_dir = "$HIP/ayon/{product[name]}/render/{product[name]}.$AOV.$F4.{ext}" + rs_dir = "$HIP/ayon/{product[name]}/rs/{product[name]}.$F4.rs" # Default to split export and render jobs split_render = True @@ -60,7 +60,7 @@ def create(self, subset_name, instance_data, pre_create_data): ext = pre_create_data.get("image_format") filepath = self.render_staging_dir.format( - product_name="`chs(\"subset\")`", # keep dynamic link to subset + product={"name": subset_name}, ext=ext ) @@ -85,7 +85,7 @@ def create(self, subset_name, instance_data, pre_create_data): parms["RS_renderCamera"] = camera or "" rs_filepath = self.rs_dir.format( - product_name="`chs(\"subset\")`" # keep dynamic link to subset + product={"name": subset_name} ) parms["RS_archive_file"] = rs_filepath diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_review.py b/client/ayon_core/hosts/houdini/plugins/create/create_review.py index ab579fe6a6..6091620037 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_review.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_review.py @@ -14,7 +14,7 @@ class CreateReview(plugin.HoudiniCreator): label = "Review" family = "review" icon = "video-camera" - staging_dir = "$HIP/ayon/{product_name}/{product_name}.$F4.{ext}" + staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" def create(self, subset_name, instance_data, pre_create_data): @@ -33,7 +33,7 @@ def create(self, subset_name, instance_data, pre_create_data): frame_range = hou.playbar.frameRange() filepath = self.staging_dir.format( - product_name="`chs(\"subset\")`", # keep dynamic link to subset + product={"name": subset_name}, ext=pre_create_data.get("image_format", "png") ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py b/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py index c13b8a339b..37bf2bed2a 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py @@ -15,7 +15,7 @@ class CreateStaticMesh(plugin.HoudiniCreator): icon = "fa5s.cubes" default_variants = ["Main"] - staging_dir = "$HIP/ayon/{product_name}/{product_name}.fbx" + staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.fbx" def create(self, subset_name, instance_data, pre_create_data): @@ -31,7 +31,7 @@ def create(self, subset_name, instance_data, pre_create_data): # prepare parms filepath = self.staging_dir.format( - product_name="`chs(\"subset\")`" # keep dynamic link to subset + product={"name": subset_name} ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_usd.py b/client/ayon_core/hosts/houdini/plugins/create/create_usd.py index 69e8688ae2..ac6e6285ac 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_usd.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_usd.py @@ -13,7 +13,7 @@ class CreateUSD(plugin.HoudiniCreator): family = "usd" icon = "gears" enabled = False - staging_dir = "$HIP/ayon/{product_name}/{product_name}.usd" + staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.usd" def create(self, subset_name, instance_data, pre_create_data): @@ -28,7 +28,7 @@ def create(self, subset_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) filepath = self.staging_dir.format( - product_name="`chs(\"subset\")`" # keep dynamic link to subset + product={"name": subset_name} ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py b/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py index f883489574..a3976d9872 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py @@ -14,7 +14,7 @@ class CreateVDBCache(plugin.HoudiniCreator): label = "VDB Cache" family = "vdbcache" icon = "cloud" - staging_dir = "$HIP/ayon/{product_name}/{product_name}.$F4.vdb" + staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.$F4.vdb" def create(self, subset_name, instance_data, pre_create_data): import hou @@ -32,7 +32,7 @@ def create(self, subset_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) filepath = self.staging_dir.format( - product_name="`chs(\"subset\")`" # keep dynamic link to subset + product={"name": subset_name} ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py index 84f268b920..c67dbaf886 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py @@ -15,8 +15,8 @@ class CreateVrayROP(plugin.HoudiniCreator): family = "vray_rop" icon = "magic" ext = "exr" - render_staging_dir = "$HIP/ayon/{product_name}/render/{product_name}.$AOV.$F4.{ext}", - vrscene_dir = "$HIP/ayon/{product_name}/vrscene/{product_name}.$F4.vrscene" + render_staging_dir = "$HIP/ayon/{product[name]}/render/{product[name]}.$AOV.$F4.{ext}", + vrscene_dir = "$HIP/ayon/{product[name]}/vrscene/{product[name]}.$F4.vrscene" # Default to split export and render jobs export_job = True @@ -60,7 +60,7 @@ def create(self, subset_name, instance_data, pre_create_data): if pre_create_data.get("export_job"): scene_filepath = self.vrscene_dir.format( - product_name="`chs(\"subset\")`" # keep dynamic link to subset + product={"name": subset_name} ) # Setting render_export_mode to "2" because that's for # "Export only" ("1" is for "Export & Render") @@ -83,7 +83,7 @@ def create(self, subset_name, instance_data, pre_create_data): if pre_create_data.get("render_element_enabled", True): # Vray has its own tag for AOV file output filepath = self.render_staging_dir.format( - product_name="`chs(\"subset\")`", # keep dynamic link to subset + product={"name": subset_name}, ext=ext ) @@ -102,7 +102,7 @@ def create(self, subset_name, instance_data, pre_create_data): else: filepath = self.render_staging_dir.format( - product_name="`chs(\"subset\")`", # keep dynamic link to subset + product={"name": subset_name}, ext=ext ).replace(".$AOV", "") diff --git a/server_addon/houdini/server/settings/create.py b/server_addon/houdini/server/settings/create.py index 136e2c5f45..0fbe3f0bdc 100644 --- a/server_addon/houdini/server/settings/create.py +++ b/server_addon/houdini/server/settings/create.py @@ -148,73 +148,73 @@ class CreatePluginsModel(BaseSettingsModel): "CreateAlembicCamera": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product_name}/{product_name}.abc" + "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.abc" }, "CreateArnoldAss": { "enabled": True, "default_variants": ["Main"], "ext": ".ass", - "staging_dir": "$HIP/ayon/{product_name}/{product_name}.$F4.{ext}" + "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" }, "CreateArnoldRop": { "enabled": True, "default_variants": ["Main"], - "render_staging_dir": "$HIP/ayon/{product_name}/render/{product_name}.$F4.{ext}", - "ass_dir": "$HIP/ayon/{product_name}/ass/{product_name}.$F4.{ext}" + "render_staging_dir": "$HIP/ayon/{product[name]}/render/{product[name]}.$F4.{ext}", + "ass_dir": "$HIP/ayon/{product[name]}/ass/{product[name]}.$F4.{ext}" }, "CreateCompositeSequence": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product_name}/{product_name}.$F4.{ext}" + "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" }, "CreateHDA": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product_name}/{product_name}.{ext}" + "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.{ext}" }, "CreateKarmaROP": { "enabled": True, "default_variants": ["Main"], - "render_staging_dir": "$HIP/ayon/{product_name}/render/{product_name}.$F4.{ext}", - "checkpoint_dir": "$HIP/ayon/{product_name}/checkpoint/{product_name}.$F4.checkpoint", - "usd_dir": "$HIP/ayon/{product_name}/usd/{product_name}_$RENDERID" + "render_staging_dir": "$HIP/ayon/{product[name]}/render/{product[name]}.$F4.{ext}", + "checkpoint_dir": "$HIP/ayon/{product[name]}/checkpoint/{product[name]}.$F4.checkpoint", + "usd_dir": "$HIP/ayon/{product[name]}/usd/{product[name]}_$RENDERID" }, "CreateMantraIFD": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product_name}/{product_name}.$F4.ifd" + "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.$F4.ifd" }, "CreateMantraROP": { "enabled": True, "default_variants": ["Main"], - "render_staging_dir": "$HIP/ayon/{product_name}/render/{product_name}.$F4.{ext}", - "ifd_dir": "$HIP/ayon/{product_name}/ifd/{product_name}.$F4.ifd" + "render_staging_dir": "$HIP/ayon/{product[name]}/render/{product[name]}.$F4.{ext}", + "ifd_dir": "$HIP/ayon/{product[name]}/ifd/{product[name]}.$F4.ifd" }, "CreatePointCache": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product_name}/{product_name}.abc" + "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.abc" }, "CreateBGEO": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product_name}/{product_name}.$F4.{ext}" + "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" }, "CreateRedshiftProxy": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product_name}/{product_name}.$F4.rs" + "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.$F4.rs" }, "CreateRedshiftROP": { "enabled": True, "default_variants": ["Main"], - "render_staging_dir": "$HIP/ayon/{product_name}/render/{product_name}.$AOV.$F4.{ext}", - "rs_dir": "$HIP/ayon/{product_name}/rs/{product_name}.$F4.rs" + "render_staging_dir": "$HIP/ayon/{product[name]}/render/{product[name]}.$AOV.$F4.{ext}", + "rs_dir": "$HIP/ayon/{product[name]}/rs/{product[name]}.$F4.rs" }, "CreateReview": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product_name}/{product_name}.$F4.{ext}" + "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" }, "CreateStaticMesh": { "enabled": True, @@ -228,12 +228,12 @@ class CreatePluginsModel(BaseSettingsModel): "USP", "UCX" ], - "staging_dir": "$HIP/ayon/{product_name}/{product_name}.fbx" + "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.fbx" }, "CreateUSD": { "enabled": False, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product_name}/{product_name}.usd" + "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.usd" }, "CreateUSDRender": { "enabled": False, @@ -243,12 +243,12 @@ class CreatePluginsModel(BaseSettingsModel): "CreateVDBCache": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product_name}/{product_name}.$F4.vdb" + "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.$F4.vdb" }, "CreateVrayROP": { "enabled": True, "default_variants": ["Main"], - "render_staging_dir": "$HIP/ayon/{product_name}/render/{product_name}.$AOV.$F4.{ext}", - "vrscene_dir": "$HIP/ayon/{product_name}/vrscene/{product_name}.$F4.vrscene" + "render_staging_dir": "$HIP/ayon/{product[name]}/render/{product[name]}.$AOV.$F4.{ext}", + "vrscene_dir": "$HIP/ayon/{product[name]}/vrscene/{product[name]}.$F4.vrscene" }, } From 7b3ae236fe0bd44d8d0453339ab5214d87262aca Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 15 Feb 2024 21:44:49 +0200 Subject: [PATCH 11/86] fix some bug --- server_addon/houdini/server/settings/create.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server_addon/houdini/server/settings/create.py b/server_addon/houdini/server/settings/create.py index 0fbe3f0bdc..5318935d55 100644 --- a/server_addon/houdini/server/settings/create.py +++ b/server_addon/houdini/server/settings/create.py @@ -120,8 +120,8 @@ class CreatePluginsModel(BaseSettingsModel): CreateRedshiftProxy: CreatorModel = SettingsField( default_factory=CreatorModel, title="Create Redshift Proxy") - CreateRedshiftROP: CreatorModel = SettingsField( - default_factory=CreatorModel, + CreateRedshiftROP: CreateRedshiftROPModel = SettingsField( + default_factory=CreateRedshiftROPModel, title="Create Redshift ROP") CreateReview: CreatorModel = SettingsField( default_factory=CreatorModel, From 51b378d79b1c501c3f864d2a40d18b5828c5c677 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 22 Feb 2024 20:15:40 +0200 Subject: [PATCH 12/86] BigRoy's comment - Allow admins to select product types for the collector --- .../houdini/server/settings/publish.py | 38 ++++++++++++++++++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/server_addon/houdini/server/settings/publish.py b/server_addon/houdini/server/settings/publish.py index eb895b429e..f81bba974a 100644 --- a/server_addon/houdini/server/settings/publish.py +++ b/server_addon/houdini/server/settings/publish.py @@ -20,6 +20,39 @@ class CollectChunkSizeModel(BaseSettingsModel): title="Frames Per Task") +def product_types_enum(): + return [ + {"value": "camera", "label": "Camera (Abc)"}, + {"value": "pointcache", "label": "PointCache (Abc)/PointCache (Bgeo)"}, + {"value": "review", "staticMesh": "Static Mesh (FBX)"}, + {"value": "usd", "label": "USD (experimental)"}, + {"value": "vdbcache", "label": "VDB Cache"}, + {"value": "imagesequence", "label": "Composite (Image Sequence)"}, + {"value": "review", "review": "Review"}, + {"value": "ass", "label": "Arnold ASS"}, + # {"value": "arnold_rop", "label": "Arnold ROP"}, + {"value": "mantraifd", "label": "Mantra IFD"}, + # {"value": "mantra_rop", "label": "Mantra ROP"}, + {"value": "redshiftproxy", "label": "Redshift Proxy"}, + # {"value": "redshift_rop", "label": "Redshift ROP"}, + # {"value": "karma_rop", "label": "Karma ROP"}, + # {"value": "vray_rop", "label": "VRay ROP"}, + ] + + +class CollectFilesForCleaningUpModel(BaseSettingsModel): + enabled: bool = SettingsField(title="Enabled") + optional: bool = SettingsField(title="Optional") + active: bool = SettingsField(title="Active") + + families: list[str] = SettingsField( + default_factory=list, + enum_resolver=product_types_enum, + conditionalEnum=True, + title="Product Types", + ) + + class ValidateWorkfilePathsModel(BaseSettingsModel): enabled: bool = SettingsField(title="Enabled") optional: bool = SettingsField(title="Optional") @@ -49,7 +82,7 @@ class PublishPluginsModel(BaseSettingsModel): default_factory=CollectChunkSizeModel, title="Collect Chunk Size." ) - CollectFilesForCleaningUp:BasicValidateModel = SettingsField( + CollectFilesForCleaningUp:CollectFilesForCleaningUpModel = SettingsField( default_factory=BasicValidateModel, title="Collect Files For Cleaning Up." ) @@ -86,7 +119,8 @@ class PublishPluginsModel(BaseSettingsModel): "CollectFilesForCleaningUp": { "enabled": False, "optional": True, - "active": True + "active": True, + "families" : [] }, "ValidateContainers": { "enabled": True, From cf7fa9b732b18e60fa9de48585a930cd824a947c Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 29 Feb 2024 23:30:24 +0200 Subject: [PATCH 13/86] fix a typo with a class attribute --- .../ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py index 69407420d0..1b631f36ac 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py @@ -11,7 +11,7 @@ class CreateMantraROP(plugin.HoudiniCreator): label = "Mantra ROP" product_type = "mantra_rop" icon = "magic" - render_staging_dir = "$HIP/ayon/{product[name]}/render/{product[name]}.$F4.{ext}", + render_staging_dir = "$HIP/ayon/{product[name]}/render/{product[name]}.$F4.{ext}" ifd_dir = "$HIP/ayon/{product[name]}/ifd/{product[name]}.$F4.ifd" # Default to split export and render jobs From 492f021ce4200b0e92133d3167ee51a868384a38 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 29 Feb 2024 23:31:33 +0200 Subject: [PATCH 14/86] add one more setting to CollectFilesForCleaningUpModel --- server_addon/houdini/server/settings/publish.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server_addon/houdini/server/settings/publish.py b/server_addon/houdini/server/settings/publish.py index f81bba974a..2f32553382 100644 --- a/server_addon/houdini/server/settings/publish.py +++ b/server_addon/houdini/server/settings/publish.py @@ -44,7 +44,7 @@ class CollectFilesForCleaningUpModel(BaseSettingsModel): enabled: bool = SettingsField(title="Enabled") optional: bool = SettingsField(title="Optional") active: bool = SettingsField(title="Active") - + include_intermediate_files: bool = SettingsField(title="Include Intermediate Render Files") families: list[str] = SettingsField( default_factory=list, enum_resolver=product_types_enum, @@ -120,6 +120,7 @@ class PublishPluginsModel(BaseSettingsModel): "enabled": False, "optional": True, "active": True, + "include_intermediate_files": False, "families" : [] }, "ValidateContainers": { From 76b38b40b27b0cd07f0bb938c51535cc49875c03 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 29 Feb 2024 23:37:25 +0200 Subject: [PATCH 15/86] use lib function to get output parameters --- .../publish/collect_files_for_cleaning_up.py | 65 ++----------------- 1 file changed, 7 insertions(+), 58 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py index 215e3fb2ed..4682c0bcb6 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -1,6 +1,7 @@ import pyblish.api import os from ayon_core.pipeline import AYONPyblishPluginMixin +from ayon_core.hosts.houdini.api import lib class CollectFilesForCleaningUp(pyblish.api.InstancePlugin, @@ -38,11 +39,13 @@ def process(self, instance): import hou node = hou.node(instance.data["instance_node"]) - filepath = self.get_filepath(node) - - if not filepath: - self.log.warning("No filepath value to collect.") + output_parm = lib.get_output_parameter(node) + if not output_parm: + self.log.debug("ROP node type '{}' is not supported for cleaning up." + .format(node.type().name())) return + + filepath = output_parm.eval() staging_dir, _ = os.path.split(filepath) files = instance.data.get("frames", []) @@ -56,57 +59,3 @@ def process(self, instance): self.log.debug("Add files to 'cleanupFullPaths': {}".format(files)) instance.context.data["cleanupFullPaths"] += files - - def get_filepath(self, node): - # Get sop path - node_type = node.type().name() - filepath = None - if node_type == "geometry": - filepath = node.evalParm("sopoutput") - - elif node_type == "comp": - filepath = node.evalParm("copoutput") - - elif node_type == "alembic": - filepath = node.evalParm("filename") - - elif node_type == "ifd": - if node.evalParm("soho_outputmode"): - filepath = node.evalParm("soho_diskfile") - else: - filepath = node.evalParm("vm_picture") - - elif node_type == "Redshift_Proxy_Output": - filepath = node.evalParm("RS_archive_file") - - elif node_type == "Redshift_ROP": - filepath = node.evalParm("RS_outputFileNamePrefix") - - elif node_type == "opengl": - filepath = node.evalParm("picture") - - elif node_type == "filmboxfbx": - filepath = node.evalParm("sopoutput") - - elif node_type == "usd": - filepath = node.evalParm("lopoutput") - - elif node_type == "karma": - filepath = node.evalParm("picture") - - elif node_type == "arnold": - if node.evalParm("ar_ass_export_enable"): - filepath = node.evalParm("ar_ass_file") - else: - filepath = node.evalParm("ar_picture") - - elif node_type == "vray_renderer": - filepath = node.evalParm("SettingsOutput_img_file_path") - - else: - self.log.debug( - "ROP node type '{}' is not supported for cleaning up." - .format(node_type) - ) - - return filepath \ No newline at end of file From 2a80259461a807bb2f83b31abb5b18f915631f55 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 29 Feb 2024 23:42:04 +0200 Subject: [PATCH 16/86] update code logic to get the files to cleanup --- .../publish/collect_files_for_cleaning_up.py | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py index 4682c0bcb6..d395dd2bb0 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -46,12 +46,36 @@ def process(self, instance): return filepath = output_parm.eval() - + if not filepath: + self.log.warning("No filepath value to collect.") + return + + files = [] + # Non Render Products with frames + frames = instance.data.get("frames", []) staging_dir, _ = os.path.split(filepath) - files = instance.data.get("frames", []) - if files: - files = ["{}/{}".format(staging_dir, f) for f in files] + if isinstance(frames, str): + files = ["{}/{}".format(staging_dir, frames)] else: + files = ["{}/{}".format(staging_dir, f) for f in frames] + + # Render Products + expectedFiles = instance.data.get("expectedFiles", []) + for aov in expectedFiles: + for v in aov.values(): + files += v + + # Render Intermediate files. + # This doesn't cover all intermediate render products. + # E.g. Karma's USD and checkpoint. + # For some reason it's one file with $F4 evaluated as 0000 + # So, we need to get all the frames. + ifdFile = instance.data.get("ifdFile") + if self.include_intermediate_files and ifdFile: + files += [ifdFile] + + # Non Render Products with no frames + if not files: files = [filepath] self.log.debug("Add directories to 'cleanupEmptyDir': {}".format(staging_dir)) From bb31dc3a69ba689c71464d366958b43ef4d62e22 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 4 Mar 2024 17:54:38 +0200 Subject: [PATCH 17/86] consistent staging directories --- .../plugins/create/create_alembic_camera.py | 6 +++-- .../plugins/create/create_karma_rop.py | 5 +++-- .../plugins/create/create_mantra_ifd.py | 6 +++-- .../plugins/create/create_mantra_rop.py | 5 +++-- .../plugins/create/create_pointcache.py | 6 +++-- .../plugins/create/create_redshift_proxy.py | 4 +++- .../plugins/create/create_redshift_rop.py | 5 +++-- .../plugins/create/create_staticmesh.py | 6 +++-- .../houdini/plugins/create/create_usd.py | 6 +++-- .../plugins/create/create_vbd_cache.py | 6 +++-- .../houdini/plugins/create/create_vray_rop.py | 5 +++-- .../houdini/server/settings/create.py | 22 +++++++++---------- 12 files changed, 50 insertions(+), 32 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py b/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py index 98aa3e2371..04df1e57f8 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py @@ -13,7 +13,8 @@ class CreateAlembicCamera(plugin.HoudiniCreator): label = "Camera (Abc)" product_type = "camera" icon = "camera" - staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.abc" + ext = "abc" + staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.{ext}" def create(self, product_name, instance_data, pre_create_data): import hou @@ -29,7 +30,8 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) filepath = self.staging_dir.format( - product={"name": product_name} + product={"name": product_name}, + ext=self.ext ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py index 90e2d30380..74a5cad90a 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py @@ -12,7 +12,7 @@ class CreateKarmaROP(plugin.HoudiniCreator): product_type = "karma_rop" icon = "magic" render_staging_dir = "$HIP/ayon/{product[name]}/render/{product[name]}.$F4.{ext}" - checkpoint_dir = "$HIP/ayon/{product[name]}/checkpoint/{product[name]}.$F4.checkpoint" + checkpoint_dir = "$HIP/ayon/{product[name]}/checkpoint/{product[name]}.$F4.{ext}" usd_dir = "$HIP/ayon/{product_name}/usd/{product_name}_$RENDERID" def create(self, product_name, instance_data, pre_create_data): @@ -40,7 +40,8 @@ def create(self, product_name, instance_data, pre_create_data): ) checkpoint = self.checkpoint_dir.format( - product={"name": product_name} + product={"name": product_name}, + ext="checkpoint" ) usd_directory = self.usd_dir.format( diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py index 9449840eed..c1dfbf43fb 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py @@ -11,7 +11,8 @@ class CreateMantraIFD(plugin.HoudiniCreator): label = "Mantra IFD" product_type = "mantraifd" icon = "gears" - staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.$F4.ifd" + ext = "ifd" + staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" def create(self, product_name, instance_data, pre_create_data): import hou @@ -28,7 +29,8 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) filepath = self.staging_dir.format( - product={"name": product_name} + product={"name": product_name}, + ext=self.ext ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py index 1b631f36ac..4232da632c 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py @@ -12,7 +12,7 @@ class CreateMantraROP(plugin.HoudiniCreator): product_type = "mantra_rop" icon = "magic" render_staging_dir = "$HIP/ayon/{product[name]}/render/{product[name]}.$F4.{ext}" - ifd_dir = "$HIP/ayon/{product[name]}/ifd/{product[name]}.$F4.ifd" + ifd_dir = "$HIP/ayon/{product[name]}/ifd/{product[name]}.$F4.{ext}" # Default to split export and render jobs export_job = True @@ -50,7 +50,8 @@ def create(self, product_name, instance_data, pre_create_data): if pre_create_data.get("export_job"): ifd_filepath = self.ifd_dir.format( - product={"name": product_name} + product={"name": product_name}, + ext="ifd" ) parms["soho_outputmode"] = 1 diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py b/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py index b282a97843..e58ebe6eb4 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py @@ -13,7 +13,8 @@ class CreatePointCache(plugin.HoudiniCreator): label = "PointCache (Abc)" product_type = "pointcache" icon = "gears" - staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.abc" + ext = "abc" + staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.{ext}" def create(self, product_name, instance_data, pre_create_data): instance_data.pop("active", None) @@ -30,7 +31,8 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) filepath = self.staging_dir.format( - product={"name": product_name} + product={"name": product_name}, + ext=self.ext ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py index 2a0ae6bd17..457cb3d117 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py @@ -11,7 +11,8 @@ class CreateRedshiftProxy(plugin.HoudiniCreator): label = "Redshift Proxy" product_type = "redshiftproxy" icon = "magic" - staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.$F4.rs" + ext = "rs" + staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" def create(self, product_name, instance_data, pre_create_data): @@ -39,6 +40,7 @@ def create(self, product_name, instance_data, pre_create_data): filepath = self.staging_dir.format( product={"name": product_name}, + ext=self.ext ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py index 5913aa225f..f4f566e01d 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py @@ -15,7 +15,7 @@ class CreateRedshiftROP(plugin.HoudiniCreator): icon = "magic" ext = "exr" render_staging_dir = "$HIP/ayon/{product[name]}/render/{product[name]}.$AOV.$F4.{ext}" - rs_dir = "$HIP/ayon/{product[name]}/rs/{product[name]}.$F4.rs" + rs_dir = "$HIP/ayon/{product[name]}/rs/{product[name]}.$F4.{ext}" # Default to split export and render jobs split_render = True @@ -85,7 +85,8 @@ def create(self, product_name, instance_data, pre_create_data): parms["RS_renderCamera"] = camera or "" rs_filepath = self.rs_dir.format( - product={"name": product_name} + product={"name": product_name}, + ext="rs" ) parms["RS_archive_file"] = rs_filepath diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py b/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py index be93939991..1f2a34b823 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py @@ -15,7 +15,8 @@ class CreateStaticMesh(plugin.HoudiniCreator): icon = "fa5s.cubes" default_variants = ["Main"] - staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.fbx" + ext = "fbx" + staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.{ext}" def create(self, product_name, instance_data, pre_create_data): @@ -31,7 +32,8 @@ def create(self, product_name, instance_data, pre_create_data): # prepare parms filepath = self.staging_dir.format( - product={"name": product_name} + product={"name": product_name}, + ext=self.ext ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_usd.py b/client/ayon_core/hosts/houdini/plugins/create/create_usd.py index a78d8fb78c..955d1d0e43 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_usd.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_usd.py @@ -13,7 +13,8 @@ class CreateUSD(plugin.HoudiniCreator): product_type = "usd" icon = "gears" enabled = False - staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.usd" + ext = "usd" + staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.{ext}" def create(self, product_name, instance_data, pre_create_data): @@ -28,7 +29,8 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) filepath = self.staging_dir.format( - product={"name": product_name} + product={"name": product_name}, + ext=self.ext ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py b/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py index 91d83e4979..df1c11a409 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py @@ -14,7 +14,8 @@ class CreateVDBCache(plugin.HoudiniCreator): label = "VDB Cache" product_type = "vdbcache" icon = "cloud" - staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.$F4.vdb" + ext = "vdb" + staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" def create(self, product_name, instance_data, pre_create_data): import hou @@ -32,7 +33,8 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) filepath = self.staging_dir.format( - product={"name": product_name} + product={"name": product_name}, + ext=self.ext ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py index b5800f8eea..2d0f960a80 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py @@ -16,7 +16,7 @@ class CreateVrayROP(plugin.HoudiniCreator): icon = "magic" ext = "exr" render_staging_dir = "$HIP/ayon/{product[name]}/render/{product[name]}.$AOV.$F4.{ext}", - vrscene_dir = "$HIP/ayon/{product[name]}/vrscene/{product[name]}.$F4.vrscene" + vrscene_dir = "$HIP/ayon/{product[name]}/vrscene/{product[name]}.$F4.{ext}" # Default to split export and render jobs export_job = True @@ -60,7 +60,8 @@ def create(self, product_name, instance_data, pre_create_data): if pre_create_data.get("export_job"): scene_filepath = self.vrscene_dir.format( - product={"name": product_name} + product={"name": product_name}, + ext="vrscene" ) # Setting render_export_mode to "2" because that's for # "Export only" ("1" is for "Export & Render") diff --git a/server_addon/houdini/server/settings/create.py b/server_addon/houdini/server/settings/create.py index 5318935d55..03a3774969 100644 --- a/server_addon/houdini/server/settings/create.py +++ b/server_addon/houdini/server/settings/create.py @@ -148,7 +148,7 @@ class CreatePluginsModel(BaseSettingsModel): "CreateAlembicCamera": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.abc" + "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.{ext}" }, "CreateArnoldAss": { "enabled": True, @@ -176,24 +176,24 @@ class CreatePluginsModel(BaseSettingsModel): "enabled": True, "default_variants": ["Main"], "render_staging_dir": "$HIP/ayon/{product[name]}/render/{product[name]}.$F4.{ext}", - "checkpoint_dir": "$HIP/ayon/{product[name]}/checkpoint/{product[name]}.$F4.checkpoint", + "checkpoint_dir": "$HIP/ayon/{product[name]}/checkpoint/{product[name]}.$F4.{ext}", "usd_dir": "$HIP/ayon/{product[name]}/usd/{product[name]}_$RENDERID" }, "CreateMantraIFD": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.$F4.ifd" + "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" }, "CreateMantraROP": { "enabled": True, "default_variants": ["Main"], "render_staging_dir": "$HIP/ayon/{product[name]}/render/{product[name]}.$F4.{ext}", - "ifd_dir": "$HIP/ayon/{product[name]}/ifd/{product[name]}.$F4.ifd" + "ifd_dir": "$HIP/ayon/{product[name]}/ifd/{product[name]}.$F4.{ext}" }, "CreatePointCache": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.abc" + "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.{ext}" }, "CreateBGEO": { "enabled": True, @@ -203,13 +203,13 @@ class CreatePluginsModel(BaseSettingsModel): "CreateRedshiftProxy": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.$F4.rs" + "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" }, "CreateRedshiftROP": { "enabled": True, "default_variants": ["Main"], "render_staging_dir": "$HIP/ayon/{product[name]}/render/{product[name]}.$AOV.$F4.{ext}", - "rs_dir": "$HIP/ayon/{product[name]}/rs/{product[name]}.$F4.rs" + "rs_dir": "$HIP/ayon/{product[name]}/rs/{product[name]}.$F4.{ext}" }, "CreateReview": { "enabled": True, @@ -228,12 +228,12 @@ class CreatePluginsModel(BaseSettingsModel): "USP", "UCX" ], - "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.fbx" + "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.{ext}" }, "CreateUSD": { "enabled": False, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.usd" + "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.{ext}" }, "CreateUSDRender": { "enabled": False, @@ -243,12 +243,12 @@ class CreatePluginsModel(BaseSettingsModel): "CreateVDBCache": { "enabled": True, "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.$F4.vdb" + "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" }, "CreateVrayROP": { "enabled": True, "default_variants": ["Main"], "render_staging_dir": "$HIP/ayon/{product[name]}/render/{product[name]}.$AOV.$F4.{ext}", - "vrscene_dir": "$HIP/ayon/{product[name]}/vrscene/{product[name]}.$F4.vrscene" + "vrscene_dir": "$HIP/ayon/{product[name]}/vrscene/{product[name]}.$F4.{ext}" }, } From 5667ee014cefc29e86a2994969b40b92bb8c258e Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 4 Mar 2024 18:12:19 +0200 Subject: [PATCH 18/86] use dynamic product name in created Houdini ROPs --- .../hosts/houdini/plugins/create/create_alembic_camera.py | 2 +- .../hosts/houdini/plugins/create/create_arnold_ass.py | 2 +- .../hosts/houdini/plugins/create/create_arnold_rop.py | 4 ++-- .../ayon_core/hosts/houdini/plugins/create/create_bgeo.py | 2 +- .../hosts/houdini/plugins/create/create_composite.py | 2 +- client/ayon_core/hosts/houdini/plugins/create/create_hda.py | 2 +- .../hosts/houdini/plugins/create/create_karma_rop.py | 6 +++--- .../hosts/houdini/plugins/create/create_mantra_ifd.py | 2 +- .../hosts/houdini/plugins/create/create_mantra_rop.py | 4 ++-- .../hosts/houdini/plugins/create/create_pointcache.py | 2 +- .../hosts/houdini/plugins/create/create_redshift_proxy.py | 2 +- .../hosts/houdini/plugins/create/create_redshift_rop.py | 4 ++-- .../hosts/houdini/plugins/create/create_staticmesh.py | 2 +- client/ayon_core/hosts/houdini/plugins/create/create_usd.py | 2 +- .../hosts/houdini/plugins/create/create_vbd_cache.py | 2 +- .../hosts/houdini/plugins/create/create_vray_rop.py | 6 +++--- 16 files changed, 23 insertions(+), 23 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py b/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py index 04df1e57f8..69971a908b 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py @@ -30,7 +30,7 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) filepath = self.staging_dir.format( - product={"name": product_name}, + product={"name": "`chs(\"AYON_productName\")`"}, ext=self.ext ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py index 987fc3d78e..b0ae30ea93 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py @@ -41,7 +41,7 @@ def create(self, product_name, instance_data, pre_create_data): instance_node.setParmTemplateGroup(parm_template_group) filepath = self.staging_dir.format( - product={"name": product_name}, + product={"name": "`chs(\"AYON_productName\")`"}, ext=self.ext.lstrip(".") ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py index 546e45fac7..b05f790917 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py @@ -40,7 +40,7 @@ def create(self, product_name, instance_data, pre_create_data): ext = pre_create_data.get("image_format") filepath = self.render_staging_dir.format( - product={"name": product_name}, + product={"name": "`chs(\"AYON_productName\")`"}, ext=ext ) @@ -55,7 +55,7 @@ def create(self, product_name, instance_data, pre_create_data): if pre_create_data.get("export_job"): ass_filepath = self.ass_dir.format( - product={"name": product_name}, + product={"name": "`chs(\"AYON_productName\")`"}, ext="ass" ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py b/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py index df468608ec..1f17c892ce 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py @@ -31,7 +31,7 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) filepath = self.staging_dir.format( - product={"name": product_name}, + product={"name": "`chs(\"AYON_productName\")`"}, ext=pre_create_data.get("bgeo_type") or "bgeo.sc" ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_composite.py b/client/ayon_core/hosts/houdini/plugins/create/create_composite.py index 294d302798..64a815ecae 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_composite.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_composite.py @@ -30,7 +30,7 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) filepath = self.staging_dir.format( - product={"name": product_name}, + product={"name": "`chs(\"AYON_productName\")`"}, ext=self.ext ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_hda.py b/client/ayon_core/hosts/houdini/plugins/create/create_hda.py index f0adfe283f..3777ecc7e3 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_hda.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_hda.py @@ -62,7 +62,7 @@ def create_instance_node( # for consistency I'm using {subset} as it's # the same key used in other creators filepath = self.staging_dir.format( - product={"name": node_name}, + product={"name": "`chs(\"AYON_productName\")`"}, ext=self.ext ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py index 74a5cad90a..d4d11faa63 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py @@ -35,17 +35,17 @@ def create(self, product_name, instance_data, pre_create_data): ext = pre_create_data.get("image_format") filepath = self.render_staging_dir.format( - product={"name": product_name}, + product={"name": "`chs(\"AYON_productName\")`"}, ext=ext ) checkpoint = self.checkpoint_dir.format( - product={"name": product_name}, + product={"name": "`chs(\"AYON_productName\")`"}, ext="checkpoint" ) usd_directory = self.usd_dir.format( - product={"name": product_name} + product={"name": "`chs(\"AYON_productName\")`"}, ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py index c1dfbf43fb..acf59917e7 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py @@ -29,7 +29,7 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) filepath = self.staging_dir.format( - product={"name": product_name}, + product={"name": "`chs(\"AYON_productName\")`"}, ext=self.ext ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py index 4232da632c..2677ca81a5 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py @@ -37,7 +37,7 @@ def create(self, product_name, instance_data, pre_create_data): ext = pre_create_data.get("image_format") filepath = self.render_staging_dir.format( - product={"name": product_name}, + product={"name": "`chs(\"AYON_productName\")`"}, ext=ext ) @@ -50,7 +50,7 @@ def create(self, product_name, instance_data, pre_create_data): if pre_create_data.get("export_job"): ifd_filepath = self.ifd_dir.format( - product={"name": product_name}, + product={"name": "`chs(\"AYON_productName\")`"}, ext="ifd" ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py b/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py index e58ebe6eb4..b1804940d1 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py @@ -31,7 +31,7 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) filepath = self.staging_dir.format( - product={"name": product_name}, + product={"name": "`chs(\"AYON_productName\")`"}, ext=self.ext ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py index 457cb3d117..e8062ddd77 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py @@ -39,7 +39,7 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) filepath = self.staging_dir.format( - product={"name": product_name}, + product={"name": "`chs(\"AYON_productName\")`"}, ext=self.ext ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py index f4f566e01d..646e1fe216 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py @@ -60,7 +60,7 @@ def create(self, product_name, instance_data, pre_create_data): ext = pre_create_data.get("image_format") filepath = self.render_staging_dir.format( - product={"name": product_name}, + product={"name": "`chs(\"AYON_productName\")`"}, ext=ext ) @@ -85,7 +85,7 @@ def create(self, product_name, instance_data, pre_create_data): parms["RS_renderCamera"] = camera or "" rs_filepath = self.rs_dir.format( - product={"name": product_name}, + product={"name": "`chs(\"AYON_productName\")`"}, ext="rs" ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py b/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py index 1f2a34b823..bbfb64ac03 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py @@ -32,7 +32,7 @@ def create(self, product_name, instance_data, pre_create_data): # prepare parms filepath = self.staging_dir.format( - product={"name": product_name}, + product={"name": "`chs(\"AYON_productName\")`"}, ext=self.ext ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_usd.py b/client/ayon_core/hosts/houdini/plugins/create/create_usd.py index 955d1d0e43..3c17d7695e 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_usd.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_usd.py @@ -29,7 +29,7 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) filepath = self.staging_dir.format( - product={"name": product_name}, + product={"name": "`chs(\"AYON_productName\")`"}, ext=self.ext ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py b/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py index df1c11a409..7b201c726b 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py @@ -33,7 +33,7 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) filepath = self.staging_dir.format( - product={"name": product_name}, + product={"name": "`chs(\"AYON_productName\")`"}, ext=self.ext ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py index 2d0f960a80..74b155c5ab 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py @@ -60,7 +60,7 @@ def create(self, product_name, instance_data, pre_create_data): if pre_create_data.get("export_job"): scene_filepath = self.vrscene_dir.format( - product={"name": product_name}, + product={"name": "`chs(\"AYON_productName\")`"}, ext="vrscene" ) # Setting render_export_mode to "2" because that's for @@ -84,7 +84,7 @@ def create(self, product_name, instance_data, pre_create_data): if pre_create_data.get("render_element_enabled", True): # Vray has its own tag for AOV file output filepath = self.render_staging_dir.format( - product={"name": product_name}, + product={"name": "`chs(\"AYON_productName\")`"}, ext=ext ) @@ -103,7 +103,7 @@ def create(self, product_name, instance_data, pre_create_data): else: filepath = self.render_staging_dir.format( - product={"name": product_name}, + product={"name": "`chs(\"AYON_productName\")`"}, ext=ext ).replace(".$AOV", "") From 930dbce25e148a90354d39eb8a258770aa96e5f7 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 4 Mar 2024 18:22:39 +0200 Subject: [PATCH 19/86] use os.path.join instead of string format --- .../houdini/plugins/publish/collect_files_for_cleaning_up.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py index d395dd2bb0..811a9bfceb 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -55,9 +55,9 @@ def process(self, instance): frames = instance.data.get("frames", []) staging_dir, _ = os.path.split(filepath) if isinstance(frames, str): - files = ["{}/{}".format(staging_dir, frames)] + files = [os.path.join(staging_dir, frames)] else: - files = ["{}/{}".format(staging_dir, f) for f in frames] + files = [os.path.join(staging_dir, f) for f in frames] # Render Products expectedFiles = instance.data.get("expectedFiles", []) From 54eb86c86030765a76775354a8c707349bc0d302 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 4 Mar 2024 19:01:31 +0200 Subject: [PATCH 20/86] use better list operations --- .../publish/collect_files_for_cleaning_up.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py index 811a9bfceb..3a18ccb87e 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -30,7 +30,8 @@ class CollectFilesForCleaningUp(pyblish.api.InstancePlugin, "review", "staticMesh", "usd", - "vdbcache" + "vdbcache", + "redshift_rop" ] label = "Collect Files For Cleaning Up" @@ -61,9 +62,9 @@ def process(self, instance): # Render Products expectedFiles = instance.data.get("expectedFiles", []) - for aov in expectedFiles: - for v in aov.values(): - files += v + for aovs in expectedFiles: + # aovs.values() is a list of lists + files.extend(sum(aovs.values(), [])) # Render Intermediate files. # This doesn't cover all intermediate render products. @@ -72,11 +73,11 @@ def process(self, instance): # So, we need to get all the frames. ifdFile = instance.data.get("ifdFile") if self.include_intermediate_files and ifdFile: - files += [ifdFile] + files.append(ifdFile) # Non Render Products with no frames if not files: - files = [filepath] + files.append(filepath) self.log.debug("Add directories to 'cleanupEmptyDir': {}".format(staging_dir)) instance.context.data["cleanupEmptyDirs"].append(staging_dir) From 5e4138e0ec417dfea02c18c6f48728304dfbb524 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 4 Mar 2024 21:17:43 +0200 Subject: [PATCH 21/86] add TODO for Intermediate render files --- .../plugins/publish/collect_files_for_cleaning_up.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py index 3a18ccb87e..f4d9c3acf8 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -66,11 +66,13 @@ def process(self, instance): # aovs.values() is a list of lists files.extend(sum(aovs.values(), [])) - # Render Intermediate files. - # This doesn't cover all intermediate render products. - # E.g. Karma's USD and checkpoint. - # For some reason it's one file with $F4 evaluated as 0000 - # So, we need to get all the frames. + # Intermediate render files. + # TODO 1:For products with split render enabled, + # We need to calculate all exported frames. as. + # `ifdFile` should be a list of files. + # TODO 2: For products like Karma, + # Karma has more intermediate files + # e.g. USD and checkpoint ifdFile = instance.data.get("ifdFile") if self.include_intermediate_files and ifdFile: files.append(ifdFile) From d7c0dff7b75ff776b27e81d8218791e4e2ac4f60 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 4 Mar 2024 21:25:30 +0200 Subject: [PATCH 22/86] skip collector if no instance node found --- .../plugins/publish/collect_files_for_cleaning_up.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py index f4d9c3acf8..02ee5f940e 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -39,7 +39,11 @@ def process(self, instance): import hou - node = hou.node(instance.data["instance_node"]) + node = hou.node(instance.data.get("instance_node", "")) + if not node: + self.log.debug("Skipping Collector. Instance has no instance_node") + return + output_parm = lib.get_output_parameter(node) if not output_parm: self.log.debug("ROP node type '{}' is not supported for cleaning up." From 746819ef517e84f049b83ffcb67746a3061ed5aa Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 4 Mar 2024 21:40:53 +0200 Subject: [PATCH 23/86] better variable/setting naming and add description for it --- .../plugins/publish/collect_files_for_cleaning_up.py | 4 ++-- server_addon/houdini/server/settings/publish.py | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py index 02ee5f940e..501e8d4f85 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -70,7 +70,7 @@ def process(self, instance): # aovs.values() is a list of lists files.extend(sum(aovs.values(), [])) - # Intermediate render files. + # Intermediate exported render files. # TODO 1:For products with split render enabled, # We need to calculate all exported frames. as. # `ifdFile` should be a list of files. @@ -78,7 +78,7 @@ def process(self, instance): # Karma has more intermediate files # e.g. USD and checkpoint ifdFile = instance.data.get("ifdFile") - if self.include_intermediate_files and ifdFile: + if self.intermediate_exported_render and ifdFile: files.append(ifdFile) # Non Render Products with no frames diff --git a/server_addon/houdini/server/settings/publish.py b/server_addon/houdini/server/settings/publish.py index 2f32553382..c340dbeb27 100644 --- a/server_addon/houdini/server/settings/publish.py +++ b/server_addon/houdini/server/settings/publish.py @@ -44,7 +44,11 @@ class CollectFilesForCleaningUpModel(BaseSettingsModel): enabled: bool = SettingsField(title="Enabled") optional: bool = SettingsField(title="Optional") active: bool = SettingsField(title="Active") - include_intermediate_files: bool = SettingsField(title="Include Intermediate Render Files") + intermediate_exported_render: bool = SettingsField( + title="Include Intermediate Exported Render Files", + description="Include intermediate exported render scenes for cleanup" + " (.idf, .ass, .usd, .rs) for render instances.", + ) families: list[str] = SettingsField( default_factory=list, enum_resolver=product_types_enum, @@ -120,7 +124,7 @@ class PublishPluginsModel(BaseSettingsModel): "enabled": False, "optional": True, "active": True, - "include_intermediate_files": False, + "intermediate_exported_render": False, "families" : [] }, "ValidateContainers": { From 607a2666c388e4342bb1d972a9c60145bd792370 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 4 Mar 2024 22:41:35 +0200 Subject: [PATCH 24/86] move create_file_list to Houdini's lib --- client/ayon_core/hosts/houdini/api/lib.py | 36 ++++++++++++++++++ .../houdini/plugins/publish/collect_frames.py | 38 +------------------ 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/client/ayon_core/hosts/houdini/api/lib.py b/client/ayon_core/hosts/houdini/api/lib.py index 9db055779d..29a893cf12 100644 --- a/client/ayon_core/hosts/houdini/api/lib.py +++ b/client/ayon_core/hosts/houdini/api/lib.py @@ -1054,3 +1054,39 @@ def add_self_publish_button(node): template = node.parmTemplateGroup() template.insertBefore((0,), button_parm) node.setParmTemplateGroup(template) + + +def create_file_list(match, start_frame, end_frame): + """Collect files based on frame range and `regex.match` + + Args: + match(re.match): match object + start_frame(int): start of the animation + end_frame(int): end of the animation + + Returns: + list + + """ + + # Get the padding length + frame = match.group(1) + padding = len(frame) + + # Get the parts of the filename surrounding the frame number, + # so we can put our own frame numbers in. + span = match.span(1) + prefix = match.string[: span[0]] + suffix = match.string[span[1]:] + + # Generate filenames for all frames + result = [] + for i in range(start_frame, end_frame + 1): + + # Format frame number by the padding amount + str_frame = "{number:0{width}d}".format(number=i, width=padding) + + file_name = prefix + str_frame + suffix + result.append(file_name) + + return result \ No newline at end of file diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_frames.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_frames.py index a643ab0d38..6931f29e1c 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_frames.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_frames.py @@ -54,46 +54,10 @@ def process(self, instance): # Check if frames are bigger than 1 (file collection) # override the result if end_frame - start_frame > 0: - result = self.create_file_list( + result = lib.create_file_list( match, int(start_frame), int(end_frame) ) # todo: `frames` currently conflicts with "explicit frames" for a # for a custom frame list. So this should be refactored. instance.data.update({"frames": result}) - - @staticmethod - def create_file_list(match, start_frame, end_frame): - """Collect files based on frame range and `regex.match` - - Args: - match(re.match): match object - start_frame(int): start of the animation - end_frame(int): end of the animation - - Returns: - list - - """ - - # Get the padding length - frame = match.group(1) - padding = len(frame) - - # Get the parts of the filename surrounding the frame number, - # so we can put our own frame numbers in. - span = match.span(1) - prefix = match.string[: span[0]] - suffix = match.string[span[1]:] - - # Generate filenames for all frames - result = [] - for i in range(start_frame, end_frame + 1): - - # Format frame number by the padding amount - str_frame = "{number:0{width}d}".format(number=i, width=padding) - - file_name = prefix + str_frame + suffix - result.append(file_name) - - return result From 4b9a75075ad9831881c6c43e5ec98ebfce7edf4f Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 4 Mar 2024 22:43:45 +0200 Subject: [PATCH 25/86] Implement TODO: get_ifd_file_list --- .../publish/collect_files_for_cleaning_up.py | 37 ++++++++++++++++--- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py index 501e8d4f85..a28cb6e72e 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -1,5 +1,6 @@ import pyblish.api import os +import re from ayon_core.pipeline import AYONPyblishPluginMixin from ayon_core.hosts.houdini.api import lib @@ -34,6 +35,7 @@ class CollectFilesForCleaningUp(pyblish.api.InstancePlugin, "redshift_rop" ] label = "Collect Files For Cleaning Up" + intermediate_exported_render = False def process(self, instance): @@ -71,15 +73,17 @@ def process(self, instance): files.extend(sum(aovs.values(), [])) # Intermediate exported render files. - # TODO 1:For products with split render enabled, - # We need to calculate all exported frames. as. - # `ifdFile` should be a list of files. - # TODO 2: For products like Karma, + # TODO : For products like Karma, # Karma has more intermediate files # e.g. USD and checkpoint ifdFile = instance.data.get("ifdFile") if self.intermediate_exported_render and ifdFile: - files.append(ifdFile) + start_frame = instance.data.get("frameStartHandle", None) + end_frame = instance.data.get("frameEndHandle", None) + + ifd_files = self._get_ifd_file_list(ifdFile, + start_frame, end_frame) + files.extend(ifd_files) # Non Render Products with no frames if not files: @@ -90,3 +94,26 @@ def process(self, instance): self.log.debug("Add files to 'cleanupFullPaths': {}".format(files)) instance.context.data["cleanupFullPaths"] += files + + @staticmethod + def _get_ifd_file_list(ifdFile, start_frame, end_frame): + + file_name = os.path.basename(ifdFile) + parent_path = os.path.dirname(ifdFile) + + pattern = r"\w+\.(0+).\w+" # It's always (0000) + match = re.match(pattern, file_name) + + if match and start_frame is not None: + + # Check if frames are bigger than 1 (file collection) + # override the result + if end_frame - start_frame > 0: + result = lib.create_file_list( + match, int(start_frame), int(end_frame) + ) + result = [os.path.join(parent_path, r) for r in result] + + return result + + return [] \ No newline at end of file From ffd84d45bb8333df75e54f553e060a907a34ce15 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 4 Mar 2024 22:44:31 +0200 Subject: [PATCH 26/86] uncomment products in product_types_enum --- server_addon/houdini/server/settings/publish.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server_addon/houdini/server/settings/publish.py b/server_addon/houdini/server/settings/publish.py index c340dbeb27..13d7f4c14f 100644 --- a/server_addon/houdini/server/settings/publish.py +++ b/server_addon/houdini/server/settings/publish.py @@ -30,13 +30,13 @@ def product_types_enum(): {"value": "imagesequence", "label": "Composite (Image Sequence)"}, {"value": "review", "review": "Review"}, {"value": "ass", "label": "Arnold ASS"}, - # {"value": "arnold_rop", "label": "Arnold ROP"}, + {"value": "arnold_rop", "label": "Arnold ROP"}, {"value": "mantraifd", "label": "Mantra IFD"}, - # {"value": "mantra_rop", "label": "Mantra ROP"}, + {"value": "mantra_rop", "label": "Mantra ROP"}, {"value": "redshiftproxy", "label": "Redshift Proxy"}, - # {"value": "redshift_rop", "label": "Redshift ROP"}, - # {"value": "karma_rop", "label": "Karma ROP"}, - # {"value": "vray_rop", "label": "VRay ROP"}, + {"value": "redshift_rop", "label": "Redshift ROP"}, + {"value": "karma_rop", "label": "Karma ROP"}, + {"value": "vray_rop", "label": "VRay ROP"}, ] From 405f9a07a16ef4aa13d8654b12d3acf322dbaf99 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 4 Mar 2024 22:59:23 +0200 Subject: [PATCH 27/86] use forward slashed with generated file list --- .../houdini/plugins/publish/collect_files_for_cleaning_up.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py index a28cb6e72e..f637f680e4 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -112,7 +112,10 @@ def _get_ifd_file_list(ifdFile, start_frame, end_frame): result = lib.create_file_list( match, int(start_frame), int(end_frame) ) - result = [os.path.join(parent_path, r) for r in result] + result = [ + os.path.join(parent_path, r).replace("\\", "/") + for r in result + ] return result From d5101b73600949b1769ad8950e9f3ad8fda1948b Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 5 Mar 2024 16:12:39 +0200 Subject: [PATCH 28/86] put return in a correct place --- .../houdini/plugins/publish/collect_files_for_cleaning_up.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py index f637f680e4..3356c6bd0d 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -117,6 +117,6 @@ def _get_ifd_file_list(ifdFile, start_frame, end_frame): for r in result ] - return result + return result return [] \ No newline at end of file From ccaba9340bc9177b35b5eca05d4d651faabf21e1 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 22 Apr 2024 15:20:03 +0200 Subject: [PATCH 29/86] update comments --- .../publish/collect_files_for_cleaning_up.py | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py index 3356c6bd0d..e170dce4e0 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -8,7 +8,7 @@ class CollectFilesForCleaningUp(pyblish.api.InstancePlugin, AYONPyblishPluginMixin): """Collect Files For Cleaning Up. - + This collector collects output files and adds them to file remove list. @@ -45,20 +45,20 @@ def process(self, instance): if not node: self.log.debug("Skipping Collector. Instance has no instance_node") return - + output_parm = lib.get_output_parameter(node) if not output_parm: self.log.debug("ROP node type '{}' is not supported for cleaning up." .format(node.type().name())) return - + filepath = output_parm.eval() if not filepath: self.log.warning("No filepath value to collect.") return files = [] - # Non Render Products with frames + # Products with frames frames = instance.data.get("frames", []) staging_dir, _ = os.path.split(filepath) if isinstance(frames, str): @@ -66,7 +66,7 @@ def process(self, instance): else: files = [os.path.join(staging_dir, f) for f in frames] - # Render Products + # Farm Products with expected files expectedFiles = instance.data.get("expectedFiles", []) for aovs in expectedFiles: # aovs.values() is a list of lists @@ -74,7 +74,7 @@ def process(self, instance): # Intermediate exported render files. # TODO : For products like Karma, - # Karma has more intermediate files + # Karma has more intermediate files # e.g. USD and checkpoint ifdFile = instance.data.get("ifdFile") if self.intermediate_exported_render and ifdFile: @@ -84,14 +84,14 @@ def process(self, instance): ifd_files = self._get_ifd_file_list(ifdFile, start_frame, end_frame) files.extend(ifd_files) - - # Non Render Products with no frames + + # Products with single output file/frame if not files: files.append(filepath) self.log.debug("Add directories to 'cleanupEmptyDir': {}".format(staging_dir)) instance.context.data["cleanupEmptyDirs"].append(staging_dir) - + self.log.debug("Add files to 'cleanupFullPaths': {}".format(files)) instance.context.data["cleanupFullPaths"] += files @@ -113,10 +113,10 @@ def _get_ifd_file_list(ifdFile, start_frame, end_frame): match, int(start_frame), int(end_frame) ) result = [ - os.path.join(parent_path, r).replace("\\", "/") + os.path.join(parent_path, r).replace("\\", "/") for r in result ] - return result - - return [] \ No newline at end of file + return result + + return [] From af13d6af91dc6930b26c89abe2d7f22ee09e0f9a Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 22 Apr 2024 15:23:37 +0200 Subject: [PATCH 30/86] revert changes --- .../houdini/server/settings/create.py | 134 ++++-------------- 1 file changed, 28 insertions(+), 106 deletions(-) diff --git a/server_addon/houdini/server/settings/create.py b/server_addon/houdini/server/settings/create.py index 03a3774969..203ca4f9d6 100644 --- a/server_addon/houdini/server/settings/create.py +++ b/server_addon/houdini/server/settings/create.py @@ -8,7 +8,6 @@ class CreatorModel(BaseSettingsModel): title="Default Products", default_factory=list, ) - staging_dir: str = SettingsField(title="Staging Directory") class CreateArnoldAssModel(BaseSettingsModel): @@ -18,58 +17,6 @@ class CreateArnoldAssModel(BaseSettingsModel): default_factory=list, ) ext: str = SettingsField(Title="Extension") - staging_dir: str = SettingsField(title="Staging Directory") - - -class CreateArnoldRopModel(BaseSettingsModel): - enabled: bool = SettingsField(title="Enabled") - default_variants: list[str] = SettingsField( - title="Default Products", - default_factory=list, - ) - render_staging_dir: str = SettingsField(title="Render Staging Directory") - ass_dir: str = SettingsField(title="Ass Directory") - - -class CreateKarmaROPModel(BaseSettingsModel): - enabled: bool = SettingsField(title="Enabled") - default_variants: list[str] = SettingsField( - title="Default Products", - default_factory=list, - ) - render_staging_dir: str = SettingsField(title="Render Staging Directory") - checkpoint_dir: str = SettingsField(title="Checkpoint Directory") - usd_dir: str = SettingsField(title="USD Directory") - - -class CreateMantraROPModel(BaseSettingsModel): - enabled: bool = SettingsField(title="Enabled") - default_variants: list[str] = SettingsField( - title="Default Products", - default_factory=list, - ) - render_staging_dir: str = SettingsField(title="Render Staging Directory") - ifd_dir: str = SettingsField(title="IFD Directory") - - -class CreateRedshiftROPModel(BaseSettingsModel): - enabled: bool = SettingsField(title="Enabled") - default_variants: list[str] = SettingsField( - title="Default Products", - default_factory=list, - ) - render_staging_dir: str = SettingsField(title="Render Staging Directory") - rs_dir: str = SettingsField(title="RS Directory") - - -class CreateVrayROPModel(BaseSettingsModel): - enabled: bool = SettingsField(title="Enabled") - default_variants: list[str] = SettingsField( - title="Default Products", - default_factory=list, - ) - render_staging_dir: str = SettingsField(title="Render Staging Directory") - vrscene_dir: str = SettingsField(title="VRay scene Directory") class CreateStaticMeshModel(BaseSettingsModel): @@ -83,7 +30,6 @@ class CreateStaticMeshModel(BaseSettingsModel): default_factory=list, title="Collision Prefixes" ) - staging_dir: str = SettingsField(title="Staging Directory") class CreatePluginsModel(BaseSettingsModel): @@ -93,8 +39,8 @@ class CreatePluginsModel(BaseSettingsModel): CreateArnoldAss: CreateArnoldAssModel = SettingsField( default_factory=CreateArnoldAssModel, title="Create Arnold Ass") - CreateArnoldRop: CreateArnoldRopModel = SettingsField( - default_factory=CreateArnoldRopModel, + CreateArnoldRop: CreatorModel = SettingsField( + default_factory=CreatorModel, title="Create Arnold ROP") CreateCompositeSequence: CreatorModel = SettingsField( default_factory=CreatorModel, @@ -102,14 +48,14 @@ class CreatePluginsModel(BaseSettingsModel): CreateHDA: CreatorModel = SettingsField( default_factory=CreatorModel, title="Create Houdini Digital Asset") - CreateKarmaROP: CreateKarmaROPModel = SettingsField( - default_factory=CreateKarmaROPModel, + CreateKarmaROP: CreatorModel = SettingsField( + default_factory=CreatorModel, title="Create Karma ROP") CreateMantraIFD: CreatorModel = SettingsField( default_factory=CreatorModel, title="Create Mantra IFD") - CreateMantraROP: CreateMantraROPModel = SettingsField( - default_factory=CreateMantraROPModel, + CreateMantraROP: CreatorModel = SettingsField( + default_factory=CreatorModel, title="Create Mantra ROP") CreatePointCache: CreatorModel = SettingsField( default_factory=CreatorModel, @@ -120,8 +66,8 @@ class CreatePluginsModel(BaseSettingsModel): CreateRedshiftProxy: CreatorModel = SettingsField( default_factory=CreatorModel, title="Create Redshift Proxy") - CreateRedshiftROP: CreateRedshiftROPModel = SettingsField( - default_factory=CreateRedshiftROPModel, + CreateRedshiftROP: CreatorModel = SettingsField( + default_factory=CreatorModel, title="Create Redshift ROP") CreateReview: CreatorModel = SettingsField( default_factory=CreatorModel, @@ -139,82 +85,64 @@ class CreatePluginsModel(BaseSettingsModel): CreateVDBCache: CreatorModel = SettingsField( default_factory=CreatorModel, title="Create VDB Cache") - CreateVrayROP: CreateVrayROPModel = SettingsField( - default_factory=CreateVrayROPModel, + CreateVrayROP: CreatorModel = SettingsField( + default_factory=CreatorModel, title="Create VRay ROP") DEFAULT_HOUDINI_CREATE_SETTINGS = { "CreateAlembicCamera": { "enabled": True, - "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.{ext}" + "default_variants": ["Main"] }, "CreateArnoldAss": { "enabled": True, "default_variants": ["Main"], - "ext": ".ass", - "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" + "ext": ".ass" }, "CreateArnoldRop": { "enabled": True, - "default_variants": ["Main"], - "render_staging_dir": "$HIP/ayon/{product[name]}/render/{product[name]}.$F4.{ext}", - "ass_dir": "$HIP/ayon/{product[name]}/ass/{product[name]}.$F4.{ext}" + "default_variants": ["Main"] }, "CreateCompositeSequence": { "enabled": True, - "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" + "default_variants": ["Main"] }, "CreateHDA": { "enabled": True, - "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.{ext}" + "default_variants": ["Main"] }, "CreateKarmaROP": { "enabled": True, - "default_variants": ["Main"], - "render_staging_dir": "$HIP/ayon/{product[name]}/render/{product[name]}.$F4.{ext}", - "checkpoint_dir": "$HIP/ayon/{product[name]}/checkpoint/{product[name]}.$F4.{ext}", - "usd_dir": "$HIP/ayon/{product[name]}/usd/{product[name]}_$RENDERID" + "default_variants": ["Main"] }, "CreateMantraIFD": { "enabled": True, - "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" + "default_variants": ["Main"] }, "CreateMantraROP": { "enabled": True, - "default_variants": ["Main"], - "render_staging_dir": "$HIP/ayon/{product[name]}/render/{product[name]}.$F4.{ext}", - "ifd_dir": "$HIP/ayon/{product[name]}/ifd/{product[name]}.$F4.{ext}" + "default_variants": ["Main"] }, "CreatePointCache": { "enabled": True, - "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.{ext}" + "default_variants": ["Main"] }, "CreateBGEO": { "enabled": True, - "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" + "default_variants": ["Main"] }, "CreateRedshiftProxy": { "enabled": True, - "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" + "default_variants": ["Main"] }, "CreateRedshiftROP": { "enabled": True, - "default_variants": ["Main"], - "render_staging_dir": "$HIP/ayon/{product[name]}/render/{product[name]}.$AOV.$F4.{ext}", - "rs_dir": "$HIP/ayon/{product[name]}/rs/{product[name]}.$F4.{ext}" + "default_variants": ["Main"] }, "CreateReview": { "enabled": True, - "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" + "default_variants": ["Main"] }, "CreateStaticMesh": { "enabled": True, @@ -227,28 +155,22 @@ class CreatePluginsModel(BaseSettingsModel): "UCP", "USP", "UCX" - ], - "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.{ext}" + ] }, "CreateUSD": { "enabled": False, - "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.{ext}" + "default_variants": ["Main"] }, "CreateUSDRender": { "enabled": False, - "default_variants": ["Main"], - "staging_dir": "$HIP/ayon" + "default_variants": ["Main"] }, "CreateVDBCache": { "enabled": True, - "default_variants": ["Main"], - "staging_dir": "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" + "default_variants": ["Main"] }, "CreateVrayROP": { "enabled": True, - "default_variants": ["Main"], - "render_staging_dir": "$HIP/ayon/{product[name]}/render/{product[name]}.$AOV.$F4.{ext}", - "vrscene_dir": "$HIP/ayon/{product[name]}/vrscene/{product[name]}.$F4.{ext}" + "default_variants": ["Main"] }, } From ed5c5f09a98db152a9ec968ab76eb05fb112237d Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 22 Apr 2024 15:25:26 +0200 Subject: [PATCH 31/86] add CollectFilesForCleaningUp --- server_addon/houdini/server/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/houdini/server/version.py b/server_addon/houdini/server/version.py index b5c9b6cb71..11ef092868 100644 --- a/server_addon/houdini/server/version.py +++ b/server_addon/houdini/server/version.py @@ -1 +1 @@ -__version__ = "0.2.12" +__version__ = "0.2.13" From 2c53fcf8e5cebc301787a755b920d88f59fe8d47 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 22 Apr 2024 15:43:34 +0200 Subject: [PATCH 32/86] fix typo --- .../houdini/plugins/create/create_pointcache.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py b/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py index b1804940d1..4c9a0d9b37 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py @@ -13,8 +13,6 @@ class CreatePointCache(plugin.HoudiniCreator): label = "PointCache (Abc)" product_type = "pointcache" icon = "gears" - ext = "abc" - staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.{ext}" def create(self, product_name, instance_data, pre_create_data): instance_data.pop("active", None) @@ -29,12 +27,6 @@ def create(self, product_name, instance_data, pre_create_data): pre_create_data) instance_node = hou.node(instance.get("instance_node")) - - filepath = self.staging_dir.format( - product={"name": "`chs(\"AYON_productName\")`"}, - ext=self.ext - ) - parms = { "use_sop_path": True, "build_from_path": True, @@ -42,7 +34,8 @@ def create(self, product_name, instance_data, pre_create_data): "prim_to_detail_pattern": "cbId", "format": 2, "facesets": 0, - "filename": filepath + "filename": hou.text.expandString( + "$HIP/pyblish/{}.abc".format(product_name)) } if self.selected_nodes: @@ -112,7 +105,7 @@ def get_obj_output(self, obj_node): elif len(outputs) == 1: return outputs[0] - # if there are more than one, then it have multiple ouput nodes + # if there are more than one, then it have multiple output nodes # return the one with the minimum 'outputidx' else: return min(outputs, From fee69d102de6aa75d40ef6b9582604ad2800195a Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 22 Apr 2024 15:44:05 +0200 Subject: [PATCH 33/86] tweak filepath a little bit --- .../hosts/houdini/plugins/create/create_pointcache.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py b/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py index 4c9a0d9b37..e3dab9ed41 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py @@ -27,6 +27,13 @@ def create(self, product_name, instance_data, pre_create_data): pre_create_data) instance_node = hou.node(instance.get("instance_node")) + + filepath = "{staging_dir}/{product_name}.abc".format( + staging_dir=hou.text.expandString("$HIP/pyblish/"), + # keep dynamic link to product name + product_name="`chs(\"AYON_productName\")`", + ) + parms = { "use_sop_path": True, "build_from_path": True, @@ -34,8 +41,7 @@ def create(self, product_name, instance_data, pre_create_data): "prim_to_detail_pattern": "cbId", "format": 2, "facesets": 0, - "filename": hou.text.expandString( - "$HIP/pyblish/{}.abc".format(product_name)) + "filename": filepath } if self.selected_nodes: From 0ceec686e1596703a77ac2aae583a9e2fb5202c6 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 22 Apr 2024 15:45:48 +0200 Subject: [PATCH 34/86] tweak filepath a little bit --- .../houdini/plugins/create/create_alembic_camera.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py b/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py index 6eeb51eeac..60025ff3c0 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py @@ -13,8 +13,6 @@ class CreateAlembicCamera(plugin.HoudiniCreator): label = "Camera (Abc)" product_type = "camera" icon = "camera" - ext = "abc" - staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.{ext}" def create(self, product_name, instance_data, pre_create_data): import hou @@ -29,9 +27,10 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) - filepath = self.staging_dir.format( - product={"name": "`chs(\"AYON_productName\")`"}, - ext=self.ext + filepath = "{staging_dir}/{product_name}.abc".format( + staging_dir=hou.text.expandString("$HIP/pyblish/"), + # keep dynamic link to product name + product_name="`chs(\"AYON_productName\")`", ) parms = { From b0c62d314b90b08154581f658dab6b65cc7f830e Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 22 Apr 2024 15:58:31 +0200 Subject: [PATCH 35/86] tweak filepath a little bit --- .../hosts/houdini/plugins/create/create_arnold_ass.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py index e7ff01edee..469b643875 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py @@ -16,7 +16,6 @@ class CreateArnoldAss(plugin.HoudiniCreator): # however calling HoudiniCreator.create() # will override it by the value in the project settings ext = ".ass" - staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.{ext}" def create(self, product_name, instance_data, pre_create_data): import hou @@ -40,9 +39,11 @@ def create(self, product_name, instance_data, pre_create_data): parm_template_group.hideFolder("Properties", True) instance_node.setParmTemplateGroup(parm_template_group) - filepath = self.staging_dir.format( - product={"name": "`chs(\"AYON_productName\")`"}, - ext=self.ext.lstrip(".") + filepath = "{staging_dir}/{product_name}.$F4.{ext}".format( + staging_dir=hou.text.expandString("$HIP/pyblish"), + # keep dynamic link to product name + product_name="`chs(\"AYON_productName\")`", + ext=self.ext.lstrip(".") # ignore the dot in self.ext ) parms = { From 064029ccfe6e40d27d972ca50253d9261a99e3cb Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 22 Apr 2024 16:00:02 +0200 Subject: [PATCH 36/86] remove redundant `/` in filepath --- .../hosts/houdini/plugins/create/create_alembic_camera.py | 2 +- .../ayon_core/hosts/houdini/plugins/create/create_pointcache.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py b/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py index 60025ff3c0..95afa77249 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py @@ -28,7 +28,7 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) filepath = "{staging_dir}/{product_name}.abc".format( - staging_dir=hou.text.expandString("$HIP/pyblish/"), + staging_dir=hou.text.expandString("$HIP/pyblish"), # keep dynamic link to product name product_name="`chs(\"AYON_productName\")`", ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py b/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py index e3dab9ed41..2913f3cdbf 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py @@ -29,7 +29,7 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) filepath = "{staging_dir}/{product_name}.abc".format( - staging_dir=hou.text.expandString("$HIP/pyblish/"), + staging_dir=hou.text.expandString("$HIP/pyblish"), # keep dynamic link to product name product_name="`chs(\"AYON_productName\")`", ) From bdbbd290f9e6d924aacb80c908835bae0ec102fd Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 22 Apr 2024 16:00:59 +0200 Subject: [PATCH 37/86] update comment --- .../ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py index 469b643875..908f80851c 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py @@ -43,7 +43,7 @@ def create(self, product_name, instance_data, pre_create_data): staging_dir=hou.text.expandString("$HIP/pyblish"), # keep dynamic link to product name product_name="`chs(\"AYON_productName\")`", - ext=self.ext.lstrip(".") # ignore the dot in self.ext + ext=self.ext.lstrip(".") # ignore the dot in self.ext ) parms = { From 662a93146658484ce1b2f99306f8ae492c52ad02 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 22 Apr 2024 16:09:45 +0200 Subject: [PATCH 38/86] tweak filepaths a little bit --- .../plugins/create/create_arnold_rop.py | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py index 2a5cb21bc0..bf79207e66 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py @@ -9,8 +9,6 @@ class CreateArnoldRop(plugin.HoudiniCreator): label = "Arnold ROP" product_type = "arnold_rop" icon = "magic" - render_staging_dir = "$HIP/ayon/{product[name]}/render/{product[name]}.$F4.{ext}" - ass_dir = "$HIP/ayon/{product[name]}/ass/{product[name]}.$F4.{ext}" # Default extension ext = "exr" @@ -39,11 +37,12 @@ def create(self, product_name, instance_data, pre_create_data): ext = pre_create_data.get("image_format") - filepath = self.render_staging_dir.format( - product={"name": "`chs(\"AYON_productName\")`"}, - ext=ext + filepath = "{render_dir}/{product_name}/{product_name}.$F4.{ext}".format( + render_dir=hou.text.expandString("$HIP/pyblish/renders"), + # keep dynamic link to product name + product_name="`chs(\"AYON_productName\")`", + ext=ext, ) - parms = { # Render frame range "trange": 1, @@ -54,11 +53,11 @@ def create(self, product_name, instance_data, pre_create_data): } if pre_create_data.get("export_job"): - ass_filepath = self.ass_dir.format( - product={"name": "`chs(\"AYON_productName\")`"}, - ext="ass" - ) - + ass_filepath = "{render_dir}/{product_name}/ass/{product_name}.$F4.ass".format( + render_dir=hou.text.expandString("$HIP/pyblish/renders/"), + # keep dynamic link to product name + product_name="`chs(\"AYON_productName\")`", + ) parms["ar_ass_export_enable"] = 1 parms["ar_ass_file"] = ass_filepath From ed26f80a13b686ca7ebb8ec4f3a8d01d7406e09b Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 22 Apr 2024 16:14:09 +0200 Subject: [PATCH 39/86] tweak filepath a little bit --- .../ayon_core/hosts/houdini/plugins/create/create_bgeo.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py b/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py index a6a55b3ab8..e8c7717354 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py @@ -12,7 +12,6 @@ class CreateBGEO(plugin.HoudiniCreator): label = "PointCache (Bgeo)" product_type = "pointcache" icon = "gears" - staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" def create(self, product_name, instance_data, pre_create_data): @@ -30,11 +29,12 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) - filepath = self.staging_dir.format( - product={"name": "`chs(\"AYON_productName\")`"}, + filepath = "{staging_dir}/{product_name}.{ext}".format( + staging_dir=hou.text.expandString("$HIP/pyblish"), + # keep dynamic link to product name + product_name="`chs(\"AYON_productName\")`", ext=pre_create_data.get("bgeo_type") or "bgeo.sc" ) - parms = { "sopoutput": filepath } From 3652021bb9b1295ce4f87804cb0774f7b1eb0f31 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 22 Apr 2024 16:58:25 +0200 Subject: [PATCH 40/86] tweak filepath a little bit - add dynamic link to productname and use ayon dir instead of pyblish --- .../plugins/create/create_alembic_camera.py | 4 +- .../plugins/create/create_arnold_ass.py | 4 +- .../plugins/create/create_arnold_rop.py | 4 +- .../houdini/plugins/create/create_bgeo.py | 4 +- .../plugins/create/create_composite.py | 9 +++-- .../houdini/plugins/create/create_hda.py | 11 ++---- .../plugins/create/create_karma_rop.py | 31 +++++++++------ .../plugins/create/create_mantra_ifd.py | 10 ++--- .../plugins/create/create_mantra_rop.py | 21 +++++----- .../plugins/create/create_pointcache.py | 4 +- .../plugins/create/create_redshift_proxy.py | 9 ++--- .../plugins/create/create_redshift_rop.py | 18 ++++----- .../houdini/plugins/create/create_review.py | 9 +++-- .../plugins/create/create_staticmesh.py | 9 ++--- .../houdini/plugins/create/create_usd.py | 8 ++-- .../plugins/create/create_vbd_cache.py | 10 ++--- .../houdini/plugins/create/create_vray_rop.py | 39 ++++++++++++------- 17 files changed, 108 insertions(+), 96 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py b/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py index 95afa77249..f4c1634fbe 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py @@ -27,8 +27,8 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) - filepath = "{staging_dir}/{product_name}.abc".format( - staging_dir=hou.text.expandString("$HIP/pyblish"), + filepath = "{staging_dir}/{product_name}/{product_name}.abc".format( + staging_dir=hou.text.expandString("$HIP/ayon"), # keep dynamic link to product name product_name="`chs(\"AYON_productName\")`", ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py index 908f80851c..abbc1730ec 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py @@ -39,8 +39,8 @@ def create(self, product_name, instance_data, pre_create_data): parm_template_group.hideFolder("Properties", True) instance_node.setParmTemplateGroup(parm_template_group) - filepath = "{staging_dir}/{product_name}.$F4.{ext}".format( - staging_dir=hou.text.expandString("$HIP/pyblish"), + filepath = "{staging_dir}/{product_name}/{product_name}.$F4.{ext}".format( + staging_dir=hou.text.expandString("$HIP/ayon"), # keep dynamic link to product name product_name="`chs(\"AYON_productName\")`", ext=self.ext.lstrip(".") # ignore the dot in self.ext diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py index bf79207e66..02a41464fc 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py @@ -38,7 +38,7 @@ def create(self, product_name, instance_data, pre_create_data): ext = pre_create_data.get("image_format") filepath = "{render_dir}/{product_name}/{product_name}.$F4.{ext}".format( - render_dir=hou.text.expandString("$HIP/pyblish/renders"), + render_dir=hou.text.expandString("$HIP/ayon/renders"), # keep dynamic link to product name product_name="`chs(\"AYON_productName\")`", ext=ext, @@ -54,7 +54,7 @@ def create(self, product_name, instance_data, pre_create_data): if pre_create_data.get("export_job"): ass_filepath = "{render_dir}/{product_name}/ass/{product_name}.$F4.ass".format( - render_dir=hou.text.expandString("$HIP/pyblish/renders/"), + render_dir=hou.text.expandString("$HIP/ayon/renders/"), # keep dynamic link to product name product_name="`chs(\"AYON_productName\")`", ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py b/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py index e8c7717354..b6ab391044 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py @@ -29,8 +29,8 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) - filepath = "{staging_dir}/{product_name}.{ext}".format( - staging_dir=hou.text.expandString("$HIP/pyblish"), + filepath = "{staging_dir}/{product_name}/{product_name}.$F4.{ext}".format( + staging_dir=hou.text.expandString("$HIP/ayon"), # keep dynamic link to product name product_name="`chs(\"AYON_productName\")`", ext=pre_create_data.get("bgeo_type") or "bgeo.sc" diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_composite.py b/client/ayon_core/hosts/houdini/plugins/create/create_composite.py index 0a6d3fc187..6fee077b1c 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_composite.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_composite.py @@ -13,7 +13,7 @@ class CreateCompositeSequence(plugin.HoudiniCreator): label = "Composite (Image Sequence)" product_type = "imagesequence" icon = "gears" - staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" + ext = "exr" def create(self, product_name, instance_data, pre_create_data): @@ -28,9 +28,10 @@ def create(self, product_name, instance_data, pre_create_data): pre_create_data) instance_node = hou.node(instance.get("instance_node")) - - filepath = self.staging_dir.format( - product={"name": "`chs(\"AYON_productName\")`"}, + filepath = "{staging_dir}/{product_name}/{product_name}.$F4.{ext}".format( + staging_dir=hou.text.expandString("$HIP/ayon"), + # keep dynamic link to product name + product_name="`chs(\"AYON_productName\")`", ext=self.ext ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_hda.py b/client/ayon_core/hosts/houdini/plugins/create/create_hda.py index 54129f6928..8cfd06e5ef 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_hda.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_hda.py @@ -15,8 +15,6 @@ class CreateHDA(plugin.HoudiniCreator): product_type = "hda" icon = "gears" maintain_selection = False - staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.{ext}" - ext = "hda" def _check_existing(self, folder_path, product_name): # type: (str, str) -> bool @@ -58,11 +56,10 @@ def create_instance_node( raise CreatorError( "cannot create hda from node {}".format(to_hda)) - # for consistency I'm using {subset} as it's - # the same key used in other creators - filepath = self.staging_dir.format( - product={"name": "`chs(\"AYON_productName\")`"}, - ext=self.ext + filepath = "{staging_dir}/HDAs/{product_name}.hda".format( + staging_dir=hou.text.expandString("$HIP/ayon"), + # keep dynamic link to product name + product_name="`chs(\"AYON_productName\")`" ) hda_node = to_hda.createDigitalAsset( diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py index 2ada4ff3de..a00527e210 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py @@ -10,9 +10,6 @@ class CreateKarmaROP(plugin.HoudiniCreator): label = "Karma ROP" product_type = "karma_rop" icon = "magic" - render_staging_dir = "$HIP/ayon/{product[name]}/render/{product[name]}.$F4.{ext}" - checkpoint_dir = "$HIP/ayon/{product[name]}/checkpoint/{product[name]}.$F4.{ext}" - usd_dir = "$HIP/ayon/{product_name}/usd/{product_name}_$RENDERID" def create(self, product_name, instance_data, pre_create_data): import hou # noqa @@ -33,18 +30,28 @@ def create(self, product_name, instance_data, pre_create_data): ext = pre_create_data.get("image_format") - filepath = self.render_staging_dir.format( - product={"name": "`chs(\"AYON_productName\")`"}, - ext=ext + filepath = "{render_dir}/{product_name}/{product_name}.$F4.{ext}".format( + render_dir=hou.text.expandString("$HIP/ayon/renders"), + # keep dynamic link to product name + product_name="`chs(\"AYON_productName\")`", + ext=ext, ) - - checkpoint = self.checkpoint_dir.format( - product={"name": "`chs(\"AYON_productName\")`"}, - ext="checkpoint" + checkpoint = ( + "{render_dir}/{product_name}/checkpoints/{product_name}.$F4.checkpoint" + .format( + render_dir=hou.text.expandString("$HIP/ayon/renders"), + # keep dynamic link to product name + product_name="`chs(\"AYON_productName\")`", + ) ) - usd_directory = self.usd_dir.format( - product={"name": "`chs(\"AYON_productName\")`"}, + usd_directory = ( + "{render_dir}/{product_name}/usd/{product_name}_$RENDERID" + .format( + render_dir=hou.text.expandString("$HIP/ayon/renders"), + # keep dynamic link to product name + product_name="`chs(\"AYON_productName\")`" + ) ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py index bc2d79b19e..9fa9e969ea 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py @@ -10,8 +10,6 @@ class CreateMantraIFD(plugin.HoudiniCreator): label = "Mantra IFD" product_type = "mantraifd" icon = "gears" - ext = "ifd" - staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" def create(self, product_name, instance_data, pre_create_data): import hou @@ -27,11 +25,11 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) - filepath = self.staging_dir.format( - product={"name": "`chs(\"AYON_productName\")`"}, - ext=self.ext + filepath = "{staging_dir}/{product_name}/{product_name}.$F4.ifd".format( + staging_dir=hou.text.expandString("$HIP/ayon"), + # keep dynamic link to product name + product_name="`chs(\"AYON_productName\")`" ) - parms = { # Render frame range "trange": 1, diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py index e380755830..445296bd6a 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py @@ -10,8 +10,6 @@ class CreateMantraROP(plugin.HoudiniCreator): label = "Mantra ROP" product_type = "mantra_rop" icon = "magic" - render_staging_dir = "$HIP/ayon/{product[name]}/render/{product[name]}.$F4.{ext}" - ifd_dir = "$HIP/ayon/{product[name]}/ifd/{product[name]}.$F4.{ext}" # Default to split export and render jobs export_job = True @@ -35,9 +33,11 @@ def create(self, product_name, instance_data, pre_create_data): ext = pre_create_data.get("image_format") - filepath = self.render_staging_dir.format( - product={"name": "`chs(\"AYON_productName\")`"}, - ext=ext + filepath = "{render_dir}/{product_name}/{product_name}.$F4.{ext}".format( + render_dir=hou.text.expandString("$HIP/ayon/renders"), + # keep dynamic link to product name + product_name="`chs(\"AYON_productName\")`", + ext=ext, ) parms = { @@ -48,11 +48,14 @@ def create(self, product_name, instance_data, pre_create_data): } if pre_create_data.get("export_job"): - ifd_filepath = self.ifd_dir.format( - product={"name": "`chs(\"AYON_productName\")`"}, - ext="ifd" + ifd_filepath = ( + "{staging_dir}/{product_name}/ifd/{product_name}.$F4.ifd" + .format( + staging_dir=hou.text.expandString("$HIP/ayon"), + # keep dynamic link to product name + product_name="`chs(\"AYON_productName\")`" + ) ) - parms["soho_outputmode"] = 1 parms["soho_diskfile"] = ifd_filepath diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py b/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py index 2913f3cdbf..9acd1d6841 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py @@ -28,8 +28,8 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) - filepath = "{staging_dir}/{product_name}.abc".format( - staging_dir=hou.text.expandString("$HIP/pyblish"), + filepath = "{staging_dir}/{product_name}/{product_name}.abc".format( + staging_dir=hou.text.expandString("$HIP/ayon"), # keep dynamic link to product name product_name="`chs(\"AYON_productName\")`", ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py index e8062ddd77..80d19daecf 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py @@ -11,8 +11,6 @@ class CreateRedshiftProxy(plugin.HoudiniCreator): label = "Redshift Proxy" product_type = "redshiftproxy" icon = "magic" - ext = "rs" - staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" def create(self, product_name, instance_data, pre_create_data): @@ -38,9 +36,10 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) - filepath = self.staging_dir.format( - product={"name": "`chs(\"AYON_productName\")`"}, - ext=self.ext + filepath = "{staging_dir}/{product_name}/{product_name}.$F4.rs".format( + staging_dir=hou.text.expandString("$HIP/ayon"), + # keep dynamic link to product name + product_name="`chs(\"AYON_productName\")`" ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py index e7d9193b09..dc04999018 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py @@ -16,8 +16,6 @@ class CreateRedshiftROP(plugin.HoudiniCreator): icon = "magic" ext = "exr" multi_layered_mode = "No Multi-Layered EXR File" - render_staging_dir = "$HIP/ayon/{product[name]}/render/{product[name]}.$AOV.$F4.{ext}" - rs_dir = "$HIP/ayon/{product[name]}/rs/{product[name]}.$F4.{ext}" # Default to split export and render jobs split_render = True @@ -65,9 +63,11 @@ def create(self, product_name, instance_data, pre_create_data): multilayer_mode_index = {"No Multi-Layered EXR File": "1", "Full Multi-Layered EXR File": "2" } - filepath = self.render_staging_dir.format( - product={"name": "`chs(\"AYON_productName\")`"}, - ext=ext + filepath = "{render_dir}/{product_name}/{product_name}.$AOV.$F4.{ext}".format( + render_dir=hou.text.expandString("$HIP/ayon/renders"), + # keep dynamic link to product name + product_name="`chs(\"AYON_productName\")`", + ext=ext, ) if multilayer_mode_index[multi_layered_mode] == "1": @@ -96,11 +96,11 @@ def create(self, product_name, instance_data, pre_create_data): camera = node.path() parms["RS_renderCamera"] = camera or "" - rs_filepath = self.rs_dir.format( - product={"name": "`chs(\"AYON_productName\")`"}, - ext="rs" + rs_filepath = "{staging_dir}/{product_name}/rs/{product_name}.$F4.rs".format( + staging_dir=hou.text.expandString("$HIP/ayon"), + # keep dynamic link to product name + product_name="`chs(\"AYON_productName\")`" ) - parms["RS_archive_file"] = rs_filepath if pre_create_data.get("split_render", self.split_render): diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_review.py b/client/ayon_core/hosts/houdini/plugins/create/create_review.py index 1d2110042d..fbb74886ee 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_review.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_review.py @@ -14,7 +14,6 @@ class CreateReview(plugin.HoudiniCreator): label = "Review" product_type = "review" icon = "video-camera" - staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" def create(self, product_name, instance_data, pre_create_data): @@ -32,9 +31,11 @@ def create(self, product_name, instance_data, pre_create_data): frame_range = hou.playbar.frameRange() - filepath = self.staging_dir.format( - product={"name": "`chs(\"AYON_productName\")`"}, - ext=pre_create_data.get("image_format", "png") + filepath = "{staging_dir}/{product_name}/{product_name}.$F4.{ext}".format( + staging_dir=hou.text.expandString("$HIP/ayon"), + # keep dynamic link to product name + product_name="`chs(\"AYON_productName\")`", + ext=pre_create_data.get("image_format") or "png" ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py b/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py index 7be4ccfe12..bca62207d5 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py @@ -15,8 +15,6 @@ class CreateStaticMesh(plugin.HoudiniCreator): icon = "fa5s.cubes" default_variants = ["Main"] - ext = "fbx" - staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.{ext}" def create(self, product_name, instance_data, pre_create_data): @@ -31,9 +29,10 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) # prepare parms - filepath = self.staging_dir.format( - product={"name": "`chs(\"AYON_productName\")`"}, - ext=self.ext + filepath = "{staging_dir}/{product_name}.fbx".format( + staging_dir=hou.text.expandString("$HIP/ayon"), + # keep dynamic link to product name + product_name="`chs(\"AYON_productName\")`", ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_usd.py b/client/ayon_core/hosts/houdini/plugins/create/create_usd.py index 69483d3ca2..108d7b28b0 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_usd.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_usd.py @@ -12,8 +12,6 @@ class CreateUSD(plugin.HoudiniCreator): product_type = "usd" icon = "gears" enabled = False - ext = "usd" - staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.{ext}" def create(self, product_name, instance_data, pre_create_data): @@ -27,8 +25,10 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) - filepath = self.staging_dir.format( - product={"name": "`chs(\"AYON_productName\")`"}, + filepath = "{staging_dir}/{product_name}/{product_name}.{ext}".format( + staging_dir=hou.text.expandString("$HIP/ayon"), + # keep dynamic link to product name + product_name="`chs(\"AYON_productName\")`", ext=self.ext ) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py b/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py index 7d21385b07..c60a0e47e4 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py @@ -13,8 +13,6 @@ class CreateVDBCache(plugin.HoudiniCreator): label = "VDB Cache" product_type = "vdbcache" icon = "cloud" - ext = "vdb" - staging_dir = "$HIP/ayon/{product[name]}/{product[name]}.$F4.{ext}" def create(self, product_name, instance_data, pre_create_data): import hou @@ -30,10 +28,10 @@ def create(self, product_name, instance_data, pre_create_data): pre_create_data) instance_node = hou.node(instance.get("instance_node")) - - filepath = self.staging_dir.format( - product={"name": "`chs(\"AYON_productName\")`"}, - ext=self.ext + filepath = "{staging_dir}/{product_name}/{product_name}.$F4.vdb".format( + staging_dir=hou.text.expandString("$HIP/ayon"), + # keep dynamic link to product name + product_name="`chs(\"AYON_productName\")`" ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py index ebf5203b29..f5db4a1e65 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py @@ -15,8 +15,6 @@ class CreateVrayROP(plugin.HoudiniCreator): product_type = "vray_rop" icon = "magic" ext = "exr" - render_staging_dir = "$HIP/ayon/{product[name]}/render/{product[name]}.$AOV.$F4.{ext}", - vrscene_dir = "$HIP/ayon/{product[name]}/vrscene/{product[name]}.$F4.{ext}" # Default to split export and render jobs export_job = True @@ -58,10 +56,13 @@ def create(self, product_name, instance_data, pre_create_data): } if pre_create_data.get("export_job"): - - scene_filepath = self.vrscene_dir.format( - product={"name": "`chs(\"AYON_productName\")`"}, - ext="vrscene" + scene_filepath = ( + "{staging_dir}/{product_name}/vrscene/{product_name}.$F4.vrscene" + .format( + staging_dir=hou.text.expandString("$HIP/pyblish"), + # keep dynamic link to product name + product_name="`chs(\"AYON_productName\")`" + ) ) # Setting render_export_mode to "2" because that's for # "Export only" ("1" is for "Export & Render") @@ -83,11 +84,15 @@ def create(self, product_name, instance_data, pre_create_data): instance_data["RenderElement"] = pre_create_data.get("render_element_enabled") # noqa if pre_create_data.get("render_element_enabled", True): # Vray has its own tag for AOV file output - filepath = self.render_staging_dir.format( - product={"name": "`chs(\"AYON_productName\")`"}, - ext=ext + filepath = ( + "{render_dir}/{product_name}/{product_name}.$AOV.$F4.{ext}" + .format( + render_dir=hou.text.expandString("$HIP/pyblish/renders"), + # keep dynamic link to product name + product_name="`chs(\"AYON_productName\")`", + ext=ext, + ) ) - re_rop = instance_node.parent().createNode( "vray_render_channels", node_name=basename + "_render_element" @@ -102,11 +107,15 @@ def create(self, product_name, instance_data, pre_create_data): }) else: - filepath = self.render_staging_dir.format( - product={"name": "`chs(\"AYON_productName\")`"}, - ext=ext - ).replace(".$AOV", "") - + filepath = ( + "{render_dir}/{product_name}/{product_name}.$F4.{ext}" + .format( + render_dir=hou.text.expandString("$HIP/ayon/renders"), + # keep dynamic link to product name + product_name="`chs(\"AYON_productName\")`", + ext=ext, + ) + ) parms.update({ "use_render_channels": 0, "SettingsOutput_img_file_path": filepath From 5733fb7426e3d70e544d5d8c6a6e40aa779e2bcc Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 22 Apr 2024 17:03:42 +0200 Subject: [PATCH 41/86] revert changes in creators --- .../plugins/create/create_alembic_camera.py | 10 +---- .../plugins/create/create_arnold_ass.py | 9 ++-- .../plugins/create/create_arnold_rop.py | 15 +++---- .../houdini/plugins/create/create_bgeo.py | 12 +++--- .../plugins/create/create_composite.py | 11 ++--- .../houdini/plugins/create/create_hda.py | 8 +--- .../plugins/create/create_karma_rop.py | 27 ++++-------- .../plugins/create/create_mantra_ifd.py | 8 ++-- .../plugins/create/create_mantra_rop.py | 18 +++----- .../plugins/create/create_pointcache.py | 10 +---- .../plugins/create/create_redshift_proxy.py | 8 +--- .../plugins/create/create_redshift_rop.py | 18 +++----- .../houdini/plugins/create/create_review.py | 4 +- .../plugins/create/create_staticmesh.py | 8 ++-- .../houdini/plugins/create/create_usd.py | 9 +--- .../plugins/create/create_vbd_cache.py | 11 ++--- .../houdini/plugins/create/create_vray_rop.py | 43 +++++++++---------- 17 files changed, 82 insertions(+), 147 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py b/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py index f4c1634fbe..0ab5e2794e 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_alembic_camera.py @@ -26,15 +26,9 @@ def create(self, product_name, instance_data, pre_create_data): pre_create_data) instance_node = hou.node(instance.get("instance_node")) - - filepath = "{staging_dir}/{product_name}/{product_name}.abc".format( - staging_dir=hou.text.expandString("$HIP/ayon"), - # keep dynamic link to product name - product_name="`chs(\"AYON_productName\")`", - ) - parms = { - "filename": filepath, + "filename": hou.text.expandString( + "$HIP/pyblish/{}.abc".format(product_name)), "use_sop_path": False, } diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py index abbc1730ec..be5604c01c 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_ass.py @@ -39,13 +39,10 @@ def create(self, product_name, instance_data, pre_create_data): parm_template_group.hideFolder("Properties", True) instance_node.setParmTemplateGroup(parm_template_group) - filepath = "{staging_dir}/{product_name}/{product_name}.$F4.{ext}".format( - staging_dir=hou.text.expandString("$HIP/ayon"), - # keep dynamic link to product name - product_name="`chs(\"AYON_productName\")`", - ext=self.ext.lstrip(".") # ignore the dot in self.ext + filepath = "{}{}".format( + hou.text.expandString("$HIP/pyblish/"), + "{}.$F4{}".format(product_name, self.ext) ) - parms = { # Render frame range "trange": 1, diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py index 02a41464fc..f65b54a452 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_arnold_rop.py @@ -37,10 +37,9 @@ def create(self, product_name, instance_data, pre_create_data): ext = pre_create_data.get("image_format") - filepath = "{render_dir}/{product_name}/{product_name}.$F4.{ext}".format( - render_dir=hou.text.expandString("$HIP/ayon/renders"), - # keep dynamic link to product name - product_name="`chs(\"AYON_productName\")`", + filepath = "{renders_dir}{product_name}/{product_name}.$F4.{ext}".format( + renders_dir=hou.text.expandString("$HIP/pyblish/renders/"), + product_name=product_name, ext=ext, ) parms = { @@ -53,10 +52,10 @@ def create(self, product_name, instance_data, pre_create_data): } if pre_create_data.get("export_job"): - ass_filepath = "{render_dir}/{product_name}/ass/{product_name}.$F4.ass".format( - render_dir=hou.text.expandString("$HIP/ayon/renders/"), - # keep dynamic link to product name - product_name="`chs(\"AYON_productName\")`", + ass_filepath = \ + "{export_dir}{product_name}/{product_name}.$F4.ass".format( + export_dir=hou.text.expandString("$HIP/pyblish/ass/"), + product_name=product_name, ) parms["ar_ass_export_enable"] = 1 parms["ar_ass_file"] = ass_filepath diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py b/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py index b6ab391044..3749598b1d 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_bgeo.py @@ -29,14 +29,14 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) - filepath = "{staging_dir}/{product_name}/{product_name}.$F4.{ext}".format( - staging_dir=hou.text.expandString("$HIP/ayon"), - # keep dynamic link to product name - product_name="`chs(\"AYON_productName\")`", - ext=pre_create_data.get("bgeo_type") or "bgeo.sc" + file_path = "{}{}".format( + hou.text.expandString("$HIP/pyblish/"), + "{}.$F4.{}".format( + product_name, + pre_create_data.get("bgeo_type") or "bgeo.sc") ) parms = { - "sopoutput": filepath + "sopoutput": file_path } instance_node.parm("trange").set(1) diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_composite.py b/client/ayon_core/hosts/houdini/plugins/create/create_composite.py index 6fee077b1c..a25faf0e8e 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_composite.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_composite.py @@ -14,7 +14,7 @@ class CreateCompositeSequence(plugin.HoudiniCreator): product_type = "imagesequence" icon = "gears" - ext = "exr" + ext = ".exr" def create(self, product_name, instance_data, pre_create_data): import hou # noqa @@ -28,13 +28,10 @@ def create(self, product_name, instance_data, pre_create_data): pre_create_data) instance_node = hou.node(instance.get("instance_node")) - filepath = "{staging_dir}/{product_name}/{product_name}.$F4.{ext}".format( - staging_dir=hou.text.expandString("$HIP/ayon"), - # keep dynamic link to product name - product_name="`chs(\"AYON_productName\")`", - ext=self.ext + filepath = "{}{}".format( + hou.text.expandString("$HIP/pyblish/"), + "{}.$F4{}".format(product_name, self.ext) ) - parms = { "trange": 1, "copoutput": filepath diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_hda.py b/client/ayon_core/hosts/houdini/plugins/create/create_hda.py index 8cfd06e5ef..d399aa5e15 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_hda.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_hda.py @@ -56,15 +56,9 @@ def create_instance_node( raise CreatorError( "cannot create hda from node {}".format(to_hda)) - filepath = "{staging_dir}/HDAs/{product_name}.hda".format( - staging_dir=hou.text.expandString("$HIP/ayon"), - # keep dynamic link to product name - product_name="`chs(\"AYON_productName\")`" - ) - hda_node = to_hda.createDigitalAsset( name=node_name, - hda_file_name=filepath + hda_file_name="$HIP/{}.hda".format(node_name) ) hda_node.layoutChildren() elif self._check_existing(folder_path, node_name): diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py index a00527e210..e91ddbc0ac 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_karma_rop.py @@ -30,28 +30,19 @@ def create(self, product_name, instance_data, pre_create_data): ext = pre_create_data.get("image_format") - filepath = "{render_dir}/{product_name}/{product_name}.$F4.{ext}".format( - render_dir=hou.text.expandString("$HIP/ayon/renders"), - # keep dynamic link to product name - product_name="`chs(\"AYON_productName\")`", + filepath = "{renders_dir}{product_name}/{product_name}.$F4.{ext}".format( + renders_dir=hou.text.expandString("$HIP/pyblish/renders/"), + product_name=product_name, ext=ext, ) - checkpoint = ( - "{render_dir}/{product_name}/checkpoints/{product_name}.$F4.checkpoint" - .format( - render_dir=hou.text.expandString("$HIP/ayon/renders"), - # keep dynamic link to product name - product_name="`chs(\"AYON_productName\")`", - ) + checkpoint = "{cp_dir}{product_name}.$F4.checkpoint".format( + cp_dir=hou.text.expandString("$HIP/pyblish/"), + product_name=product_name ) - usd_directory = ( - "{render_dir}/{product_name}/usd/{product_name}_$RENDERID" - .format( - render_dir=hou.text.expandString("$HIP/ayon/renders"), - # keep dynamic link to product name - product_name="`chs(\"AYON_productName\")`" - ) + usd_directory = "{usd_dir}{product_name}_$RENDERID".format( + usd_dir=hou.text.expandString("$HIP/pyblish/renders/usd_renders/"), # noqa + product_name=product_name ) parms = { diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py index 9fa9e969ea..e0cf035c35 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_ifd.py @@ -25,11 +25,9 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) - filepath = "{staging_dir}/{product_name}/{product_name}.$F4.ifd".format( - staging_dir=hou.text.expandString("$HIP/ayon"), - # keep dynamic link to product name - product_name="`chs(\"AYON_productName\")`" - ) + filepath = "{}{}".format( + hou.text.expandString("$HIP/pyblish/"), + "{}.$F4.ifd".format(product_name)) parms = { # Render frame range "trange": 1, diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py index 445296bd6a..64ecf428e9 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_mantra_rop.py @@ -33,10 +33,9 @@ def create(self, product_name, instance_data, pre_create_data): ext = pre_create_data.get("image_format") - filepath = "{render_dir}/{product_name}/{product_name}.$F4.{ext}".format( - render_dir=hou.text.expandString("$HIP/ayon/renders"), - # keep dynamic link to product name - product_name="`chs(\"AYON_productName\")`", + filepath = "{renders_dir}{product_name}/{product_name}.$F4.{ext}".format( + renders_dir=hou.text.expandString("$HIP/pyblish/renders/"), + product_name=product_name, ext=ext, ) @@ -48,14 +47,11 @@ def create(self, product_name, instance_data, pre_create_data): } if pre_create_data.get("export_job"): - ifd_filepath = ( - "{staging_dir}/{product_name}/ifd/{product_name}.$F4.ifd" - .format( - staging_dir=hou.text.expandString("$HIP/ayon"), - # keep dynamic link to product name - product_name="`chs(\"AYON_productName\")`" + ifd_filepath = \ + "{export_dir}{product_name}/{product_name}.$F4.ifd".format( + export_dir=hou.text.expandString("$HIP/pyblish/ifd/"), + product_name=product_name, ) - ) parms["soho_outputmode"] = 1 parms["soho_diskfile"] = ifd_filepath diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py b/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py index 9acd1d6841..4c9a0d9b37 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_pointcache.py @@ -27,13 +27,6 @@ def create(self, product_name, instance_data, pre_create_data): pre_create_data) instance_node = hou.node(instance.get("instance_node")) - - filepath = "{staging_dir}/{product_name}/{product_name}.abc".format( - staging_dir=hou.text.expandString("$HIP/ayon"), - # keep dynamic link to product name - product_name="`chs(\"AYON_productName\")`", - ) - parms = { "use_sop_path": True, "build_from_path": True, @@ -41,7 +34,8 @@ def create(self, product_name, instance_data, pre_create_data): "prim_to_detail_pattern": "cbId", "format": 2, "facesets": 0, - "filename": filepath + "filename": hou.text.expandString( + "$HIP/pyblish/{}.abc".format(product_name)) } if self.selected_nodes: diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py index 80d19daecf..6a9321b95a 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_proxy.py @@ -36,14 +36,8 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) - filepath = "{staging_dir}/{product_name}/{product_name}.$F4.rs".format( - staging_dir=hou.text.expandString("$HIP/ayon"), - # keep dynamic link to product name - product_name="`chs(\"AYON_productName\")`" - ) - parms = { - "RS_archive_file": filepath, + "RS_archive_file": '$HIP/pyblish/{}.$F4.rs'.format(product_name), } if self.selected_nodes: diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py index dc04999018..1cd239e929 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_redshift_rop.py @@ -63,12 +63,11 @@ def create(self, product_name, instance_data, pre_create_data): multilayer_mode_index = {"No Multi-Layered EXR File": "1", "Full Multi-Layered EXR File": "2" } - filepath = "{render_dir}/{product_name}/{product_name}.$AOV.$F4.{ext}".format( - render_dir=hou.text.expandString("$HIP/ayon/renders"), - # keep dynamic link to product name - product_name="`chs(\"AYON_productName\")`", - ext=ext, - ) + filepath = "{renders_dir}{product_name}/{product_name}.{fmt}".format( + renders_dir=hou.text.expandString("$HIP/pyblish/renders/"), + product_name=product_name, + fmt="$AOV.$F4.{ext}".format(ext=ext) + ) if multilayer_mode_index[multi_layered_mode] == "1": multipart = False @@ -96,11 +95,8 @@ def create(self, product_name, instance_data, pre_create_data): camera = node.path() parms["RS_renderCamera"] = camera or "" - rs_filepath = "{staging_dir}/{product_name}/rs/{product_name}.$F4.rs".format( - staging_dir=hou.text.expandString("$HIP/ayon"), - # keep dynamic link to product name - product_name="`chs(\"AYON_productName\")`" - ) + export_dir = hou.text.expandString("$HIP/pyblish/rs/") + rs_filepath = f"{export_dir}{product_name}/{product_name}.$F4.rs" parms["RS_archive_file"] = rs_filepath if pre_create_data.get("split_render", self.split_render): diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_review.py b/client/ayon_core/hosts/houdini/plugins/create/create_review.py index fbb74886ee..18f7ce498d 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_review.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_review.py @@ -31,8 +31,8 @@ def create(self, product_name, instance_data, pre_create_data): frame_range = hou.playbar.frameRange() - filepath = "{staging_dir}/{product_name}/{product_name}.$F4.{ext}".format( - staging_dir=hou.text.expandString("$HIP/ayon"), + filepath = "{root}/{product_name}/{product_name}.$F4.{ext}".format( + root=hou.text.expandString("$HIP/pyblish"), # keep dynamic link to product name product_name="`chs(\"AYON_productName\")`", ext=pre_create_data.get("image_format") or "png" diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py b/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py index bca62207d5..3271107c6e 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_staticmesh.py @@ -29,15 +29,13 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) # prepare parms - filepath = "{staging_dir}/{product_name}.fbx".format( - staging_dir=hou.text.expandString("$HIP/ayon"), - # keep dynamic link to product name - product_name="`chs(\"AYON_productName\")`", + output_path = hou.text.expandString( + "$HIP/pyblish/{}.fbx".format(product_name) ) parms = { "startnode": self.get_selection(), - "sopoutput": filepath, + "sopoutput": output_path, # vertex cache format "vcformat": pre_create_data.get("vcformat"), "convertunits": pre_create_data.get("convertunits"), diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_usd.py b/client/ayon_core/hosts/houdini/plugins/create/create_usd.py index 108d7b28b0..700f7eefd6 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_usd.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_usd.py @@ -25,15 +25,8 @@ def create(self, product_name, instance_data, pre_create_data): instance_node = hou.node(instance.get("instance_node")) - filepath = "{staging_dir}/{product_name}/{product_name}.{ext}".format( - staging_dir=hou.text.expandString("$HIP/ayon"), - # keep dynamic link to product name - product_name="`chs(\"AYON_productName\")`", - ext=self.ext - ) - parms = { - "lopoutput": filepath, + "lopoutput": "$HIP/pyblish/{}.usd".format(product_name), "enableoutputprocessor_simplerelativepaths": False, } diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py b/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py index c60a0e47e4..c34cd2b4b5 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_vbd_cache.py @@ -28,14 +28,11 @@ def create(self, product_name, instance_data, pre_create_data): pre_create_data) instance_node = hou.node(instance.get("instance_node")) - filepath = "{staging_dir}/{product_name}/{product_name}.$F4.vdb".format( - staging_dir=hou.text.expandString("$HIP/ayon"), - # keep dynamic link to product name - product_name="`chs(\"AYON_productName\")`" - ) - + file_path = "{}{}".format( + hou.text.expandString("$HIP/pyblish/"), + "{}.$F4.vdb".format(product_name)) parms = { - "sopoutput": filepath, + "sopoutput": file_path, "initsim": True, "trange": 1 } diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py index f5db4a1e65..5ed9e848a7 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_vray_rop.py @@ -56,14 +56,11 @@ def create(self, product_name, instance_data, pre_create_data): } if pre_create_data.get("export_job"): - scene_filepath = ( - "{staging_dir}/{product_name}/vrscene/{product_name}.$F4.vrscene" - .format( - staging_dir=hou.text.expandString("$HIP/pyblish"), - # keep dynamic link to product name - product_name="`chs(\"AYON_productName\")`" + scene_filepath = \ + "{export_dir}{product_name}/{product_name}.$F4.vrscene".format( + export_dir=hou.text.expandString("$HIP/pyblish/vrscene/"), + product_name=product_name, ) - ) # Setting render_export_mode to "2" because that's for # "Export only" ("1" is for "Export & Render") parms["render_export_mode"] = "2" @@ -84,14 +81,18 @@ def create(self, product_name, instance_data, pre_create_data): instance_data["RenderElement"] = pre_create_data.get("render_element_enabled") # noqa if pre_create_data.get("render_element_enabled", True): # Vray has its own tag for AOV file output - filepath = ( - "{render_dir}/{product_name}/{product_name}.$AOV.$F4.{ext}" - .format( - render_dir=hou.text.expandString("$HIP/pyblish/renders"), - # keep dynamic link to product name - product_name="`chs(\"AYON_productName\")`", - ext=ext, - ) + filepath = "{renders_dir}{product_name}/{product_name}.{fmt}".format( + renders_dir=hou.text.expandString("$HIP/pyblish/renders/"), + product_name=product_name, + fmt="${aov}.$F4.{ext}".format(aov="AOV", + ext=ext) + ) + filepath = "{}{}".format( + hou.text.expandString("$HIP/pyblish/renders/"), + "{}/{}.${}.$F4.{}".format(product_name, + product_name, + "AOV", + ext) ) re_rop = instance_node.parent().createNode( "vray_render_channels", @@ -107,14 +108,10 @@ def create(self, product_name, instance_data, pre_create_data): }) else: - filepath = ( - "{render_dir}/{product_name}/{product_name}.$F4.{ext}" - .format( - render_dir=hou.text.expandString("$HIP/ayon/renders"), - # keep dynamic link to product name - product_name="`chs(\"AYON_productName\")`", - ext=ext, - ) + filepath = "{renders_dir}{product_name}/{product_name}.{fmt}".format( + renders_dir=hou.text.expandString("$HIP/pyblish/renders/"), + product_name=product_name, + fmt="$F4.{ext}".format(ext=ext) ) parms.update({ "use_render_channels": 0, From 00366b447ea040639b7bb48845f589996c910108 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 22 Apr 2024 17:15:37 +0200 Subject: [PATCH 42/86] fix wrong enum items --- server_addon/houdini/server/settings/publish.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server_addon/houdini/server/settings/publish.py b/server_addon/houdini/server/settings/publish.py index da5a3e9b1b..3de50ee5d9 100644 --- a/server_addon/houdini/server/settings/publish.py +++ b/server_addon/houdini/server/settings/publish.py @@ -24,11 +24,11 @@ def product_types_enum(): return [ {"value": "camera", "label": "Camera (Abc)"}, {"value": "pointcache", "label": "PointCache (Abc)/PointCache (Bgeo)"}, - {"value": "review", "staticMesh": "Static Mesh (FBX)"}, + {"value": "review", "label": "Review"}, + {"value": "staticMesh", "label": "Static Mesh (FBX)"}, {"value": "usd", "label": "USD (experimental)"}, {"value": "vdbcache", "label": "VDB Cache"}, {"value": "imagesequence", "label": "Composite (Image Sequence)"}, - {"value": "review", "review": "Review"}, {"value": "ass", "label": "Arnold ASS"}, {"value": "arnold_rop", "label": "Arnold ROP"}, {"value": "mantraifd", "label": "Mantra IFD"}, From 0f7db69eb5ce55a3d160e78b0261d4dc253c0da4 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 4 Mar 2024 22:41:35 +0200 Subject: [PATCH 43/86] move create_file_list to Houdini's lib --- client/ayon_core/hosts/houdini/api/lib.py | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/client/ayon_core/hosts/houdini/api/lib.py b/client/ayon_core/hosts/houdini/api/lib.py index da1b21ad95..cca19cbcf5 100644 --- a/client/ayon_core/hosts/houdini/api/lib.py +++ b/client/ayon_core/hosts/houdini/api/lib.py @@ -1156,3 +1156,39 @@ def prompt_reset_context(): update_content_on_context_change() dialog.deleteLater() + + +def create_file_list(match, start_frame, end_frame): + """Collect files based on frame range and `regex.match` + + Args: + match(re.match): match object + start_frame(int): start of the animation + end_frame(int): end of the animation + + Returns: + list + + """ + + # Get the padding length + frame = match.group(1) + padding = len(frame) + + # Get the parts of the filename surrounding the frame number, + # so we can put our own frame numbers in. + span = match.span(1) + prefix = match.string[: span[0]] + suffix = match.string[span[1]:] + + # Generate filenames for all frames + result = [] + for i in range(start_frame, end_frame + 1): + + # Format frame number by the padding amount + str_frame = "{number:0{width}d}".format(number=i, width=padding) + + file_name = prefix + str_frame + suffix + result.append(file_name) + + return result From 6f2521bfb1483914c36b11dd1b6576d291f9f51f Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 22 Apr 2024 17:43:56 +0200 Subject: [PATCH 44/86] update a TODO --- .../houdini/plugins/publish/collect_files_for_cleaning_up.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py index e170dce4e0..1dbb6c413e 100644 --- a/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/client/ayon_core/hosts/houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -73,9 +73,8 @@ def process(self, instance): files.extend(sum(aovs.values(), [])) # Intermediate exported render files. - # TODO : For products like Karma, - # Karma has more intermediate files - # e.g. USD and checkpoint + # TODO : Clean up intermediate files of Karma product type. + # as "ifdFile" works for other render product types only. ifdFile = instance.data.get("ifdFile") if self.intermediate_exported_render and ifdFile: start_frame = instance.data.get("frameStartHandle", None) From 0ad90c3d0022bd4b1998cfa46bbc0b467a805123 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 25 Apr 2024 10:43:34 +0200 Subject: [PATCH 45/86] add CollectFilesForCleaning setting --- server_addon/houdini/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/houdini/package.py b/server_addon/houdini/package.py index 4b72af2a89..4e441c76ae 100644 --- a/server_addon/houdini/package.py +++ b/server_addon/houdini/package.py @@ -1,3 +1,3 @@ name = "houdini" title = "Houdini" -version = "0.2.12" +version = "0.2.13" From 02ee0c4c842efd9ec75e662bf01bf9b1d6cf9073 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 29 Apr 2024 10:34:00 +0300 Subject: [PATCH 46/86] add CollectFilesForCleaning setting --- server_addon/houdini/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/houdini/package.py b/server_addon/houdini/package.py index 4e441c76ae..6c81eba439 100644 --- a/server_addon/houdini/package.py +++ b/server_addon/houdini/package.py @@ -1,3 +1,3 @@ name = "houdini" title = "Houdini" -version = "0.2.13" +version = "0.2.14" From fd819906f9559bc658b0682c9a98d0e022d754f4 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 29 Apr 2024 19:37:15 +0300 Subject: [PATCH 47/86] CollectFilesForCleaningUp: Drop the enum and make it a regular list. --- .../houdini/server/settings/publish.py | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/server_addon/houdini/server/settings/publish.py b/server_addon/houdini/server/settings/publish.py index 3de50ee5d9..ce710eb274 100644 --- a/server_addon/houdini/server/settings/publish.py +++ b/server_addon/houdini/server/settings/publish.py @@ -20,26 +20,6 @@ class CollectChunkSizeModel(BaseSettingsModel): title="Frames Per Task") -def product_types_enum(): - return [ - {"value": "camera", "label": "Camera (Abc)"}, - {"value": "pointcache", "label": "PointCache (Abc)/PointCache (Bgeo)"}, - {"value": "review", "label": "Review"}, - {"value": "staticMesh", "label": "Static Mesh (FBX)"}, - {"value": "usd", "label": "USD (experimental)"}, - {"value": "vdbcache", "label": "VDB Cache"}, - {"value": "imagesequence", "label": "Composite (Image Sequence)"}, - {"value": "ass", "label": "Arnold ASS"}, - {"value": "arnold_rop", "label": "Arnold ROP"}, - {"value": "mantraifd", "label": "Mantra IFD"}, - {"value": "mantra_rop", "label": "Mantra ROP"}, - {"value": "redshiftproxy", "label": "Redshift Proxy"}, - {"value": "redshift_rop", "label": "Redshift ROP"}, - {"value": "karma_rop", "label": "Karma ROP"}, - {"value": "vray_rop", "label": "VRay ROP"}, - ] - - class CollectFilesForCleaningUpModel(BaseSettingsModel): enabled: bool = SettingsField(title="Enabled") optional: bool = SettingsField(title="Optional") @@ -51,9 +31,9 @@ class CollectFilesForCleaningUpModel(BaseSettingsModel): ) families: list[str] = SettingsField( default_factory=list, - enum_resolver=product_types_enum, - conditionalEnum=True, title="Product Types", + description="Find a list of all stock product types in " + "[Houdini admin docs](https://ayon.ynput.io/docs/addon_houdini_admin)." ) From 4afad33fc68a8a8724e6f62ed874f4c473b54630 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 29 Apr 2024 19:39:59 +0300 Subject: [PATCH 48/86] CollectFilesForCleaningUp: update link --- server_addon/houdini/server/settings/publish.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/houdini/server/settings/publish.py b/server_addon/houdini/server/settings/publish.py index ce710eb274..c078547f9b 100644 --- a/server_addon/houdini/server/settings/publish.py +++ b/server_addon/houdini/server/settings/publish.py @@ -33,7 +33,7 @@ class CollectFilesForCleaningUpModel(BaseSettingsModel): default_factory=list, title="Product Types", description="Find a list of all stock product types in " - "[Houdini admin docs](https://ayon.ynput.io/docs/addon_houdini_admin)." + "[Houdini admin docs](https://ayon.ynput.io/docs/addon_houdini_admin#stock-product-types)." # noqa: E501 ) From c4613e1896bf5f438b775169602e215a3a9be4fa Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 13 May 2024 16:45:56 +0300 Subject: [PATCH 49/86] add Cleanup after publishing settings --- server_addon/houdini/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/houdini/package.py b/server_addon/houdini/package.py index 6c81eba439..06b034da38 100644 --- a/server_addon/houdini/package.py +++ b/server_addon/houdini/package.py @@ -1,3 +1,3 @@ name = "houdini" title = "Houdini" -version = "0.2.14" +version = "0.2.15" From a0e8a338db32c0599eee945aed4c02061d33bae1 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 13 May 2024 16:53:16 +0300 Subject: [PATCH 50/86] revert server_addon/houdini/server/settings/publish.py --- .../houdini/server/settings/publish.py | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/server_addon/houdini/server/settings/publish.py b/server_addon/houdini/server/settings/publish.py index cd74d125dd..9e8e796aff 100644 --- a/server_addon/houdini/server/settings/publish.py +++ b/server_addon/houdini/server/settings/publish.py @@ -44,23 +44,6 @@ class CollectLocalRenderInstancesModel(BaseSettingsModel): ) -class CollectFilesForCleaningUpModel(BaseSettingsModel): - enabled: bool = SettingsField(title="Enabled") - optional: bool = SettingsField(title="Optional") - active: bool = SettingsField(title="Active") - intermediate_exported_render: bool = SettingsField( - title="Include Intermediate Exported Render Files", - description="Include intermediate exported render scenes for cleanup" - " (.idf, .ass, .usd, .rs) for render instances.", - ) - families: list[str] = SettingsField( - default_factory=list, - title="Product Types", - description="Find a list of all stock product types in " - "[Houdini admin docs](https://ayon.ynput.io/docs/addon_houdini_admin#stock-product-types)." # noqa: E501 - ) - - class ValidateWorkfilePathsModel(BaseSettingsModel): enabled: bool = SettingsField(title="Enabled") optional: bool = SettingsField(title="Optional") @@ -90,6 +73,10 @@ class PublishPluginsModel(BaseSettingsModel): default_factory=CollectChunkSizeModel, title="Collect Chunk Size." ) + CollectLocalRenderInstances: CollectLocalRenderInstancesModel = SettingsField( + default_factory=CollectLocalRenderInstancesModel, + title="Collect Local Render Instances." + ) ValidateContainers: BasicValidateModel = SettingsField( default_factory=BasicValidateModel, title="Validate Latest Containers.", @@ -123,6 +110,15 @@ class PublishPluginsModel(BaseSettingsModel): "optional": True, "chunk_size": 999999 }, + "CollectLocalRenderInstances": { + "use_deadline_aov_filter": False, + "aov_filter" : { + "host_name": "houdini", + "value": [ + ".*([Bb]eauty).*" + ] + } + }, "ValidateContainers": { "enabled": True, "optional": True, From 5ee0f9692084b6c6ef2a9c15f022f99fc23dd6fa Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 13 May 2024 17:31:15 +0300 Subject: [PATCH 51/86] add CollectFilesForCleaningUp settings --- .../houdini/server/settings/publish.py | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/server_addon/houdini/server/settings/publish.py b/server_addon/houdini/server/settings/publish.py index 9e8e796aff..a095b8fd24 100644 --- a/server_addon/houdini/server/settings/publish.py +++ b/server_addon/houdini/server/settings/publish.py @@ -44,6 +44,43 @@ class CollectLocalRenderInstancesModel(BaseSettingsModel): ) +def product_types_enum(): + return [ + {"value": "camera", "label": "Camera (Abc)"}, + {"value": "pointcache", "label": "PointCache (Abc)/PointCache (Bgeo)"}, + {"value": "review", "label": "Review"}, + {"value": "staticMesh", "label": "Static Mesh (FBX)"}, + {"value": "usd", "label": "USD (experimental)"}, + {"value": "vdbcache", "label": "VDB Cache"}, + {"value": "imagesequence", "label": "Composite (Image Sequence)"}, + {"value": "ass", "label": "Arnold ASS"}, + {"value": "arnold_rop", "label": "Arnold ROP"}, + {"value": "mantraifd", "label": "Mantra IFD"}, + {"value": "mantra_rop", "label": "Mantra ROP"}, + {"value": "redshiftproxy", "label": "Redshift Proxy"}, + {"value": "redshift_rop", "label": "Redshift ROP"}, + {"value": "karma_rop", "label": "Karma ROP"}, + {"value": "vray_rop", "label": "VRay ROP"}, + ] + + +class CollectFilesForCleaningUpModel(BaseSettingsModel): + enabled: bool = SettingsField(title="Enabled") + optional: bool = SettingsField(title="Optional") + active: bool = SettingsField(title="Active") + intermediate_exported_render: bool = SettingsField( + title="Include Intermediate Exported Render Files", + description="Include intermediate exported render scenes for cleanup" + " (.idf, .ass, .usd, .rs) for render instances.", + ) + families: list[str] = SettingsField( + default_factory=list, + enum_resolver=product_types_enum, + conditionalEnum=True, + title="Product Types" + ) + + class ValidateWorkfilePathsModel(BaseSettingsModel): enabled: bool = SettingsField(title="Enabled") optional: bool = SettingsField(title="Optional") @@ -73,6 +110,10 @@ class PublishPluginsModel(BaseSettingsModel): default_factory=CollectChunkSizeModel, title="Collect Chunk Size." ) + CollectFilesForCleaningUp:CollectFilesForCleaningUpModel = SettingsField( + default_factory=BasicValidateModel, + title="Collect Files For Cleaning Up." + ) CollectLocalRenderInstances: CollectLocalRenderInstancesModel = SettingsField( default_factory=CollectLocalRenderInstancesModel, title="Collect Local Render Instances." @@ -110,6 +151,13 @@ class PublishPluginsModel(BaseSettingsModel): "optional": True, "chunk_size": 999999 }, + "CollectFilesForCleaningUp": { + "enabled": False, + "optional": True, + "active": True, + "intermediate_exported_render": False, + "families" : [] + }, "CollectLocalRenderInstances": { "use_deadline_aov_filter": False, "aov_filter" : { From 2619387fe84168c170b32d0a8f7672b23cd7b531 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 23 May 2024 12:14:32 +0300 Subject: [PATCH 52/86] Bump Addon version - add CollectFilesForCleaningUp setting --- server_addon/houdini/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/houdini/package.py b/server_addon/houdini/package.py index 06b034da38..ee4ae85e0b 100644 --- a/server_addon/houdini/package.py +++ b/server_addon/houdini/package.py @@ -1,3 +1,3 @@ name = "houdini" title = "Houdini" -version = "0.2.15" +version = "0.2.16" From a0b65f36608fc23de0f1aea29d0925c22f8e544c Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 3 Jun 2024 16:57:44 +0300 Subject: [PATCH 53/86] add CollectFilesForCleaningUp --- server_addon/houdini/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/houdini/package.py b/server_addon/houdini/package.py index 275d21c1bf..a8884ff60a 100644 --- a/server_addon/houdini/package.py +++ b/server_addon/houdini/package.py @@ -1,6 +1,6 @@ name = "houdini" title = "Houdini" -version = "0.3.0" +version = "0.3.1" client_dir = "ayon_houdini" From d6e666965be1d788dda5e4e52cc991a5c120ee99 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 3 Jun 2024 17:15:12 +0300 Subject: [PATCH 54/86] bump version --- server_addon/houdini/client/ayon_houdini/version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server_addon/houdini/client/ayon_houdini/version.py b/server_addon/houdini/client/ayon_houdini/version.py index a30c770e1d..87d445d563 100644 --- a/server_addon/houdini/client/ayon_houdini/version.py +++ b/server_addon/houdini/client/ayon_houdini/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- -"""Package declaring Houdini addon version.""" -__version__ = "0.3.0" +"""Package declaring AYON addon 'houdini' version.""" +__version__ = "0.3.1" From 48020b5dc70456bb1ffba47859f3ee194b71c65f Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 3 Jun 2024 17:18:13 +0300 Subject: [PATCH 55/86] update imports --- .../plugins/publish/collect_files_for_cleaning_up.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py index ccde16cb32..9e7bbe6742 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -2,10 +2,10 @@ import os import re from ayon_core.pipeline import AYONPyblishPluginMixin -from ayon_houdini.api import lib +from ayon_houdini.api import lib, plugin -class CollectFilesForCleaningUp(pyblish.api.InstancePlugin, +class CollectFilesForCleaningUp(plugin.HoudiniInstancePlugin, AYONPyblishPluginMixin): """Collect Files For Cleaning Up. From 04d2b6ceb0a97039595d2515974f6ad2dc3055b9 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Mon, 3 Jun 2024 17:26:22 +0300 Subject: [PATCH 56/86] add model to product types enums --- server_addon/houdini/server/settings/publish.py | 1 + 1 file changed, 1 insertion(+) diff --git a/server_addon/houdini/server/settings/publish.py b/server_addon/houdini/server/settings/publish.py index 7116179bca..e914cf2d0d 100644 --- a/server_addon/houdini/server/settings/publish.py +++ b/server_addon/houdini/server/settings/publish.py @@ -61,6 +61,7 @@ def product_types_enum(): {"value": "redshift_rop", "label": "Redshift ROP"}, {"value": "karma_rop", "label": "Karma ROP"}, {"value": "vray_rop", "label": "VRay ROP"}, + {"value": "model", "label": "Model"}, ] From 547065d93ac85c3ab9cdd4b5b0db8fbc62d3f5f1 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 14 Jun 2024 11:27:17 +0300 Subject: [PATCH 57/86] use clique instead of lib.create_file_list --- .../houdini/client/ayon_houdini/api/lib.py | 36 ---------- .../publish/collect_files_for_cleaning_up.py | 67 ++++++++---------- .../plugins/publish/collect_frames.py | 70 +++++++++---------- 3 files changed, 62 insertions(+), 111 deletions(-) diff --git a/server_addon/houdini/client/ayon_houdini/api/lib.py b/server_addon/houdini/client/ayon_houdini/api/lib.py index c5980d54ba..671265fae9 100644 --- a/server_addon/houdini/client/ayon_houdini/api/lib.py +++ b/server_addon/houdini/client/ayon_houdini/api/lib.py @@ -1193,39 +1193,3 @@ def prompt_reset_context(): update_content_on_context_change() dialog.deleteLater() - - -def create_file_list(match, start_frame, end_frame): - """Collect files based on frame range and `regex.match` - - Args: - match(re.match): match object - start_frame(int): start of the animation - end_frame(int): end of the animation - - Returns: - list - - """ - - # Get the padding length - frame = match.group(1) - padding = len(frame) - - # Get the parts of the filename surrounding the frame number, - # so we can put our own frame numbers in. - span = match.span(1) - prefix = match.string[: span[0]] - suffix = match.string[span[1]:] - - # Generate filenames for all frames - result = [] - for i in range(start_frame, end_frame + 1): - - # Format frame number by the padding amount - str_frame = "{number:0{width}d}".format(number=i, width=padding) - - file_name = prefix + str_frame + suffix - result.append(file_name) - - return result diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py index 9e7bbe6742..485442cef0 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -1,6 +1,6 @@ import pyblish.api import os -import re +import clique from ayon_core.pipeline import AYONPyblishPluginMixin from ayon_houdini.api import lib, plugin @@ -18,22 +18,12 @@ class CollectFilesForCleaningUp(plugin.HoudiniInstancePlugin, Artists are free to change the file path in the ROP node. """ - order = pyblish.api.CollectorOrder + 0.2 # it should run after CollectFrames + # It should run after CollectFrames and Collect Render plugins, + # and before CollectLocalRenderInstances. + order = pyblish.api.CollectorOrder + 0.115 hosts = ["houdini"] - families = [ - "camera", - "ass", - "pointcache", - "imagesequence", - "mantraifd", - "redshiftproxy", - "review", - "staticMesh", - "usd", - "vdbcache", - "redshift_rop" - ] + families = ["*"] label = "Collect Files For Cleaning Up" intermediate_exported_render = False @@ -73,13 +63,15 @@ def process(self, instance): files.extend(sum(aovs.values(), [])) # Intermediate exported render files. + # Note: This only takes effect when setting render target to + # "Farm Rendering - Split export & render jobs" + # as it's the only case where "ifdFile" exists in instance data. # TODO : Clean up intermediate files of Karma product type. # as "ifdFile" works for other render product types only. ifdFile = instance.data.get("ifdFile") if self.intermediate_exported_render and ifdFile: - start_frame = instance.data.get("frameStartHandle", None) - end_frame = instance.data.get("frameEndHandle", None) - + start_frame = instance.data["frameStartHandle"] + end_frame = instance.data["frameEndHandle"] ifd_files = self._get_ifd_file_list(ifdFile, start_frame, end_frame) files.extend(ifd_files) @@ -94,28 +86,25 @@ def process(self, instance): self.log.debug("Add files to 'cleanupFullPaths': {}".format(files)) instance.context.data["cleanupFullPaths"] += files - @staticmethod - def _get_ifd_file_list(ifdFile, start_frame, end_frame): + def _get_ifd_file_list(self, ifdFile, start_frame, end_frame): file_name = os.path.basename(ifdFile) parent_path = os.path.dirname(ifdFile) - pattern = r"\w+\.(0+).\w+" # It's always (0000) - match = re.match(pattern, file_name) - - if match and start_frame is not None: - - # Check if frames are bigger than 1 (file collection) - # override the result - if end_frame - start_frame > 0: - result = lib.create_file_list( - match, int(start_frame), int(end_frame) - ) - result = [ - os.path.join(parent_path, r).replace("\\", "/") - for r in result - ] - - return result - - return [] + # Compute frames list + frame_collection, _ = clique.assemble( + [file_name], + patterns=[clique.PATTERNS["frames"]], + minimum_items=1 + ) + + # It's always expected to be one collection. + frame_collection = frame_collection[0] + frame_collection.indexes.clear() + frame_collection.indexes.update(list(range(start_frame, (end_frame + 1)))) + + result = [ + "{}/{}".format(parent_path, frame) + for frame in frame_collection + ] + return result diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_frames.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_frames.py index cb07a4c695..ea15ca0ad0 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_frames.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_frames.py @@ -1,9 +1,8 @@ # -*- coding: utf-8 -*- """Collector plugin for frames data on ROP instances.""" import os -import re - import hou # noqa +import clique import pyblish.api from ayon_houdini.api import lib, plugin @@ -21,43 +20,42 @@ class CollectFrames(plugin.HoudiniInstancePlugin): def process(self, instance): - ropnode = hou.node(instance.data["instance_node"]) - - start_frame = instance.data.get("frameStartHandle", None) - end_frame = instance.data.get("frameEndHandle", None) + # CollectRopFrameRange computes `start_frame` and `end_frame` + # depending on the trange value. + start_frame = instance.data["frameStartHandle"] + end_frame = instance.data["frameEndHandle"] + # Evaluate the file name at the first frame. + ropnode = hou.node(instance.data["instance_node"]) output_parm = lib.get_output_parameter(ropnode) - if start_frame is not None: - # When rendering only a single frame still explicitly - # get the name for that particular frame instead of current frame - output = output_parm.evalAtFrame(start_frame) - else: - self.log.warning("Using current frame: {}".format(hou.frame())) - output = output_parm.eval() - - _, ext = lib.splitext( - output, allowed_multidot_extensions=[ - ".ass.gz", ".bgeo.sc", ".bgeo.gz", - ".bgeo.lzma", ".bgeo.bz2"]) + output = output_parm.evalAtFrame(start_frame) file_name = os.path.basename(output) - result = file_name - - # Get the filename pattern match from the output - # path, so we can compute all frames that would - # come out from rendering the ROP node if there - # is a frame pattern in the name - pattern = r"\w+\.(\d+)" + re.escape(ext) - match = re.match(pattern, file_name) - - if match and start_frame is not None: - - # Check if frames are bigger than 1 (file collection) - # override the result - if end_frame - start_frame > 0: - result = lib.create_file_list( - match, int(start_frame), int(end_frame) - ) # todo: `frames` currently conflicts with "explicit frames" for a # for a custom frame list. So this should be refactored. - instance.data.update({"frames": result}) + + # Set frames to the file name by default. + instance.data.update({"frames": file_name}) + + # Skip unnecessary logic if start and end frames are equal. + if start_frame == end_frame: + return + + # Create collection using frame pattern. + # e.g. 'pointcacheBgeoCache_AB010.1001.bgeo' + # will be + frame_collection, _ = clique.assemble( + [file_name], + patterns=[clique.PATTERNS["frames"]], + minimum_items=1 + ) + + # Return as no frame pattern detected. + if not frame_collection: + return + + # It's always expected to be one collection. + frame_collection = frame_collection[0] + frame_collection.indexes.clear() + frame_collection.indexes.update(list(range(start_frame, (end_frame + 1)))) + instance.data.update({"frames": list(frame_collection)}) From d0f2642eaeee0c800667b7b81faa550610af45f2 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 14 Jun 2024 11:28:48 +0300 Subject: [PATCH 58/86] use string format instead of os.path.join --- .../plugins/publish/collect_files_for_cleaning_up.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py index 485442cef0..1f2bfc3cf1 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -52,9 +52,9 @@ def process(self, instance): frames = instance.data.get("frames", []) staging_dir, _ = os.path.split(filepath) if isinstance(frames, str): - files = [os.path.join(staging_dir, frames)] + files = ["{}/{}".format(staging_dir, frames)] else: - files = [os.path.join(staging_dir, f) for f in frames] + files = ["{}/{}".format(staging_dir, f) for f in frames] # Farm Products with expected files expectedFiles = instance.data.get("expectedFiles", []) From 6d9667ed3d442008f0735a4834c11caa93ad98bb Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 14 Jun 2024 12:16:15 +0300 Subject: [PATCH 59/86] fix a bug with products with single file and improve the logic --- .../plugins/publish/collect_cache_farm.py | 48 +++++++------------ 1 file changed, 18 insertions(+), 30 deletions(-) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_cache_farm.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_cache_farm.py index ecfebccfef..68a66dacbd 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_cache_farm.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_cache_farm.py @@ -29,23 +29,30 @@ def process(self, instance): # Why do we need this particular collector to collect the expected # output files from a ROP node. Don't we have a dedicated collector # for that yet? + # Answer: No, we don't have a generic expected file collector. + # Because different product types needs different logic. + # e.g. check CollectMantraROPRenderProducts + # and CollectKarmaROPRenderProducts # Collect expected files ropnode = hou.node(instance.data["instance_node"]) output_parm = lib.get_output_parameter(ropnode) expected_filepath = output_parm.eval() instance.data.setdefault("files", list()) instance.data.setdefault("expectedFiles", list()) - if instance.data.get("frames"): - files = self.get_files(instance, expected_filepath) - # list of files - instance.data["files"].extend(files) - else: + + frames = instance.data.get("frames", []) + if not frames or isinstance(frames, str): # single file - instance.data["files"].append(output_parm.eval()) - cache_files = {"_": instance.data["files"]} - # Convert instance family to pointcache if it is bgeo or abc - # because ??? - self.log.debug(instance.data["families"]) + instance.data["files"].append(expected_filepath) + else: + # list of files + staging_dir, _ = os.path.split(expected_filepath) + instance.data["files"].extend( + ["{}/{}".format(staging_dir, f) for f in frames] + ) + + cache_files = {"cache": instance.data["files"]} + instance.data.update({ "plugin": "Houdini", "publish": True @@ -53,23 +60,4 @@ def process(self, instance): instance.data["families"].append("publish.hou") instance.data["expectedFiles"].append(cache_files) - self.log.debug("{}".format(instance.data)) - - def get_files(self, instance, output_parm): - """Get the files with the frame range data - - Args: - instance (_type_): instance - output_parm (_type_): path of output parameter - - Returns: - files: a list of files - """ - directory = os.path.dirname(output_parm) - - files = [ - os.path.join(directory, frame).replace("\\", "/") - for frame in instance.data["frames"] - ] - - return files + self.log.debug("{}".format(instance.data["expectedFiles"])) From 9a95b3b76f72ec2ced13aa56fe65f4f3d3036ef3 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 14 Jun 2024 12:17:10 +0300 Subject: [PATCH 60/86] update a comment and refactor a variable name --- .../plugins/publish/collect_files_for_cleaning_up.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py index 1f2bfc3cf1..e8280d1fb7 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -52,15 +52,16 @@ def process(self, instance): frames = instance.data.get("frames", []) staging_dir, _ = os.path.split(filepath) if isinstance(frames, str): - files = ["{}/{}".format(staging_dir, frames)] + files = [filepath] else: files = ["{}/{}".format(staging_dir, f) for f in frames] - # Farm Products with expected files + # Products with expected files + # This can be Render products or submitted cache to farm. expectedFiles = instance.data.get("expectedFiles", []) - for aovs in expectedFiles: - # aovs.values() is a list of lists - files.extend(sum(aovs.values(), [])) + for expected in expectedFiles: + # expected.values() is a list of lists + files.extend(sum(expected.values(), [])) # Intermediate exported render files. # Note: This only takes effect when setting render target to From 48f7559e64fc74b34a935c0817bdb235e988bb8e Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 14 Jun 2024 12:20:20 +0300 Subject: [PATCH 61/86] improve the logic --- .../client/ayon_houdini/plugins/publish/collect_cache_farm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_cache_farm.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_cache_farm.py index 68a66dacbd..d722907182 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_cache_farm.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_cache_farm.py @@ -40,8 +40,8 @@ def process(self, instance): instance.data.setdefault("files", list()) instance.data.setdefault("expectedFiles", list()) - frames = instance.data.get("frames", []) - if not frames or isinstance(frames, str): + frames = instance.data.get("frames", "") + if isinstance(frames, str): # single file instance.data["files"].append(expected_filepath) else: From f2cff110db3dc7fbc7c1d292204f9c3ed0a6a309 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 14 Jun 2024 16:26:31 +0300 Subject: [PATCH 62/86] prefer 'expectedFiles' over 'frames' and improve the logic --- .../publish/collect_files_for_cleaning_up.py | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py index e8280d1fb7..98e56fa414 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -48,20 +48,28 @@ def process(self, instance): return files = [] - # Products with frames - frames = instance.data.get("frames", []) staging_dir, _ = os.path.split(filepath) - if isinstance(frames, str): - files = [filepath] - else: - files = ["{}/{}".format(staging_dir, f) for f in frames] - # Products with expected files - # This can be Render products or submitted cache to farm. expectedFiles = instance.data.get("expectedFiles", []) - for expected in expectedFiles: - # expected.values() is a list of lists - files.extend(sum(expected.values(), [])) + + # 'expectedFiles' are preferred over 'frames' + if expectedFiles: + # Products with expected files + # This can be Render products or submitted cache to farm. + for expected in expectedFiles: + # expected.values() is a list of lists + files.extend(sum(expected.values(), [])) + else: + # Products with frames or single file. + frames = instance.data.get("frames", "") + if isinstance(frames, str): + # single file. + files.append(filepath) + else: + # list of frame. + files.extend( + ["{}/{}".format(staging_dir, f) for f in frames] + ) # Intermediate exported render files. # Note: This only takes effect when setting render target to @@ -77,15 +85,11 @@ def process(self, instance): start_frame, end_frame) files.extend(ifd_files) - # Products with single output file/frame - if not files: - files.append(filepath) - self.log.debug("Add directories to 'cleanupEmptyDir': {}".format(staging_dir)) instance.context.data["cleanupEmptyDirs"].append(staging_dir) self.log.debug("Add files to 'cleanupFullPaths': {}".format(files)) - instance.context.data["cleanupFullPaths"] += files + instance.context.data["cleanupFullPaths"].extend(files) def _get_ifd_file_list(self, ifdFile, start_frame, end_frame): From b4b8ffac080619e4a64b299d6a81ae2b15d325e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Mon, 17 Jun 2024 17:21:29 +0200 Subject: [PATCH 63/86] :dog: style changes --- .../publish/collect_files_for_cleaning_up.py | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py index 98e56fa414..a04c7a1f56 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -1,6 +1,7 @@ -import pyblish.api import os + import clique +import pyblish.api from ayon_core.pipeline import AYONPyblishPluginMixin from ayon_houdini.api import lib, plugin @@ -28,18 +29,19 @@ class CollectFilesForCleaningUp(plugin.HoudiniInstancePlugin, intermediate_exported_render = False def process(self, instance): - - import hou + import hou # noqa: E402 node = hou.node(instance.data.get("instance_node", "")) if not node: - self.log.debug("Skipping Collector. Instance has no instance_node") + self.log.debug( + "Skipping Collector. Instance has no instance_node") return output_parm = lib.get_output_parameter(node) if not output_parm: - self.log.debug("ROP node type '{}' is not supported for cleaning up." - .format(node.type().name())) + self.log.debug( + f"ROP node type '{node.type().name()}' is not " + "supported for cleaning up.") return filepath = output_parm.eval() @@ -50,13 +52,13 @@ def process(self, instance): files = [] staging_dir, _ = os.path.split(filepath) - expectedFiles = instance.data.get("expectedFiles", []) + expected_files = instance.data.get("expectedFiles", []) # 'expectedFiles' are preferred over 'frames' - if expectedFiles: + if expected_files: # Products with expected files # This can be Render products or submitted cache to farm. - for expected in expectedFiles: + for expected in expected_files: # expected.values() is a list of lists files.extend(sum(expected.values(), [])) else: @@ -68,7 +70,7 @@ def process(self, instance): else: # list of frame. files.extend( - ["{}/{}".format(staging_dir, f) for f in frames] + [f"{staging_dir}/{frame}" for frame in frames] ) # Intermediate exported render files. @@ -77,24 +79,25 @@ def process(self, instance): # as it's the only case where "ifdFile" exists in instance data. # TODO : Clean up intermediate files of Karma product type. # as "ifdFile" works for other render product types only. - ifdFile = instance.data.get("ifdFile") - if self.intermediate_exported_render and ifdFile: + ifd_file = instance.data.get("ifdFile") + if self.intermediate_exported_render and ifd_file: start_frame = instance.data["frameStartHandle"] end_frame = instance.data["frameEndHandle"] - ifd_files = self._get_ifd_file_list(ifdFile, + ifd_files = self._get_ifd_file_list(ifd_file, start_frame, end_frame) files.extend(ifd_files) - self.log.debug("Add directories to 'cleanupEmptyDir': {}".format(staging_dir)) + self.log.debug( + f"Add directories to 'cleanupEmptyDir': {staging_dir}") instance.context.data["cleanupEmptyDirs"].append(staging_dir) self.log.debug("Add files to 'cleanupFullPaths': {}".format(files)) instance.context.data["cleanupFullPaths"].extend(files) - def _get_ifd_file_list(self, ifdFile, start_frame, end_frame): + def _get_ifd_file_list(self, ifd_file, start_frame, end_frame): - file_name = os.path.basename(ifdFile) - parent_path = os.path.dirname(ifdFile) + file_name = os.path.basename(ifd_file) + parent_path = os.path.dirname(ifd_file) # Compute frames list frame_collection, _ = clique.assemble( @@ -106,10 +109,7 @@ def _get_ifd_file_list(self, ifdFile, start_frame, end_frame): # It's always expected to be one collection. frame_collection = frame_collection[0] frame_collection.indexes.clear() - frame_collection.indexes.update(list(range(start_frame, (end_frame + 1)))) + frame_collection.indexes.update( + list(range(start_frame, (end_frame + 1)))) - result = [ - "{}/{}".format(parent_path, frame) - for frame in frame_collection - ] - return result + return [f"{parent_path}/{frame}" for frame in frame_collection] From a22a99b1a9fa7b2652bd7384d7c641d5e73ff629 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 25 Jun 2024 15:15:01 +0300 Subject: [PATCH 64/86] Add CollectFilesForCleaningUp settings --- server_addon/houdini/client/ayon_houdini/version.py | 2 +- server_addon/houdini/package.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server_addon/houdini/client/ayon_houdini/version.py b/server_addon/houdini/client/ayon_houdini/version.py index 5c32b4860e..3dbbb4c23e 100644 --- a/server_addon/houdini/client/ayon_houdini/version.py +++ b/server_addon/houdini/client/ayon_houdini/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring AYON addon 'houdini' version.""" -__version__ = "0.3.6" +__version__ = "0.3.7" diff --git a/server_addon/houdini/package.py b/server_addon/houdini/package.py index fb345dab51..c01cc6044d 100644 --- a/server_addon/houdini/package.py +++ b/server_addon/houdini/package.py @@ -1,6 +1,6 @@ name = "houdini" title = "Houdini" -version = "0.3.6" +version = "0.3.7" client_dir = "ayon_houdini" From b04defeaee38bb31cda6b7acf81354764a60e544 Mon Sep 17 00:00:00 2001 From: Mustafa Taher Date: Wed, 26 Jun 2024 15:25:13 +0300 Subject: [PATCH 65/86] remove mantraifd from products enum Co-authored-by: Roy Nieterau --- server_addon/houdini/server/settings/publish.py | 1 - 1 file changed, 1 deletion(-) diff --git a/server_addon/houdini/server/settings/publish.py b/server_addon/houdini/server/settings/publish.py index e914cf2d0d..7a2e7df0d9 100644 --- a/server_addon/houdini/server/settings/publish.py +++ b/server_addon/houdini/server/settings/publish.py @@ -55,7 +55,6 @@ def product_types_enum(): {"value": "imagesequence", "label": "Composite (Image Sequence)"}, {"value": "ass", "label": "Arnold ASS"}, {"value": "arnold_rop", "label": "Arnold ROP"}, - {"value": "mantraifd", "label": "Mantra IFD"}, {"value": "mantra_rop", "label": "Mantra ROP"}, {"value": "redshiftproxy", "label": "Redshift Proxy"}, {"value": "redshift_rop", "label": "Redshift ROP"}, From 09b0364d2c913c249d746d063ce991809760c2ab Mon Sep 17 00:00:00 2001 From: Mustafa Taher Date: Wed, 26 Jun 2024 15:42:41 +0300 Subject: [PATCH 66/86] use assignment instead of update Co-authored-by: Roy Nieterau --- .../client/ayon_houdini/plugins/publish/collect_frames.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_frames.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_frames.py index 6e22574d93..987e477326 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_frames.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_frames.py @@ -59,4 +59,4 @@ def process(self, instance): frame_collection = frame_collection[0] frame_collection.indexes.clear() frame_collection.indexes.update(list(range(start_frame, (end_frame + 1)))) - instance.data.update({"frames": list(frame_collection)}) + instance.data["frames"] = list(frame_collection) From 8a264b14f8a1619ec50493522b8f4006ec383c9b Mon Sep 17 00:00:00 2001 From: Mustafa Taher Date: Wed, 26 Jun 2024 15:54:25 +0300 Subject: [PATCH 67/86] Update doc string of CollectFilesForCleaningUp Co-authored-by: Roy Nieterau --- .../plugins/publish/collect_files_for_cleaning_up.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py index a04c7a1f56..542fd6ded4 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -14,8 +14,9 @@ class CollectFilesForCleaningUp(plugin.HoudiniInstancePlugin, and adds them to file remove list. CAUTION: - This collector deletes the exported files and - deletes the parent folder if it was empty. + This collector registers exported files and + the parent folder (if it was empty) for deletion + in `ExplicitCleanUp` plug-in. Artists are free to change the file path in the ROP node. """ From 74fe37f00634986cdb66fa7051c1f8493edae143 Mon Sep 17 00:00:00 2001 From: Mustafa Taher Date: Wed, 26 Jun 2024 17:02:16 +0300 Subject: [PATCH 68/86] update log message Co-authored-by: Roy Nieterau --- .../client/ayon_houdini/plugins/publish/collect_cache_farm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_cache_farm.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_cache_farm.py index a3c104fa76..b7c3b55cae 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_cache_farm.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_cache_farm.py @@ -58,4 +58,4 @@ def process(self, instance): instance.data["families"].append("publish.hou") instance.data["expectedFiles"].append(cache_files) - self.log.debug("{}".format(instance.data["expectedFiles"])) + self.log.debug("Caching on farm expected files: {}".format(instance.data["expectedFiles"])) From c2d851a9b578f563b8c4b6eb91923abad5025ace Mon Sep 17 00:00:00 2001 From: Mustafa Taher Date: Wed, 26 Jun 2024 21:01:53 +0300 Subject: [PATCH 69/86] use for loop instead of sum Co-authored-by: Roy Nieterau --- .../plugins/publish/collect_files_for_cleaning_up.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py index 542fd6ded4..735b378024 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -61,7 +61,8 @@ def process(self, instance): # This can be Render products or submitted cache to farm. for expected in expected_files: # expected.values() is a list of lists - files.extend(sum(expected.values(), [])) + for output_files in expected.values(): + files.extend(output_files) else: # Products with frames or single file. frames = instance.data.get("frames", "") From 37cbcc13527741ad69d1f9c7c2b0145580df5825 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Wed, 26 Jun 2024 22:25:08 +0300 Subject: [PATCH 70/86] update logic of CollectFilesForCleaningUp and add collector for HDA products --- .../publish/collect_files_for_cleaning_up.py | 47 +++++++++---------- .../plugins/publish/collect_frames.py | 24 +++++++++- .../plugins/publish/extract_hda.py | 7 +-- 3 files changed, 46 insertions(+), 32 deletions(-) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py index 735b378024..f63dbd6f37 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -3,7 +3,7 @@ import clique import pyblish.api from ayon_core.pipeline import AYONPyblishPluginMixin -from ayon_houdini.api import lib, plugin +from ayon_houdini.api import plugin class CollectFilesForCleaningUp(plugin.HoudiniInstancePlugin, @@ -30,28 +30,9 @@ class CollectFilesForCleaningUp(plugin.HoudiniInstancePlugin, intermediate_exported_render = False def process(self, instance): - import hou # noqa: E402 - - node = hou.node(instance.data.get("instance_node", "")) - if not node: - self.log.debug( - "Skipping Collector. Instance has no instance_node") - return - - output_parm = lib.get_output_parameter(node) - if not output_parm: - self.log.debug( - f"ROP node type '{node.type().name()}' is not " - "supported for cleaning up.") - return - - filepath = output_parm.eval() - if not filepath: - self.log.warning("No filepath value to collect.") - return files = [] - staging_dir, _ = os.path.split(filepath) + staging_dirs = [] expected_files = instance.data.get("expectedFiles", []) @@ -62,13 +43,26 @@ def process(self, instance): for expected in expected_files: # expected.values() is a list of lists for output_files in expected.values(): + staging_dir, _ = os.path.split(output_files[0]) + if staging_dir not in staging_dirs: + staging_dirs.append(staging_dir) files.extend(output_files) else: # Products with frames or single file. - frames = instance.data.get("frames", "") - if isinstance(frames, str): + + staging_dir = instance.data.get("stagingDir") + staging_dirs.append(staging_dir) + + frames = instance.data.get("frames") + if frames is None: + self.log.warning( + f"No frames data found on instance {instance}" + ". Skipping collection for caching on farm..." + ) + return + elif isinstance(frames, str): # single file. - files.append(filepath) + files.append(frames) else: # list of frame. files.extend( @@ -87,11 +81,12 @@ def process(self, instance): end_frame = instance.data["frameEndHandle"] ifd_files = self._get_ifd_file_list(ifd_file, start_frame, end_frame) + staging_dirs.append(os.path.dirname(ifd_file)) files.extend(ifd_files) self.log.debug( - f"Add directories to 'cleanupEmptyDir': {staging_dir}") - instance.context.data["cleanupEmptyDirs"].append(staging_dir) + f"Add directories to 'cleanupEmptyDir': {staging_dirs}") + instance.context.data["cleanupEmptyDirs"].extend(staging_dirs) self.log.debug("Add files to 'cleanupFullPaths': {}".format(files)) instance.context.data["cleanupFullPaths"].extend(files) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_frames.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_frames.py index 987e477326..b001d3757d 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_frames.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_frames.py @@ -15,7 +15,8 @@ class CollectFrames(plugin.HoudiniInstancePlugin): order = pyblish.api.CollectorOrder + 0.1 label = "Collect Frames" families = ["camera", "vdbcache", "imagesequence", "ass", - "redshiftproxy", "review", "pointcache", "fbx"] + "redshiftproxy", "review", "pointcache", "fbx", + "model"] def process(self, instance): @@ -60,3 +61,24 @@ def process(self, instance): frame_collection.indexes.clear() frame_collection.indexes.update(list(range(start_frame, (end_frame + 1)))) instance.data["frames"] = list(frame_collection) + + +class CollectHDAFrames(plugin.HoudiniInstancePlugin): + """Collect all frames which would be saved from HDA nodes""" + + order = pyblish.api.CollectorOrder + label = "Collect Frames" + families = ["hda"] + + def process(self, instance): + + hda_node = hou.node(instance.data.get("instance_node")) + hda_def = hda_node.type().definition() + + file_name = os.path.basename(hda_def.libraryFilePath()) + staging_dir = os.path.dirname(hda_def.libraryFilePath()) + + instance.data.update({ + "frames": file_name, # Set frames to the file name by default. + "stagingDir": staging_dir + }) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/extract_hda.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/extract_hda.py index e4449d11f8..c1c0ed67f2 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/extract_hda.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/extract_hda.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -import os from pprint import pformat import hou import pyblish.api @@ -28,14 +27,12 @@ def process(self, instance): if "representations" not in instance.data: instance.data["representations"] = [] - file = os.path.basename(hda_def.libraryFilePath()) - staging_dir = os.path.dirname(hda_def.libraryFilePath()) self.log.info("Using HDA from {}".format(hda_def.libraryFilePath())) representation = { 'name': 'hda', 'ext': 'hda', - 'files': file, - "stagingDir": staging_dir, + 'files': instance.data["frames"], + "stagingDir": instance.data["stagingDir"], } instance.data["representations"].append(representation) From 5d5f3d913081e66c8455e31801116a69c6f817b7 Mon Sep 17 00:00:00 2001 From: Mustafa Taher Date: Thu, 27 Jun 2024 10:20:52 +0300 Subject: [PATCH 71/86] update comment in CollectFilesForCleaningUp.process Co-authored-by: Roy Nieterau --- .../plugins/publish/collect_files_for_cleaning_up.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py index f63dbd6f37..ccd473aff0 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -36,7 +36,8 @@ def process(self, instance): expected_files = instance.data.get("expectedFiles", []) - # 'expectedFiles' are preferred over 'frames' + # Prefer 'expectedFiles' over 'frames' because it usually contains + # more output files than just a single file or single sequence of files. if expected_files: # Products with expected files # This can be Render products or submitted cache to farm. From 9784287079e9b8bcd1a647b4cd26f3a5f0285247 Mon Sep 17 00:00:00 2001 From: Mustafa Taher Date: Thu, 27 Jun 2024 10:33:27 +0300 Subject: [PATCH 72/86] make files complete for the single file condition Co-authored-by: Roy Nieterau --- .../plugins/publish/collect_files_for_cleaning_up.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py index ccd473aff0..7fbd14641b 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -51,9 +51,6 @@ def process(self, instance): else: # Products with frames or single file. - staging_dir = instance.data.get("stagingDir") - staging_dirs.append(staging_dir) - frames = instance.data.get("frames") if frames is None: self.log.warning( @@ -61,9 +58,13 @@ def process(self, instance): ". Skipping collection for caching on farm..." ) return - elif isinstance(frames, str): + + staging_dir = instance.data.get("stagingDir") + staging_dirs.append(staging_dir) + + if isinstance(frames, str): # single file. - files.append(frames) + files.append(f"{staging_dir}/{frames}") else: # list of frame. files.extend( From e9e2e0c32594d82de5bf519ae9bb20daaa3a9673 Mon Sep 17 00:00:00 2001 From: Mustafa Taher Date: Thu, 27 Jun 2024 10:50:47 +0300 Subject: [PATCH 73/86] add type hints Co-authored-by: Roy Nieterau --- .../plugins/publish/collect_files_for_cleaning_up.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py index 7fbd14641b..85fa649d07 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -31,8 +31,8 @@ class CollectFilesForCleaningUp(plugin.HoudiniInstancePlugin, def process(self, instance): - files = [] - staging_dirs = [] + files: List[os.PathLike] = [] + staging_dirs: List[os.PathLike] = [] expected_files = instance.data.get("expectedFiles", []) From 03d1f856608af5a762e70b77ba61170033f1b1e6 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 27 Jun 2024 10:56:56 +0300 Subject: [PATCH 74/86] fix type hints --- .../plugins/publish/collect_files_for_cleaning_up.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py index 85fa649d07..b204e0f740 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -31,8 +31,8 @@ class CollectFilesForCleaningUp(plugin.HoudiniInstancePlugin, def process(self, instance): - files: List[os.PathLike] = [] - staging_dirs: List[os.PathLike] = [] + files: list[os.PathLike] = [] + staging_dirs: list[os.PathLike] = [] expected_files = instance.data.get("expectedFiles", []) From 60ec86206f51cbafdefaa447685e661fc2dc888a Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 27 Jun 2024 11:23:56 +0300 Subject: [PATCH 75/86] revert changes in HDA plugins --- .../plugins/publish/collect_frames.py | 21 ------------------- .../plugins/publish/extract_hda.py | 7 +++++-- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_frames.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_frames.py index b001d3757d..a442e74835 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_frames.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_frames.py @@ -61,24 +61,3 @@ def process(self, instance): frame_collection.indexes.clear() frame_collection.indexes.update(list(range(start_frame, (end_frame + 1)))) instance.data["frames"] = list(frame_collection) - - -class CollectHDAFrames(plugin.HoudiniInstancePlugin): - """Collect all frames which would be saved from HDA nodes""" - - order = pyblish.api.CollectorOrder - label = "Collect Frames" - families = ["hda"] - - def process(self, instance): - - hda_node = hou.node(instance.data.get("instance_node")) - hda_def = hda_node.type().definition() - - file_name = os.path.basename(hda_def.libraryFilePath()) - staging_dir = os.path.dirname(hda_def.libraryFilePath()) - - instance.data.update({ - "frames": file_name, # Set frames to the file name by default. - "stagingDir": staging_dir - }) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/extract_hda.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/extract_hda.py index c1c0ed67f2..e4449d11f8 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/extract_hda.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/extract_hda.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +import os from pprint import pformat import hou import pyblish.api @@ -27,12 +28,14 @@ def process(self, instance): if "representations" not in instance.data: instance.data["representations"] = [] + file = os.path.basename(hda_def.libraryFilePath()) + staging_dir = os.path.dirname(hda_def.libraryFilePath()) self.log.info("Using HDA from {}".format(hda_def.libraryFilePath())) representation = { 'name': 'hda', 'ext': 'hda', - 'files': instance.data["frames"], - "stagingDir": instance.data["stagingDir"], + 'files': file, + "stagingDir": staging_dir, } instance.data["representations"].append(representation) From d34ccc1495f742a88f783c4b702fb0ec2ca32811 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 27 Jun 2024 11:38:15 +0300 Subject: [PATCH 76/86] remove farm related logic and add notes about it --- .../publish/collect_files_for_cleaning_up.py | 43 +++++++++++-------- .../houdini/server/settings/publish.py | 6 +-- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py index b204e0f740..edd3a4c82b 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -15,9 +15,27 @@ class CollectFilesForCleaningUp(plugin.HoudiniInstancePlugin, CAUTION: This collector registers exported files and - the parent folder (if it was empty) for deletion - in `ExplicitCleanUp` plug-in. + the parent folder for deletion in `ExplicitCleanUp` plug-in. + please refer to `ExplicitCleanUp`'s docstring for further info. + + Notes: Artists are free to change the file path in the ROP node. + + Farm instances will be processed on farm by other dedicated plugins + that live in core addon e.g. `CollectRenderedFiles` plugin. + These dedicated plugins don't support tracking and removing + intermediated render files. + + Local Render instances don't track intermediated render files, + Therefore, this plugin doesn't support removing + intermediate render files. + + HDA is not added to this plugin's options in server settings. + Cleaning up HDA products will break the scene as Houdini will no longer + be able to find the HDA file. + In addition,HDA plugins always save HDAs to external files. + Therefore, Cleaning up HDA products will break the ability to go back + to the workfile and continue on the HDA. """ # It should run after CollectFrames and Collect Render plugins, @@ -27,13 +45,15 @@ class CollectFilesForCleaningUp(plugin.HoudiniInstancePlugin, hosts = ["houdini"] families = ["*"] label = "Collect Files For Cleaning Up" - intermediate_exported_render = False def process(self, instance): + if instance.data.get("farm"): + self.log.debug("Should be processed on farm, skipping.") + return + files: list[os.PathLike] = [] staging_dirs: list[os.PathLike] = [] - expected_files = instance.data.get("expectedFiles", []) # Prefer 'expectedFiles' over 'frames' because it usually contains @@ -71,21 +91,6 @@ def process(self, instance): [f"{staging_dir}/{frame}" for frame in frames] ) - # Intermediate exported render files. - # Note: This only takes effect when setting render target to - # "Farm Rendering - Split export & render jobs" - # as it's the only case where "ifdFile" exists in instance data. - # TODO : Clean up intermediate files of Karma product type. - # as "ifdFile" works for other render product types only. - ifd_file = instance.data.get("ifdFile") - if self.intermediate_exported_render and ifd_file: - start_frame = instance.data["frameStartHandle"] - end_frame = instance.data["frameEndHandle"] - ifd_files = self._get_ifd_file_list(ifd_file, - start_frame, end_frame) - staging_dirs.append(os.path.dirname(ifd_file)) - files.extend(ifd_files) - self.log.debug( f"Add directories to 'cleanupEmptyDir': {staging_dirs}") instance.context.data["cleanupEmptyDirs"].extend(staging_dirs) diff --git a/server_addon/houdini/server/settings/publish.py b/server_addon/houdini/server/settings/publish.py index 7a2e7df0d9..71dc466968 100644 --- a/server_addon/houdini/server/settings/publish.py +++ b/server_addon/houdini/server/settings/publish.py @@ -68,11 +68,7 @@ class CollectFilesForCleaningUpModel(BaseSettingsModel): enabled: bool = SettingsField(title="Enabled") optional: bool = SettingsField(title="Optional") active: bool = SettingsField(title="Active") - intermediate_exported_render: bool = SettingsField( - title="Include Intermediate Exported Render Files", - description="Include intermediate exported render scenes for cleanup" - " (.idf, .ass, .usd, .rs) for render instances.", - ) + families: list[str] = SettingsField( default_factory=list, enum_resolver=product_types_enum, From b8ec2a95b3e2968997e0910a3967785609627210 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 27 Jun 2024 12:17:15 +0300 Subject: [PATCH 77/86] remove a redundant default setting value --- server_addon/houdini/server/settings/publish.py | 1 - 1 file changed, 1 deletion(-) diff --git a/server_addon/houdini/server/settings/publish.py b/server_addon/houdini/server/settings/publish.py index 71dc466968..08b9eca82f 100644 --- a/server_addon/houdini/server/settings/publish.py +++ b/server_addon/houdini/server/settings/publish.py @@ -148,7 +148,6 @@ class PublishPluginsModel(BaseSettingsModel): "enabled": False, "optional": True, "active": True, - "intermediate_exported_render": False, "families" : [] }, "CollectLocalRenderInstances": { From 53fb6ba45c843d4af6292b703fe5402ee7351a7e Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Thu, 27 Jun 2024 13:07:06 +0200 Subject: [PATCH 78/86] Cosmetics PEP8 --- .../plugins/publish/collect_files_for_cleaning_up.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py index edd3a4c82b..af79aa089c 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -56,8 +56,8 @@ def process(self, instance): staging_dirs: list[os.PathLike] = [] expected_files = instance.data.get("expectedFiles", []) - # Prefer 'expectedFiles' over 'frames' because it usually contains - # more output files than just a single file or single sequence of files. + # Prefer 'expectedFiles' over 'frames' because it usually contains more + # output files than just a single file or single sequence of files. if expected_files: # Products with expected files # This can be Render products or submitted cache to farm. From 24cc6a9c418645762ae15bf54ed424b1b96899f3 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Thu, 27 Jun 2024 13:10:06 +0200 Subject: [PATCH 79/86] Use `List[str]` instead of `list[os.PathLike]` - `list[]` is only since Py3.9 - this way we're compatible with older Py3 - `os.PathLike` doesn't seem to like it if we just pass it a `str` for whatever reason --- .../plugins/publish/collect_files_for_cleaning_up.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py index af79aa089c..a90df9749c 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -1,4 +1,5 @@ import os +from typing import List import clique import pyblish.api @@ -52,8 +53,8 @@ def process(self, instance): self.log.debug("Should be processed on farm, skipping.") return - files: list[os.PathLike] = [] - staging_dirs: list[os.PathLike] = [] + files: List[str] = [] + staging_dirs: List[str] = [] expected_files = instance.data.get("expectedFiles", []) # Prefer 'expectedFiles' over 'frames' because it usually contains more From 9b652dff1a839815fd6169e9b323229206a06c5d Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Thu, 27 Jun 2024 13:10:32 +0200 Subject: [PATCH 80/86] Cosmetics --- .../plugins/publish/collect_files_for_cleaning_up.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py index a90df9749c..5067f046c4 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -11,8 +11,7 @@ class CollectFilesForCleaningUp(plugin.HoudiniInstancePlugin, AYONPyblishPluginMixin): """Collect Files For Cleaning Up. - This collector collects output files - and adds them to file remove list. + This collector collects output files and adds them to file remove list. CAUTION: This collector registers exported files and @@ -25,9 +24,9 @@ class CollectFilesForCleaningUp(plugin.HoudiniInstancePlugin, Farm instances will be processed on farm by other dedicated plugins that live in core addon e.g. `CollectRenderedFiles` plugin. These dedicated plugins don't support tracking and removing - intermediated render files. + intermediate render files. - Local Render instances don't track intermediated render files, + Local Render instances don't track intermediate render files, Therefore, this plugin doesn't support removing intermediate render files. From 52837d1d7f655fd5783b7aefa93892978a1c4db1 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Thu, 27 Jun 2024 13:14:08 +0200 Subject: [PATCH 81/86] Explicitly error if it doesn't behave as we expect it to --- .../plugins/publish/collect_files_for_cleaning_up.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py index 5067f046c4..d0c77cd98a 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -104,14 +104,19 @@ def _get_ifd_file_list(self, ifd_file, start_frame, end_frame): parent_path = os.path.dirname(ifd_file) # Compute frames list - frame_collection, _ = clique.assemble( + collections, _ = clique.assemble( [file_name], patterns=[clique.PATTERNS["frames"]], minimum_items=1 ) # It's always expected to be one collection. - frame_collection = frame_collection[0] + if len(collections) != 1: + raise ValueError( + f"Expected to detect a single sequence from {file_name} but " + f"instead got {collections}") + + frame_collection = collections[0] frame_collection.indexes.clear() frame_collection.indexes.update( list(range(start_frame, (end_frame + 1)))) From b818abcd78ca6f8ed43bdeae958f5e8cf49b81be Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Thu, 27 Jun 2024 13:15:34 +0200 Subject: [PATCH 82/86] Refactor `BasicValidateModel` -> `BasicEnabledStatesModel` --- server_addon/houdini/server/settings/publish.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/houdini/server/settings/publish.py b/server_addon/houdini/server/settings/publish.py index 555b6de376..ff39ff88e3 100644 --- a/server_addon/houdini/server/settings/publish.py +++ b/server_addon/houdini/server/settings/publish.py @@ -108,7 +108,7 @@ class PublishPluginsModel(BaseSettingsModel): title="Collect Chunk Size" ) CollectFilesForCleaningUp:CollectFilesForCleaningUpModel = SettingsField( - default_factory=BasicValidateModel, + default_factory=BasicEnabledStatesModel, title="Collect Files For Cleaning Up." ) CollectLocalRenderInstances: CollectLocalRenderInstancesModel = SettingsField( From 2e10a5dc322390e1cb432f7ff649fc8e6d8a5c84 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 27 Jun 2024 14:30:16 +0300 Subject: [PATCH 83/86] refactor `BasicEnabledStatesModel` -> `CollectFilesForCleaningUpModel` --- server_addon/houdini/server/settings/publish.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/houdini/server/settings/publish.py b/server_addon/houdini/server/settings/publish.py index ff39ff88e3..fe0d25751a 100644 --- a/server_addon/houdini/server/settings/publish.py +++ b/server_addon/houdini/server/settings/publish.py @@ -108,7 +108,7 @@ class PublishPluginsModel(BaseSettingsModel): title="Collect Chunk Size" ) CollectFilesForCleaningUp:CollectFilesForCleaningUpModel = SettingsField( - default_factory=BasicEnabledStatesModel, + default_factory=CollectFilesForCleaningUpModel, title="Collect Files For Cleaning Up." ) CollectLocalRenderInstances: CollectLocalRenderInstancesModel = SettingsField( From 15505a9f674617de59db36fa1580f06dd2b7008b Mon Sep 17 00:00:00 2001 From: Mustafa Taher Date: Thu, 27 Jun 2024 14:40:28 +0300 Subject: [PATCH 84/86] fix code style Co-authored-by: Roy Nieterau --- server_addon/houdini/server/settings/publish.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_addon/houdini/server/settings/publish.py b/server_addon/houdini/server/settings/publish.py index fe0d25751a..793f14eae6 100644 --- a/server_addon/houdini/server/settings/publish.py +++ b/server_addon/houdini/server/settings/publish.py @@ -107,7 +107,7 @@ class PublishPluginsModel(BaseSettingsModel): default_factory=CollectChunkSizeModel, title="Collect Chunk Size" ) - CollectFilesForCleaningUp:CollectFilesForCleaningUpModel = SettingsField( + CollectFilesForCleaningUp: CollectFilesForCleaningUpModel = SettingsField( default_factory=CollectFilesForCleaningUpModel, title="Collect Files For Cleaning Up." ) From 067f1c250bb417b4d11df24db9a8293f8beee434 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 27 Jun 2024 14:41:34 +0300 Subject: [PATCH 85/86] remove unused method --- .../publish/collect_files_for_cleaning_up.py | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py index d0c77cd98a..3ab03babf4 100644 --- a/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py +++ b/server_addon/houdini/client/ayon_houdini/plugins/publish/collect_files_for_cleaning_up.py @@ -1,7 +1,6 @@ import os from typing import List -import clique import pyblish.api from ayon_core.pipeline import AYONPyblishPluginMixin from ayon_houdini.api import plugin @@ -97,28 +96,3 @@ def process(self, instance): self.log.debug("Add files to 'cleanupFullPaths': {}".format(files)) instance.context.data["cleanupFullPaths"].extend(files) - - def _get_ifd_file_list(self, ifd_file, start_frame, end_frame): - - file_name = os.path.basename(ifd_file) - parent_path = os.path.dirname(ifd_file) - - # Compute frames list - collections, _ = clique.assemble( - [file_name], - patterns=[clique.PATTERNS["frames"]], - minimum_items=1 - ) - - # It's always expected to be one collection. - if len(collections) != 1: - raise ValueError( - f"Expected to detect a single sequence from {file_name} but " - f"instead got {collections}") - - frame_collection = collections[0] - frame_collection.indexes.clear() - frame_collection.indexes.update( - list(range(start_frame, (end_frame + 1)))) - - return [f"{parent_path}/{frame}" for frame in frame_collection] From 435e5f31771e819c2989d9abbade219193a6db5c Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Thu, 27 Jun 2024 13:55:50 +0200 Subject: [PATCH 86/86] Bump Houdini addon version --- server_addon/houdini/client/ayon_houdini/version.py | 2 +- server_addon/houdini/package.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server_addon/houdini/client/ayon_houdini/version.py b/server_addon/houdini/client/ayon_houdini/version.py index 3dbbb4c23e..4010dbff93 100644 --- a/server_addon/houdini/client/ayon_houdini/version.py +++ b/server_addon/houdini/client/ayon_houdini/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring AYON addon 'houdini' version.""" -__version__ = "0.3.7" +__version__ = "0.3.8" diff --git a/server_addon/houdini/package.py b/server_addon/houdini/package.py index c01cc6044d..7e67b169c6 100644 --- a/server_addon/houdini/package.py +++ b/server_addon/houdini/package.py @@ -1,6 +1,6 @@ name = "houdini" title = "Houdini" -version = "0.3.7" +version = "0.3.8" client_dir = "ayon_houdini"