Commit Graph

1788 Commits

Author SHA1 Message Date
Thomas Barlow
eb7a2f47d2 Fix #122794: FBX Subsurf Export applies the last Subsurf modifier
Disabling the last Subdivision Surface modifier was removed by mistake
in
blender/blender-addons/commit/bc801d7b1dad4be446435e0cab4d3a80e6bb1d04

This patch restores the mistakenly removed code that disables the last
Subdivision Surface modifier when the option to export FBX Subdivision
Surface is enabled.

The add-on's patch version has been increased.

Pull Request: https://projects.blender.org/blender/blender/pulls/122841
2024-06-07 12:55:29 +02:00
Campbell Barton
059dc93cde Extensions: support refreshing local repositories when offline
Since [0] there was no way to refresh local repositories,
with the poll messages suggesting to restart Blender to see updates
which isn't practical for developers.

The ability to refresh was prevented when "Online Access" was disabled,
meaning a developer couldn't easily develop their own add-ons unless
they were online.

[0]: 651621da0d
2024-06-07 17:36:59 +10:00
Campbell Barton
3dd8c826b5 Extensions: correct the descriptions for active repository actions 2024-06-07 16:52:51 +10:00
Campbell Barton
dc0e559cbb Extensions: remove intermediate operators for upgrade and sync
The buttons to upgrade or sync extensions called extension
operators via bpy.app.handlers, requiring awkward glue-code
which didn't show error reports in to the user.

Remove these operators and call the upgrade & sync operators directly.
2024-06-07 16:33:03 +10:00
Campbell Barton
9c60fe88fa Cleanup: de-duplicate check/update poll function 2024-06-07 15:11:54 +10:00
Campbell Barton
6450141a18 Fix #122769: bpy.utils.register_submodule_factory fails with extensions
The unregister function from register_submodule_factory didn't support
a sub-module name argument.
2024-06-07 13:42:59 +10:00
Campbell Barton
239f032186 Fix #122857: error validating older permissions list 2024-06-07 12:49:16 +10:00
Campbell Barton
98bb157ad9 License headers: add SPDX header
Also include "addons_core" in license check.
2024-06-07 12:09:58 +10:00
Campbell Barton
dc9430c480 Extensions: support system repositories & BLENDER_SYSTEM_EXTENSIONS
Support for "System" extensions as an alternative to the current
"User" extensions repository.

The purpose of this change is to support bundling extensions for
offline work or in environments where users setting up thier own
extensions isn't desirable, see #122512.

Details:

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.

- Blender's default startup now has a "System" repository
  which users or administrators may populate.

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

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

Ref !122832
2024-06-07 11:36:20 +10:00
Campbell Barton
881d83031e Cleanup: minor changes to extension repository handing
- Add a function to initialize all default repositories.
- Rename function for creating extensions.blender.org repo for clarity.

Prepare for !122832.
2024-06-07 11:02:48 +10:00
Guillermo Venegas
26965a0758 Fix #122802: Drag and droping a .vdb file no longer works
Changes in view3d_id_path_drop_copy from 8b6a21c122 assumed that
drag-drop filepaths was handled only with FileHandlers in View3d. This
adds the missing drop-box to FileHandler conversion for .vdb files.

Pull Request: https://projects.blender.org/blender/blender/pulls/122839
2024-06-07 02:15:34 +02:00
noodlebox
b73b663309 Fix: Redundant submenus are created in the Add menu for certain catalog names
A few of the recently added submenus are not included in the list of builtin
menus, so node assets under those catalog names will generate redundant submenus.
Fixes same issue as b49c84276c for newly added nested menus.

Pull Request: https://projects.blender.org/blender/blender/pulls/122855
2024-06-06 23:39:00 +02:00
Ray Molenkamp
9f1f869e16 make.bat: Enable .py formatting with make format
autopep8_format_paths.py was never wired up in the windows tooling,
this PR wires it up, to get around a 8191 limitation for command
lines on windows an alternative "--no-subprocess" option has been
introduced to call the pep8 module directly from python.

TODO: A subprocess is still used for getting the version information

Contributors:

- @campbellbarton fixes to autopep8_format_paths.py to support
  the -no-subprocess option.

Pull Request: https://projects.blender.org/blender/blender/pulls/120794
2024-06-06 09:10:19 -06:00
Julien Duroure
08d43667c8 glTF importer: Fix bone shape size not always pertinent
We don't have yet the perfect formula, so adding
- An option to disable bone shape for Blender heuristic, if needed
- An option to scale factor the bone shape for Blender heuristic
2024-06-06 16:42:08 +02:00
Julien Duroure
d9d5597a6c glTF importer: Remove legacy EEVEE blend_method update 2024-06-06 16:35:12 +02:00
Brecht Van Lommel
f7797a90f6 Core: Make BLENDER_SYSTEM_SCRIPTS always add paths
Originally this would replace scripts that come bundled with Blender,
but it's unclear how this is useful.

Searching for this online mainly leads to people asking how they can
use it to add scripts. For example in a studio environment you might
want to deploy add-ons and startup scripts for all users.

Even if you wanted to use it for replacement though, it wasn't really
doing that and inconsistent for different types of scripts:

* startup: ignored
* modules: replaces bundled scripts
* presets: adds to bundled scripts
* addons (in 4.1): ignored
* addons_core (in 4.2): ignored
* startup/bl_app_templates_system: replaces bundled scripts

This change makes it add scripts from this path for all. This is a
breaking change, though arguably this feature was just broken to
begin with and not used much in practice because of that.

The alternative would be add a new set of environment variables to
avoid breaking existing behavior. But that also means keeping around the
broken behavior or fixing it in another way.

Supporting multiple paths may be used too, but for now just support
a single one as doing this for all BLENDER_SYSTEM variables is
non-trivial. The main use case for that would be add-ons anyway, and
those will mainly be handled through upcoming
BLENDER_SYSTEM_EXTENSIONS instead.

Ref #122512

Pull Request: https://projects.blender.org/blender/blender/pulls/122689
2024-06-06 15:28:44 +02:00
Damien Picard
15ec49ff28 Nodes: improve temp viewer from Connect to Output
This PR changes the temporary viewers created in node groups by Connect to Output in two ways:
- Rename it, as it is currently called "tmp_viewer", which stands out
  as strange and code-like. It is renamed to "(Viewer)", which can be
  translated.
- Use the actual connected socket type.
  Currently the viewer uses hardcoded socket types (Geometry for Geometry
  Nodes, Shader for shader nodes). While in GN we can only connect
  geometry to the output, in shader nodes other types can be inspected.
  This change allows the tmp_viewer to use the type of the actual socket
  being inspected, to have a better idea of what it contains from
  outside the group.

  It can be especially useful if a group is used in multiple materials
  and different sockets are being previewed in each one.

It also does some cleanup, details in the commits.

Pull Request: https://projects.blender.org/blender/blender/pulls/122520
2024-06-06 14:47:23 +02:00
Julien Duroure
b0153f5891 glTF exporter: Collection Export: update filepath when changing format
Update .glb / .gltf extension
Part of #122783

Still remaining the change of default (grayed) value if user didn't set filepath yet
But not sure this can be accessible from python API
2024-06-06 12:40:27 +02:00
Julien Duroure
c6e38d084c glTF exporter: Collection Export: Exporting a center of mass of root objects option 2024-06-06 12:18:52 +02:00
Julien Duroure
8fd9712df9 glTF exporter: add alphamode management backward compatibility
When a file is created with pre- 4.2 version, but is open with 4.2 version:
We can now detect the automatically created node setup
Wrong for the exact value of the cutoff, but better than nothing to get it detected
2024-06-06 12:01:48 +02:00
Campbell Barton
fa5f2354f7 Extensions: adjust add-ons shown in missing built-in extensions
Based on feedback in !122727, include previously built-in add-ons
in the built-in extensions panel even if there is no support for
adding it back via the extensions repository.
2024-06-06 18:19:54 +10:00
Damien Picard
3b5f7b0052 I18n: Restore keyconfig after extracting messages
The translation extraction goes through each keyconfig preset file and
activates it in order to extract its messages. This change makes it
restore the original config, otherwise it would end up switching to
Industry Compatible.

Pull Request: https://projects.blender.org/blender/blender/pulls/122789
2024-06-06 09:53:01 +02:00
Campbell Barton
8cb94adbef Extensions: support updated permissions table in the manifest
- Update the example manifest.
- Validate the values are short, single line strings.
2024-06-06 17:42:20 +10:00
Campbell Barton
d5850809cd Cleanup: update Makefile to quite mypy errors, remove redundant check 2024-06-06 17:40:24 +10:00
Campbell Barton
fc0a538168 Extensions: translate each permission individually
Without translating terms individually, the translation lookup table
would have had to included every permutation of permissions.
2024-06-06 16:42:22 +10:00
Campbell Barton
2533ff39f9 Extensions: support replacing missing legacy add-ons with extensions
This groups all the add-ons from 4.1 which were enabled but are no
longer distributed with Blender and provides an easy way for users to
install them. This panel is collapsed by default.

Ref !122727

Co-authored-by: Dalai Felinto <dalai@blender.org>
2024-06-06 14:41:20 +10:00
Campbell Barton
949dfbfaa8 Cleanup: Python script formatting
- Double quotes for strings.
- Trailing commas when wrapped lines.
2024-06-06 11:26:28 +10:00
Nika Kutsniashvili
1d894aa1a7 Add Convert Image Empty to Mesh Plane operator
Since import images as mesh planes operator was added recently in core
Blender, it is now easy to also support converting image empties to mesh
planes by reusing the same code.

This results in a fast workflow where you can use Blender's drag & drop
& align feature for reference images, and quickly turn them into meshes
without registering second file handler and clicking anything before
import is finished.

Ref !122546
2024-06-06 11:15:47 +10:00
Campbell Barton
809be0c8e0 Extensions: disable translation for labels such as URL & repo name 2024-06-06 10:20:13 +10:00
Campbell Barton
e60887c642 Cleanup: address mypy warnings 2024-06-06 10:07:13 +10:00
Campbell Barton
b56ddb6c90 Fix error building an extension without any paths defined
When the [build] table was defined without any paths, duplicate files
could be added to the zipfile.
2024-06-06 10:05:37 +10:00
Campbell Barton
613f00d5ff Fix variable use before assignment in extensions timer
Also remove unused global.
2024-06-06 09:55:13 +10:00
Campbell Barton
83a2693818 Fix error with debugging operator to lock/unlock extension repos 2024-06-06 09:55:13 +10:00
Miguel Pozo
74224b25a5 GPU: Add GPU_shader_batch_create_from_infos
This is the first commit of the several required to support
subprocess-based parallel compilation on OpenGL.
This provides the base API and implementation, and exposes the max
subprocesses setting on the UI, but it's not used by any code yet.

More information and the rest of the code can be found in #121925.

This one includes:
- A new `GPU_shader_batch` API that allows requesting the compilation
  of multiple shaders at once, allowing GPU backed to compile them in
  parallel and asynchronously without blocking the Blender UI.
- A virtual `ShaderCompiler` class that backends can use to add their
  own implementation.
- A `ShaderCompilerGeneric` class that implements synchronous/blocking
  compilation of batches for backends that don't have their own
  implementation yet.
- A `GLShaderCompiler` that supports parallel compilation using
  subprocesses.
- A new `BLI_subprocess` API, including IPC (required for the
  `GLShaderCompiler` implementation).
- The implementation of the subprocess program in
  `GPU_compilation_subprocess`.
- A new `Max Shader Compilation Subprocesses` option in
  `Preferences > System > Memory & Limits` to enable parallel shader
  compilation and the max number of subprocesses to allocate (each
  subprocess has a relatively high memory footprint).

Implementation Overview:
There's a single `GLShaderCompiler` shared by all OpenGL contexts.
This class stores a pool of up to `GCaps.max_parallel_compilations`
subprocesses that can be used for compilation.
Each subprocess has a shared memory pool used for sending the shader
source code from the main Blender process and for receiving the already
compiled shader binary from the subprocess. This is synchronized using
a series of shared semaphores.
The subprocesses maintain a shader cache on disk inside a
`BLENDER_SHADER_CACHE` folder at the OS temporary folder.
Shaders that fail to compile are tried to be compiled again locally for
proper error reports.
Hanged subprocesses are currently detected using a timeout of 30s.

Pull Request: https://projects.blender.org/blender/blender/pulls/122232
2024-06-05 18:45:57 +02:00
Pablo Vazquez
7b601464c3 UI: Add new TAG icon
Introduce a new icon: `TAG`. A generic tag/label, to be used anywhere
there are tags.

Details and images in the pull request.

Pull Request: https://projects.blender.org/blender/blender/pulls/122738
2024-06-05 17:56:51 +02:00
Jacques Lucke
e2de34263a Nodes: don't show custom color panel for reroute nodes
This color is not used anywhere.
2024-06-05 11:00:22 +02:00
Leon Schittek
db5d410164 Node Editor: add overlay to automatically label reroute nodes
Add an overlay option to automatically display a label on reroute nodes.

This automatic label is propagated through chained reroute nodes and
is based on the explicit label of linked reroute nodes.

The automatic label is dimmed to distinguish it from manually set ones.

Pull Request: https://projects.blender.org/blender/blender/pulls/113368
2024-06-05 10:02:37 +02:00
Campbell Barton
7c143367d7 Extensions: use deflate compression for ZIP files
Replace LZMA with ZLIB compression as default tools on Linux & Windows
can't decompress these ZIP files and some users wish to open and inspect
the extensions.

While LZMA has the potential for significantly better compression it
turns out the actual gains were marginal for extensions that contain
many Python files (compared with `tar.lzma`) because each file is
compressed individually, see #122710.
2024-06-05 17:18:42 +10:00
Campbell Barton
8719057b4a Cleanup: unused arguments and warnings raised by pylint 2024-06-05 16:21:20 +10:00
Campbell Barton
17ec64770c Extensions: ensure paths are always included for the "build" command
Scanning the file-system for paths to include didn't detect cases when
explicitly included paths (such as wheels) were missing.

Change the logic to build a list of paths which is merged with pattern
matched paths (de-duplicating), then add all files into the ZIP.
Any missing paths will raise an error.
2024-06-05 15:50:14 +10:00
Leon Schittek
b15dc90c9d Fix #119282: Enable edge-pan when duplicating nodes from menu
The commit that added this to the keymap (33d5ecd5b5) mentions not
hard-coding the edge-panning to be enabled. So this just enables the
edge-panning for the menu entries, as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/120324
2024-06-05 06:53:17 +02:00
Campbell Barton
6c1b908d46 Extensions: correct type checks for permissions 2024-06-05 14:41:20 +10:00
Julien Duroure
b28abfaad4 glTF: Bump version after recent update for EEVEE 2024-06-04 21:09:39 +02:00
Pablo Vazquez
fac32e9647 Cleanup: make format
Missed in my previous commit e2458001e4
2024-06-04 19:15:14 +02:00
Dalai Felinto
ffa363355d Extensions: "permissions" Expect a dictionary instead of a list
We don't do anything with the content of the dictionary yet (the reason
why each permission is required. But Blender can talk again with the
extensions server.

This still requires changes on the validation and build and
server_generate commands. To be tackled separately.
2024-06-04 19:08:17 +02:00
Pablo Vazquez
e2458001e4 UI: Extensions: Layout tweaks to list items
Light redesign of the extension/add-on list item.

The last time this layout was updated was in Blender 2.5, when text was
usually left-aligned, and add-ons preferences weren't streamlined yet.

The goal is to keep a familiar look, while making some improvements to
organization such as group actions (install/uninstall, buttons to external sources
like website, documentation, report a bug).

Detail images available in the pull request.

Pull Request: https://projects.blender.org/blender/blender/pulls/122726
2024-06-04 19:07:56 +02:00
Jacques Lucke
c49045ff53 Nodes: open node property panel by default
This makes it easier to find these properties which are more common
nowadays than they used to be. Especially in geometry nodes.
2024-06-04 19:06:26 +02:00
Bastien Montagne
1e5d1c0d04 Fix (unreported) I18N error when generating messages for an add-on.
Would error when a language is not selected in the translation UI, and
new messages are generated by the update.
2024-06-04 18:42:17 +02:00
Bastien Montagne
b179378766 Fix (unreported) crash in I18N messages extraction script.
Using `bpy.types.OperatorProperties.__subclasses__()` has become utterly
unreliable now, to the point that it keeps references to freed (aka
unregistered) operators now, leading to crash when accessing them.

This commit refactors quite seriously the `dump_rna_messages` code, by
first listing all 'valid' classes, and then processing them all at once
in a flat iteration.

RNA classes are still generated from class hierarchy rooted on the
'virtual' `rna_struct` one, except for operators. These are now
generated by introspecting `bpy.ops` instead.
2024-06-04 18:42:17 +02:00
Dalai Felinto
98dd62ebda UI: Extensions: Missing Script Files tweaks
* Move missing script files inside a panel.
* Call it Missing Add-ons.
* Add an explicit "X" to dismiss (instead of the checkbox).

Note: The panel is collapsed by default.

Co-authored by Pablo Vazquez.

Pull Request: https://projects.blender.org/blender/blender/pulls/122721
2024-06-04 18:16:34 +02:00