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

Allow adjusting scan folder priority for project-relative Gems #14028

Conversation

amzn-phist
Copy link
Contributor

@amzn-phist amzn-phist commented Jan 12, 2023

What does this PR do?

It may be desirable to have the scan folders of any project-relative Gems (Gems that reside within the project folder) be prioritized before the main Project scan folder. By default, the project scan folder is priority 0, and all Gem scan folders start incrementing from starting value of 100, so Gem scan folders are always at a lower priority than the project.

This introduces two settings registry keys that can be used to tweak relative priorities:
"/Amazon/AssetProcessor/Settings/GemScanFolderStartingPriorityOrder": 100
This setting will define the starting priority order for all Gems. The first Gem scan folder will be assigned 101 and increase value from there.

"/Amazon/AssetProcessor/Settings/ProjectRelativeGemsScanFolderPriority": "none"
This setting determines how you want project-relative Gem scan folders to be prioritized against the main project scan folder.
"none" (default): This means don't do anything special. All project-relative Gem scan folders will be assigned priority order using the 'running value' that starts at the value defined in the above setting.
"lower": All project-relative Gem scan folders will have a priority that is lower than the project. Users could configure the priority order of the project's main scan folder to be lower than all Gems, but having a setting of "lower" here would force project-relative Gem scan folders to be lower than the project.
"higher": All project-relative Gem scan folders will have a priority that is higher than the project. Again, by default Gems have lower priority than the project, but having a setting of "higher" here would force project-relative Gem scan folders to be higher than the project.

fixes #8480

How was this PR tested?

Followed instructions from the GHI. Was able to tweak relative priorities and get the assets in project-relative Gems to scan and be picked up. More testing ongoing.

@amzn-phist amzn-phist marked this pull request as ready for review January 12, 2023 18:20
@amzn-phist amzn-phist requested review from a team as code owners January 12, 2023 18:20
Copy link
Contributor

@lemonade-dm lemonade-dm left a comment

Choose a reason for hiding this comment

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

This looks good, just a few suggestion to make this even more data driven and to simplify the detection a gem being underneath the project.

- For scan folders of Gems inside the project, this allows you more
  flexibility to configure the priorities of the scan folders, with
  respect to the main project scan folder.
- "GemScanFolderPriorityStart": the starting value of all gems priority
- "ProjectGemsRelativeScanFolderPriority": controls whether
  project-relative gems will be prioritized higher, lower, or "none"
  against the project scan folder.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>
- Also updated comments

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>
Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>
- Fixes linux build because it's unused.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>
- Fix the FindScanFolder iterator & return.
- Change an index-based find function to use FindScanFolder.
- Add string constants.
- Check for gem paths that are relative to the project path (simplify).

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>
@amzn-phist amzn-phist force-pushed the systems/amzn-phist/AssetScanFolders branch from eef72b0 to 82067c3 Compare January 13, 2023 18:36
Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>
@lemonade-dm lemonade-dm requested a review from a team January 19, 2023 19:29
@amzn-phist amzn-phist merged commit e8a26af into o3de:development Jan 20, 2023
@amzn-phist amzn-phist deleted the systems/amzn-phist/AssetScanFolders branch January 20, 2023 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gems: Assets paths for gems local to a project are incorrect
3 participants