diff --git a/client/ayon_houdini/api/hda_utils.py b/client/ayon_houdini/api/hda_utils.py index 412364bc04..8b8b0a323b 100644 --- a/client/ayon_houdini/api/hda_utils.py +++ b/client/ayon_houdini/api/hda_utils.py @@ -129,6 +129,14 @@ def update_info(node, context): if node.evalParm(key) != value} parms["load_message"] = "" # clear any warnings/errors + # Update the product type filter to match the type + current = node.evalParm("product_type") + product_type = context["product"]["productType"] + if current and current != product_type: + # If current is empty we consider no filtering applied and we allow + # that to be a state that needs no switching + parms["product_type"] = product_type + # Note that these never trigger any parm callbacks since we do not # trigger the `parm.pressButton` and programmatically setting values # in Houdini does not trigger callbacks automatically @@ -569,13 +577,16 @@ def get_available_products(node): if not folder_entity: return [] + # Apply filter only if any value is set + product_types = [product_type] if product_type else None + products = ayon_api.get_products( project_name, folder_ids=[folder_entity["id"]], - product_types=[product_type] + product_types=product_types ) - return [product["name"] for product in products] + return list(sorted(product["name"] for product in products)) def set_to_latest_version(node): diff --git a/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/DialogScript b/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/DialogScript index 3c97d10f35..dee8fa4c8f 100644 --- a/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/DialogScript +++ b/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/DialogScript @@ -3,7 +3,7 @@ { name ayon::lop_import::1.0 script load_asset::1.0 - label "Load Asset" + label "AYON Load Asset" help { "" @@ -52,6 +52,14 @@ label "Product Type" type string default { "usd" } + menu { + "" "*" + "animation" "animation" + "camera" "camera" + "model" "model" + "pointcache" "pointcache" + "usd" "usd" + } } parm { name "product_name" diff --git a/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/OnCreated b/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/OnCreated index 06ccdaa653..bd09a7838b 100644 --- a/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/OnCreated +++ b/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/OnCreated @@ -2,5 +2,4 @@ node = kwargs["node"] hda_module = node.hdaModule() hda_module.setup_flag_changed_callback(node) -node.parm("product_type").lock(True) node.parm("file").lock(True)