`makesrna` was somewhat wasteful in causing rebuilds on MSBUILD for
files that have not changed.
This makes 2 changes to `makesrna.cc`
- the code in place to keep "make" out of trouble and regenerate
files regardless if they have changed or not has been disabled for non
"Unix Makefile" generators, as they do not appear to be needing this.
This brings the number of actions ninja takes down after a white-space
change in `rna_wm.cc` from 423 down to 107.
- `rna_prototypes_gen.h` was always written, this is somewhat wasteful
and has been changed to be only written when changed.
This brings the number of actions ninja takes down after a white-space
change in `rna_wm.cc` from 107 down to 11.
in total, this saves several minutes of build time for simple changes
to rna source files.
Ref !110664.
Use PyC_ParseUnicodeAsBytesAndSize parser instead of "s" / "z" type
specifier. This relates to #111033, resolving Python exceptions which
causes icons not to load (for e.g.).
Now bytes are also supported as path arguments.
Expose PyC_UnicodeAsBytesAndSize using a parser which PyArg_ParseTuple
can use. This should be used with PyArg_ParseTuple instead of "s" type
specifier when passing in file-system path arguments.
PyC_ParseUnicodeAsBytesAndSize_OrNone has been included to match "z".
This is not used in the UI except for the tooltip.
UI elements should be given full names rather than relying on symbols.
This improves the API docs as well as makes it a more understandable tooltip message.
Pull Request: https://projects.blender.org/blender/blender/pulls/110865
This PR enabled the draw manager test cases when compiling with
`WITH_VULKAN_BACKEND=On`. Currently they should pass all the tests
in draw_pass_test.cc that also pass for OpenGL. The draw_visibility
test seems to be faulty (also for OpenGL).
The vulkan backend doesn't have all the features implemented to
pass the Eevee testcases and are expected to fail.
Pull Request: https://projects.blender.org/blender/blender/pulls/110994
This is one of the many ID elements that should be ignored from further
processing in this if-else block. It would only set the
`TreeElement.idcode` (and call an assert) for this, which wasn't used
elsewhere. We're trying to untangle the code step by step and make it
more clear & explicit which data is set where, changes like this help.
This PR blends the selected keyframes to an ease-in or ease-out curve.
The difference to the existing ease slider is that this one blends,
while the other snaps to the ease curve
Co-authored-by: Ares Deveaux <aresdevo@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/110566
This makes it so that in the layer tree UI layers that have an
invisible parent will render their visibility icon as inactive (faded).
Same for the locked icon.
This caused confusion when Bastien passed an empty string to the ID
template, expecting that it would ensure no default label is placed, but
it caused the layout to be split. This is because we'd still add an
empty label in this case.
Relying on the `TreeStoreElem.id` void pointer makes assumptions about
what code elsewhere sets to it (it's also misleading since it's actually
not an ID pointer), in this case we can easily avoid that.
`TreeElement.idcode` would be reused to store the sequence type. This is
risky if the field is assumed to actually contain a valid ID-code,
without further checks.
This was only accessed in one place, which I've refactored to a clean,
type-safe solution now.
For the root group, the parent is `nullptr` so calling `parent_group()`
would fail. This fixes the issue by adding a null check and returning
`nullptr` otherwise.
The view layer "base" element (the parent that the individual layers are
nested in) does not point to any data in its `directdata`, definitely
not to a view layer. Don't cast it to one, this can cause undefined
behavior when the pointer is not null.
Before this patch, the drawing code iterated the FCurve to see if there are any
curve interpolation types that can't easily be drawn. (Sinusoidal, Bounce, etc)
If it found one, it would fall back to evaluating the FCurve.
That meant in the worst case scenario it would iterate the whole FCurve
before even starting to draw.
This PR unifies the drawing logic for FCurves no matter their interpolation type.
If it encounters a key type that it can't draw, it falls back to samples, but only
for the current key.
To clarify that it renames `draw_fcurve_curve_bezts` to `draw_fcurve_curve_keys`
Curves with modifiers are still drawn with samples.
## Performance
Test setup: 6000f of dense data on 62 bones.
Only measuring the average draw time **per curve**.
All measurements were done at the same zoom level.
| - | before | after |
| - | - | - |
| only beziers | 28μs | 13μs |
| only elastic | 90μs | 60μs |
| mix (~1/2 of the view with elastic) | 110μs | 24μs |
The performance boost with "only elastic" can be explained by the fact that per key I can skip 1 call to `evaluate_fcurve`. That is because I always start at an existing keyframe so I can use its position.
Pull Request: https://projects.blender.org/blender/blender/pulls/110764
The `OBJECT_OT_simulation_nodes_cache_delete` operator
would delete the parent bake directory. This could lead to catastrophic
loss of data if the user set their bake directory to a folder that
contains other files or folders.
This commit makes sure that only the "meta" and "bdata" folders get
deleted in the parent directory.
Pull Request: https://projects.blender.org/blender/blender/pulls/110999
This patch adds layer widgets in the grease pencil layer channels of the grease pencil dopesheet.
It adds RNA + getter function for the `use_onion_skinning` at layer level.
It also sets the offset of the channel, and the color of grease pencil data-block channels.
Pull Request: https://projects.blender.org/blender/blender/pulls/110991
Using ClangBuildAnalyzer on the whole Blender build, it was pointing
out that BLI_math.h is the heaviest "header hub" (i.e. non tiny file
that is included a lot).
However, there's very little (actually zero) source files in Blender
that need "all the math" (base, colors, vectors, matrices,
quaternions, intersection, interpolation, statistics, solvers and
time). A common use case is source files needing just vectors, or
just vectors & matrices, or just colors etc. Actually, 181 files
were including the whole math thing without needing it at all.
This change removes BLI_math.h completely, and instead in all the
places that need it, includes BLI_math_vector.h or BLI_math_color.h
and so on.
Change from that:
- BLI_math_color.h was included 1399 times -> now 408 (took 114.0sec
to parse -> now 36.3sec)
- BLI_simd.h 1403 -> 418 (109.7sec -> 34.9sec).
Full rebuild of Blender (Apple M1, Xcode, RelWithDebInfo) is not
affected much (342sec -> 334sec). Most of benefit would be when
someone's changing BLI_simd.h or BLI_math_color.h or similar files,
that now there's 3x fewer files result in a recompile.
Pull Request #110944
Implementation of the transform action for grease pencil frames, which enables translating and scaling grease pencil frames in the dopesheet.
This patch adds the following in the grease pencil API :
- `move_frames` to move a set of frames given a map of key transformations (with overwrite), and
- the structure `LayerTransformData` that stores in the layer runtime some useful data for the frames transformation.
Co-authored-by: Falk David <falk@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/110743
In RNA collections storing ID references, the name of the collection
item may not always be unique, when several IDs from different libraries
are present.
While rare, this situation can become deadly to liboverride, by causing
random but exponential liboverride hierarchies corruptions.
This has already been alleviated by using preferably both name and index
in items lookup (a05419f18b) and by reducing the risk of name collision
in general between liboverrides and their linked reference (b9becc47de).
This commit goes further, by ensuring that references to items of RNA
collections of IDs stored in liboverride operations become completely
unambiguous. This is achieved by storing an extra pointer to the item's
ID itself, when relevant.
Lookup then requires a complete match `name + ID` to be successful,
which is guaranteed to match at most a single item in the whole RNA
collection (since RNA collection of IDs do not allow duplicates, and
the ID pointer is always unique).
Note that this ID pointer is implemented as an `std::optional` one
(either directly in C++ code, or using an new liboverride operation `flag`
in DNA). This allows to smoothly transition from existing data to the
added ID pointer info (when needed), without needing any dedicated
versioning. This solution also preserves forward compatibility as much
as possible.
It may also provide marginal performances improvements in some cases, as
looking up for ID items in RNA collections will first check for the
ID pointer, which should be faster than a string comparision.
Implements #110421.
Pull Request: https://projects.blender.org/blender/blender/pulls/110773
The text used to be centered around a point left of the slider line
with the assumption that it displays a number from 0-1 and "%"
With the ability to set the unit name, this assumption is no longer true,
and if setting a long name (like "Frames" in #110540) the text overlaps the slider line
By right aligning the text on the left side of the slider, this overlap cannot happen anymore.
| Before | After |
| - | - |
|  |  |
|  |  |
|  |  |
Pull Request: https://projects.blender.org/blender/blender/pulls/110586
The new keyframe jumping code for the graph editor did not respect the NLA strip offset.
This patch fixes that by applying `ANIM_nla_mapping_apply_fcurve`
Technical side note: `FCurve *` lost its constness due to that
Pull Request: https://projects.blender.org/blender/blender/pulls/110790