ayon-core icon indicating copy to clipboard operation
ayon-core copied to clipboard

Add simple Create Project Structure launcher action

Open BigRoy opened this issue 1 year ago • 26 comments

Imp for AY-5076

Changelog Description

Add simple Create Project Structure launcher action.

image

Which creates the folder structure as defined in project settings: ayon+settings://core/project_folder_structure

image

Additional info

It currently only shows when you're in a project in the launcher but have NO folder or task selected to avoid clutter in launcher.

The label unfortunately is a bit too long to be nicely displayed by default, see screenshot. Any ideas for better icon and shorter label that doesn't get cut off?


This feature request came up a few times:

Testing notes:

  1. Update core addon
  2. Run the launcher action when you enter a project.
  3. Folders should now be generated as per settings.

BigRoy avatar Jun 20 '24 18:06 BigRoy

Any ideas for better icon and shorter label that doesn't get cut off?

Your icon choice is already very good.

Shorter labels : The "disk" concept is important, to avoid confusion with the project's folder structure in database. Ideas :

  • Add disk proj struct
  • Add proj struct on disk
  • Create Project Structure (the current label, but with a different icon : mdi.harddisk-plus or mdi.harddisk )

alainxi avatar Jun 21 '24 08:06 alainxi

I can think of these names:

Create Dir Create PRJ Project Dir

LiborBatek avatar Jun 28 '24 09:06 LiborBatek

I think maybe it's also worth discussing whether it might be nice to shrink the font sizes just a tad there to ensure there's less cut off. I often see it on other applications as well - which may fix the chosen names here as well?

@iLLiCiTiT what do you think?

BigRoy avatar Jun 28 '24 09:06 BigRoy

@BigRoy btw what happens if user trigger Create Project... if those already existing?? I hope it will just skip the creation :) ?

LiborBatek avatar Jun 28 '24 09:06 LiborBatek

@BigRoy btw what happens if user trigger Create Project... if those already existing?? I hope it will just skip the creation :) ?

Not sure - since I didn't implement that code myself. But I suspect it would just generate the folders on disk that currently do not exist yet - so if you've adjusted your studio settings to have new folders in the template - then those get added.

Are you afraid to click the button? If so, what is making you scared and what could we do to make it feel less scary? A tooltip? A pop-up before the creation? (Like a confirmation? Which might make it feel more scary even?)

BigRoy avatar Jun 28 '24 09:06 BigRoy

@BigRoy btw what happens if user trigger Create Project... if those already existing?? I hope it will just skip the creation :) ?

Not sure - since I didn't implement that code myself. But I suspect it would just generate the folders on disk that currently do not exist yet - so if you've adjusted your studio settings to have new folders in the template - then those get added.

Are you afraid to click the button? If so, what is making you scared and what could we do to make it feel less scary? A tooltip? A pop-up before the creation? (Like a confirmation? Which might make it feel more scary even?)

yeah, some popup would do! informing user whats gonna happen...

LiborBatek avatar Jun 29 '24 06:06 LiborBatek

Thanks a lot for this @BigRoy , this is one of the things I was missing from our current pipeline while testing Ayon.

In our current pipeline we always have a folder called 00_MATERIALS where we save a lot of stuff in different subfolders like audio, references (with more subfolders), logos, client_material...

The production team is who usually save there all the material and they need to have the folder structure created to start copying files.

Now my question. As far as I know you can setup the folder structure in ayon+settings://core/project_folder_structure but there's no way to create these folders automatically before this PR, but if you setup a folder structure in that Ayon setting it's because you want it. So, shouldn't this folder structure be created automatically when you create a new project with that Bundle instead of have to go the the Launcher and click on this icon?

Of course, this is just for that folder structure setting and not for the whole folders/tasks you define inside the Project Settings.

LichiMan avatar Jul 09 '24 08:07 LichiMan

Thanks a lot for this @BigRoy , this is one of the things I was missing from our current pipeline while testing Ayon.

In our current pipeline we always have a folder called 00_MATERIALS where we save a lot of stuff in different subfolders like audio, references (with more subfolders), logos, client_material...

The production team is who usually save there all the material and they need to have the folder structure created to start copying files.

Now my question. As far as I know you can setup the folder structure in ayon+settings://core/project_folder_structure but there's no way to create these folders automatically before this PR, but if you setup a folder structure in that Ayon setting it's because you want it. So, shouldn't this folder structure be created automatically when you create a new project with that Bundle instead of have to go the the Launcher and click on this icon?

Of course, this is just for that folder structure setting and not for the whole folders/tasks you define inside the Project Settings.

It's a good question - but admittedly with site sync a project may be accessible from multiple locations and thus may have already been existing before that 'creation'. Also the project creation may happen in any variety of ways, yes currently most likely is the ayon-frontend triggering this but it may even be automated by the API or e.g. occur due to syncing from kitsu, ftrack or shotgrid/flow (which you may not want to automatically flood a local directory with project folders or not). Also, what if a producer just happens to create a project using the web frontend without access to the physical storage | what would create the project folder and files where?

Anyway, nothing is holding anyone from triggering e.g. this logic anytime the AYON Tray Launcher starts up or whatever - I'd just say that from my perspective I don't think I'd recommend that.

Do note that potentially soon using Web Actions from the front-end it may be possible to trigger an action like this from the web front-end, not requiring to do it via the Tray Launcher UI.


Additionally, having it accessible as a callable action does allow you to update the template in settings, and re-run it again if you happened to have changed the template.

BigRoy avatar Jul 09 '24 12:07 BigRoy

I have done one more test run to see what happens if those folders are already present and filled with some content...

The good is, even when re-triggering this Create Proj action nothing happens aka no deleting or similar destructive action.

However still missing that popup info message what are you about to do.... @BigRoy any chance you incorporate it? :)

LiborBatek avatar Jul 10 '24 07:07 LiborBatek

It's a good question - but admittedly with site sync a project may be accessible from multiple locations and thus may have already been existing before that 'creation'. Also the project creation may happen in any variety of ways, yes currently most likely is the ayon-frontend triggering this but it may even be automated by the API or e.g. occur due to syncing from kitsu, ftrack or shotgrid/flow (which you may not want to automatically flood a local directory with project folders or not). Also, what if a producer just happens to create a project using the web frontend without access to the physical storage | what would create the project folder and files where?

Anyway, nothing is holding anyone from triggering e.g. this logic anytime the AYON Tray Launcher starts up or whatever - I'd just say that from my perspective I don't think I'd recommend that.

Do note that potentially soon using Web Actions from the front-end it may be possible to trigger an action like this from the web front-end, not requiring to do it via the Tray Launcher UI.

Additionally, having it accessible as a callable action does allow you to update the template in settings, and re-run it again if you happened to have changed the template.

Yes, it makes sense.

I'm still don't know how Web Actions will work but it sounds like a nice way for doing this, better than the Tray Launcher as everything stay in the web front-end, IMHO.

LichiMan avatar Jul 11 '24 08:07 LichiMan

@iLLiCiTiT any preference where to go from here aside of the icon and label cosmetics?

BigRoy avatar Jul 29 '24 23:07 BigRoy

any preference where to go from here aside of the icon and label cosmetics?

Not from my point of view. Code is ok.

The question is, if it is "pipeline ok". Not sure if any artist should be able to run the action?

iLLiCiTiT avatar Aug 02 '24 09:08 iLLiCiTiT

The question is, if it is "pipeline ok". Not sure if any artist should be able to run the action?

Or should the option be like, select the folders/shots on the left pane and choose the option!? even creating all the folders by artists is also okay, there is no harm I believe, anyway production already carefully adds the shots in ayon web. We are waiting for this option, everytime when we wanted to paste something inside shots its manual, I think this helps a lot

krishnaavril avatar Aug 05 '24 04:08 krishnaavril

Just commenting that I'm not working on this currently - so it may be stale until there's more details on how to best proceed with this? I believe Web Actions might take precedence on this and 'replace' it? But maybe @LiborBatek 's comment here is still relevant if there is a time and place for having this also directly in launcher.

@iLLiCiTiT so FYI - I'll hold of changes to this until there's a clear route of action.

BigRoy avatar Sep 02 '24 12:09 BigRoy

For the first glance when I read the PR's description (sorry if it was mentioned before) I had these thoughts:

  • What will happen if the ayon+settings://core/project_folder_structure doesn't match my actual project structure in the project editor ?
  • What should be the source of truth for the folder creation ?

MustafaJafar avatar Sep 09 '24 08:09 MustafaJafar

For the first glance when I read the PR's description (sorry if it was mentioned before) I had these thoughts:

  • What will happen if the ayon+settings://core/project_folder_structure doesn't match my actual project structure in the project editor ?
  • What should be the source of truth for the folder creation ?

I think "Create Project Structure" (on disk, for assets that are not handled by Ayon) should follow "ayon+settings://core/project_folder_structure".

It's really different from the Logical structure (in Editor), which is only for Ayon managed stuff.

Look at Jakub's message on that matter (a year ago) :

This particular settings is at wrong place even in OpenPype...

The same settings are used for 2 features: 1 : Create default folder structure (on disk) 2 : Create default project hierarchy (in project manager) Which usually cause many troubles..

Found here : https://discord.com/channels/517362899170230292/890894521817260052/1147160515576082552

alainxi avatar Sep 09 '24 09:09 alainxi

For the first glance when I read the PR's description (sorry if it was mentioned before) I had these thoughts:

* What will happen if the `ayon+settings://core/project_folder_structure` doesn't match my actual project structure in the project editor ?

* What should be the source of truth for the folder creation ?

AFAIK this is not at all about creating folders for "folder" entities or tasks, etc. It's to create generic folders for your project that you may want to populate for "a project". Like e.g. you may - out of the pipeline - have a static "resources" folder, or a static "documents" folder where producers maybe put in some stuff. Etc.

So it's more of a "Please just create me some standard folders for the project" that are not related to actual assets or shots.

BigRoy avatar Sep 09 '24 11:09 BigRoy

@krishnaavril this action is not intended as a substitution for creation of AYON driven project folders (assets, shots etc) but for additional folders predefined in the ayon-core settings ayon+settings://core/project_folder_structure (for resources like plates, footage, offline and other items production might need and to save those in a standard places)

@BigRoy as the confusion already happening I think we definetely should use different naming than Create Project Folders but refer more to Resources folders or similar.

LiborBatek avatar Sep 12 '24 07:09 LiborBatek

@LiborBatek

I agree we should use different naming than Create Project Folders, to avoid confusion. For that, the "disk" concept is important. Here are alternatives (very short ones, to not clutter GUI) :

  • Add disk proj struct
  • Add proj struct on disk

alainxi avatar Sep 12 '24 08:09 alainxi

@BigRoy @iLLiCiTiT @dee-ynput should we convert this to draft since it may be replaced by a web action?

MustafaJafar avatar Oct 02 '24 08:10 MustafaJafar

@dee-ynput could you answer the remaining questions:

  • What should be the label on the action? It must be short because as can be seen from the screenshot - it gets cut off. These have come up:
    Add disk proj struct
    Add proj struct on disk
    Create Project Structure (will be cut off after "Project...")
    Create Project Folders (will be cut off after "Project...")
  • What's a sensible icon to use. I think you can pick one from: https://fontawesome.com/v4/icons/
  • Should it pop up a confirmation dialog (maybe even explaining which folders would get created; it could even report if they already exist too) to avoid accidental clicks?
  • Should it appear for ALL users? Or just certain roles? (If so, which?)
  • Should it have a setting to enable/disable the action completely?

BigRoy avatar Oct 04 '24 08:10 BigRoy

Thanks for the summary @BigRoy!

  • What should be the label on the action? It must be short because as can be seen from the screenshot - it gets cut off. These have come up:

Let's match the setting name "Project folder structure", so: Create Project Folders. The name being cut off indeed sucks, but that's something we'll fix at UI level (this limitation is a bummer for many other situations)

The sitemap icon kinda works. I could consider a simple folder icon or the hdd icon...

  • Should it pop up a confirmation dialog (maybe even explaining which folders would get created; it could even report if they already exist too) to avoid accidental clicks?

Let's add this later if requested 👍 (I do like it)

  • Should it appear for ALL users? Or just certain roles? (If so, which?)

I need to check with CS team, but worst case would be to have a setting to state if it's managers only or for artists too.

  • Should it have a setting to enable/disable the action completely?

Having the setting value empty should disable it. It must be stated in the settings inline help / tooltip.

dee-ynput avatar Oct 04 '24 09:10 dee-ynput

Task linked: AY-5076 Ayon: Folder creation

ynbot avatar Oct 04 '24 09:10 ynbot

@BigRoy After reviewing the CS request:

  • Should it appear for ALL users? Or just certain roles? (If so, which?)

Let's do it for all users. The restriction will be implemented if/when we move this to a proper web action 👍

dee-ynput avatar Oct 04 '24 09:10 dee-ynput

Let's match the setting name "Project folder structure", so: Create Project Folders. The name being cut off indeed sucks, but that's something we'll fix at UI level (this limitation is a bummer for many other situations)

Done.

Unfortunately reads like this:

image

Having the setting value empty should disable it. It must be stated in the settings inline help / tooltip.

Done.

image

The sitemap icon kinda works. I could consider a simple folder icon or the hdd icon...

I'll keep sitemap for now.

BigRoy avatar Oct 04 '24 09:10 BigRoy

I used {root[work]}/{project[name]} instead of __project_root__ , because the later is marked as legacy in the code (and it tries to create the same folder tree on all Anatomy roots, a behaviour that we don't want).

Separate from this PR - should we update the default settings @m-u-r-p-h-y @LiborBatek to use {root[work]}/{project[name]} instead? Or?

BigRoy avatar Oct 07 '24 14:10 BigRoy

@BigRoy Is this still something we want ?

philippe-ynput avatar Feb 18 '25 15:02 philippe-ynput

Yes, last I heard this is still a valid request but we did not want it inside the launcher, but instead wanted it to become a web action - so this was left here dangling.

BigRoy avatar Feb 18 '25 16:02 BigRoy

@BigRoy I guess theres no way to show the action only for certain user role atm, right?

LiborBatek avatar Mar 05 '25 09:03 LiborBatek

@BigRoy I guess theres no way to show the action only for certain user role atm, right?

It's possible - not sure how fast the exact query would be, but it should be possible. Do we still want it in launcher, or are you asking web actions?

BigRoy avatar Mar 05 '25 09:03 BigRoy