Age | Commit message (Collapse) | Author |
|
|
|
Custom driver functions need access to the dependency graph that is
triggering the evaluation of the driver. This patch passes the
dependency graph pointer through all the animation-related calls.
Instead of passing the evaluation time to functions, the code now passes
an `AnimationEvalContext` pointer:
```
typedef struct AnimationEvalContext {
struct Depsgraph *const depsgraph;
const float eval_time;
} AnimationEvalContext;
```
These structs are read-only, meaning that the code cannot change the
evaluation time. Note that the `depsgraph` pointer itself is const, but
it points to a non-const depsgraph.
FCurves and Drivers can be evaluated at a different time than the
current scene time, for example when evaluating NLA strips. This means
that, even though the current time is stored in the dependency graph, we
need an explicit evaluation time.
There are two functions that allow creation of `AnimationEvalContext`
objects:
- `BKE_animsys_eval_context_construct(Depsgraph *depsgraph, float
eval_time)`, which creates a new context object from scratch, and
- `BKE_animsys_eval_context_construct_at(AnimationEvalContext
*anim_eval_context, float eval_time)`, which can be used to create a
`AnimationEvalContext` with the same depsgraph, but at a different
time. This makes it possible to later add fields without changing any
of the code that just want to change the eval time.
This also provides a fix for T75553, although it does require a change
to the custom driver function. The driver should call
`custom_function(depsgraph)`, and the function should use that depsgraph
instead of information from `bpy.context`.
Reviewed By: brecht, sergey
Differential Revision: https://developer.blender.org/D8047
|
|
Clang Tidy reported a couple of false positives. I disabled
those `NOLINTNEXTLINE`.
Differential Revision: https://developer.blender.org/D8199
|
|
|
|
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/animation` module.
No functional changes.
|
|
|
|
Fixes issue where lines in timeline are sometimes double-width when hovering in area.
Differential Revision: https://developer.blender.org/D8116
Reviewed by Brecht Van Lommel
|
|
When playing back animations a playhead is updated in all the animation editors.
The drawing of the playhead is part of the drawing of the main region
`RGN_TYPE_WINDOW` that redraws the whole region.
This change will draw the play head and window scrollers when updating the
screen. This affects the Action editor, Timeline, Graph editor, NLA editor and
Sequence editor. There is noticeable speedup when using complex animation files.
Spring 02_020_A.anim.blend fps went from 11.8 to 12.5 when showing a timeline
and a action editor on a Ryzen 1700.
* When playing back animation the markers don't jump up/down when near the
frame. This could be added back.
Reviewed By: Brecht van Lommel
Differential Revision: https://developer.blender.org/D8066
|
|
Draw the text with the "header text highlight" theme color, which is
rarely used, making it a good candidate for this special case.
Differential Revision: https://developer.blender.org/D7897
|
|
|
|
|
|
After talking with UI team, we decided to change the tooltip.
|
|
The old tooltip was not clear enough
|
|
Functionality here has become confusing over time,
this removes duplicate, similar functions, preferring to set the mode
instead of toggle, enter, exit.
Mode switching utility function behaved differently regarding undo,
'ED_object_mode_toggle' for example didn't skip the undo push
where 'ED_object_mode_set' did.
Some callers chose these functions based on the intended undo behavior,
even when toggling didn't make sense.
There was also ED_object_mode_generic_enter which was similar to
ED_object_mode_set, instead of the reverse of ED_object_mode_generic_exit.
Simplify object mode switching internals:
- Replace ED_object_mode_generic_enter with ED_object_mode_set.
- Remove ED_object_mode_toggle as nearly all callers needed to check
the current mode so toggling would set the mode argument correctly.
- Use ED_object_mode_set for the object mode switching operator
to simplify logic.
- Add ED_object_mode_set_ex which has an argument to disable undo,
needed when loading undo data needs to set the mode.
- Remove unused ED_object_mode_exit.
|
|
This code was made obsolete by the changes to the animation editor
scrubbing areas in D4654.
Differential Revision: https://developer.blender.org/D7898
|
|
|
|
Issue is that update functions defined in
`rna_def_fmodifier_envelope_ctrl` (namely `rna_FModifier_update`) are
actually never called.
This is because UI code for FCurve modifiers often does not use RNA
buttons but uses custom update functions (or non at all). For example,
rB9a88bd55903a did this for the generators, envelope control points did
not have this at all.
This is now changed to use RNA buttons for the envelope control points,
this could done for other non-RNA buttons as well to get rid of
'validate_fmodifier_cb()'.
Maniphest Tasks: T76734
Differential Revision: https://developer.blender.org/D7732
|
|
Do not execute the operator to change the Graph Editor cursor when changing the
active frame through the scrubbing region. This is not what users expect, see
T76599.
Removes an explicit exception to not let the regular frame change operator
execute in the Graph Editor. It was needed to let the cursor operator run
instead, but the interplay between the two operators is now handled at keymap
level.
Fixes T76599.
|
|
|
|
- 'coords' is an abbreviation for coordinates, not 'cords'.
- Rename 'moves' to 'coords_len'.
|
|
All the driver-specific code in `fcurve.c` has been moved into a new file
`fcurve_driver.c`. The corresponding declarations have been moved from
`BKE_fcurve.h` to `BKE_fcurve_driver.h`.
All the `#include "BKE_fcurve.h"` statements have been investigated and
replaced with `BKE_fcurve_driver.h` where necessary.
No functional changes.
|
|
|
|
It is just a quick fix for the tooltips in the graph editor, it replaces:
- "F-curve modifiers are disabled" with "Enable F-Curve modifiers"
- "F-curve is visible in graph editor for editing" with "F-Curve visibility in Graph Editor".
Reviewed By: billreynish
Maniphest Tasks: T75519
Differential Revision: https://developer.blender.org/D7387
|
|
|
|
The `ANIMFILTER_NODUPLIS` option, to prevent duplicates in the list of
animation data to be freed, was missing. This caused a use-after-free.
|
|
This data block will be the container for simulation node trees.
It will be used for the new particle node system (T73324).
The new data block has the type `ID_SIM`.
It is not visible to users and other developers by default yet.
To enable it, activate the cmake option `WITH_NEW_SIMULATION_TYPE`.
New simulation data blocks can be created by running `bpy.data.simulations.new("name")`.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D7225
|
|
The selection was not checking all modes.
|
|
This was not removed in previous fix.
|
|
|
|
The loop of datablocks was using the scene datablock (3D View) only, but all others datablocks were ignored.
Now the loop consider any annotation datablock.
|
|
Don't set 'special preview' or Solo mode if scrubbing in scrubbing region.
Author: a.monti
Reviewed By: Severin
Differential Revision: https://developer.blender.org/D7234
|
|
Note this only changes cases where the variable was declared inside
the for loop. To handle it outside as well is a different challenge.
Differential Revision: https://developer.blender.org/D7320
|
|
These headers are not needed right away, but will be in the upcoming
commit.
|
|
Makes it more clear that code using this is related to the RNA
integration of a type.
Part of T74432.
Also ran clang-format on affected files.
|
|
The `BKE_animsys.h` and `anim_sys.c` files already had a an "AnimData
API" section. The code in that section has now been split off, and
placed into `BKE_anim_data.h` and `anim_data.c`.
All files that used to include `BKE_animsys.h` have been adjusted to
only include the animation headers they need (sometimes none).
No functional changes.
|
|
Part of T74432.
Mostly a careful batch rename but had to do few smaller fixes.
Also ran clang-format on affected files.
|
|
Follow up of b2ee1770d4c3 and 10c2254d412d, part of T74432.
Now the area and region naming conventions should be less confusing.
Mostly a careful batch rename but had to do few smaller fixes.
Also ran clang-format on affected files.
|
|
|
|
Caused by rBedb3b7a323a1.
Using evaluate_fcurve_only_curve actually causes quite a bit of slowdown
[6x] compared to bezier forward differencing [which was used prior to
rBedb3b7a323a1]. But full fcurve evaluation is desired with Dynamic
Interpolation Effects [Back/Elastic] since their min/max will not be
captured with forward differencing.
So now gain back speed [using bezier forward differencing] and only do
the full fcurve evaluation for dynamic interpolation effects.
Maniphest Tasks: T74927
Differential Revision: https://developer.blender.org/D7196
|
|
Issues exposed by 'bl_run_operators.py' utility.
|
|
Also pass some args as 'const'.
|
|
|
|
Differential Revision: https://developer.blender.org/D7167
|
|
Mpving utils from idcode to idtype proved to be somewhat painful for
some reasons, but now all looks good.
Had to add a fake/empty shell for the special snowflake too,
`ID_LINK_PLACEHOLDER/INDEX_ID_NULL`...
|
|
|
|
Both the MS headers and blender headers define the HKEY
which gives all kind of inclusion order issues.
This diff renames all *KEY constants to EVT_*KEY to resolve
this conflict.
Reviewed By: brecht , dfelinto
Differential Revision: http://developer.blender.org/D7164
|
|
This was missing in previous commit.
|
|
Only the volume object is exposed in the user interface. It is based on OpenVDB
internally. Drawing and rendering code will follow in another commit.
https://wiki.blender.org/wiki/Source/Objects/Volume
https://wiki.blender.org/wiki/Reference/Release_Notes/2.83/Volumes
Hair and PointCloud object types are hidden behind a WITH_NEW_OBJECT_TYPES
build option. These are unfinished, and included only to make it easier to
cooperate on development in the future and avoid tricky merges.
https://wiki.blender.org/wiki/Source/Objects/New_Object_Types
Ref T73201, T68981
Differential Revision: https://developer.blender.org/D6945
|
|
|
|
`ANIM_animdata_update()` did not sort grease pencil frames. A
pre-existing comment stated this wouldn't be necessary as
`posttrans_gpd_clean()` already does this. However, this is only
applicable when the change is performed via the transform system. The
mirror operator doesn't call `posttrans_gpd_clean()`, invalidating the
assumption in the comment.
I moved the sorting code into `BKE_gpencil_layer_frames_sort()`, which
is now called from both `ANIM_animdata_update()` and
`posttrans_gpd_clean()`.
|