Commit Graph

100154 Commits

Author SHA1 Message Date
guishe
fb348137d5 Cleanup: Move IO files to C++
Changes:
1. `UNUSED` AND `UNUSED_VARS`   ->   `/*arg*/`
2. `NULL` -> `nullptr`
3. `Function style cast` for `enums` values
4. `void *` -> `static_cast<T*>`
5. Use standard includes `#include <file.h>` ->`#include <cfile>`
6. Replace designated initializers with member assignment
7. `typdef struct N{...} N; ` -> `struct N{...}`

See: #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/108477
2023-06-07 00:52:34 +02:00
guishe
7dc85e68fe Cleanup: Fix comment warning
When compiling on Ubuntu this comment could generate
thousands of warning lines, the comment is fixed now.

Introduced by 8e059b569b

Pull Request: https://projects.blender.org/blender/blender/pulls/108676
2023-06-06 21:59:09 +02:00
Germano Cavalcante
cf967f8e08 Transform: Remove Indication of the Transformed Snap Base
This commit removes the transformed `Snap Base` symbol (white target)
and displays only the untransformed `Snap Base` symbol (X) when
confirming the Snap Base Edit operation.

The usefulness of the white target icon representing the transformed
`Snap Base` is debatable since it represents the snap target itself
(orange circle) during the Move operation or the direction between the
pivot and the snap target during the Rotation operation.

Having multiple symbols on the screen can clutter the interface and may
not be intuitive.

Therefore, further discussion is required.

Ref.
#108669
2023-06-06 15:42:22 -03:00
Germano Cavalcante
8e059b569b UI: move 'Face Nearest' snap option to another section
The snap mode called "Face Nearest" (and the "Increment" but that's for
another time) doesn't behave like the other snap modes.

Unlike the other snap modes, "Face Nearest" does not act on a Snap
Base (or Snap Source).

It always acts on the origin of individually transformed elements, (such
as each vertex individually).

It works just like the "Project Individual Elements" option.

So this commit makes the following changes:
- `Snap With` was moved to the beginning of the popover
- `Align Rotation to Target` and `Backface Culling` have been moved closer to the snap targets
- `Snap With`, `Target Selection` and `Align Rotation to Target` are no longer hidden by varying the mode and options
- `Project Individual Elements` has been replaced with the `Face Project` option
- `Face Nearest` has been moved to stick together with the `Face Project` option

Co-authored-by: Germano Cavalcante <germano.costa@ig.com.br>
Pull Request: https://projects.blender.org/blender/blender/pulls/108555
2023-06-06 19:35:57 +02:00
Iliya Katueshenock
8dc70b9e2e Cleanup: Correcting default cases in node.cc
Add all other enum items to switch statements instead of using default.

Pull Request: https://projects.blender.org/blender/blender/pulls/107339
2023-06-06 19:19:53 +02:00
Almaz Shinbay
c5ddf63a4a Outliner: Port metaball elements to new tree-element code design
No user visible changes expected.

Part of #96713, continuation of work started in 249e4df110 and 2e221de4ce.
Refer to these for a motivation and design overview.

Adds a new tree-element class for metaball IDs.

Pull Request: https://projects.blender.org/blender/blender/pulls/108654
2023-06-06 19:01:11 +02:00
Clément Foucault
3ecb301a20 Metal: Remove empty lines in log messages
There produce unneeded empty lines in the
console. They are just relic from the time
these message were using printf.

Also remove some redundant informations in
the messages themselves.
2023-06-06 18:59:05 +02:00
Clément Foucault
79ec23b25f Metal: Use CLOG macros with working log level
This avoid flooding the console with infos that are
generally not important.
2023-06-06 18:45:53 +02:00
Hans Goudey
708dfbb91b Fix: Compile error in main after recent fmt usage
In the 3.6 branch we use `FMT_HEADER_ONLY`,
but that was changed in main by 0d38fa2422.
2023-06-06 12:43:38 -04:00
Hans Goudey
c7a804fe9e Merge branch 'blender-v3.6-release' 2023-06-06 12:27:46 -04:00
Hans Goudey
d9dfa782eb Fix: Remove non-threadsafe BMesh assertions in Mesh conversion
Currently this macro modifies faces. It needs to take a const pointer
to the element so it can be run on the same face from multiple threads.
2023-06-06 12:12:26 -04:00
Jason Fielder
3db231189d Metal: Remove command buffer error file
This file isn't useful anymore with all the other debug tools.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/108268
2023-06-06 18:08:27 +02:00
Jason Fielder
a29f6c854d GPU: Move texture attachment usage flag into Metal backend
This is a backend related workaround and doesn't belong to
the GPU layer.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/108151
2023-06-06 18:01:26 +02:00
Bastien Montagne
6c7354a69a Merge branch 'blender-v3.6-release' 2023-06-06 17:38:42 +02:00
Damien Picard
f07a4c1eed I18n: disambiguate "Fill"
The "Fill" message can be either a noun or a verb. This commit
disambiguates the verb usages for translation through various
translation contexts.

The more involved change is in the generation of keymaps from paint
modes. By default, the enums defining brush names are in the default
context, but this commit changes the ones including a "Fill" item to
"Brush". In order to get the same contexts in the keymap, we introduce
a specific function in `paint.cc` to return the appropriate context
depending on the tool.

Issue reported by Gabriel Gazzán (@GabrielGazzan) in #43295.

Pull Request: https://projects.blender.org/blender/blender/pulls/108561
2023-06-06 16:29:22 +02:00
Damien Picard
d95486af95 18n: Use fmt::format() to replace string concatenation in nodes
The UI code for nodes uses `stringstream`s a few times to format
strings. In some cases it is fine, but in others it makes localization
hard or impossible to do properly, as explained in #92758.

This commit replaces some `stringstreams` by `fmt::format()`, a
library that is already used in other parts of Blender and was
suggested by Hans Goudey (@hooglyboogly) in
[D15996](https://archive.blender.org/developer/differential/0015/0015996/#inline-138440).

Pull Request: https://projects.blender.org/blender/blender/pulls/107260
2023-06-06 16:27:49 +02:00
Brecht Van Lommel
a741749a5c Fix crash in some tests after bpy.context.property addition
This was masked by the cleanup commit that was done right after.

Ref #107280
2023-06-06 16:24:05 +02:00
Falk David
b29ba95cae GPv3: Add "(De)select All" operator and keymap
This adds the `GREASE_PENCIL_OT_select_all` operator as well as a new keymap for edit mode for the new grease pencil objects.

Pull Request: https://projects.blender.org/blender/blender/pulls/108628
2023-06-06 14:45:54 +02:00
Falk David
fa0fe6f55e Refactor: Pass deformed positions to curve selection
This refactor pulls the call to get the `deformation` data from inside the selection function to the outside.
Instead, the deformed positions are now passed directly to the selection functions.

This means that the selection functions become more independent of the object type, which was the original intent.
Otherwise, using these functions with e.g. Grease Pencil will crash.

Pull Request: https://projects.blender.org/blender/blender/pulls/108650
2023-06-06 14:28:03 +02:00
Philipp Oeser
693a921f02 Merge branch 'blender-v3.6-release' 2023-06-06 14:25:46 +02:00
Philipp Oeser
014825dd26 Fix: UI: cannot copy-paste many array buttons in nodes
This came up in #108096

Reason this fails is the `ui_but_has_array_value` check [which depends
on a property subtype that supports arrays]. The default `VectorBuilder`
has a `PropertySubType` of `PROP_NONE` though, so one possibility
would be to change this to `PROP_XYZ`.

However, RNA should know much better which RNA property buttons
have arrays than the UI code, so use RNA_property_array_check now
(instead of checking particular UI property subtypes).

Pull Request: https://projects.blender.org/blender/blender/pulls/108349
2023-06-06 14:24:45 +02:00
Jeroen Bakker
91f9615ed2 Cleanup: Make format 2023-06-06 14:22:29 +02:00
Philipp Oeser
cbefcacdf3 Merge branch 'blender-v3.6-release' 2023-06-06 13:51:49 +02:00
Philipp Oeser
32a349d3a3 Fix #108492 : Compo Track Position node wrong Y for Relative Start/Frame
This seems to be a simple copy/paste error from e0c5ff87b7

Thx @Chris-Thomas spotting this!

Pull Request: https://projects.blender.org/blender/blender/pulls/108504
2023-06-06 13:50:34 +02:00
himisa
f12e9f32b5 Fix #32022, #43188, #100373, Armature modifier - Preserve volume + Scale
Fixes armature deformation bug when Preserve Volume is enabled and deforming bones are both rotated and scaled.

The bug happens because Preserve Volume uses Quaternion to interpolate rotations.  A bone has 3 parts of data describing its deformation: Quaternion(w,x,y,z) rotation (`quat`), Translation(w,x,y,z) (`trans`), and Scaling(4x4 matrix) (`scale`). To calculate deformed position of a vertex `r`, it will be firstly scaled by `scale`, then rotated and translated by `quat & trans`.

The 4x4 scaling matrix `scale` has a 3x3 part `S33` about scaling and shearing along 3 axes, and a vector part `ST3` that further translate the scaled position. i.e. `scale@r = S33@r + ST3`. This enables scaling about an arbitrary "pivot" (a point `r0` satisfies `scale@r0 = r0`).

However, when blending influence of multiple bones, different bones have different scaling pivot (their head position). Since quaternion rotation and translation/scaling are not commutative operations, this is what I believe causing this bug.

How this is fixed:

Note that the translational part `ST3` of the scaling matrix is redundant in functionality with Translational part `trans` in deformation data. There exists an equivalence transformation that simultaneously change `trans` and `ST3`, while keeping the deformation unchanged.

I applied this equivalence transformation to move the pivot to the vertex that the bones are deforming, before blending multiple bone transformations. Note that now the vertex is the pivot, so scaling transformations will not change its position. Further blending/applying of scaling matrices can be avoided.

Pull Request: https://projects.blender.org/blender/blender/pulls/108134
2023-06-06 12:31:52 +02:00
Brecht Van Lommel
bca3839749 Revert "Cleanup: consistently use rnaindex -1 to mean the no or entire array"
This reverts commit 8ed65fe6de.

Fix #108553: Alt + value change doesn't work for various inputs
Fix #108621: Driven values are no longer marked in purple
2023-06-06 11:34:22 +02:00
Nathan Vegdahl
b664de2c8e Merge branch 'blender-v3.6-release' 2023-06-06 11:14:50 +02:00
Nathan Vegdahl
997ad50b49 Fix #106801: loading file with overriden NLA in tweak mode loses action
The root issue was that the `tmpact` field of an object's animation
data wasn't exposed to RNA, and thus wasn't getting overridden.

Pull Request: https://projects.blender.org/blender/blender/pulls/108548
2023-06-06 11:10:58 +02:00
YimingWu
8a0a9ec0c3 Fix #108591: Handle null material adding paint slot
When adding a texture paint slot to an object, the object could have no
material, this patch handles that by checking the material first in
`default_paint_slot_color_get`, if material is null, then it will return a
fallback default color so the operator can proceed normally.

Pull Request: https://projects.blender.org/blender/blender/pulls/108592
2023-06-06 04:13:01 +02:00
Campbell Barton
05b8242e45 Cleanup: use \n for line endings (run dos2unix) 2023-06-06 11:52:25 +10:00
Campbell Barton
0824ef7e91 Cleanup: remove TODO's from console_ops.c
As some of these require discussion (addition of undo/redo for e.g.),
this is better suited to a task #108641.
2023-06-06 10:40:42 +10:00
Campbell Barton
bdd189f593 Cleanup: replace BLI_strncpy with memcpy
Prefer memcpy when exact sizes have been calculated as this removes the
implication that the string might be smaller than the length argument.

Further, passing in `len + 1` to BLI_strncpy without clamping by the
destination buffer size is reads like a common mistake,
where the length of the source may exceed the destination buffer size.

While using `std::min(sizeof(dst), len + 1)` would avoid the confusion
it's complicating a statement which can use memcpy instead.
2023-06-06 10:30:26 +10:00
Campbell Barton
db03beea24 Cleanup: early return, reduce right-shift 2023-06-06 10:30:26 +10:00
Hans Goudey
81da428cec Merge branch 'blender-v3.6-release' 2023-06-05 20:20:26 -04:00
Hans Goudey
41d994c9ac Fix #108571: OBJ vertex group import crash
`tot_loop_idx` was increased before it was used to set the set
the vertex group value of the current face corner's vertex.
2023-06-05 20:20:03 -04:00
Campbell Barton
f31dfa9b74 Merge branch 'blender-v3.6-release' 2023-06-06 09:49:06 +10:00
Campbell Barton
8e871971b4 Cleanup: quiet compiler warning (missing-declarations) 2023-06-06 09:42:09 +10:00
Campbell Barton
7e7c14ad4c Fix paste flipped creating invalid RNA data paths
- Paste flipped created invalid paths when the size of the name changed
  left -> right: lost the 't' in right.
  right -> left: lost the entire end of the RNA path.

- Correct the fixed buffer size as it may include escaped characters.
2023-06-06 09:35:21 +10:00
Campbell Barton
dd1fe31a74 Cleanup: quiet compiler warnings 2023-06-06 09:34:50 +10:00
Hans Goudey
5ee22dd490 Cleanup: Use const for modifier utility function 2023-06-05 16:50:26 -04:00
Hans Goudey
c2430e55c8 Cleanup: Remove disabled code from particle system modifier
This comment referenced a special case for modifier evaluation in edit
mode. With replacements on the horizon, this won't be added anymore.
2023-06-05 16:50:26 -04:00
Hans Goudey
102c015306 Cleanup: Remove argument from deform modifier utility function
This was only used in the particle system modifier.
2023-06-05 16:50:26 -04:00
Hans Goudey
73d921a0c6 Cleanup: Avoid curve to mesh conversion in some deform modifiers
Some modifiers used `MOD_deform_mesh_eval_get` to make sure they had
a mesh to retrieve vertex groups from. But since curves don't support
vertex groups anyway, and since the curve to mesh conversion is handled
by the (legacy) curve object modifier stack anyway, this is confusing
and unnecessary. This shouldn't give any behavior changes, but some
deform modifiers on legacy curve objects might be faster if they used
to do the conversion.
2023-06-05 16:50:26 -04:00
Germano Cavalcante
05b8cfec5e Transform: Allow navigation with "release_confirm"
This limitation was added to avoid conflicts with tools.

But since we now have the "allow_navigation" option on transform
operators, there is no real benefit to having this limitation.
2023-06-05 16:49:44 -03:00
Germano Cavalcante
251614c39c Transform: Include "allow_navigation" option in "Shrink/Fatten"
No functional changes from user's point of view.

"Shrink/Fatten" is used in macros for some extrude operations.

These operations may rely on the type of mesh selection.

While some of these operations are combined with the "Move" function,
which already permits navigation, others are combined with
"Shrink/Fatten", which currently lacks navigation capabilities.

To ensure consistency and enable navigation in all extrude operations,
this commit introduces the option to enable navigation for the
"Shrink/Fatten" operator.
2023-06-05 16:49:44 -03:00
Leon Schittek
27184c4643 Merge branch 'blender-v3.6-release' 2023-06-05 20:23:45 +02:00
Leon Schittek
e6a8c45fd9 Fix #108578: Crash when unlinking input sockets
Fix a mistake in commit 2ce5fc4a3e that caused a crash when detaching
node links from input sockets.

When a link is detached from an input socket, `nodeRemLink` nulls the
`link` pointer of the socket.
So before the next update inputs are linked but don't have a valid `link`
pointer causing the crash, when trying to access the link in
`std_node_socket_draw`.

The introduced check avoids the crash and is more correct since it
doesn't just check one link for multi-input sockets.

Pull Request: https://projects.blender.org/blender/blender/pulls/108623
2023-06-05 20:21:07 +02:00
Bastien Montagne
90a0f39c02 Merge branch 'blender-v3.6-release' 2023-06-05 18:12:35 +02:00
Damien Picard
745baa788d I18n: extract a few messages
- "Invalid" in transformation messages.
- For three messages, translation occured after a string
- concatenation, so the full message was not found.
  Instead, translate a format pattern and format it afterwards.
- Alembic errors when there is an import type mismatch.

Pull Request: https://projects.blender.org/blender/blender/pulls/108212
2023-06-05 18:10:11 +02:00
Falk David
8d0b10bbc7 Fix: GP brush stroke operator name and description
These were still the ones copied from the curves operator.
2023-06-05 18:06:00 +02:00