f0f1afd250
No functional changes expected. Before this PR the keyframing code was aware of driver specifics and changed the frame where a key is inserted to the current driver value. This is now changed so that the calling code needs to know where on the FCurve the key should be inserted. This removes the need for the `INSERTKEY_DRIVER` flag. Pull Request: https://projects.blender.org/blender/blender/pulls/116823
29 lines
746 B
C++
29 lines
746 B
C++
/* SPDX-FileCopyrightText: 2024 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup animrig
|
|
*/
|
|
|
|
#include "ANIM_driver.hh"
|
|
#include "BKE_animsys.h"
|
|
#include "BKE_fcurve_driver.h"
|
|
#include "DNA_anim_types.h"
|
|
#include "RNA_access.hh"
|
|
|
|
namespace blender::animrig {
|
|
|
|
float remap_driver_frame(const AnimationEvalContext *anim_eval_context,
|
|
PointerRNA *ptr,
|
|
PropertyRNA *prop,
|
|
const FCurve *fcu)
|
|
{
|
|
PathResolvedRNA anim_rna;
|
|
if (!RNA_path_resolved_create(ptr, prop, fcu->array_index, &anim_rna)) {
|
|
return 0.0f;
|
|
}
|
|
return evaluate_driver(&anim_rna, fcu->driver, fcu->driver, anim_eval_context);
|
|
}
|
|
|
|
} // namespace blender::animrig
|