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.
`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
This happened, because `SEQ_retiming_find_segment_start_handle()` does
not consider last handle as valid return value, so it was never checked
against.
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
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.
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
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
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).
When the profile is a single point, and all the curves are poly curves,
the mesh has the same number of points as the curves, and attributes
can be shared, reducing memory usage and time spend copying. This
doesn't apply to positions yet though. With 8 attributes, the
time for the conversion in a test went from 55 to 14 ms.
When profile is a single point but the curves aren't poly curves,
we can evaluate main point attributes directly into the mesh attribute
arrays rather than using a temporary buffer. In a test with 8
attributes, the time went from 3.7 to 1.6 ms.
When the profile is the default (or manually set to a single point at
the origin), avoid computing tangents and normals, and avoid evaluating
the radius attribute. That data is only used to build the transforms of
the new points. In a simple test case, this changed the total time from
34.4 to 14.7 ms (removing the cost 4.7, 8.4, and 2.1 ms) cost of
calculating tangents, normals, and radii.
A GPU_finish for each EEVEE_render_draw was initially added by
3f0873fa1e but it introduces
important GPU execution gaps during rendering.
Removing it gives a ~10% improvement on Intel Arc / Windows from
our testing with Red Autumn Forest scene.
Pull Request: https://projects.blender.org/blender/blender/pulls/109382
Since snapping to endpoints is already done when you snap to edges
together, there is no need to create a bvhtree with all the vertices.
Also use the appropriate endpoint definition for snap to armatures.
This is part of what was implemented in #109062
When adding multiple snap points (`A` key), the 'Snap Base' location no longer corresponds to the snap target point, so it becomes invisible.
Therefore, show the resulting `Snap Base` during this operation.
Pull Request: https://projects.blender.org/blender/blender/pulls/109379
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.
Removes `isExpandValid()` from `AbstractTreeElement` and its sub-classes as all ID elements are ported to new tree-element code design. It was meant to be temporary for this transition phase.
Pull Request: https://projects.blender.org/blender/blender/pulls/109380
No user visible changes expected.
This function was added in 86b2cf4574 as a more type safe and more
convenient way of setting button callbacks. So use it for simple cases.
No user visible changes expected.
Rather than relying on a C-style function pointer with void pointer
arguments, allow storing a `std::function` object, which can hold
arbitrary data in a type safe way. This can be conveniently used with
lambdas for example.
This is not used yet, but will be with #104831 merged. Replacing the
existing C-style callback uses with this can be done separately.
Pull Request: https://projects.blender.org/blender/blender/pulls/109016
The problem was caused because the `Nearest2dUserData::obmat_` member
was deallocated in derived classes even before the main class
destructor was called.
This is strange behavior and only seen in Mac or Linux Release builds.
The solution is to not rely on the destructor to register snap values.
So create a separate function.
This moves the `stroke_cache` that was previously stored on every
drawing to the `GreasePencilRuntime` struct.
Since this cache is only used for when a user is drawing a stroke, there
can only ever be one. It makes more sense to have this cache on the
data-block runtime data, rather than every drawings runtime data.
- "Front"/"Back": 'put something at the front/back' or 'the front/back
face of something'. (e. g. the Empty Image options, Depth and Side
option, both use the same strings as enum, which should be avoided
in some languages).
- "Flip": invert, as in normals, or mirror, as in an image.
- "Path": a path to a resource, in general a file but sometimes a
datablock, as opposed to a trajectory in space.
- "Join": disambiguate for the Grease Pencil operator, which may use a
different word as that for meshes.
- "Wave": an ondulating motion, as opposed to a fluid dynamics motion.
- "Step": can mean the distance between two things, or a number of
times to do something. In this case it is better to use the plural.
- "Edge": generally the edges of a mesh, but can also mean edge
detection. Additionally, it was used for the option to enable
Freestyle. This was changed to "Use Freestyle".
- "Boundary": the limit of a grease pencil drawing for filling
purposes, as opposed to the external limit of a (non-manifold) mesh.
- "Rotations": can be translated to something like "Turns", in the
context of a spiral.
Pull Request: https://projects.blender.org/blender/blender/pulls/108213