Use actual enum types (`eAnimEdit_Context` etc) for enum values in the
`bAnimContext` struct.
This commit also splits the `mode` field into `dopesheet_mode` and
`grapheditor_mode`, so that their values are clearly differentiated.
Before you'd have to check `spacetype` to know how to interpret this
field (but that wasn't described either). You still have to check that
field to know which one of the two you need to look at, but at least
it's now clear what values can be expected there.
No functional changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/125423
Using the clone brush without previously having copied any stroke points
to clone would crash.
Steps to reproduce were:
- Add Grease Pencil object
- Enter grease pencil Sculpt mode
- Select Clone brush asset
- Click in 3D Viewport
Note that there's also a memory leak appearing now, will submit a
separate fix.
Pull Request: https://projects.blender.org/blender/blender/pulls/125425
The GPU compositor transforms are off by half a pixel in some cases.
That's because the realization shader was to perform transforms, and it
includes logic to move images by half a pixel if the domain and image
had different even/odd sizes. To fix this, we only move by half a pixel
if we are doing realization, while transforms are left as is.
Context menu operators to assign/change/remove shortcuts for brush
assets were missing. Reason being that the keymap to add them to and
look them up in was not detected correctly.
Part of #124418.
In the Action editor's channel list:
- always show the 'slot' icon on the left, to indicate the channel
represents a slot (icon design pending #123372), and
- show the slot's ID type icon on the right.
This should help reduce the confusion between "the ID name" and "the slot
name that animates the ID".
Pull Request: https://projects.blender.org/blender/blender/pulls/125314
This is only visible when text color has transparency or is fully
transparent. Desired behavior is that the outline would only be
"outside" the actual text.
Pull Request: https://projects.blender.org/blender/blender/pulls/125372
When the setting "Only Insert Available" is enabled and there is no action yet,
we can exit early because we know that it will not be possible to insert a keyframe.
This prevents an action from being created.
Co-authored by: Pratik Borhade
Pull Request: https://projects.blender.org/blender/blender/pulls/125408
There were two issues:
* The target layer name was not copied over
* The thickness setting was being divided by two when it
resulted in thinner strokes.
These functions can now be called on layered Actions:
- `action.fcurves.new(data_path, array_index)`
- `action.fcurves.find(data_path, array_index)`
- `action.fcurves.remove(fcurve)`
- `action.fcurves.clear()`
These will operate on the first keyframe strip (searching layers bottom
to top), and then its channelbag for the first slot.
If necessary, `fcurves.new()` will create the layer, keyframe strip,
channelbag, and slot.
This backward compatibility layer only kicks in if either of these is
true:
- The Action is empty AND the experimental flag is enabled, or
- The Action already has a layer or a slot (i.e. is already considered
'layered').
If none of these conditions hold, `action.fcurves` just gives access to
the legacy data.
Ref: #124714
Pull Request: https://projects.blender.org/blender/blender/pulls/124996
Rename leftover references to action 'bindings' to 'slot':
- Two comments, and
- bunch of `bind_` variable prefixes, renamed to `slot_`.
No functional changes.
Add `#ifdef WITH_ANIM_BAKLAVA` to the blend file reading/writing code,
so that the Action layers & slots are ignored when Blender is built
without experimental features.
This ensures that any loaded Action is just treated as 'legacy' (which
is the only kind of Action non-experimental Blender should have to deal
with), which will also properly deal with the forward compatible data
written by !125065.
This fix was committed on the `blender-v4.2-release` branch as
1b7485f20892523942752f81239807b2eab0f00b.
Pull Request: https://projects.blender.org/blender/blender/pulls/125068
This affected cursor snapping as well as the `Jump to Keyframes`
operator since both use `sum_selected_keyframes` to get the averaged
values of elements. It was already taking into account the normalization
factor, but the way a single `KeyframeEditData` was created from
multiple `bAnimListElem` was wrong:
- first, we should only add to it if we actually have some keys selected
(not a problem without normalization, but with it, we would add values
there
- second, the offset needs to be taken into account for each selected
key when adding to the absolute values
Could go into LTS probably
Pull Request: https://projects.blender.org/blender/blender/pulls/125221
This is visible in VSE text strip "box" and "outline" options at least.
For some fonts (mostly script/cursive type) BLF_boundbox function
was calculating horizontal bounds purely from pen position and
advance to the next character position. But the actual glyph can extend
beyond the advance distance.
Curiously, blf_font_boundbox_foreach_glyph (used by
blf_str_offset_from_cursor_position and blf_str_offset_to_glyph_bounds)
was already doing the correct thing and taking glyph horizontal bounds
into account.
Pull Request: https://projects.blender.org/blender/blender/pulls/125363
For meshes (in comparison to multires grids and BMesh) there is nothing
special about position, normals, or mask arrays. We can use the same
functions for gathering and scattering all the arrays. This also gives us
a somewhat nicer temporary solution for the issue of the `array_utils`
utilities using multithreading forcing us to use task isolation. Now the
brushes don't use those utilities.
The Rotate node was off by 0.5 pixels because pixels were not evaluated
at their center. Furthermore, the center of rotation was also off by
half a pixel. To fix this, we ensure rotation happen around the exact
center as well as rotate the pixels at their center.
The compositor translate node produces artifacts when its fractional
part is 0.5. That's because GPUs do round-to-even for nearest neighbour
sampling in case samples were at pixel boundaries.
To fix this, we bias translations by a small value to break the
rounding and ensure predictable rounding direction.
There could be a rare case where a div by zero situation would take
place in LineArt shadow stage where the silhouette and shadows are
calculated, which would cause infinite shadow edge cutting. Now will
return a non-cutting state for those edge cases.
Pull Request: https://projects.blender.org/blender/blender/pulls/125361
All image saving mechanisms in Blender ignores the color format for EXR
images, including Render Pipeline, Save Operator, and File Output nodes.
To fix this, we first allow EXR images to be BW for flexibility. Then we
adjust the EXR saving code to take into account the required number of
channels. This is only done for single layer EXR images. Multi-layer EXR
images correctly ignores the option.
Pull Request: https://projects.blender.org/blender/blender/pulls/124807
Though it results in more duplication currently, splitting these
could help to facilitate further performance improvements here
in the future, and it avoids passing a bunch of useless arguments
for the multires case.
These were mostly getting in the way of refactoring this code.
If the referenced problems actually happen, there would be
more obvious ways to observe the issues anyway.
This applies the same change as the previous commit to the bounds
of every BVH node. The bounds calculation can be changed to use
the standard functions from the regular BVH deformation.
In a simple test this makes building the sculpt BVH 64% faster.
I observed a change from 762ms to 464ms for a 1.9m vertex mesh.
This simplifies the BVH build process and potentially improves
its performance when parts of the geometry is hidden. The method
used to calculate whether a node is fully hidden is slightly different
too, vertex indices are used instead of triangle indices and a triangle
to face map.
Where possible, removes SculptSession as a parameter. Currently, this
only leaves the add_active function with this concept, as how we handle
this concept in the future is currently ambiguous
Pull Request: https://projects.blender.org/blender/blender/pulls/125352
Originally added in ed9c0464ba.
`last_visited_vertex` was never assigned to inside the flood fill loop,
therefore the following conditional to check if it had been set would
always be false, meaning that `forms_loop` was always false.
Pull Request: https://projects.blender.org/blender/blender/pulls/125344
Commit adds support for new format of RawInput packets used by
3Dconnexion devices: SpaceMouse Enterprise, Keyboard Pro and Numpad Pro
specifically. This required distinguishing processing button data
delivered as a bitmask and as a numbers array.
Basically it allows for using said devices buttons in Blender including
using these buttons in shortcuts.
Changes work only for Windows. MacOS will allow only for older format
that is bitmask.
Details:
- NDOF button event values have been moved into the public GHOST_Types.h
header and are no longer aligned to the WM event values.
This was done so the values could be changed to match hardware/drivers
without breaking key-maps stored in user preferences.
- Keyboard Pro and Numpad Pro buttons are not currently used because
they don't map to any standard keyboard events.
These could be supported, see the PR for details.
Ref: !124155