Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Launcher action to create folder structure for task if not existing #30

Open
3 tasks done
BenSouchet opened this issue Jan 13, 2025 · 7 comments
Open
3 tasks done
Assignees
Labels
enhancement New feature or request pre-prod Scope: Pre Prod tool: Launcher Linked to the Launcher
Milestone

Comments

@BenSouchet
Copy link
Contributor

BenSouchet commented Jan 13, 2025

Goal / To Do

  • Add a new action in the Launcher tool to create the folder structure for the selected task (project, shot) if the structure is not already present on the server
  • Ensure the action is displayed ONLY if the folder structure is not present already
  • Display a popup to tell the user if the operation succeed
@BenSouchet BenSouchet added the enhancement New feature or request label Jan 13, 2025
@BenSouchet BenSouchet added tool: Launcher Linked to the Launcher pre-prod Scope: Pre Prod labels Jan 13, 2025
@BenSouchet BenSouchet moved this to Ready in QuadPype Wizz Jan 14, 2025
@BenSouchet BenSouchet added this to the Pre-Prod milestone Jan 14, 2025
@hfarre hfarre moved this from Ready to In progress in QuadPype Wizz Jan 15, 2025
@hfarre hfarre moved this from In progress to In review in QuadPype Wizz Jan 15, 2025
@hfarre
Copy link

hfarre commented Jan 15, 2025

New button created, only appearing if the folder doesn't exist:

Image

A popup informs the user

Image

And the path is put in the clipboard

The only problem for the moment, is that to make dissaper the create button after clicking on it, I refresh the discover_actions() in the launcher window, which will make unavailable the turning circle showing the progress of the opening of a soft

@hfarre
Copy link

hfarre commented Jan 15, 2025

Made an update to only refresh the actions if the process() from action return something
And only the create folder.process() return something at the moment

Thus, we can still have the rolling charging circle on others action (apps)

@BenSouchet
Copy link
Contributor Author

I cleanup, reworked & optimized the code. Last element to discuss is should we disable the Open Work Dir action when the workdirectory doesn't exists OR should we call the mkdir.

@hfarre
Copy link

hfarre commented Jan 16, 2025

After testing, here are the troubles:

  • Can't access explore here or create folder from asset, a task must be selected (not necessary, and best if we can keep access those actions from asset only and task too)
  • Explorer here open a file explorer even if the folder doesn't exist, before, a notification message appared at the bottom left to inform us the folder doesn't exist. But like you said, we could just hide the action if the folder doesn't exist, sounds good.
  • The create folder return a error:
    WARNING:quadpype.tools.launcher.window.LauncherWindow:Action launch failed.
    Traceback (most recent call last):
    File "C:\Users\hfarreQP\quad\quadpype\src\quadpype\tools\launcher\window.py", line 425, in run_action
    return action().process(filtered_session)
    File "C:\Users\hfarreQP\quad\quadpype\src\quadpype\plugins\actions\create_folder_explorer.py", line 39, in process
    path.mkdir()
    File "C:\Users\hfarreQP.pyenv\pyenv-win\versions\3.9.13\lib\pathlib.py", line 1323, in mkdir
    self._accessor.mkdir(self, mode)
    FileNotFoundError: [WinError 3] Le chemin d’accès spécifié est introuvable: 'L:\2024\PROJET_ZERO_KITSU_OP_23_21\Assets\BG\H_BG_06\work\BG_Line'

@hfarre
Copy link

hfarre commented Jan 16, 2025

After retakes here are the returns:

  • Explorer here properly create the folder if doesn't exist

  • Create folder seems to work but an error still occurs:
    WARNING:quadpype.tools.launcher.window.LauncherWindow:Action launch failed.
    Traceback (most recent call last):
    File "C:\Users\hfarreQP\quad\quadpype\src\quadpype\tools\launcher\window.py", line 425, in run_action
    return action().process(filtered_session)
    File "C:\Users\hfarreQP\quad\quadpype\src\quadpype\plugins\actions\create_folder_explorer.py", line 39, in process
    self.copy_path_to_clipboard(path)
    File "C:\Users\hfarreQP\quad\quadpype\src\quadpype\pipeline\actions.py", line 111, in copy_path_to_clipboard
    path = path.replace("\", "/")
    TypeError: replace() takes 2 positional arguments but 3 were given

  • Finally, can we implement the refresh of the plug in discovery to update like this:
    When the folder is created by explorer here or create folder, the option to create must disappear

@BenSouchet
Copy link
Contributor Author

Now everything should work fine

@hfarre
Copy link

hfarre commented Jan 16, 2025

Yes, I confirm the success of the tests !

@BenSouchet BenSouchet moved this from In review to Waiting deployment in QuadPype Wizz Jan 16, 2025
@BenSouchet BenSouchet closed this as completed by moving to Waiting deployment in QuadPype Wizz Jan 16, 2025
@BenSouchet BenSouchet reopened this Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pre-prod Scope: Pre Prod tool: Launcher Linked to the Launcher
Projects
Status: Waiting deployment
Development

No branches or pull requests

2 participants