11 Commits

Author SHA1 Message Date
Nika Kutsniashvili
b4a8e8c5f8 Anim: Move "Copy Global Transform" extension to internal scripts
Move the Copy Global Transform core add-on into Blender's code.

- The entire extension was one Python file. This PR basically splits
  it into two, one for operators (in `bl_operators`) and the other for
  UI panels. Those panels are registered in the 3D viewport's sidebar,
  which were registered in `space_view3d`, but I made the decision
  here to create a new file `space_view3d_sidebar`, because the main
  file is getting too large and difficult to navigate. This PR puts
  the global transform panel in this file. After this is merged, I
  will do refactors to move the rest of the sidebar panels here as
  well.

- `AutoKeying` class was moved into `bpy_extras/anim_utils.py` so that
  it's reusable and also accessible from API, since it's generally
  very useful. There were discussions about putting this somewhere,
  but for now, I chose against it because creating a new file would
  also mean PR would have to affect documentation generation, and
  would complicate things. If we want to, we can probably create a new
  module in the future.

- Little tweaks to labels and descriptions. Now that they exist
  outside of the add-on context, and exist without the user explicitly
  enabling them, they need to be more descriptive and tell users what
  they actually do. They also need to conform to Blender's GUI
  guidelines. Also tried organizing files a little by grouping
  objects.

- Add-on properties (which included word `addon` in the name) have
  been registered in C++, on `scene.tool_settings` with `anim_`
  prefix.

Pull Request: https://projects.blender.org/blender/blender/pulls/145414
2025-10-03 17:42:04 +02:00
Janne Nylander
f702eba53f Grease Pencil: Add python operator for masking with above/below layer
Adds a new python operator to Grease Pencil for adding the layer
above or below  as a masking layers to the active layer.

Creates a new file for Grease Pencil python operators in
`scripts/startup/bl_operators/grease_pencil.py`.

Pull Request: https://projects.blender.org/blender/blender/pulls/134401
2025-02-13 12:24:06 +01:00
Sybren A. Stüvel
9d3dc77e05 Anim: move Bone Selection Sets add-on into Blender
The functionality of the Bone Selection Sets add-on is now integrated
into Blender itself. Rigify has been updated to no longer check for the
add-on, but just assume that the functionality is available.

The keymap is still the same, and so are all the class names. This
ensures that there are no conflicts when people still have the old
add-on enabled somehow. And there is versioning code to remove the
'add-on enabled' state so that Blender won't complain it cannot find it
any more.

Compared to the add-on, the following changes are made:

- The 'bone' icon has been removed from the list of available selection
  sets. It was the same for each entry anyway, and thus didn't provide
  any information.
- The code has been split up into multiple files, with the UI elements
  in `scripts/startup/bl_ui/properties_data_armature.py` and the
  operators in `scripts/startup/bl_operators/bone_selection_sets.py`.
- Helper functions and classes are prefixed with `_` to indicate that
  they are not part of any public API.
- The `Operator` helper subclasses have been transformed to mix-in
  classes. This way the only subclasses of `Operator` are the actual
  operators.
- Comments & descriptions have been updated for clarity & consistency.

This commit contains code by the following authors, ordered by number of
commits in the original add-on repository, highest first:

Co-Authored By: Ines Almeida <britalmeida@gmail.com>
Co-Authored By: Sybren A. Stüvel <sybren@stuvel.eu>
Co-Authored By: Campbell Barton <ideasman42@gmail.com>
Co-Authored By: meta-androcto <meta.androcto1@gmail.com>
Co-Authored By: Demeter Dzadik <Mets>
Co-Authored By: lijenstina <lijenstina@gmail.com>
Co-Authored By: Brecht Van Lommel <brechtvanlommel@gmail.com>
Co-Authored By: Aaron Carlisle <carlisle.b3d@gmail.com>

For the full history see the original add-on at:
https://projects.blender.org/blender/blender-addons/commits/branch/main/bone_selection_sets.py

Reviewed On: https://projects.blender.org/blender/blender/pulls/124343
2024-07-08 16:28:42 +02:00
Nika Kutsniashvili
61178b22a2 Nodes: port "Connect to Output" operator from Node Wrangler
As Node Wrangler add-on is moving to extensions platform and maybe isn't shipped
with Blender from 4.2 onwards, some of it's more important functionalities which are
crucial for Blender UX can be ported inside core. Also see #121749.

This PR ports "Preview Node" operator from add-on inside `scripts/startup/bl_operators`.

When Shift-Ctrl (or Shift-Alt) clicked on the node operator connects output socket of the
node to active Output node in the tree (group, material, light, or world output). For Geometry
Nodes this is just handy operator, but in Shader Nodes, because Viewer Node isn't
implemented, this has always been the only way to quickly preview nodes by connecting
it to Material Output.

Changes made from Node Wrangler version:
- Renamed operator from "Preview Node" to "**Connect to Output**", because node previews
  already mean a different thing in context of compositor and shader editor, and viewer node
  is used for previewing in geometry nodes. Connect to Output is correct name because in every
  context it's called that's what it does.
- Assigned shortcut Shift-Alt-Click in shader editor as well. Even though Shift-Ctrl click already
  works, it's good to have consistency with geometry nodes, so that users can use same shortcut
  in both contexts.

Operator doesn't work in compositor. It's not clear if that's wanted (to connect to Composite node),
and if it is it'll be added in separate PR.

Original authors of the add-on: Bartek Skorupa, Greg Zaal, Sebastian Koenig, Christian Brinkmann, Florian Meyer

Pull Request: https://projects.blender.org/blender/blender/pulls/122016
2024-05-28 16:42:55 +02:00
Campbell Barton
b5003fa56c Support "Add -> Image -> Mesh Plane" as a built-in operator
Add the operator from the io_import_images_as_planes add-on,
making it a built-in operator.

The main differences with the add-on are:

- Compositor integration has been removed.
- The file handler for dropping images has been removed
  to avoid a popup whenever images are dropped onto Blender.

There were also changes to follow Blender's core scripts more closely:

- Defer imports where possible.
- Use `str.format`.
- Use double-quotes for non-enum strings.
- Remove or "_" prefix unused arguments.
- Avoid unnecessary use back-slashes for wrapping lines.

Otherwise all other functionality has been kept.

Ref !122223

Co-authored-by: Aaron Carlisle <carlisle.b3d@gmail.com>
Co-authored-by: Bastien Montagne <bastien@blender.org>
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Co-authored-by: Brendon Murphy <meta.androcto1@gmail.com>
Co-authored-by: CoDEmanX <codemanx@gmx.de>
Co-authored-by: Dalai Felinto <dalai@blender.org>
Co-authored-by: Damien Picard <dam.pic@free.fr>
Co-authored-by: Daniel Salazar <zanqdo@gmail.com>
Co-authored-by: Florian Meyer <florianfelix@web.de>
Co-authored-by: Jacques Lucke <mail@jlucke.com>
Co-authored-by: Jesse Yurkovich <jesse.y@gmail.com>
Co-authored-by: Jonathan Smith <j.jaydez@gmail.com>
Co-authored-by: Luca Bonavita <mindrones@gmail.com>
Co-authored-by: meta-androcto <meta.androcto1@gmail.com>
Co-authored-by: Philipp Oeser <info@graphics-engineer.com>
Co-authored-by: Pratik Borhade <pratikborhade302@gmail.com>
Co-authored-by: Rick Astley <mrbimax>
Co-authored-by: Sergey Sharybin <sergey@blender.org>
Co-authored-by: Sibo Van Gool <SiboVG>
Co-authored-by: Sun Kim <perplexing.sun@gmail.com>
Co-authored-by: Thomas Dinges <blender@dingto.org>
Co-authored-by: Victor Chedeville <victor-09@noreply.localhost>
2024-05-27 12:42:36 +10:00
Jeroen Bakker
f01e84e3a5 EEVEE-Next: Add operator to convert a world volume to mesh
EEVEE-Next world volume are infinite like Cycles. EEVEE-Classic world volumes
end at the clip_end of the camera/viewport. This can lead to confusion as
it would render different then expected.

This PR adds an operator to convert a world volume into a mesh volume. The
operator can be found in the shader editor (world mode) and in the properties
panel/World/Volume.

**Why an operator?**

As this alters the content of the scene we want the artist to be in control of
the conversion. Doing it automatic lead to a lot of complexity and cases that
might not be expected by the user.

Pull Request: https://projects.blender.org/blender/blender/pulls/119734
2024-05-10 12:42:17 +02:00
Campbell Barton
9d4dc5376c Fix #112377: Edit Source missing info in the status bar
Reports from the internal operator weren't forwarded to the Python
operator, they were printed in the console instead.

Resolve by moving the operator to C++, use a utility function
to launch the external editor instead of an operator.
2023-10-05 13:09:47 +11:00
Campbell Barton
e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Campbell Barton
65f99397ec License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
guishe
e16ec95a16 UI: Add a custom text editor preference
Add a user preference to set up a custom text editor for editing text
files with the "Edit Source" action in the UI context menu.

- An operator TEXT_OT_jump_to_file_at_point has been added.
- A custom editor can be set in the user preferences.
- A preset has been included for "Visual Studio Code".
- When the editor is not set, use Blender's internal editor.

Ref !108299.
2023-06-07 14:09:19 +10:00
Sergey Sharybin
03806d0b67 Re-design of submodules used in blender.git
This commit implements described in the #104573.

The goal is to fix the confusion of the submodule hashes change, which are not
ideal for any of the supported git-module configuration (they are either always
visible causing confusion, or silently staged and committed, also causing
confusion).

This commit replaces submodules with a checkout of addons and addons_contrib,
covered by the .gitignore, and locale and developer tools are moved to the
main repository.

This also changes the paths:
- /release/scripts are moved to the /scripts
- /source/tools are moved to the /tools
- /release/datafiles/locale is moved to /locale

This is done to avoid conflicts when using bisect, and also allow buildbot to
automatically "recover" wgen building older or newer branches/patches.

Running `make update` will initialize the local checkout to the changed
repository configuration.

Another aspect of the change is that the make update will support Github style
of remote organization (origin remote pointing to thy fork, upstream remote
pointing to the upstream blender/blender.git).

Pull Request #104755
2023-02-21 16:39:58 +01:00