Age | Commit message (Collapse) | Author |
|
Rename and refactor several F-curve key manipulation functions, and move
them from `editors` to `blenkernel`.
The functions formerly known as `delete_fcurve_key`,
`delete_fcurve_keys`, and `clear_fcurve_keys` have been moved from
`ED_keyframes_edit.h` to `BKE_fcurve.h` and have been renamed according
to hierarchical naming rules.
Below is a table of the naming changes.
| From | To |
| -- | -- |
| `delete_fcurve_key(fcu, index, do_recalc)` | `BKE_fcurve_delete_key(fcu, index)` |
| `delete_fcurve_keys(fcu)` | `BKE_fcurve_delete_keys_selected(fcu)` |
| `clear_fcurve_keys(fcu)` | `BKE_fcurve_delete_keys_all(fcu)` |
| `calchandles_fcurve()` | `BKE_fcurve_handles_recalc()` |
| `calchandles_fcurve_ex()`| `BKE_fcurve_handles_recalc_ex()` |
The function formerly known as `delete_fcurve_key` no longer takes a
`do_fast` parameter, which determined whether or not to call
`calchandles_fcurve`. Now, the responsibility is on the caller to run
the new `BKE_fcurve_handles_recalc` function if they have want to
recalculate the handles.
In addition, there is now a new static private function called
`fcurve_bezt_free` which sets the key count to zero and frees the key
array. This function is now used in couple of instances of functionally
equivalent code. Note that `BKE_fcurve_delete_keys_all` is just a
wrapper around `fcurve_bezt_free`.
This change was initially spurred by the fact that `delete_fcurve_keys`
was improperly named; this was a good opportunity to fix the location
and naming of a few of these functions.
Reviewed By: sybren
Differential Revision: https://developer.blender.org/D15282
|
|
|
|
Some operator titles were not translated in the quick favorites menu.
Before:
{F13283724}
After:
{F13283725}
Reviewed By: mont29
Differential Revision: https://developer.blender.org/D15416
|
|
|
|
Fundamental issue is that the attribute api returns none, because
the custom data api returns null for a layer when the size of 0.
This should be improved separately.
|
|
3D text included checks for escape codes such as \n\r\b which have not
been included in wmEvent.ascii since [0] (2009).
Remove these and use more straightforward logic for overriding the
events text input.
[0] 66437a62a73966de8ccb673473ba69d6c1ed66a3
|
|
- Remove references to `ISTEXTINPUT` as any keyboard event with it's
utf8_buf set can be handled as text input.
- Update references to the key repeat flag.
|
|
The `ascii` member was only kept for historic reason as some platforms
didn't support utf8 when it was first introduced.
Remove the `ascii` struct members since many checks used this as a
fall-back for utf8_buf not being set which isn't needed.
There are a few cases where it's convenient to access the ASCII value
of an event (or nil) so a function has been added to do that.
*Details*
- WM_event_utf8_to_ascii() has been added for the few cases an events
ASCII value needs to be accessed, this just avoids having to do
multi-byte character checks in-line.
- RNA Event.ascii remains, using utf8_buf[0] for single byte characters.
- GHOST_TEventKeyData.ascii has been removed.
- To avoid regressions non-ASCII Latin1 characters from GHOST are
converted into multi-byte UTF8, when building X11 without
XInput & X_HAVE_UTF8_STRING it seems like could still occur.
|
|
While GHOST/SDL doesn't support non-ASCII text input,
use the UTF8 buffer to be consistent with all other back-ends.
Move the conversion from SDL_KeyboardEvent to ASCII into a function.
Also only lookup this value on key press (not release).
|
|
|
|
Differential Revision: https://developer.blender.org/D15421
|
|
Now all ghost back-ends support the key repeat flag
(accessed as WM_EVENT_IS_REPEAT from wmEvent.flag).
|
|
Fixes T99672
|
|
Using white spaces in data names should not be encouraged in general,
better not give wrong example here.
Originally part of D15441.
|
|
New remapper code would also fail in some cases when remapping
libraries, similar to the issue yesterday, because ID_LI type had no
mask value.
That would fail to remap `parent` member of a library to NULL when
deleting that parent, leading to a crash e.g. in Outliner tree building
code.
Reported by @JulienKaspar from Blender studio.
|
|
This patch updates the documentation for arguments regarding the `Gizmo`
type.
- Corrected `select_id` doc for draw_preset_ functions. `-1` indicates
that no selection ID is to be written, but previous docs incorrectly
specified `0` instead.
- Added missing doc for `target` argument for `target_set_handler`
function.
Reviewed by: Aaron Carlisle (Blendify)
Differential Revision: https://developer.blender.org/D14834
|
|
This patch allows new GizmoGroup classes to support tool fallback keymap.
With this patch, when new gizmo groups add `'TOOL_FALLBACK_KEYMAP'` to
its `bl_options`, the fallback tools are added to the group. This
allows a `WorkSpaceTool` (for example) to have selection be a fallback
tool if the user LeftMouse drags away from other gizmos in the group.
Reviewed by: Campbell Barton (campbellbarton)
Differential Revision: https://developer.blender.org/D15154
|
|
This commit exposes snap options in transform operators. These options
are needed for Python tools to control snapping without requiring the
tool settings to be adjusted.
The newly exposed options are:
- `snap_elements` for choosing which element(s) of target the source
geometry should snap to (ex: Face Raycast).
- `use_snap_self`, `use_snap_edit`, `use_snap_nonedit`,
`use_snap_selectable_only` for controlling target selection.
- `use_snap_project` for controlling Face Raycast snapping.
- `use_snap_to_same_target` and `snap_face_nearest_steps` for
controlling Face Nearest snapping.
Reviewed by: Campbell Barton (campbellbarton)
Differential Revision: https://developer.blender.org/D15398
|
|
The problem was the new generated strokes were copied from original and the location was offset to mirror, but the internal geometry data was not updated and the collision check done by brushes was not working.
Now, the internal geometry data is recalculated when the modifier is applied.
|
|
Not clearing runtime remapping data for the new ID as well as the old
one can lead to false stale data there, wichi could e.g. make indirectly
linked data be tagged as directly linked.
This would generate an error report on file write when hapening on
ShapeKey ID, since that type is not allowed to be directly linked.
|
|
|
|
The values used for axes weren't in any meaningful order, use defines
to improve readability.
|
|
There were two bugs, a regression in [0] and the object-data wasn't
tagged for depsgraph updating.
[0]: 19df0e3cfd5b9fed891ed81dd1123b2351605a7d
|
|
Simplify interface, regularize implementation and some light cleanup.
See also: T79304 and D15419.
|
|
The data has been moved somewhere else, the span should not
keep a pointer to it.
|
|
Measurements shown on average a 1.08x speedup for a 1.04x increase in
memory usage which is an acceptable trade off for a default setting,
although discoverability of such settings influencing memory usage could
be improved.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D15429
|
|
The operator bpy.ops.object.modifier_copy_to_selected()
does not work for the new Curves objects.
This is because it isn't added to BKE_object_supports_modifiers.
Differential Revision: https://developer.blender.org/D15439
|
|
|
|
|
|
Reviewed By: Richard Antalik
Differential Revision: http://developer.blender.org/D15376
|
|
On some hardware/systems, blender may crash when adding, rendering or displaying Grease Pencil objects.
In `/source/blender/draw/engines/gpencil/shaders/gpencil_vert.glsl`, line 35:
```
gpMaterialFlag gp_flag = floatBitsToInt(gp_mat._flag);
```
`gpMaterialFlag` is of type `uint`. This is a mismatched-type assignment that can cause crashes on some hardware/systems with GLSL that do not support implicit type casting.
So use `floatBitsToUint` for type conversion.
Differential Revision: https://developer.blender.org/D15433
|
|
A geometry component may reference read-only geometry.
In this case it has to be copied before making changes to it.
This was caused by rBb876ce2a4a4638142.
|
|
The current specific CentOS7 workaround we have for AoT, which is to
disable __FAST_MATH__ by using -fhonor-nans, now also fixes the
compilation issue for JIT as well since at least driver 23570.
|
|
rB57097e9a8515 did not properly consider case where you have more than
one override for a same reference linked ID.
Also adds more security checks around shapekeys, since match between
override and its linked reference is never ensured either way (fixes a
crash reported by @Rik from Blender studio).
|
|
This makes the code clearer.
|
|
Probably to prevent the radius of a point from being stuck at zero,
the `Shrink/Fatten` curve operator sets a minimum value of `0.001`
for all points being transformed.
This is an inconvenience as these points may have been purposely set
to zero on the panel.
And it also doesn't follow the convention seen in other operators
(which keep the value zero).
So remove this limitation.
|
|
data.
When creating partial overrides, there may also be need to reamap usage
of linked data towards already existing overrides, in newly created
overrides.
|
|
Add a 'Delete Confirmation' operator property to the 'Delete Marker'
operator. This determines whether the user is asked to confirm the
deletion or not.
Defaults so that only {key X} ({key Backspace} for industry compatible
keymap) prompts for deletion, whereas {key Del} does not show the
confirmation popup.
This also makes the default keymap for marker deletion consistent with
the common delete operators (such as objects and keyframes).
Reviewed By: sybren
Differential Revision: https://developer.blender.org/D13818
|
|
In UV edge mode, box and lasso selections allow edge selections only
when the entire edge is contained within the selection area. This
doesn't consider any edges that partially overlap with the selection
area.
This is now fixed by adding a second pass, similar to how these
operators work for edit-mesh selections. Now if both operators are
unable to find any edges contained within the selection area, then
they will perform a second pass which checks for edges that partially
intersect with the selection area.
Now edge selection in the UV editor matches edit-mesh edge-selection
when drawing wire-frame.
Resolves T99443.
Ref D15362
|
|
Ref D15330.
|
|
A mesh wrapper might be being accessed for read-only from one thread
while another thread converts the wrapper type to something else.
The proposes solution is to defer assignment of the mesh wrapper
type until the wrapper is fully converted. The good thing about this
approach is that it does not introduce extra synchronization (and,
potentially, evaluation pipeline stalls). The downside is that it
might not work with all possible wrapper types in the future. If a
wrapper type which does not clear data separation is ever added in
the future we will re-consider the threading safety then.
Unfortunately, some changes outside of the mesh wrapper file are
to be made to allow "incremental" construction of the mesh prior
changing its wrapper type.
Unfortunately, there is no simplified file which demonstrates the
issue. It was investigated using Heist production file checked at
the revision 1228: `pro/lib/char/einar/einar.shading.blend`. The
repro case is simple: tab into edit mode, possibly few times.
The gist is that there several surface deform and shrinkwrap
modifiers which uses the same target. While one of them is building
BVH tree (which changes wrapper type) the other one accesses it for
read-only via `BKE_mesh_wrapper_vert_coords_copy_with_mat4()`.
Differential Revision: https://developer.blender.org/D15424
|
|
|
|
|
|
Add internal function (only used for testing at the moment)
`_bpy._driver_secure_code_test`.
Add test `script_pyapi_bpy_driver_secure_eval` to serves two purposes:
- Ensure expressions that should be insecure remain so when upgrading
Python or making any changes in this area.
- Ensure new versions of Python don't introduce new byte-codes that
prevent existing expressions from being executed
(happened when upgrading from 3.7, see [0]).
[0]: dfa52017638abdf59791e5588c439d3a558a191d
|
|
The following opcodes have been added, see [0] for details:
- LIST_TO_TUPLE: convert a list to a tuple,
use for constructing lists/tuples in some cases.
- LIST_EXTEND: use for constructing lists with unpacking.
- SET_UPDATE: use for constructing sets with unpacking.
- CONTAINS_OP: check if `a in b` generally useful.
When writing tests these op-codes where needed for basic operations
and can be safely supported.
Add note why dictionary manipulation op-codes have been left out.
Also restrict namsepace access to anything with an underscore prefix
since these may be undocumented.
[0]: https://docs.python.org/3.10/library/dis.html
|
|
Some ID types did not have a filter value, even though they would be
used in remapping code, leading to missing remappings. In that specific
case, shape keys would actually never be properly remapped.
Reproducible in r1230 of
`Heist/pro/animation_test/einar/einar_new_expression_shapes2.blend`,
|
|
When dealing with 'embedded' IDs (and the like, e.g. shape keys),
liboverride code could fail in case the reference linked data (e.g. a
mesh) would not have a shapekey anymore, while the override mesh would
still have one.
Found while investigating another issue in Heist production file
`Heist/pro/animation_test/einar/einar_new_expression_shapes2.blend`,
r1230.
|
|
Adds a better name that describes when it is used.
The GPU_SHADER_BUILDER is a buildtime tool for developers
to pre-validate GLSL (and in the overseen future pre-compile to
SpirV). We don't see that this needs to become a required
step in the future so WITH_GPU_BUILDTIME_SHADER_BUILDER
is more descriptive name.
|
|
Linking GPU shader builder requires stubs for many functions of the USD library.
We don't want to rely on other modules to update the stubs for a tool that
is only used by GPU developers.
This patch raises an error when both WITH_GPU_SHADER_BUILDER and WITH_USD are
enabled. This reduces the maintenance of updating the stubs when USD API changes.
Reviewed By: LazyDodo
Differential Revision: https://developer.blender.org/D15422
|
|
Previously it was inactive but still clickable.
Ref D15316
|