Skip to content

Conversation

@Liametc
Copy link
Contributor

@Liametc Liametc commented Dec 8, 2025

#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:

  1. Create a new flame project
  2. Check the mediahub for a new bookmark pointing to the root folders of the given project

@Liametc Liametc changed the title Setting up project bookmarks feature: Setting up project bookmarks Dec 8, 2025
@Liametc Liametc changed the title feature: Setting up project bookmarks Setting up project bookmarks Dec 8, 2025
@jakubjezek001 jakubjezek001 self-requested a review December 10, 2025 09:12
@jakubjezek001 jakubjezek001 added sponsored This is directly sponsored by a client or community member type: feature Adding something new and exciting to the product labels Dec 10, 2025
Comment on lines +75 to +81
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:]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 = [
Copy link
Member

@iLLiCiTiT iLLiCiTiT Dec 10, 2025

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).

Copy link
Member

@jakubjezek001 jakubjezek001 Dec 11, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sponsored This is directly sponsored by a client or community member type: feature Adding something new and exciting to the product

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants