diff --git a/openpype/hosts/houdini/api/lib.py b/openpype/hosts/houdini/api/lib.py index 57ced9b61b..72f1c8e71f 100644 --- a/openpype/hosts/houdini/api/lib.py +++ b/openpype/hosts/houdini/api/lib.py @@ -406,31 +406,46 @@ def imprint(node, data): node.setParmTemplateGroup(parm_group) -def lsattr(attr, value=None): +def lsattr(attr, value=None, root="/"): + """Return nodes that have `attr` + When `value` is not None it will only return nodes matching that value + for the given attribute. + Args: + attr (str): Name of the attribute (hou.Parm) + value (object, Optional): The value to compare the attribute too. + When the default None is provided the value check is skipped. + root (str): The root path in Houdini to search in. + Returns: + list: Matching nodes that have attribute with value. + """ if value is None: - nodes = list(hou.node("/obj").allNodes()) + # Use allSubChildren() as allNodes() errors on nodes without + # permission to enter without a means to continue of querying + # the rest + nodes = hou.node(root).allSubChildren() return [n for n in nodes if n.parm(attr)] return lsattrs({attr: value}) -def lsattrs(attrs): +def lsattrs(attrs, root="/"): """Return nodes matching `key` and `value` - Arguments: attrs (dict): collection of attribute: value - + root (str): The root path in Houdini to search in. Example: >> lsattrs({"id": "myId"}) ["myNode"] >> lsattr("id") ["myNode", "myOtherNode"] - Returns: - list + list: Matching nodes that have attribute with value. """ matches = set() - nodes = list(hou.node("/obj").allNodes()) # returns generator object + # Use allSubChildren() as allNodes() errors on nodes without + # permission to enter without a means to continue of querying + # the rest + nodes = hou.node(root).allSubChildren() for node in nodes: for attr in attrs: if not node.parm(attr): diff --git a/openpype/hosts/houdini/plugins/load/load_usd_layer.py b/openpype/hosts/houdini/plugins/load/load_usd_layer.py index 232ce59479..0d4378b480 100644 --- a/openpype/hosts/houdini/plugins/load/load_usd_layer.py +++ b/openpype/hosts/houdini/plugins/load/load_usd_layer.py @@ -6,10 +6,7 @@ class USDSublayerLoader(api.Loader): """Sublayer USD file in Solaris""" families = [ - "colorbleed.usd", - "colorbleed.pointcache", - "colorbleed.animation", - "colorbleed.camera", + "usd", "usdCamera", ] label = "Sublayer USD" diff --git a/openpype/hosts/houdini/plugins/load/load_usd_reference.py b/openpype/hosts/houdini/plugins/load/load_usd_reference.py index 224bfc2d61..0edd8d9af6 100644 --- a/openpype/hosts/houdini/plugins/load/load_usd_reference.py +++ b/openpype/hosts/houdini/plugins/load/load_usd_reference.py @@ -6,10 +6,7 @@ class USDReferenceLoader(api.Loader): """Reference USD file in Solaris""" families = [ - "colorbleed.usd", - "colorbleed.pointcache", - "colorbleed.animation", - "colorbleed.camera", + "usd", "usdCamera", ] label = "Reference USD" diff --git a/openpype/hosts/houdini/plugins/publish/collect_usd_layers.py b/openpype/hosts/houdini/plugins/publish/collect_usd_layers.py index 8be6ead1b1..e3985e3c97 100644 --- a/openpype/hosts/houdini/plugins/publish/collect_usd_layers.py +++ b/openpype/hosts/houdini/plugins/publish/collect_usd_layers.py @@ -48,7 +48,7 @@ class CollectUsdLayers(pyblish.api.InstancePlugin): label = "{0} -> {1}".format(instance.data["name"], name) layer_inst = context.create_instance(name) - family = "colorbleed.usdlayer" + family = "usdlayer" layer_inst.data["family"] = family layer_inst.data["families"] = [family] layer_inst.data["subset"] = "__stub__" diff --git a/openpype/plugins/publish/integrate_new.py b/openpype/plugins/publish/integrate_new.py index bf214d9139..3d48fb92ee 100644 --- a/openpype/plugins/publish/integrate_new.py +++ b/openpype/plugins/publish/integrate_new.py @@ -100,7 +100,8 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin): "redshiftproxy", "effect", "xgen", - "hda" + "hda", + "usd" ] exclude_families = ["clip"] db_representation_context_keys = [ diff --git a/openpype/settings/defaults/project_settings/ftrack.json b/openpype/settings/defaults/project_settings/ftrack.json index 00ce65705a..01831efad1 100644 --- a/openpype/settings/defaults/project_settings/ftrack.json +++ b/openpype/settings/defaults/project_settings/ftrack.json @@ -332,6 +332,18 @@ "tasks": [], "add_ftrack_family": true, "advanced_filtering": [] + }, + { + "hosts": [ + "houdini" + ], + "families": [ + "usd" + ], + "task_types": [], + "tasks": [], + "add_ftrack_family": true, + "advanced_filtering": [] } ] }, @@ -376,7 +388,8 @@ "layout": "layout", "unrealStaticMesh": "geo", "vrayproxy": "cache", - "redshiftproxy": "cache" + "redshiftproxy": "cache", + "usd": "usd" } } }