Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey@blender.org>2022-07-04 14:02:24 +0300
committerSergey Sharybin <sergey@blender.org>2022-07-07 16:22:21 +0300
commiteb7218de8dba2a977fdcf8f2e75b16fcd8fc044a (patch)
tree04e93488e1a741a25f49bbdb3553c19ad050fc41 /source/blender/blenkernel/intern/object.cc
parent9a4927031dade70e2fac42a5003ab4a21bfb9e3d (diff)
Fix T99386: Driven modifiers are always re-evaluated during animation
Even if the driver is not dependent on time the modifiers were always re-evaluated during playback. This is due to the legacy nature of the check whether modifier depends on time or not: it was simply checking for sub-string match for modifier in the F-Curve and drivers RNA paths. Nowadays such dependencies are created by the dependency graph builder, which allows to have more granular control over what depends on what. The code is now simplified to only check for "static" dependency of the modifier form time: for example, Wave modifier which always depends on time (even without explicit animation involved). This change also fixes missing relation from the animation component to the shader_fx modifiers, fixing race condition. Additional files used to verify relations: - Geometry: F13257368 - Grease Pencil: F13257369 - Shader FX: F13257370 In these files different types of modifiers have an animated property, and the purpose of the test is to verify that the modifiers do react to the animation and that there is a relation between animation and geometry components of the object. The latter one can only be checked using the dependency graph relation visualization. The drivers are not tested by these files. Those are not typically depend on time, and if there were missing relation from driver to the modifier we'd receive a bug report already. As well as if there was a bug in missing time relation to a driver we'd also receive a report. Differential Revision: https://developer.blender.org/D15358
Diffstat (limited to 'source/blender/blenkernel/intern/object.cc')
-rw-r--r--source/blender/blenkernel/intern/object.cc120
1 files changed, 0 insertions, 120 deletions
diff --git a/source/blender/blenkernel/intern/object.cc b/source/blender/blenkernel/intern/object.cc
index 5ed1ac98ddf..f7436b6112c 100644
--- a/source/blender/blenkernel/intern/object.cc
+++ b/source/blender/blenkernel/intern/object.cc
@@ -5357,126 +5357,6 @@ KDTree_3d *BKE_object_as_kdtree(Object *ob, int *r_tot)
/** \name Object Modifier Utilities
* \{ */
-bool BKE_object_modifier_use_time(Scene *scene, Object *ob, ModifierData *md)
-{
- if (BKE_modifier_depends_ontime(scene, md)) {
- return true;
- }
-
- /* Check whether modifier is animated. */
- /* TODO: this should be handled as part of build_animdata() -- Aligorith */
- if (ob->adt) {
- AnimData *adt = ob->adt;
- FCurve *fcu;
-
- char md_name_esc[sizeof(md->name) * 2];
- BLI_str_escape(md_name_esc, md->name, sizeof(md_name_esc));
-
- char pattern[sizeof(md_name_esc) + 16];
- BLI_snprintf(pattern, sizeof(pattern), "modifiers[\"%s\"]", md_name_esc);
-
- /* action - check for F-Curves with paths containing 'modifiers[' */
- if (adt->action) {
- for (fcu = (FCurve *)adt->action->curves.first; fcu != nullptr; fcu = (FCurve *)fcu->next) {
- if (fcu->rna_path && strstr(fcu->rna_path, pattern)) {
- return true;
- }
- }
- }
-
- /* This here allows modifier properties to get driven and still update properly
- *
- * Workaround to get T26764 (e.g. subsurf levels not updating when animated/driven)
- * working, without the updating problems (T28525 T28690 T28774 T28777) caused
- * by the RNA updates cache introduced in r.38649
- */
- for (fcu = (FCurve *)adt->drivers.first; fcu != nullptr; fcu = (FCurve *)fcu->next) {
- if (fcu->rna_path && strstr(fcu->rna_path, pattern)) {
- return true;
- }
- }
-
- /* XXX: also, should check NLA strips, though for now assume that nobody uses
- * that and we can omit that for performance reasons... */
- }
-
- return false;
-}
-
-bool BKE_object_modifier_gpencil_use_time(Object *ob, GpencilModifierData *md)
-{
- if (BKE_gpencil_modifier_depends_ontime(md)) {
- return true;
- }
-
- /* Check whether modifier is animated. */
- /* TODO(Aligorith): this should be handled as part of build_animdata() */
- if (ob->adt) {
- AnimData *adt = ob->adt;
-
- char md_name_esc[sizeof(md->name) * 2];
- BLI_str_escape(md_name_esc, md->name, sizeof(md_name_esc));
-
- char pattern[sizeof(md_name_esc) + 32];
- BLI_snprintf(pattern, sizeof(pattern), "grease_pencil_modifiers[\"%s\"]", md_name_esc);
-
- /* action - check for F-Curves with paths containing 'grease_pencil_modifiers[' */
- if (adt->action) {
- LISTBASE_FOREACH (FCurve *, fcu, &adt->action->curves) {
- if (fcu->rna_path && strstr(fcu->rna_path, pattern)) {
- return true;
- }
- }
- }
-
- /* This here allows modifier properties to get driven and still update properly */
- LISTBASE_FOREACH (FCurve *, fcu, &adt->drivers) {
- if (fcu->rna_path && strstr(fcu->rna_path, pattern)) {
- return true;
- }
- }
- }
-
- return false;
-}
-
-bool BKE_object_shaderfx_use_time(Object *ob, ShaderFxData *fx)
-{
- if (BKE_shaderfx_depends_ontime(fx)) {
- return true;
- }
-
- /* Check whether effect is animated. */
- /* TODO(Aligorith): this should be handled as part of build_animdata() */
- if (ob->adt) {
- AnimData *adt = ob->adt;
-
- char fx_name_esc[sizeof(fx->name) * 2];
- BLI_str_escape(fx_name_esc, fx->name, sizeof(fx_name_esc));
-
- char pattern[sizeof(fx_name_esc) + 32];
- BLI_snprintf(pattern, sizeof(pattern), "shader_effects[\"%s\"]", fx_name_esc);
-
- /* action - check for F-Curves with paths containing string[' */
- if (adt->action) {
- LISTBASE_FOREACH (FCurve *, fcu, &adt->action->curves) {
- if (fcu->rna_path && strstr(fcu->rna_path, pattern)) {
- return true;
- }
- }
- }
-
- /* This here allows properties to get driven and still update properly */
- LISTBASE_FOREACH (FCurve *, fcu, &adt->drivers) {
- if (fcu->rna_path && strstr(fcu->rna_path, pattern)) {
- return true;
- }
- }
- }
-
- return false;
-}
-
/**
* Set "ignore cache" flag for all caches on this object.
*/