Extensions: support for system extension repositories #122832

Manually merged
Campbell Barton merged 7 commits from ideasman42/blender:pr-extensions-system into blender-v4.2-release 2024-06-07 03:58:56 +02:00

Support for system extensions as an alternative to the current
"User" extensions repository.

The default "system" repository on Linux will for example use:

  • /usr/share/blender/4.2/extensions/{system} For system installs.
  • ./4.2/extensions/{system} For portable installs.

Other changes:

  • Blender's default startup now has a "System" repository
    intended to include bundled extensions.

  • An empty "system" extensions is created by the install target.
    This is mainly to make it clear where users should bundle extensions.

  • Repositories can select between User/System paths,
    setting a custom path overrides overrides this.

  • Add "BLENDER_SYSTEM_EXTENSIONS" (matching "BLENDER_LOCAL_EXTENSIONS").


Open Topic:

This PR makes it possible to switch between "User" and "System" repository locations.
The option is ignored when "Custom Directory" is set.

It's fairly unlikely a user would want to change an existing user-repo to a system-repo but the same could be said for custom directories. Since it's under "Advanced" I'm not all that fussed, the ability to do this is needed to create a new system repository, although this too seems like something users wouldn't do that often, nevertheless, supporting multiple bundles is nice to have.

We could remove the [User/System] option in the UI & only expose this when adding repositories:

  • Add Remote Repository
  • Add Local User Repository
  • Add Local System Repository [new item]

I'm undecided here, although adding to the top-level menu makes the "System" repository more prominent than it needs to be, especially when most users would just stick to the default system repository and leave the advanced settings alone.


Pending issues:

  • This PR relies on a change in Blender which changes the behavior
    of creating "config" directory locally which can be done to store
    local configuration (instead of the users home directory)
    this would cause an overlap between bundled and system extensions
    which isn't supported.

  • Support for a read-only systems repository should be added
    this PR doesn't implement this part.

This PR works towards support for bundling extensions, see #122512.

Support for system extensions as an alternative to the current "User" extensions repository. The default "system" repository on Linux will for example use: - `/usr/share/blender/4.2/extensions/{system}` For system installs. - `./4.2/extensions/{system}` For portable installs. Other changes: - Blender's default startup now has a "System" repository intended to include bundled extensions. - An empty "system" extensions is created by the install target. This is mainly to make it clear where users should bundle extensions. - Repositories can select between User/System paths, setting a custom path overrides overrides this. - Add "BLENDER_SYSTEM_EXTENSIONS" (matching "BLENDER_LOCAL_EXTENSIONS"). --- Open Topic: This PR makes it possible to switch between "User" and "System" repository locations. The option is ignored when "Custom Directory" is set. It's fairly unlikely a user would want to change an existing user-repo to a system-repo but the same could be said for custom directories. Since it's under "Advanced" I'm not all that fussed, the ability to do this is needed to create a new system repository, although this too seems like something users wouldn't do that often, nevertheless, supporting multiple bundles is nice to have. We could remove the [User/System] option in the UI & only expose this when adding repositories: - Add Remote Repository - Add Local User Repository - Add Local System Repository `[new item]` I'm undecided here, although adding to the top-level menu makes the "System" repository more prominent than it needs to be, especially when most users would just stick to the default system repository and leave the advanced settings alone. --- Pending issues: - This PR relies on a change in Blender which changes the behavior of creating "config" directory locally which can be done to store local configuration (instead of the users home directory) this would cause an overlap between bundled and system extensions which isn't supported. - Support for a read-only systems repository should be added this PR doesn't implement this part. This PR works towards support for bundling extensions, see #122512.
Campbell Barton requested review from Brecht Van Lommel 2024-06-06 16:15:57 +02:00
Campbell Barton requested review from Dalai Felinto 2024-06-06 16:16:06 +02:00
Campbell Barton force-pushed pr-extensions-system from 76a95a8b1f to a578d569cd 2024-06-06 16:25:14 +02:00 Compare
Campbell Barton reviewed 2024-06-06 16:27:42 +02:00
@ -6801,6 +6816,15 @@ static void rna_def_userdef_filepaths_extension_repo(BlenderRNA *brna)
"rna_userdef_extension_repo_access_token_length",
"rna_userdef_extension_repo_access_token_set");
prop = RNA_def_property(srna, "source_type", PROP_ENUM, PROP_NONE);
Author
Owner

The name source_type isn't great but I'm not sure of better terminology, path_preset, path_source could be used instead.

The name `source_type` isn't great but I'm not sure of better terminology, `path_preset`, `path_source` could be used instead.

I think "source" sounds ok. Personally would just call it source and Source.

I think "source" sounds ok. Personally would just call it `source` and `Source`.
ideasman42 marked this conversation as resolved
Campbell Barton reviewed 2024-06-06 16:29:55 +02:00
@ -0,0 +1,7 @@
System Extensions
Author
Owner

We normally don't have empty directories in the default install, include a README to avoid confusion, especially since it's purpose is for people setting up extensions bundles may want to manually populate it.

We normally don't have empty directories in the default install, include a README to avoid confusion, especially since it's purpose is for people setting up extensions bundles may want to manually populate it.
ideasman42 marked this conversation as resolved

This PR relies on a change in Blender which changes the behavior
of creating "config" directory locally which can be done to store
local configuration (instead of the users home directory)
this would cause an overlap between bundled and system extensions
which isn't supported.

This already landed in #122778.

> This PR relies on a change in Blender which changes the behavior of creating "config" directory locally which can be done to store local configuration (instead of the users home directory) this would cause an overlap between bundled and system extensions which isn't supported. This already landed in #122778.
Brecht Van Lommel reviewed 2024-06-06 17:11:38 +02:00
@ -6752,1 +6761,4 @@
static const EnumPropertyItem source_type_items[] = {
{USER_EXTENSION_REPO_SOURCE_TYPE_USER, "USER", 0, "User", ""},
{USER_EXTENSION_REPO_SOURCE_TYPE_SYSTEM, "SYSTEM", 0, "System", ""},

Suggested descriptions:

  • Repository managed by the user, stored in user directories
  • Read-only repository provided by the system
Suggested descriptions: * Repository managed by the user, stored in user directories * Read-only repository provided by the system
ideasman42 marked this conversation as resolved
@ -6804,0 +6823,4 @@
RNA_def_property_ui_text(
prop,
"Path Source",
"Select the location of extensions when the custom directory is not set");

Suggested description:

  • Select if the repository is in a user managed or system provided directory
Suggested description: * Select if the repository is in a user managed or system provided directory
ideasman42 marked this conversation as resolved
@ -856,6 +856,7 @@ static void print_help(bArgs *ba, bool all)
PRINT(" $BLENDER_SYSTEM_SCRIPTS Directory for system wide scripts.\n");
PRINT(" $BLENDER_SYSTEM_DATAFILES Directory for system wide data files.\n");
PRINT(" $BLENDER_SYSTEM_PYTHON Directory for system Python libraries.\n");
PRINT(" $BLENDER_SYSTEM_EXTENSIONS Directory for system extensions.\n");

Suggest:
system extensions -> system extensions repository

Suggest: system extensions -> system extensions repository
ideasman42 marked this conversation as resolved

I'm undecided here, although adding to the top-level menu makes the "System" repository more prominent than it needs to be, especially when most users would just stick to the default system repository and leave the advanced settings alone.

I think leaving it just as an option under Advanced is ok.

Most users will never set up more local repositories pointing to some custom directory. But for those that do, I would guess that wanting these to be read-only is fairly common.

> I'm undecided here, although adding to the top-level menu makes the "System" repository more prominent than it needs to be, especially when most users would just stick to the default system repository and leave the advanced settings alone. I think leaving it just as an option under Advanced is ok. Most users will never set up more local repositories pointing to some custom directory. But for those that do, I would guess that wanting these to be read-only is fairly common.
Brecht Van Lommel requested changes 2024-06-06 19:27:07 +02:00
Dismissed
Brecht Van Lommel left a comment
Owner

Marking as request changes.

Marking as request changes.
Campbell Barton force-pushed pr-extensions-system from a578d569cd to 9b6b26e9ed 2024-06-07 02:22:50 +02:00 Compare
Campbell Barton force-pushed pr-extensions-system from 891d227e36 to ed1d1ed340 2024-06-07 02:37:28 +02:00 Compare
Author
Owner

Addressed requested changes, other changes:

  • Bump the sub-version.
  • Consistent ordering of "EXTENSIONS" after "SCRIPTS".
  • Minor wording tweak for the readme Extensions bundled in this directory -> Extensions extracted into this directory since it wasn't clear if ZIP-files could be copied into directory and used in-place.
  • Lowercase readme filename.
Addressed requested changes, other changes: - Bump the sub-version. - Consistent ordering of "EXTENSIONS" after "SCRIPTS". - Minor wording tweak for the readme `Extensions bundled in this directory` -> `Extensions extracted into this directory` since it wasn't clear if ZIP-files could be copied into directory and used in-place. - Lowercase readme filename.
Campbell Barton requested review from Brecht Van Lommel 2024-06-07 02:46:09 +02:00
Campbell Barton force-pushed pr-extensions-system from 8ad3dce48a to 092209ed8a 2024-06-07 03:09:35 +02:00 Compare
Campbell Barton force-pushed pr-extensions-system from 092209ed8a to d4c4faddf3 2024-06-07 03:18:40 +02:00 Compare
Brecht Van Lommel approved these changes 2024-06-07 03:22:21 +02:00
Campbell Barton manually merged commit dc9430c480 into blender-v4.2-release 2024-06-07 03:58:56 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#122832
No description provided.