Commit Graph

100817 Commits

Author SHA1 Message Date
Falk David
6bec3bca09 GPv3: Remove dead code in drawing operator
These lines were not used and caused compiler warnings.
They can be safely removed.
2023-06-28 11:40:12 +02:00
Falk David
fdfc09502a GPv3: Improve redrawing for drawing operator
The new drawing operator uses the `paint_stroke` API which didn't
know about grease pencil yet. This simple change causes the redraw
to happen on every(?) event, which did not happen before.
2023-06-28 11:40:12 +02:00
Iliya Katueshenock
4060ba4024 Cleanup: reserve vector before an append loop
Pull Request: https://projects.blender.org/blender/blender/pulls/109416
2023-06-28 08:48:00 +02:00
Campbell Barton
d886fc0238 Fix assert on startup with empty script directories 2023-06-28 15:46:04 +10:00
Campbell Barton
3ab8e9b144 PlayAnim: only load the built-in mono-space font
There is no need to load all fonts on startup when only the mono-spaced
font is used.
2023-06-28 13:46:26 +10:00
Campbell Barton
d1e6c8f5a6 Cleanup: spelling in comments 2023-06-28 12:27:48 +10:00
Campbell Barton
275ac77f16 Cleanup: quiet clang warnings from using u8 defines 2023-06-28 12:19:51 +10:00
Campbell Barton
2332b981a5 Cleanup: quiet missing variable declaration warning 2023-06-28 12:17:06 +10:00
Campbell Barton
2f1230593c Cleanup: use nullptr, function style casts, use ELEM macro 2023-06-28 12:17:06 +10:00
Campbell Barton
93b0be468f Cleanup: use r_ prefix for return arguments in ED_anim_api callbacks 2023-06-28 12:17:06 +10:00
Campbell Barton
0fdc84fcdd Cleanup: remove incorrect/unhelpful comments 2023-06-28 12:17:06 +10:00
Harley Acheson
37eabb171a Cleanup: Make format
Format changes only
2023-06-27 12:10:07 -07:00
Damien Picard
9b4749e7c7 UI: replace "x" with multiplication sign when displaying calculations
The multiplication sign looks like an "x" but should be used in its
stead to display calculations and dimensions such as "1920x1080". It
is supported in many fonts including DejaVu Sans, the font currently
used for the UI.

Pull Request: https://projects.blender.org/blender/blender/pulls/106388
2023-06-27 21:03:05 +02:00
Ray molenkamp
eff9e2f4ce CMake: plumbing for modern CMake usage
This is the minimal change required to start using modern CMake in the
blender build system. This change is designed to allow small
incremental changes to the build system rather than doing it in one
big bang which would be unmaintainable (for me)

The biggest functional change is, previously all libraries in the
`LIB` section of a `blender_add_lib` call had the `INTERFACE` scope,
which is rarely, if ever the correct scope. This diff changes this to
`PRIVATE`

Concrete implications of this diff :

The `LIB`, `INC` and `INC_SYS` sections of an `blender_add_lib` call
now allow scoping keywords (`PUBLIC`, `PRIVATE,` `INTERFACE`) to
declare the scope of the dependency.

Right now the only library using any modern cmake is
`bf_intern_atomic` which is an header only interface library that will
just advertise its include directories.

This allows us to clean up any `CMakeLists.txt` that adds
`../../../intern/atomic` to its `INC` section to remove it in `INC` by
adding a `PRIVATE bf_intern_atomic` to the `LIB` section.

Pull Request: https://projects.blender.org/blender/blender/pulls/107858
2023-06-27 20:57:50 +02:00
Germano Cavalcante
d53862351d Transform: Allow navigation by default
As suggested in #108669, the "Navigate during Transform" option has
been removed and this feature works by default.

Now if you press `G`, `R` or `S` to move, rotate or scale an object you
can also navigate in the viewport.

Note that this update modifies the default keymap.
Now pressing `Alt` is required for the following modals:
- `PROPORTIONAL_SIZE_UP`,
- `PROPORTIONAL_SIZE_DOWN`,
- `PROPORTIONAL_SIZE`,
- `AUTOIK_CHAIN_LEN_UP`,
- `AUTOIK_CHAIN_LEN_DOWN`,
- `AUTOCONSTRAIN`,
- `AUTOCONSTRAINPLANE`.

Pull Request: https://projects.blender.org/blender/blender/pulls/109388
2023-06-27 20:29:05 +02:00
Bastien Montagne
6221410409 Fix #109004: Append: in Localize All case, LibOverrides does not behave properly.
The root of the issue was that when localizing all linked data, it makes
no sense (and there is no way) to keep liboverrides, since some linked
data would then remain linked.

The solution is then to clear any override data from localized IDs.
While simple in theory, this adds a noticeable amount of complexity to
the 'append' process, as now some IDs should remain linked, and some
should be forcefull copied (instead of directly made local), such that
the liboverride reference data remains valid.

NOTE: Appending without `Localize All` remains unchanged here, and will
keep the liboverrides untouched, since in that case having some linked
data as result of the append operation is expected.

This fix should be backported to the 3.6 LTS.
2023-06-27 18:31:45 +02:00
Bastien Montagne
daf414b48e IDManagement: Add option to 'make local' code to clear liboverride data.
In some cases, when making a linked liboverride data local, the
liboverride data should be preserved (and therefore produce a local
liboverride data).

However, it implies that the data is not really, fully made local, since
it has (critical) dependencies to linked data.

This new option allows 'make local' code to also clear any liboverride
data in the processed ID, making it effectively fully local.

Preliminary step to solve #109004.
2023-06-27 18:31:45 +02:00
Germano Cavalcante
597f9abcfa Snap: Refactor Face Nearest approach
- Use C++ types for matrices and vectors;
- Deduplicate code with `SnapData::register_result`;

This commit also improves the way of detecting supported snap types.
2023-06-27 12:49:55 -03:00
Germano Cavalcante
229ae63c6e Cleanup: Silence warning
```
warning: "DEBUG" is not defined
```
2023-06-27 12:49:41 -03:00
Iliya Katueshenock
fde8e6ce65 Fix #109406: Ignore unsupported socket in shader
In 3957a1ad03 was
added the new Rotation socket to a Mix node.
Mix node can be used in shaders node tree. This cause problem,
rotation socket is not supported in shader currently. This fix
just add check to ignore any unsupported sockets in shader and
to fix any related problem.

Pull Request: https://projects.blender.org/blender/blender/pulls/109410
2023-06-27 16:46:18 +02:00
Falk David
eb856f6fbb GPv3: Build group hierarchy for layer tree UI
This commit implements building of the layer tree hierarchy in the
layer tree UI.
Layer Groups that contain layers are now collapsible and visibility as well
as locking can be toggled.
2023-06-27 15:48:07 +02:00
Falk David
2f6d6d84d6 Fix: GPv3: Memory leak in reorder layer operator
In case the target layer was not found, the execute function of the
operator would leak the memory of the string.
2023-06-27 15:48:07 +02:00
Falk David
4bb600ef95 GPv3: Add functions to find layer groups by name
This commit adds `find_group_by_name` functions to the grease pencil
data. This is similar to the `find_layer_by_name` functions.
2023-06-27 15:48:07 +02:00
Falk David
5a9db0dd4c GPv3: Add initial layer group python API access
This adds a `groups` collection property to the grease pencil data
to access group information.
For now groups have a `name`, `hide`, and `lock` property.
2023-06-27 15:48:07 +02:00
Falk David
bf4e9ffbd9 GPv3: Add rename function for layer groups
This adds core functions to rename layer groups while preserving
name uniqueness.
2023-06-27 15:48:07 +02:00
Falk David
fee9801955 GPv3: Add caching of layer groups
Similar how nodes and layers are cached in a flat vector, this commit
adds caching of layer groups. This will be used e.g. by the python API
to access all the groups as a collection property.
2023-06-27 15:48:07 +02:00
Falk David
5967cb53e9 GPv3: Make visibility and lock state inheritable
This adds functions to check if a `LayerGroup` is visible or locked.
Additionally, visibility and the lock state is now inherited.
E.g. `Layer`s that are the children of a hidden `LayerGroup` will also
be hidden. This does not change their stored visibility. It just means
that the function `is_visible()` on the layers will return `false`.
The same applies for locking.
2023-06-27 15:48:07 +02:00
Philipp Oeser
258ba398ed Fix #109198: Enum properties don't display text in Dope Sheet sliders
`uiDefAutoButR` (or actually `uiDefButR_prop` > `ui_def_but_rna` later
down the line) has this behavior when "" string is passed in, it will
not display text on or next to the button.
This is of course desired in most scenarios -- it might even be desired
for non-icon enums in certain cases (though this is already a bit harder
to find cases for), so changing behavior in said functions is probably
not what we want.

The behavior - from the dopsheet sliders - would seem like a bug though.

Passing NULL (instead of "") to `uiDefAutoButR` results in properly
displaying the chosen item on the dropdown for enums, but for other
property types it would then show the property ui name alongside the
button (which is not what we want in the dopsheet, UI names are already
drawn there separately).

So now, pass "" or NULL conditionally (depending on property type
`PROP_ENUM`).

Pull Request: https://projects.blender.org/blender/blender/pulls/109205
2023-06-27 15:32:53 +02:00
Richard Antalik
91ff6457be Fix VSE ensuring handle adds duplicate handle.
This happened, because `SEQ_retiming_find_segment_start_handle()` does
not consider last handle as valid return value, so it was never checked
against.
2023-06-27 12:52:27 +02:00
Xavier Hallade
1d847b2ee3 EEVEE: Restrict GPU_finish workaround to Nvidia OpenGL backend
GPU_finish was initially added by
3f0873fa1e to work-around a Nvidia driver
issue but it introduces important GPU execution gaps during rendering on
other GPUs.

Pull Request: https://projects.blender.org/blender/blender/pulls/109382
2023-06-27 12:47:17 +02:00
Hans Goudey
47a52bd286 Fix: Crash in 3.6 when loading mesh edge crease from 4.0
In 3.6, the legacy to current mesh format conversion of edge creases
would crash when loading a file from 4.0, because it expected there to
be an `MEdge` array, which doesn't exist in 4.0. This didn't happen
previously because edge creases were stored in the same format for 4.0.
Other "legacy to current" format conversions have similar null checks,
it was just missing here.

Pull Request: https://projects.blender.org/blender/blender/pulls/109386
2023-06-27 10:14:23 +02:00
Jacques Lucke
bf9687f9bb Fix: handle invalid node trees more gracefully 2023-06-27 10:09:56 +02:00
Xavier Hallade
1be64e532d Revert "EEVEE: Remove unneeded GPU_finish"
This reverts commit 4038cabc6d.
Rendering red_autumn_forest.blend from cmd line was leading to a crash
in ntreeExecGPUNodes.
2023-06-27 09:39:27 +02:00
Philipp Oeser
c47074f3bb Fix #108171: bpy.ops.uv.pack_islands crash
Originally caused by edc12436c6, the fix c4f39eab88 also had a mistake
unfortunately (double free of `UVPackIslandsData` since it already
called `pack_islands_freejob`).

Pull Request: https://projects.blender.org/blender/blender/pulls/109377
2023-06-27 08:55:01 +02:00
Campbell Barton
8ff65fe63f Fix region snap-size threshold check
Checking to snap the region within a threshold didn't use the absolute
delta before comparison, making a larger snap size always pass
the threshold check.

Also assign variables for clarity.
2023-06-27 16:23:27 +10:00
Campbell Barton
64bfbddf35 Cleanup: quiet narrowing warning 2023-06-27 16:23:21 +10:00
Pratik Borhade
d66e12104b GPv3: Crash when drawing on new layers
Crash occurs during drawing on fresh added layer due to missing keyframe
on it. Use `insert_frame` to add frame on new layer.

This is similar to GPv2 (`BKE_gpencil_layer_frame_get` is used there to
add default keyframe on new layer)

Pull Request: https://projects.blender.org/blender/blender/pulls/109321
2023-06-27 08:19:37 +02:00
Campbell Barton
1a0be7be9d Cleanup: replace magic numbers with defines 2023-06-27 15:38:28 +10:00
Campbell Barton
d27be2b95d Cleanup: remove sprintf use in guarded allocator
Also remove vsprintf in exr_printf (commented out).
2023-06-27 15:31:21 +10:00
Campbell Barton
3c6239969e Cleanup: add size suffix to IMA_MAX_RENDER_TEXT
This read like a flag, when it's a string buffer size.
2023-06-27 14:51:03 +10:00
Campbell Barton
9c105065ee Cleanup: remove unused flags 2023-06-27 14:48:46 +10:00
Campbell Barton
0222876a34 Cleanup: replace defines with enum in DNA
- Group ambiguous flags Object::flag & Base::legacy_flag.
- Replace ambiguous hints (e.g. `paf->flag` with doxygen types).
- Remove unused flag PAF_MAXMULT.
2023-06-27 14:45:00 +10:00
Campbell Barton
863d93fe46 License headers: add SPDX-FileCopyrightText 2023-06-27 13:00:06 +10:00
Campbell Barton
562aca75d3 Cleanup: split anim/sequence loading into two functions
Also simplify image sequence reading loop.
2023-06-27 10:42:18 +10:00
Campbell Barton
c761f5b6fb PlayAnim: scale the font by the window DPI 2023-06-27 10:08:17 +10:00
Campbell Barton
4bbbf9007b Refactor: split out buffer loading for the animation player
- Simplify freeing resources on error.
- Correct check for failure to access the file size.
- Print the `errno` on failure.
- Use logging.
2023-06-27 10:06:34 +10:00
Iliya Katueshenock
3957a1ad03 Geometry Nodes: Mix Rotations
Add support a new Rotation socket/data type to a Mix node.

Rotation socket avala ible only in Geometry Nodes right now,
list of supported types for node depend on own node tree type.

Mixing kind is slerp (interpolation) of a quaternion. As initial
phase this is enough. In a future, other modes of interpolation
can be added (Euler for XY+Z, YZ+X, ZX+Y, ...). Clamping for
factor work the same as for all other data types.

Drag and drop should take care avoiding create links between
Rotation sockets and all other socket types, this requires chages
is mix node callback for drag & drop system.

See: https://projects.blender.org/blender/blender/issues/92967

Pull Request: https://projects.blender.org/blender/blender/pulls/109084
2023-06-27 00:50:53 +02:00
Hans Goudey
bef20cd3f1 Curves: Share positions array for single point profile at origin
This is the same as 48fad9cd0c but applied to the positions
array instead of other generic attributes. For test case with 90k poly
curves, this reduced the conversion time from 1.7 to 1.3 ms, and reduced
memory usage from 67 to 59 MiB (as reported by Blender).
2023-06-26 15:45:41 -04:00
Iliya Katueshenock
6bccea2ceb Cleanup: Remove unused variable in a add node search function
Pull Request: https://projects.blender.org/blender/blender/pulls/109385
2023-06-26 19:59:42 +02:00
Hans Goudey
49977c3aee Cleanup: Remove unused variable in curve to mesh conversion 2023-06-26 13:56:26 -04:00