-
Notifications
You must be signed in to change notification settings - Fork 3
Setting up project bookmarks #93
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
base: develop
Are you sure you want to change the base?
Conversation
| for bookmark in deepcopy(section["Bookmarks"]): | ||
| if bookmark["Path"] in bookmark_paths: | ||
| section["Bookmarks"].remove(bookmark) | ||
| # insert directly after the default "Project Home" bookmark | ||
| section["Bookmarks"] = section[ | ||
| "Bookmarks" | ||
| ][:1] + bookmarks + section["Bookmarks"][1:] |
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.
| for bookmark in deepcopy(section["Bookmarks"]): | |
| if bookmark["Path"] in bookmark_paths: | |
| section["Bookmarks"].remove(bookmark) | |
| # insert directly after the default "Project Home" bookmark | |
| section["Bookmarks"] = section[ | |
| "Bookmarks" | |
| ][:1] + bookmarks + section["Bookmarks"][1:] | |
| filtered_bookmarks = [ | |
| bookmark | |
| for bookmark in section["Bookmarks"] | |
| if bookmark["Path"] not in bookmark_paths | |
| ] | |
| # insert directly after the default "Project Home" bookmark | |
| filtered_bookmarks.insert(1, bookmarks) | |
| section["Bookmarks"] = filtered_bookmarks |
| project_entity = self.data["project_entity"] | ||
| project_name = project_entity["name"] | ||
| anatomy = Anatomy(project_name, project_entity=project_entity) | ||
| bookmark_paths = [ |
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.
Not sure I understand why this is going through each root using {root[...]}/{poroject name}/? Is that based on the fact that default templates start with {root[...]}/{project[name]}? If yes, then that can be changed and this would not make sense.
What bookmarks do affect? Is that only about workfile? If yes then we should use the workfile path or? (I'm not flame dev, sorry).
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 am guessing it needs to support multi-roots, right? Also If I could suggest rather to use pathlib for path operations. It sould be already well supported on any Flame now.
#91
Changelog Description
This feature allows ayon to create bookmarks for all the defined roots of a project in the mediahub upon project creation.
Additional review information
This uses an ayon post-launch hook to create json files flame uses to define bookmarks. It will respect any existing bookmarks the user may have created. Currently this will only add the root folders defined in the anatomy of the project, but there is scope to allow a setting to be created to add arbitrary folders, using templates, as bookmarks.
Testing notes: