Merge pull request #2631 from pypeclub/bugfix/houdini-usd-loaders-and-publishing

Houdini: fix usd family in loader and integrators
This commit is contained in:
Ondřej Samohel 2022-02-18 18:44:29 +01:00 committed by GitHub
commit 0b2ceec450
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 42 additions and 19 deletions

View file

@ -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):

View file

@ -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"

View file

@ -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"

View file

@ -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__"

View file

@ -100,7 +100,8 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
"redshiftproxy",
"effect",
"xgen",
"hda"
"hda",
"usd"
]
exclude_families = ["clip"]
db_representation_context_keys = [

View file

@ -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"
}
}
}