From 66832f3c323fb7ab7e24e9a669ef5719286ffea6 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Wed, 5 Jul 2023 18:21:40 +0300 Subject: [PATCH 01/12] add better selection --- .../plugins/create/create_pointcache.py | 68 ++++++++++++++++--- 1 file changed, 58 insertions(+), 10 deletions(-) diff --git a/openpype/hosts/houdini/plugins/create/create_pointcache.py b/openpype/hosts/houdini/plugins/create/create_pointcache.py index df74070fee..00ff22bdda 100644 --- a/openpype/hosts/houdini/plugins/create/create_pointcache.py +++ b/openpype/hosts/houdini/plugins/create/create_pointcache.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- """Creator plugin for creating pointcache alembics.""" from openpype.hosts.houdini.api import plugin -from openpype.pipeline import CreatedInstance import hou @@ -14,15 +13,13 @@ class CreatePointCache(plugin.HoudiniCreator): icon = "gears" def create(self, subset_name, instance_data, pre_create_data): - import hou - instance_data.pop("active", None) instance_data.update({"node_type": "alembic"}) instance = super(CreatePointCache, self).create( subset_name, instance_data, - pre_create_data) # type: CreatedInstance + pre_create_data) instance_node = hou.node(instance.get("instance_node")) parms = { @@ -37,13 +34,50 @@ class CreatePointCache(plugin.HoudiniCreator): } if self.selected_nodes: - parms["sop_path"] = self.selected_nodes[0].path() + selected_node = self.selected_nodes[0] - # try to find output node - for child in self.selected_nodes[0].children(): - if child.type().name() == "output": - parms["sop_path"] = child.path() - break + # Although Houdini allows ObjNode path on `sop_path`rop node + # However, it's preferred to set SopNode path explicitly + # These checks prevent using user selecting + + # Allow sop level paths (e.g. /obj/geo1/box1) + # but do not allow other sop level paths when + # the parent type is not 'geo' like + # Cameras, Dopnet nodes(sop solver) + if isinstance(selected_node, hou.SopNode) and \ + selected_node.parent().type().name() == 'geo': + parms["sop_path"] = selected_node.path() + self.log.debug( + "Valid SopNode selection, 'SOP Path' in ROP will be set to '%s'." + % selected_node.path() + ) + + # Allow object level paths to Geometry nodes (e.g. /obj/geo1) + # but do not allow other object level nodes types like cameras, etc. + elif isinstance(selected_node, hou.ObjNode) and \ + selected_node.type().name() == 'geo': + + # get the output node with the minimum + # 'outputidx' or the node with display flag + sop_path = self.get_obj_output(selected_node) or \ + selected_node.displayNode() + + if sop_path: + parms["sop_path"] = sop_path.path() + self.log.debug( + "Valid ObjNode selection, 'SOP Path' in ROP will be set to " + "the child path '%s'." + % sop_path.path() + ) + + if not parms.get("sop_path", None): + self.log.debug( + "Selection isn't valid.'SOP Path' in ROP will be empty." + ) + else: + self.log.debug( + "No Selection.'SOP Path' in ROP will be empty." + ) instance_node.setParms(parms) instance_node.parm("trange").set(1) @@ -57,3 +91,17 @@ class CreatePointCache(plugin.HoudiniCreator): hou.ropNodeTypeCategory(), hou.sopNodeTypeCategory() ] + + def get_obj_output(self, obj_node): + """Find output node with the smallest 'outputidx'.""" + + outputs = dict() + + for sop_node in obj_node.children(): + if sop_node.type().name() == 'output' : + outputs.update({sop_node : sop_node.parm('outputidx').eval()}) + + if outputs: + return min(outputs, key = outputs.get) + else: + return From e710f5f70e491a1c744e21ac5e6693f772c56b43 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Wed, 5 Jul 2023 18:48:12 +0300 Subject: [PATCH 02/12] add subnet to allowed --- openpype/hosts/houdini/plugins/create/create_pointcache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/houdini/plugins/create/create_pointcache.py b/openpype/hosts/houdini/plugins/create/create_pointcache.py index 00ff22bdda..931b8561a8 100644 --- a/openpype/hosts/houdini/plugins/create/create_pointcache.py +++ b/openpype/hosts/houdini/plugins/create/create_pointcache.py @@ -45,7 +45,7 @@ class CreatePointCache(plugin.HoudiniCreator): # the parent type is not 'geo' like # Cameras, Dopnet nodes(sop solver) if isinstance(selected_node, hou.SopNode) and \ - selected_node.parent().type().name() == 'geo': + selected_node.parent().type().name() in ['geo', 'subnet']: parms["sop_path"] = selected_node.path() self.log.debug( "Valid SopNode selection, 'SOP Path' in ROP will be set to '%s'." @@ -55,7 +55,7 @@ class CreatePointCache(plugin.HoudiniCreator): # Allow object level paths to Geometry nodes (e.g. /obj/geo1) # but do not allow other object level nodes types like cameras, etc. elif isinstance(selected_node, hou.ObjNode) and \ - selected_node.type().name() == 'geo': + selected_node.type().name() in ['geo']: # get the output node with the minimum # 'outputidx' or the node with display flag From 5009df0f2893827b739032094ab7af2dad8e7b22 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Wed, 5 Jul 2023 20:02:33 +0300 Subject: [PATCH 03/12] up date get_obj_output --- .../plugins/create/create_pointcache.py | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/openpype/hosts/houdini/plugins/create/create_pointcache.py b/openpype/hosts/houdini/plugins/create/create_pointcache.py index 931b8561a8..d36c6dfb3f 100644 --- a/openpype/hosts/houdini/plugins/create/create_pointcache.py +++ b/openpype/hosts/houdini/plugins/create/create_pointcache.py @@ -36,9 +36,8 @@ class CreatePointCache(plugin.HoudiniCreator): if self.selected_nodes: selected_node = self.selected_nodes[0] - # Although Houdini allows ObjNode path on `sop_path`rop node - # However, it's preferred to set SopNode path explicitly - # These checks prevent using user selecting + # Although Houdini allows ObjNode path on `sop_path` for the + # the ROP node we prefer it set to the SopNode path explicitly # Allow sop level paths (e.g. /obj/geo1/box1) # but do not allow other sop level paths when @@ -72,11 +71,11 @@ class CreatePointCache(plugin.HoudiniCreator): if not parms.get("sop_path", None): self.log.debug( - "Selection isn't valid.'SOP Path' in ROP will be empty." + "Selection isn't valid. 'SOP Path' in ROP will be empty." ) else: self.log.debug( - "No Selection.'SOP Path' in ROP will be empty." + "No Selection. 'SOP Path' in ROP will be empty." ) instance_node.setParms(parms) @@ -95,13 +94,18 @@ class CreatePointCache(plugin.HoudiniCreator): def get_obj_output(self, obj_node): """Find output node with the smallest 'outputidx'.""" - outputs = dict() + outputs = obj_node.subnetOutputs() - for sop_node in obj_node.children(): - if sop_node.type().name() == 'output' : - outputs.update({sop_node : sop_node.parm('outputidx').eval()}) - - if outputs: - return min(outputs, key = outputs.get) - else: + # if obj_node is empty + if not outputs: return + + # if obj_node has one output child whether its + # sop output node or a node with the render flag + elif len(outputs)==1: + return outputs[0] + + # if there are more than one, then it have multiple ouput nodes + # return the one with the minimum 'outputidx' + else: + return (min(outputs, key=lambda node : node.parm('outputidx').eval())) From 10dcc4440cd0218c899c54e70581a4814ce54e6e Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Thu, 6 Jul 2023 11:24:39 +0300 Subject: [PATCH 04/12] fix lint problems --- .../houdini/plugins/create/create_pointcache.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/openpype/hosts/houdini/plugins/create/create_pointcache.py b/openpype/hosts/houdini/plugins/create/create_pointcache.py index d36c6dfb3f..b06fb64603 100644 --- a/openpype/hosts/houdini/plugins/create/create_pointcache.py +++ b/openpype/hosts/houdini/plugins/create/create_pointcache.py @@ -44,7 +44,7 @@ class CreatePointCache(plugin.HoudiniCreator): # the parent type is not 'geo' like # Cameras, Dopnet nodes(sop solver) if isinstance(selected_node, hou.SopNode) and \ - selected_node.parent().type().name() in ['geo', 'subnet']: + selected_node.parent().type().name() in ["geo", "subnet"]: parms["sop_path"] = selected_node.path() self.log.debug( "Valid SopNode selection, 'SOP Path' in ROP will be set to '%s'." @@ -54,7 +54,7 @@ class CreatePointCache(plugin.HoudiniCreator): # Allow object level paths to Geometry nodes (e.g. /obj/geo1) # but do not allow other object level nodes types like cameras, etc. elif isinstance(selected_node, hou.ObjNode) and \ - selected_node.type().name() in ['geo']: + selected_node.type().name() in ["geo"]: # get the output node with the minimum # 'outputidx' or the node with display flag @@ -71,7 +71,7 @@ class CreatePointCache(plugin.HoudiniCreator): if not parms.get("sop_path", None): self.log.debug( - "Selection isn't valid. 'SOP Path' in ROP will be empty." + "Selection isn't valid. 'SOP Path' in ROP will be empty." ) else: self.log.debug( @@ -102,10 +102,11 @@ class CreatePointCache(plugin.HoudiniCreator): # if obj_node has one output child whether its # sop output node or a node with the render flag - elif len(outputs)==1: + elif len(outputs) == 1: return outputs[0] # if there are more than one, then it have multiple ouput nodes # return the one with the minimum 'outputidx' - else: - return (min(outputs, key=lambda node : node.parm('outputidx').eval())) + else : + return min(outputs, + key=lambda node : node.parm('outputidx').eval()) From fa57cc4bdc14f6b01306a940b20b1e3907fa29df Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Thu, 6 Jul 2023 11:27:29 +0300 Subject: [PATCH 05/12] fix lint problems --- openpype/hosts/houdini/plugins/create/create_pointcache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/houdini/plugins/create/create_pointcache.py b/openpype/hosts/houdini/plugins/create/create_pointcache.py index b06fb64603..98d46d0eef 100644 --- a/openpype/hosts/houdini/plugins/create/create_pointcache.py +++ b/openpype/hosts/houdini/plugins/create/create_pointcache.py @@ -107,6 +107,6 @@ class CreatePointCache(plugin.HoudiniCreator): # if there are more than one, then it have multiple ouput nodes # return the one with the minimum 'outputidx' - else : + else: return min(outputs, - key=lambda node : node.parm('outputidx').eval()) + key=lambda node : node.parm('outputidx').eval()) From fdf35e115b1373a9c49be9e62ae506445894f902 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Thu, 6 Jul 2023 12:39:13 +0300 Subject: [PATCH 06/12] fix lint problems --- openpype/hosts/houdini/plugins/create/create_pointcache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/houdini/plugins/create/create_pointcache.py b/openpype/hosts/houdini/plugins/create/create_pointcache.py index 98d46d0eef..18ca5240ad 100644 --- a/openpype/hosts/houdini/plugins/create/create_pointcache.py +++ b/openpype/hosts/houdini/plugins/create/create_pointcache.py @@ -109,4 +109,4 @@ class CreatePointCache(plugin.HoudiniCreator): # return the one with the minimum 'outputidx' else: return min(outputs, - key=lambda node : node.parm('outputidx').eval()) + key=lambda node : node.parm('outputidx').eval()) From ac517edf5545b0ffbdd7e47f22ee8a8aea84ec80 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Thu, 6 Jul 2023 13:35:13 +0300 Subject: [PATCH 07/12] resolve conversation --- openpype/hosts/houdini/plugins/create/create_pointcache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/houdini/plugins/create/create_pointcache.py b/openpype/hosts/houdini/plugins/create/create_pointcache.py index 18ca5240ad..cf5f9b2edb 100644 --- a/openpype/hosts/houdini/plugins/create/create_pointcache.py +++ b/openpype/hosts/houdini/plugins/create/create_pointcache.py @@ -109,4 +109,4 @@ class CreatePointCache(plugin.HoudiniCreator): # return the one with the minimum 'outputidx' else: return min(outputs, - key=lambda node : node.parm('outputidx').eval()) + key=lambda node : node.evalParm('outputidx')) From 44571c1f062ee2ed607378f560332bae824b2225 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Thu, 6 Jul 2023 13:42:50 +0300 Subject: [PATCH 08/12] delete unnecessary function call --- openpype/hosts/houdini/plugins/create/create_pointcache.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openpype/hosts/houdini/plugins/create/create_pointcache.py b/openpype/hosts/houdini/plugins/create/create_pointcache.py index cf5f9b2edb..8914269f45 100644 --- a/openpype/hosts/houdini/plugins/create/create_pointcache.py +++ b/openpype/hosts/houdini/plugins/create/create_pointcache.py @@ -58,8 +58,7 @@ class CreatePointCache(plugin.HoudiniCreator): # get the output node with the minimum # 'outputidx' or the node with display flag - sop_path = self.get_obj_output(selected_node) or \ - selected_node.displayNode() + sop_path = self.get_obj_output(selected_node) if sop_path: parms["sop_path"] = sop_path.path() From d58ef791f81130a9552811ff4e95da5abe9be87a Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Thu, 6 Jul 2023 13:47:52 +0300 Subject: [PATCH 09/12] make hound happy --- openpype/hosts/houdini/plugins/create/create_pointcache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/houdini/plugins/create/create_pointcache.py b/openpype/hosts/houdini/plugins/create/create_pointcache.py index 8914269f45..4eadef86f7 100644 --- a/openpype/hosts/houdini/plugins/create/create_pointcache.py +++ b/openpype/hosts/houdini/plugins/create/create_pointcache.py @@ -108,4 +108,4 @@ class CreatePointCache(plugin.HoudiniCreator): # return the one with the minimum 'outputidx' else: return min(outputs, - key=lambda node : node.evalParm('outputidx')) + key=lambda node: node.evalParm('outputidx')) From 6b1707d51fc633db190300f46f5c72a3c1395590 Mon Sep 17 00:00:00 2001 From: Mustafa-Zarkash Date: Thu, 6 Jul 2023 17:37:21 +0300 Subject: [PATCH 10/12] make it less restrictive --- openpype/hosts/houdini/plugins/create/create_pointcache.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/openpype/hosts/houdini/plugins/create/create_pointcache.py b/openpype/hosts/houdini/plugins/create/create_pointcache.py index 4eadef86f7..554d5f2016 100644 --- a/openpype/hosts/houdini/plugins/create/create_pointcache.py +++ b/openpype/hosts/houdini/plugins/create/create_pointcache.py @@ -40,11 +40,7 @@ class CreatePointCache(plugin.HoudiniCreator): # the ROP node we prefer it set to the SopNode path explicitly # Allow sop level paths (e.g. /obj/geo1/box1) - # but do not allow other sop level paths when - # the parent type is not 'geo' like - # Cameras, Dopnet nodes(sop solver) - if isinstance(selected_node, hou.SopNode) and \ - selected_node.parent().type().name() in ["geo", "subnet"]: + if isinstance(selected_node, hou.SopNode): parms["sop_path"] = selected_node.path() self.log.debug( "Valid SopNode selection, 'SOP Path' in ROP will be set to '%s'." From 0611163c1f3fdcda3ffaa2dca3caf8389a98ffc8 Mon Sep 17 00:00:00 2001 From: Ynbot Date: Sat, 8 Jul 2023 03:31:49 +0000 Subject: [PATCH 11/12] [Automated] Bump version --- openpype/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/version.py b/openpype/version.py index 4a6131a26a..cdd546c4a0 100644 --- a/openpype/version.py +++ b/openpype/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring Pype version.""" -__version__ = "3.15.12-nightly.3" +__version__ = "3.15.12-nightly.4" From 680ea6d0d71bbee13d3ff85bc0ff6c444501d60d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 8 Jul 2023 03:32:33 +0000 Subject: [PATCH 12/12] chore(): update bug report / version --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 9fcb69e2e9..1280e6a6e5 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -35,6 +35,7 @@ body: label: Version description: What version are you running? Look to OpenPype Tray options: + - 3.15.12-nightly.4 - 3.15.12-nightly.3 - 3.15.12-nightly.2 - 3.15.12-nightly.1 @@ -134,7 +135,6 @@ body: - 3.14.5-nightly.1 - 3.14.4 - 3.14.4-nightly.4 - - 3.14.4-nightly.3 validations: required: true - type: dropdown