107840 Commits

Author SHA1 Message Date
Campbell Barton
eb165f574b Cleanup: remove redundant imports
The module was importing it's own functions.
2021-08-09 15:02:31 +10:00
Yuki Hashimoto
8830cfe541 Fix text object inserting multiple characters with a selection
`bpy.ops.font.text_insert(text="multiple characters")` wasn't working.

When the text is selected does not correctly insert multiple characters.

- When the text was selected from left to right,
  the cursor only move one position next to the selected text.
- When the text is selected from right to left,
  a part of the selected text remain.

Ref D12161
2021-08-09 14:31:57 +10:00
Campbell Barton
ff9bc901f4 Cleanup: grease pencil app-template versioning
- Remove check for screens being None as this would raise an error.
- Replace loop over `area.spaces` with `area.spaces.active`.
- Loop over grease pencil data directly instead of accessing
  through the scenes objects.
- Split versioning into functions.
- Use `update_factory_startup_*` prefix for function names
  as this isn't versioning existing files.
2021-08-09 12:45:06 +10:00
Campbell Barton
3ea6cf7d41 Cleanup: avoid using context in versioning code
Also extract versioning into a function that makes it's purpose clear.
2021-08-09 12:01:11 +10:00
Aaron Carlisle
4c26bb0232 UI: Show Mask Display Options Conistently
This commit makes the display options for mask only show in the header for the clip and image editors.
Prior to this change they would display in the header for the clip editor and in the sidebar for the image editors.
2021-08-08 16:09:23 -04:00
Aaron Carlisle
0be26f563e UI: Sequencer: Fix placement of display options in sequencer & preview mode
This commit does two things, first it removes the proportional editing tool settings.
This is not accessible code and is has not been used since the grease pencil/annotations changes in 2.8.

Second, this patch reorders the if statements so that the display options are always shown on the rightside.

Reviewed By: antoniov

Differential Revision: https://developer.blender.org/D12163
2021-08-08 13:30:52 -04:00
Aaron Carlisle
76e24609fd Cleanup: Remove stale/dead code
This seems to be really old code from 2.4 or earlier.
I was unable to find when it was removed gitk and git blame both couldnt find anything.
However, it is safe to say that this code is long gone.
2021-08-08 13:29:29 -04:00
Antonio Vazquez
3f1873111e Cleanup: Fix comment typo 2021-08-08 15:11:50 +02:00
Antonio Vazquez
b541b5f875 GPencil: Fix memory leak in previous commit 2021-08-08 15:09:34 +02:00
Antonio Vazquez
a7aeec2655 GPencil: New Select Random operator
Select strokes or points randomly (similar to meshes).

Reviewed By: pepeland

Differential Revision: https://developer.blender.org/D12157
2021-08-08 14:56:33 +02:00
Peter Kim
a7bb537a61 Cleanup: unnecessary double pointers in XR module
No functional changes.
2021-08-07 21:30:15 +09:00
nutti
b33b70ed07 PyDoc: Fix poll_message_set API documentation to consistent with Python style
Fix poll_message_set API documentation to consistent with Python style

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D12150
2021-08-06 20:18:31 -04:00
Aaron Carlisle
d245782b80 Windows: Add support to compile python api docs from make file
This adds support to compile the html python api docs from the command line by running `make doc_py` matching support between windows and unix.

This patch also makes it so the compiler is not needed if you set the `blender_bin` variable, this affects icon generation as well.

In the future, I want to move away from generating the build output in the build directory but that can come in a later change.

Reviewed By: LazyDodo

Differential Revision: https://developer.blender.org/D12144
2021-08-06 13:55:14 -04:00
Germano Cavalcante
3fab16fe8e Fix T90477: Cursor vertex snapping not working in UV editor
`t->obedit_type` is read to indicate if we are in uv edit mode.

Also fixes a crash introduced in {rBdd14ea18190ff27082009f73a556569a43377a71}.
2021-08-06 11:44:26 -03:00
Sergey Sharybin
4f64fa4f86 Cycles: Fix for possible viewport dead-lock
This is a backport of recent development in the Cycles X branch.

Fixes possible dead-lock in viewport rendering when exiting at an
exact bad moment (couldn't reproduce in master branch, but in the
cycles-x branch it was happening every now and then).

Differential Revision: https://developer.blender.org/D12154
2021-08-06 16:26:51 +02:00
Sergey Sharybin
69c9363e39 Cleanup: Use conventional naming for private Session members
Makes it consistent with the guidelines and the Cycles X branch, and
allows to backport fix for the viewport update from the branch. Will
cause a merge conflict, which should be simple accept-ours in the
branch.
2021-08-06 15:56:00 +02:00
Antonio Vazquez
335379d8fc Cleanup: Add missing newline at end of file 2021-08-06 15:32:28 +02:00
Antonio Vazquez
3fbe6f513d Move NanoSVG lib to extern
The library has some modifications and it has been included in a diff.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D12142

(Some minor changes done in the patch)
2021-08-06 15:29:54 +02:00
Sybren A. Stüvel
9cff9f9f5d Cleanup: rename FileList::asset_libraryasset_library_ref
In the `FileList` struct, rename the `AssetLibraryReference
*asset_library` field to `asset_library_ref` -- it's a description of
which asset library is used, and not the asset library itself.

This is to make space for a future `AssetLibrary *asset_library` field,
which will point to an actual asset library struct/class.

No functional changes.

Reviewed by: Severin

Differential Revision: https://developer.blender.org/D12151
2021-08-06 15:20:39 +02:00
Campbell Barton
2796ee7da0 Fix error setting the ID name in disabled alembic nurbs importe
This corrects code that's currently disabled, see `USE_NURBS` define.

The name passed to `BKE_curve_add` was overwritten,
bypassing uniqueness and utf8 encoding checks.

Longer names would cause a buffer overrun as the length of the source
data was passed to `BLI_strncpy` instead of the destination.

Reviewed By: sybren

Ref D12125
2021-08-06 23:01:57 +10:00
Julian Eisel
01c1b1e82e Fix shortcut for Asset Details not showing in Asset Browser pulldown
The shortcut wouldn't show up in the Asset Browser's "View" pulldown for
the "Asset Details" item. It's the "N" key to toggle the right sidebar.
2021-08-06 14:39:09 +02:00
Brecht Van Lommel
f4adb35f28 Fix T90476: intermittent wrong generated texture coordinates with modifiers
This caused Cycles texture_space_mesh_modifier and panorama_dicing tests to
randomly fail.

The issue was introduced with D11377, due to a missing dependency. Now ensure
we first copy the texture space parameters, and only then use or recompute then.

In general it seems like this dependency should have already been there, since
parameter evaluation includes animation and drivers, and geometry evaluation
may depend on that (even if you would not typically animate e.g. an autosmooth
angle).

Thanks Campbell for tracking this one down.
2021-08-06 13:59:25 +02:00
Peter Kim
b0df8f53ba Cleanup: rna_xr.c
- Rename functions to use RNA identifiers
- Use SET_FLAG_FROM_TEST macro
- Specify max string length for relevant function params
2021-08-06 17:56:06 +09:00
Peter Kim
4c675bc356 Fix missing function param definition in rna_xr.c
Was accidentally left out in rBe844e9e8f3bb.
2021-08-06 17:55:32 +09:00
Peter Kim
151eed752b Fix invalid XR action map indices after alloc
Although the relevant structs (wmXrRuntime/XrActionMap/
XrActionMapItem) are zero-allocated, the selected and active action
map indices need to be initialized to -1 to prevent potential
out-of-bounds list access.
2021-08-06 17:55:00 +09:00
Jacques Lucke
d98791a106 Cleanup: clang tidy
`bugprone-signed-char-misuse`
2021-08-06 10:20:24 +02:00
Jeroen Bakker
6188c29603 Cleanup: use const result in ED_keyframes_find_* functions. 2021-08-06 09:54:56 +02:00
Jeroen Bakker
1ab75c1d49 Cleanup: use range2f in ED_keylist_find_any_between. 2021-08-06 09:46:36 +02:00
Jeroen Bakker
bb8ce95b5e Cleanup: const pass keyframes_keylist. 2021-08-06 09:10:28 +02:00
Campbell Barton
bc97d78329 Cleanup: use MEM_SAFE_FREE macro 2021-08-06 14:24:16 +10:00
Hans Goudey
99738fbfdc Fix memory leak from rB263fa406cd2b 2021-08-05 21:10:54 -05:00
Hans Goudey
1f8485ae82 Geometry Nodes: Select by Handle Type Node
Just like the "Select by Material" node, this node outputs a
boolean attribute for control points that have a matching handle
type. By default left and right handles are considered, but it's
possible to only check one side with the toggle in the node.

Differential Revision: https://developer.blender.org/D12135
2021-08-05 18:42:20 -05:00
Mattias Fredriksson
bc0d55e724 Fix: Avoid floating point error in some mesh primitive nodes
Some mesh primitives created using geometry nodes use loops to create
vertices and accumulates positions/angles in FP variables. This allows
rounding errors to accumulate and can introduce significant errors.

To minimize changes from original implementation, variables allowing
errors to accumulate are replaced by: delta * index. Affected Mesh
Primitives nodes are Line, Grid, Cylinder, Circle, Cone, and UV-Sphere.

Differential Revision: https://developer.blender.org/D12136
2021-08-05 18:34:32 -05:00
Hans Goudey
263fa406cd Fix T90087: Assigning object data doesn't copy vertex groups
Assigning a mesh seems to do its own parameter copying, which
means we need to manual copy its vertex groups here, which was
just overlooked in rB3b6ee8cee708.

Differential Revision: https://developer.blender.org/D12110
2021-08-05 18:27:07 -05:00
Himanshi Kalra
92edf37997 Add custom data comparison for generic attributes
Generic attributes CD_PROP_* comparison is added in customdata_compare
Checks for built-in as well as user created attributes.

Reviewed By: JacquesLucke

Differential Revision: https://developer.blender.org/D12137
2021-08-06 00:07:40 +05:30
Germano Cavalcante
89014b51f1 Xcode: support cmake options for grouping in folders
The Xcode IDE can also benefit from the options:
- WINDOWS_USE_VISUAL_STUDIO_SOURCE_FOLDERS
- WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS

So add suport to these options and also renames them as they are no
longer limited to just Windows and Visual Studio.

Reviewed By: brecht, ankitm

Differential Revision: https://developer.blender.org/D12132
2021-08-05 15:31:41 -03:00
Alexander Gavrilov
cf10eb54cc Action Constraint: add Split Channels Mix choices from Copy Transforms
Practice shows that when combining actions and direct animation
it is usually best to combine location, rotation and scale
separately, which is implemented by the Split Channels modes
recently introduced in D9469 for Copy Transforms. This completes
the same set of 6 choices for the Action Constraint.

The default for new constraints is changed to the newly
added Before Original (Split Channels) mode.

The original patch is motivated by Loic Pinsard, who created
an addon that does the equivalent of this feature by splitting
the action into two, separating location and rotation+scale.

Differential Revision: https://developer.blender.org/D7547
2021-08-05 21:21:29 +03:00
Pablo Dobarro
d01781129f Fix T90235: Smooth Brush not working with interior vertices with two adjacent edges
The exception to automatically pin vertices of grid corners also
has to take into account that the vertex is in a boundary.

Reviewed By: JacquesLucke

Maniphest Tasks: T90235

Differential Revision: https://developer.blender.org/D12044
2021-08-05 20:10:02 +02:00
Pablo Dobarro
4dd6c9ad45 Fix T90236: Sculpt automasking failing when the stroke does not start over the mesh
The active geometry element are usually updated by the cursor drawing
code (as they are needed for the cursor preview) and when an sculpt
operator starts. For brushes, this was not happening. This was making
brushes rely by default on the last cursor drawing update, which can
be incorrect if the mouse moved after starting the stroke without
hovering the active geometry.

Reviewed By: JacquesLucke

Maniphest Tasks: T90236

Differential Revision: https://developer.blender.org/D12045
2021-08-05 20:08:36 +02:00
Aaron Carlisle
6844f7bedb PyDoc: document how parameter are used for 3D and 2D textures
Improves on rB171433e841379e7efad069bbda9880fb271e2fc4
2021-08-05 13:06:13 -04:00
Eitan
bd44e82b25 Geometry Nodes: Add more warnings for out of bounds parameters
Add warning(info) to nodes that don't work when an input value is
out of range. For example, the grid node doesn't work with Vertices X
or Verices Y less than 2.

These are purposefully added as "Info" warnings, because they don't
show in the modifier and they aren't printed to the terminal.

Differential Revision: https://developer.blender.org/D11923
2021-08-05 10:44:59 -05:00
Campbell Barton
c15635bd8d BMesh: support laplacian smooth for n-gons
Follow the same logic already used by the modifier.
2021-08-06 01:43:13 +10:00
Campbell Barton
04c24bec07 Cleanup: replace short with boolean for zero area array
Also remove redundant fabsf on the area of a quad/tri &
reduce indentation using continue in for loop.
2021-08-06 01:42:01 +10:00
Campbell Barton
ff2265f0a9 Cleanup: comment blocks & spelling 2021-08-06 01:36:43 +10:00
Campbell Barton
8158211198 Cleanup: quiet array-parameter warning 2021-08-06 01:32:04 +10:00
Brecht Van Lommel
ca64bd0aac Render: move Cycles visibility, holdout and shadow catcher properties to Blender
The immediate reason for this is that we want to be able to initialize them
to different defaults for light objects, which is hard with Python properties.
But in general it is useful to be able to share these with other renderers.

As a side effect, Eevee now supports a per-object holdout instead of only
per-collection.

Differential Revision: https://developer.blender.org/D12133
2021-08-05 17:22:38 +02:00
Bastien Montagne
6c326ba0a2 Fix T83164: Spline IK joint_bindings parameter is broken.
Code freeing the array would not properly reset its length value to
zero.

Note that this corrupted data could also be saved in .blend files, so
had to bump fileversion and add some doversion code too.

Fix T90166: crash when creating a liboverride.
2021-08-05 17:21:25 +02:00
Bastien Montagne
834523e239 Cleanup/Fix RNA array length accessors returning non-zero values in invalid cases.
This was apparently done in two places only, with a very cryptic comment
(`/* for raw_access, untested */`), and... I cannot see how returning a
non-zero length value for an array that does not exist or is not
accessible at least, would be anything but an obvious source of issues.

Note that both commits adding those lines are from stone ages (2009):
rBcbc2c1886dee and rB50e3bb7f5f34.
2021-08-05 17:21:25 +02:00
Antonio Vazquez
27b9cb7a1e GPencil: New Merge Layer keymap: Shift+Ctrl+M
The keymap is available in: Draw, Edit, Sculpt, Weight Paint and Vertex Paint modes.

The keymap is not available in Object mode to avoid any conflict.

Reviewed By: pepeland

Differential Revision: https://developer.blender.org/D12128
2021-08-05 17:12:34 +02:00
Peter Kim
03d7561708 Fix build error when WITH_XR_OPENXR not defined 2021-08-06 00:08:56 +09:00