Our text wrapping code is written in a way that requires the Line Feed
character to be in our glyph cache. This is problematic as none of the
control characters will ever be there if not using fallback. With
fallback these glyphs could be a zero-width character from a symbol
font, or something with width if using a last resort font. So we'd have
to ignore the advance in the latter case. This came to a head recently
because we are turning off fallback in some circumstances. 12b1f8bd7a
removed the rendering of control characters so they are never in the
cache. That change requires this one, which does wrapping based on the
string's codepoint, not that of its glyph.
Pull Request: https://projects.blender.org/blender/blender/pulls/135196
Avoid non valid glTF file by avoiding exporting multiple slots with same target_id_type in the same animation for a single object:
- Make sure to create multiple animation when needed
- Use action.name for active slots (can have multiple slots when different target_id_type)
- Use action.name - slot.name_display for additional animations
Same was true for SimpleDeform.
Invert vertex group influence should only have an effect if there is a
group specified.
Shrinkwrap always uses a weight (gets weights via
`BKE_defvert_array_find_weight_safe` -- which gets full weight for no
group specified, rightfully so), if this gets inverted, we get no
influence at all.
Now move the inverting of the weights to `BKE_defvert_array_find_weight_safe`,
adjust the other callers accordingly (Bevel also does not need to check for a valid
vertexgroup beforehand).
Pull Request: https://projects.blender.org/blender/blender/pulls/121625
Since the transform system uses previous positions to update to
"original" positions upon cancel, the elastic transforms are not working
well with this (due to their `TransformDisplacementMode::Incremental`
nature).
To resolve, rely on restoring positions from undo (as done elsewhere in
sculpt).
Pull Request: https://projects.blender.org/blender/blender/pulls/134919
`BKE_modifier_copy_ex` did it (which is called e.g. when copying the
whole stack from one object to another), but when simply duplicating a
modifier (`modifier_copy`), it was just ensuring a unique name (based on
the default name) without copyig the existing name prior.
Pull Request: https://projects.blender.org/blender/blender/pulls/135172
When called on an object that you cannot get a mesh from (e.g. Empties),
you would run into an unhelpful "SystemError: <built-in method
FromObject of type object at ...> returned NULL without setting an
exception"
Now be more specific in the error message.
Pull Request: https://projects.blender.org/blender/blender/pulls/135162
Only a single `select` prop was exposed, and this was set to "bezt.f1"
(so it affected the left handle only).
Now we add properties for `left`, `right` and the `single` handle, the
selection prop for the control point is renamed to
`select_control_point` [which is now in line with the API for a bezier
curve].
NOTE: setting/getting a `single` handle uses the existing functions for
this -- handle is selected if any of the right/left handle is selected,
setting the handle results in both handles getting selected.
Pull Request: https://projects.blender.org/blender/blender/pulls/135114
This happened for context attributes if already "complete" attributes
were typed/pasted in.
Reason is that this copies functionality from our intellisense
codecompletion where this is expected behavior, for context attributes
we cannot really use "tab" to expand, so it is less useful here.
When confirming (with the additional "."), the keymap entry would be
broken, so better solve in a way that we dont end up with those "." by
removing it.
NOTE: there might be ways to enhance the string-search behavior here (by
properly supporting "tab-expanding"), but this is a bit out-of-scope for
this bugfix.
Pull Request: https://projects.blender.org/blender/blender/pulls/135098
Previously Grease Pencil simplify operator didn't take stroke selection
into account when it's running in Adaptive or Merge modes. Now filters
points with selected stroke to make all modes have consistent behaviour.
Note that the behaviour of simplify is to operate on the entire
stroke if there's anything selected on the stroke. This is consistent
with what we have prior to switching to Grease Pencil v3 (4.2 and prior)
Arguably some modes can be further improved by only work on selected
segments, but it's beyond the scope of this patch.
Pull Request: https://projects.blender.org/blender/blender/pulls/134497
With recent changes to the matching of OS title bar to Blender colors
on MacOS and Windows, it looks far nicer to not show the editor border
for windows that only have a single area and also do not have any
global areas. This PR removes them in this case.
Pull Request: https://projects.blender.org/blender/blender/pulls/134961
Not sure why this is suddenly necessary, but I get an error now
that I didn't get in the past without this. The error happened when
accessing `gdb.printing.PrettyPrinter` further down.
This was happening because in `apply_eval_grease_pencil_data`
we gather all the potential original layers to clear. This was done
by taking the set of all original layers and then removing layers
from the set that map to an evaluated layer.
The remaining layers are unmapped and should be cleared.
The problem is that invisible layers are no longer part of evaluated
data so there wouldn't be a mapping that could be found.
To fix this, we don't initialize the set of `orig_layers_to_clear` to
all the layers, but instead to only the layers that are visible.
This will ensure that we don't clear keyframes of hidden layers.
Pull Request: https://projects.blender.org/blender/blender/pulls/135121
Drag and dropping bitmap images (as in drag and dropping directly from
another software such as a web browser, not from an image file in
Finder) inside the Blender window on macOS would segfault due to the
dropped image being [autorelease]d even though its data was meant to
outlive the function scope.
Fixed by removing the superflous autorelease and adding a comment note.
The only caller of this function (GHOST_SystemCocoa::handleDraggingEvent)
already properly [release]s the image in question.
Note that currently, non-file/bitmap image drag and drop is not
implemented on the WM side, and as such this feature/GHOST event does
not do anything practical.
Pull Request: https://projects.blender.org/blender/blender/pulls/135076
The emissions strength was only set when using an emissive texture.
Additionally, for colors brighter than 1.0, normalize the color
into 0..1 range and set the strength accordingly.
Pull-Request: https://projects.blender.org/blender/blender/pulls/135094
This applies to modifiers, constraints and shape keys.
Any driver on such data was not removed with it,
leaving invalid drivers on objects.
With this patch, the drivers are removed, but animation is left untouched.
This is because animation might be reused somewhere else and we don't
want to introduce potential side effects there.
This also adds unit tests for the fixed cases
Pull Request: https://projects.blender.org/blender/blender/pulls/134511
Only remove a grease pencil layer from the evaluated copy when its
visibility is not animated.
Animation evaluation does not recreate the evaluated copy from scratch,
and thus once a layer is removed due to it being invisible, it never got
back.
The animatedness of the `.hide` property is determined once, when the
evaluated copy is created. This is subsequently used during evaluation
to determine whether the layer can be removed or not.
Pull Request: https://projects.blender.org/blender/blender/pulls/135057
Our UI code is currently showing the text "inf" when a numerical input
contains _exactly_ the value of FLT_MAX. But this is the max value for
doubles and we enforce a maximum float precision of 6 digits. This
means that a property can start with "inf" by default but it is
impossible edit, or even keep the same value, by editing in the UI
and show as "inf". This PR defines values that are the actual minimum
and maximums currently usable in the UI and values greater than or
equal to are shown as "inf" (equivalent for "-inf").
Pull Request: https://projects.blender.org/blender/blender/pulls/131876
Fill opacities of individual strokes was overlooked when implementing
the Set Uniform Opacity operator, now corrected and also added a
separate property for controlling stroke/fills opacity.
Pull Request: https://projects.blender.org/blender/blender/pulls/134982
Grease Pencil ID data was being evaluated in the
`BKE_grease_pencil_data_update` function, but this function
is called from the evaluated objects.
The fix adds a new `BKE_grease_pencil_eval_geometry` function
thats called as a callback from `build_object_data_geometry_datablock`.
Resolves#134980, #135004.
Pull Request: https://projects.blender.org/blender/blender/pulls/135051
Update `BKE_fcurves_id_cb(id, callback)` so that it only reports
F-Curves for `id`. With legacy Actions this used to be "all F-Curves in
the Action", but with slotted Actions it should only report the F-Curves
for the assigned slot.
`BKE_fcurves_id_cb()` is used in two places:
1. Updating F-Curve paths in versioning, for example when node sockets
were added/removed. For this it is vital that the updates only happen
for those nodes that were actually affected by this versioning code,
and not blindly for all F-Curves in the Action.
2. Marking properties as 'animated' in the depsgraph, and the 'value
backup' for those properties. This should also be only done for the
properties of that ID, and thus be limited to the F-Curves for the
assigned slot.
Pull Request: https://projects.blender.org/blender/blender/pulls/134851
Entire curve points range is passed to transform-container when
proportional editing is on. Consequence is, strokes from locked
materials are also affected. Use `editable_points` mask to resolve this.
Pull Request: https://projects.blender.org/blender/blender/pulls/134838
The fix 8af27ce27e assumed that
the `edit_hints->positions()` were always empty and that we would always
fallback to using the evalauted positions instead.
But if the edit hints are populated, this fails. In this case, we populate the
positions in `remember_deformed_positions_if_necessary`.
The fix makes sure that we write to the `edit_hint` positions if they are
populated.
Pull Request: https://projects.blender.org/blender/blender/pulls/135033
The USD importer was still creating legacy Actions, which are no longer
supported in Blender 4.4. This commit updates the code to produce
slotted Actions instead.
This also avoids the need to create F-Curves "from scratch", but rather
uses the available functionality. This makes the code somewhat easier to
maintain.
Pull Request: https://projects.blender.org/blender/blender/pulls/134866
When source reference image is a single image type, selecting "sequence"
mode for tracing image into grease pencil will result in a crash in
`trace_end_job` because it's trying to finalize more frames than traced,
now ensures tracing mode to be `Single` when reference image is single
image type even when tracing mode selector is set to sequence.
Pull Request: https://projects.blender.org/blender/blender/pulls/134981
Layer had their opacity reset whenever a modifier was applied.
This was due to the property not being transferred when a new GreasePencil
object was created in `geometry::merge_layers` function. This PR makes sure
to transfer the Layer opacity (similar to other layer properties).
Pull Request: https://projects.blender.org/blender/blender/pulls/135006
This was partially fixed in ef844bad but left some unhandled corner cases with
uninitialized memory.
The core problem is that the `dst_curve_mask` used by the interpolation
functions can contain indices that don't actually exist in either the "from" or
"to" source drawings. Specifically when the "from" drawing has more curves, the
indices are still used but the supplemental `to_curve_indices` array contains
`-1` entries, indicating that only the "from" curve should be used.
The main copy code for positions takes this into account, but the generic copy
of attributes below that does not! It passes the `dst_curve_mask` straight into
the `array_utils` functions and that causes crashes. The original fix in
ef844bad was to clamp the size of the index mask, but the way this was done
could lead to empty index masks, leaving attribute values uninitialized.
The correct solution is to use index masks that exclude invalid entries for the
respective source curves. The new masks are non-overlapping, so the full set of
destination curves can be filled by combining these masks.
Pull Request: https://projects.blender.org/blender/blender/pulls/134865
Was reported for alt-editing, thats the same code though.
Previously ( da1038c768 ), the check for "matching" nodes was based on
the `legacy_type`.
This does not uniquely identify a node type, only the `idname` does.
By "matching", I mean having the same properties (so later setting
values can happen on all selected nodes).
If we allow "non-matching" nodes into our list in
`UI_context_copy_to_selected_list`, setting values on non-existent
properties later can act up (throwing `AttributeError` , also
`RNA_property_boolean_set` would actually try to create an equally named
IDP).
Better to exclude these as soon as possible, now remove nodes from
"selected_nodes" based on the `idname` (rather than `legacy_type`), this
way we can be sure properties match.
Pull Request: https://projects.blender.org/blender/blender/pulls/134930
with #133413 the intent was that VSE Text strips would not use the
fallback font stack if using a custom (non-default) font. However this
determination was done by comparing the font id. This was very weak as
the id can vary quite a bit within the first few fonts. This PR instead
adds a BLF function (BLF_is_builtin) that uses BLF_DEFAULT font flag
instead.
Pull Request: https://projects.blender.org/blender/blender/pulls/135014