diff --git a/client/ayon_houdini/api/hda_utils.py b/client/ayon_houdini/api/hda_utils.py index d12123223b..617f121258 100644 --- a/client/ayon_houdini/api/hda_utils.py +++ b/client/ayon_houdini/api/hda_utils.py @@ -264,7 +264,7 @@ def on_representation_id_changed(node): set_representation(node, repre_id) -def on_representation_parms_changed(node): +def on_representation_parms_changed(node, force=False): """ Usually used as callback to the project, folder, product, version and representation parms which on change - would result in a different @@ -272,6 +272,9 @@ def on_representation_parms_changed(node): Args: node (hou.Node): Node to update. + force (Optional[bool]): Whether to force the callback to retrigger + even if the representation id already matches. For example, when + needing to resolve the filepath in a different way. """ project_name = node.evalParm("project_name") or get_current_project_name() representation_id = get_representation_id( @@ -287,7 +290,7 @@ def on_representation_parms_changed(node): else: representation_id = str(representation_id) - if node.evalParm("representation") != representation_id: + if force or node.evalParm("representation") != representation_id: node.parm("representation").set(representation_id) node.parm("representation").pressButton() # trigger callback 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 c73479e728..f18c00d472 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 @@ -131,6 +131,15 @@ default { "" } parmtag { "script_callback_language" "python" } } + parm { + name "use_ayon_entity_uri" + label "Use AYON Entity URI" + help "When enabled, loads the filepath using the AYON Entity URI instead of the resolved filepath." + type toggle + default { "0" } + parmtag { "script_callback" "hou.phm().on_representation_parms_changed(kwargs['node'], force=True)" } + parmtag { "script_callback_language" "python" } + } parm { name "primpath1" label "Primitive Root" diff --git a/client/ayon_houdini/startup/otls/ayon_lop_load_shot.hda/ayon_8_8Lop_1load__shot_8_81.0/DialogScript b/client/ayon_houdini/startup/otls/ayon_lop_load_shot.hda/ayon_8_8Lop_1load__shot_8_81.0/DialogScript index 980e555efb..140a1f0cb9 100644 --- a/client/ayon_houdini/startup/otls/ayon_lop_load_shot.hda/ayon_8_8Lop_1load__shot_8_81.0/DialogScript +++ b/client/ayon_houdini/startup/otls/ayon_lop_load_shot.hda/ayon_8_8Lop_1load__shot_8_81.0/DialogScript @@ -125,6 +125,15 @@ default { "" } parmtag { "script_callback_language" "python" } } + parm { + name "use_ayon_entity_uri" + label "Use AYON Entity URI" + help "When enabled, loads the filepath using the AYON Entity URI instead of the resolved filepath." + type toggle + default { "0" } + parmtag { "script_callback" "hou.phm().on_representation_parms_changed(kwargs['node'], force=True)" } + parmtag { "script_callback_language" "python" } + } groupcollapsible { name "extra_options" label "Load Options"