-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add simple Create Project Structure launcher action #679
base: develop
Are you sure you want to change the base?
Add simple Create Project Structure launcher action #679
Conversation
client/ayon_core/plugins/actions/create_project_folder_structure.py
Outdated
Show resolved
Hide resolved
…re.py Co-authored-by: Jakub Trllo <[email protected]>
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 :
|
I can think of these names:
|
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BigRoy btw what happens if user trigger |
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... |
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 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 Of course, this is just for that folder structure setting and not for the whole folders/tasks you define inside the |
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. |
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 However still missing that popup info message what are you about to do.... @BigRoy any chance you incorporate it? :) |
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. |
@iLLiCiTiT 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? |
Or should the option be like, select the folders/shots on the left pane and choose the option!? |
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. |
For the first glance when I read the PR's description (sorry if it was mentioned before) I had these thoughts:
|
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) :
Found here : |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works on my side.
But, there are few things to keep in mind:
- I can only find it if I've nothing selected in the launcher (which happens when selecting a project) but once I select a folder, I won't be able to unselect it. so I have to return and reselect my project.
- I wish if I can see the folders created reflected in the launcher view. and be able to use button
Explore here
. - (irrelevant to this PR) when using the button
Explore here
on intermediate folders, it keep telling meFolder does not exist yet.
*** WRN: >>> { ActionsModel }: [ Action trigger FAILED. ] ========================== Folder does not exist yet. ========================== Traceback (most recent call last): File "E:\Ynput\ayon-core\client\ayon_core\tools\launcher\models\actions.py", line 405, in trigger_action action.process(selection) File "E:\Ynput\ayon-core\client\ayon_core\plugins\actions\open_file_explorer.py", line 26, in process path = self._get_workdir(selection) File "E:\Ynput\ayon-core\client\ayon_core\plugins\actions\open_file_explorer.py", line 94, in _get_workdir raise AssertionERROR("Folder does not exist yet.") AssertionERROR: Folder does not exist yet.
Anyways, I think this feature/enhancement may come lead to more suggestions/requests/complaints like mine above.
@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 @BigRoy as the confusion already happening I think we definetely should use different naming than |
I agree we should use different naming than
|
@BigRoy @iLLiCiTiT @dee-ynput should we convert this to draft since it may be replaced by a web action? |
@dee-ynput could you answer the remaining questions:
|
Thanks for the summary @BigRoy!
Let's match the setting name "Project folder structure", so:
The sitemap icon kinda works. I could consider a simple folder icon or the hdd icon...
Let's add this later if requested 👍
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.
Having the setting value empty should disable it. |
Task linked: AY-5076 Ayon: Folder creation |
@BigRoy
Let's do it for all users. |
Done. Unfortunately reads like this:
Done.
I'll keep sitemap for now. |
server/settings/main.py
Outdated
title="Project folder structure", | ||
description=( | ||
"Defines project folders to create on 'Create project folders'." | ||
" When empty, the action will be hidden from users in the" | ||
" launcher because there is nothing to create." | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand it will create the project structure in the setting.
but, could we be clear that it is an additional structure that is not necessarily related to the project structure in the project editor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean like adding "This does not create folder and task entities, but creates project folders on disk unrelated to any entity"? It seems quite long and verbose and still unclear too. Any ideas on how to explain it with less words and more correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW it is still used for actions that actually do use this setting to create project folder structure, instead of folder structure on disk, e.g. in ftrack. That is in fact original purpose of these settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - so you're saying it will not do anything there when empty but it will still be visible/shown as action (it does not get hidden there). Correct?
@dee-ynput thoughts? Is the tooltip just confusing then, or? Or we should start hiding the action there too in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - so you're saying it will not do anything there when empty but it will still be visible/shown as action (it does not get hidden there). Correct?
No, I'm saying that this setting is used for 2 features:
- Create folder structure in project.
- Create folder structure on disk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's why the "disk" word is important for the button name.
With "Create Project Folders", people will think it creates folder entities, and they will be surprised to discover it created disk structure.
@dee-ynput ? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean like adding "This does not create folder and task entities, but creates project folders on disk unrelated to any entity"? It seems quite long and verbose and still unclear too. Any ideas on how to explain it with less words and more correct?
I mean something like this.
imo, we may not add all of the that to the tool tip in favor of adding them to the documentation.
Defines project folders to be created when selecting 'Create project folders'.
- If you use the exact same structure in the project editor, it will create all the folders.
- If you use a different structure, it will add them as additional directories.
- If the setting is empty, the 'Create project directories' action will be hidden from users in the launcher.
This setting is also used in ftrack addon to create both the folders on disk and the ftrack entities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- If you use the exact same structure in the project editor, it will create all the folders.
- If you use a different structure, it will add them as additional directories.
I personally don't understand these? Same structure to what? :)
Anyway, make a decision and I'll be happy to adjust accordingly - so we don't keep this lingering much longer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the new tool tip is much better.
I personally don't understand these? Same structure to what? :)
I was just trying to say that I can use the same structure that I'm using in my project editor like this one
#679 (review)
where I want to create an empty folders for my assets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I've found a bug.
Can we use lists in ayon+settings://core/project_folder_structure
setting?
I made this
{
"__project_root__": {
"Assets": {
"Characters": {
"NewRobo": {
"work": [
"cfx",
"concept",
"modeling",
"walkcycle"
]
},
"RoboPoro": {
"work": [
"cfx",
"concept",
"modeling",
"walkcycle"
]
},
"RoboMad": {
"work": [
"cfx",
"concept",
"modeling",
"walkcycle"
]
}
}
}
}
}
and I got this error:
*** WRN: >>> { ActionsModel }: [ Action trigger FAILED. ]
==============================
'list' object has no attribute 'items'
==============================
Traceback (most recent call last):
File "E:\Ynput\ayon-core\client\ayon_core\tools\launcher\models\actions.py", line 405, in trigger_action
action.process(selection)
File "E:\Ynput\ayon-core\client\ayon_core\plugins\actions\create_project_folders.py", line 29, in process
project_folders.create_project_folders(selection.project_name)
File "E:\Ynput\ayon-core\client\ayon_core\pipeline\project_folders.py", line 66, in create_project_folders
basic_paths = get_project_basic_paths(project_name)
File "E:\Ynput\ayon-core\client\ayon_core\pipeline\project_folders.py", line 112, in get_project_basic_paths
return _list_path_items(folder_structure)
File "E:\Ynput\ayon-core\client\ayon_core\pipeline\project_folders.py", line 90, in _list_path_items
paths = _list_path_items(value)
File "E:\Ynput\ayon-core\client\ayon_core\pipeline\project_folders.py", line 90, in _list_path_items
paths = _list_path_items(value)
File "E:\Ynput\ayon-core\client\ayon_core\pipeline\project_folders.py", line 90, in _list_path_items
paths = _list_path_items(value)
[ Previous line repeated 2 more times ]
File "E:\Ynput\ayon-core\client\ayon_core\pipeline\project_folders.py", line 85, in _list_path_items
for key, value in folder_structure.items():
AttributeERROR: 'list' object has no attribute 'items'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested with this, which works perfectly :
{
"{root[work]}/{project[name]}": {
"DELIVERIES": {
"ASSETS_FOR_CLIENTS": {},
"ICON": {
"OLD": {}
},
"MOF_AND_PUB": {
"OLD": {}
} },
"PREPROD": {
"ASSETS_FROM_ARCHIVE": {
"NOM_DU_PROJET": {}
},
"ASSETS_FROM_CLIENT": {
"GUIDELINES_AND_STORYBOARD": {
"OLD": {}
},
"VIDEOS_AND_SOUNDS": {
"OLD": {}
}
},
"MOCKUP_AND_STORYBOARD": {
"EXPORT": {
"OLD": {}
},
"WIP": {}
}
}
}
}
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 |
Imp for AY-5076
Changelog Description
Add simple Create Project Structure launcher action.
Which creates the folder structure as defined in project settings:
ayon+settings://core/project_folder_structure
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: