WIP: Basic Blender Project Support (experimental feature) #107655
With this patch, Blender supports awareness of projects, whereby a project is a
directory on disk with an arbitrary amount of .blend files, as well as project
wide settings. The concept is quite expandable, this patch implements the very
For further info, see https://wiki.blender.org/wiki/Source/Blender_Projects
Old review: https://developer.blender.org/D16288
What's Implemented Here
- Experimental option for the project support.
- Operators to set up a new project and delete a project configuration (not the project files).
- Active project (loaded whenever the current file location changes).
- Display active project name in window title.
- Project Settings window, similar to the Preferences.
- Per project asset libraries (path relative to the project root), setup in the Project Settings, accessible in the Asset Browser & asset views.
- Confirmation dialog when exiting a file without saving modified project settings.
- File Browser displays project directories with special icon (temporary heart icon).
- Reading and writing project settings into a JSON file (
- Internal Project APIs and access to active project data via BPY.
- Split custom asset library code from preferences.
- Rather extensive unit tests for the core project code.
The code should be a good architectural foundation to build on.
- Fix failing Windows unit tests
- Link assets from project asset libraries by default and use relative paths
- Expose Import Method option for asset libraries in Project Settings
.blender_projectdirectory on Windows
- Icon for projects
When unit testing on Unix with Windows style slashes, the project directories would have the backslash in the name, rather than recognizing it as nested directory. We could just expect native paths only like most BLI functions, but it's not a big problem to just support any format and just convert it internally. The most important part is that the API defines well how it deals with the different formats, and that this is unit tested. Ideally we'd have some path object type that abstracts away the difference.
The active project is determined via the path of the .blend file. So if that changes (on write) or when a new .blend file is opend, the active project is updated. Some of the added tests require a latest checkout of the libraries SVN repository (see rBL63043).
Currently only says "Has Project", but should be the project name once that's supported.
Name and exact design of this is pending still, they are not optimal.
Adds very basic json deserializing for reading a project name from a `.blender_project/settings.json` file. The name is displayed in the window title.
Adds basic access to the active project and its properties to BPY (`context.project`).
Disable the navigation and "Save Settings" buttons when there is no active project. The message saying that no project is loaded always shows up now, even if the UI somehow displays a section that is not the "General" one.
Deletes the active project's .blender_project directory, but leaves all actual project files (.blends and such) untouched.
Also show a button to set up a project.
Using the dev-fund heart icon temporarily :)
Looks a bit less nice, but doesn't mess with muscle memory as much, since the Preferences used to be last in the menu. I for one kept opening the wrong window :)
Projects are supposed to support custom asset libraries too. So the custom asset library types should be generalized and not be preferences specific.
Unit tested, there is no UI for this yet.
Looks just like the UI for setting up custom asset libraries in the Preferences. However project asset libraries use paths relative to the project root directory. Had to do some changes to project data storage to avoid memory issues.
Default project name will just be the directory name. The default asset library will be called "Project Library" and point to an `assets/` directory inside the project root directory.
The hint in the asset browser for when the selected library path doesn't exists is updated to mention the project settings too, and there is a button to open the project settings in the asset library section.
Will probably reorganize things even further, but step by step.
Mostly this is about more cleanly separating between `BlenderProject` and `ProjectSettings`. Overall this is a nice improvement I think, helps readability of interfaces and implementation a lot.
Coded the RNA functions to only work with the preferences for the start. But we actually don't have to care here if the libraries are defined in the preferences or project.
The regular confirmation prompt is shown then with a "Save modified project settings" checkbox.
a958ae36e8introduced support for UI lists to reference items that would never be shown, regardless of filter settings. This was to skip assets in the asset view template that were not of the requested type. UI list sorting code wasn't updated to account for such items that should be entirely ignored. The following commit will remove some code duplication, just keeping that cleanup separate from the fix.
This reverts commit
160678d224. Wasn't my intention to push this to this branch. It's an unrelated patch for the main branch.
CheckoutFrom your project repository, check out a new branch and test the changes.
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?