diff --git a/server_addon/houdini/client/ayon_houdini/api/hda_utils.py b/server_addon/houdini/client/ayon_houdini/api/hda_utils.py index 12b455bbac..6e40e794a9 100644 --- a/server_addon/houdini/client/ayon_houdini/api/hda_utils.py +++ b/server_addon/houdini/client/ayon_houdini/api/hda_utils.py @@ -18,7 +18,10 @@ get_representation_context, get_representation_path_from_context ) -from ayon_core.pipeline.context_tools import get_current_project_name +from ayon_core.pipeline.context_tools import ( + get_current_project_name, + get_current_folder_path +) from ayon_houdini.api import lib @@ -418,3 +421,40 @@ def keep_background_images_linked(node, old_name): if changes: set_background_images(parent, images) + + +def select_folder_path(node): + """Show dialog to select folder path. + + When triggered it opens a dialog that shows the available + folder paths within a given project. + + Note: + This function should be refactored. + It currently shows the available + folder paths within the current project only. + + Args: + node (hou.OpNode): The HDA node. + """ + from ayon_core.tools.publisher.widgets.folders_dialog import FoldersDialog + from ayon_core.tools.utils.host_tools import get_tool_by_name + + main_window = lib.get_main_window() + publisher_window = get_tool_by_name( tool_name="publisher", parent=main_window) + + # TODO: A dedicated Dialog should be implement using `SimpleFoldersWidget`. + # we should avoid using `FoldersDialog` because It's highly recommend to + # never use inner widgets of any tool... + # Note: The following dialog doesn't support changing `the project_name` + # But, having a semi-functional dialog is better than nothing. + dialog = FoldersDialog(publisher_window.controller, main_window) + dialog.exec_() + + selected_folder_path = dialog.get_selected_folder_path() + + if not selected_folder_path or \ + selected_folder_path == get_current_folder_path(): + selected_folder_path = '$AYON_FOLDER_PATH' + + node.parm("folder_path").set(selected_folder_path) diff --git a/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/INDEX__SECTION b/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/INDEX__SECTION index 8dd8ee6270..5b5d5a1340 100644 --- a/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/INDEX__SECTION +++ b/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/INDEX__SECTION @@ -3,12 +3,11 @@ Label: AYON Load Asset Path: oplib:/ayon::Lop/lop_import::1.0?ayon::Lop/lop_import::1.0 Icon: opdef:/ayon::Lop/lop_import::1.0?IconImage Table: Lop -License: -Extra: -User: +License: +Extra: +User: Inputs: 0 to 1 Subnet: true Python: false Empty: false -Modified: Thu Jun 6 01:31:52 2024 - +Modified: Thu Jun 10 16:44:00 2024 diff --git a/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/Contents.dir/Contents.mime b/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/Contents.dir/Contents.mime index babfe0e1a9..ec12230a75 100644 --- a/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/Contents.dir/Contents.mime +++ b/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/Contents.dir/Contents.mime @@ -19,9 +19,9 @@ Content-Disposition: attachment; filename="hdaroot.def" Content-Type: text/plain comment "" -position -8.53722 4.22263 +position -1.67827 1.26636 connectornextid 0 -flags = lock off model off template off footprint off xray off bypass off display off render off highlight off unload off savedata off compress on colordefault on exposed on debug off +flags = lock off model off template off footprint off xray off bypass off display on render on highlight off unload off savedata off compress on colordefault on exposed on debug off outputsNamed3 { } @@ -35,10 +35,10 @@ stat { create -1 modify -1 - author User@HP-Z820-03 + author Mustafa_Taher@Major-Kalawy access 0777 } -color UT_Color RGB 0.8 0.8 0.8 +color UT_Color RGB 0.8 0.8 0.8 delscript "" exprlanguage hscript end @@ -98,7 +98,7 @@ stat author Maqina-05@Maqina-05 access 0777 } -color UT_Color RGB 0.8 0.8 0.8 +color UT_Color RGB 0.8 0.8 0.8 delscript "" exprlanguage hscript end @@ -158,7 +158,7 @@ stat author Maqina-05@Maqina-05 access 0777 } -color UT_Color RGB 0.8 0.8 0.8 +color UT_Color RGB 0.8 0.8 0.8 delscript "" exprlanguage hscript end @@ -324,7 +324,7 @@ stat author User@HP-Z820-03 access 0777 } -color UT_Color RGB 0.8 0.8 0.8 +color UT_Color RGB 0.8 0.8 0.8 delscript "" exprlanguage hscript end diff --git a/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/DialogScript b/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/DialogScript index 6281baecb6..097e6c348a 100644 --- a/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/DialogScript +++ b/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/DialogScript @@ -40,6 +40,8 @@ label "Folder Path" type string default { "$AYON_FOLDER_PATH" } + parmtag { "script_action" "from ayon_houdini.api.hda_utils import select_folder_path;select_folder_path(kwargs['node'])" } + parmtag { "script_action_icon" "BUTTONS_reselect" } parmtag { "script_callback" "hou.phm().on_representation_parms_changed(kwargs['node'])" } parmtag { "script_callback_language" "python" } } diff --git a/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/ExtraFileOptions b/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/ExtraFileOptions index 38babad6a2..fb58b6889f 100644 --- a/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/ExtraFileOptions +++ b/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/ExtraFileOptions @@ -41,7 +41,7 @@ }, "OnDeleted/Cursor":{ "type":"intarray", - "value":[2,1] + "value":[1,15] }, "OnDeleted/IsExpr":{ "type":"bool", @@ -81,7 +81,7 @@ }, "OnNameChanged/Cursor":{ "type":"intarray", - "value":[4,1] + "value":[1,15] }, "OnNameChanged/IsExpr":{ "type":"bool", @@ -101,7 +101,7 @@ }, "PythonModule/Cursor":{ "type":"intarray", - "value":[1,18] + "value":[10,1] }, "PythonModule/IsExpr":{ "type":"bool", diff --git a/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/MessageNodes b/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/MessageNodes index f3d2a13d61..ff389a716b 100644 --- a/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/MessageNodes +++ b/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/MessageNodes @@ -1 +1 @@ -warn_no_representation_set reference \ No newline at end of file +warn_no_representation_set reference diff --git a/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/OnCreated b/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/OnCreated index cc1a8f6325..bd09a7838b 100644 --- a/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/OnCreated +++ b/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/OnCreated @@ -2,4 +2,4 @@ node = kwargs["node"] hda_module = node.hdaModule() hda_module.setup_flag_changed_callback(node) -node.parm("file").lock(True) \ No newline at end of file +node.parm("file").lock(True) diff --git a/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/OnDeleted b/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/OnDeleted index 613107ed2b..42e4ef2401 100644 --- a/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/OnDeleted +++ b/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/OnDeleted @@ -3,4 +3,4 @@ from ayon_houdini.api.lib import remove_all_thumbnails # Clear thumbnails node = kwargs["node"] -remove_all_thumbnails(node) \ No newline at end of file +remove_all_thumbnails(node) diff --git a/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/OnLoaded b/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/OnLoaded index 067c1964e1..42e3c6e640 100644 --- a/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/OnLoaded +++ b/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/OnLoaded @@ -12,4 +12,3 @@ def on_duplicate(): if not hou.hipFile.isLoadingHipFile(): on_duplicate() - diff --git a/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/OnNameChanged b/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/OnNameChanged index af1fe7d119..2076f5ad9d 100644 --- a/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/OnNameChanged +++ b/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/OnNameChanged @@ -5,4 +5,4 @@ from ayon_houdini.api.hda_utils import ( node = kwargs["node"] old_name = kwargs["old_name"] -keep_background_images_linked(node, old_name) \ No newline at end of file +keep_background_images_linked(node, old_name) diff --git a/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/Tools.shelf b/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/Tools.shelf index 01802c33db..0c76942883 100644 --- a/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/Tools.shelf +++ b/server_addon/houdini/client/ayon_houdini/startup/otls/ayon_lop_import.hda/ayon_8_8Lop_1lop__import_8_81.0/Tools.shelf @@ -16,4 +16,3 @@ a single file. --> loptoolutils.genericTool(kwargs, '$HDA_NAME')]]> - \ No newline at end of file