Refactor: modern API for getting FCurves in Legacy Grease Pencil anim code

No functional changes.

Ref: #123424

Pull Request: https://projects.blender.org/blender/blender/pulls/128069
This commit is contained in:
Sybren A. Stüvel
2024-09-24 14:50:08 +02:00
parent 26ed4d3892
commit 5a79c8f31d
2 changed files with 6 additions and 10 deletions

View File

@@ -25,6 +25,8 @@
#include "BKE_material.h"
#include "BKE_scene.hh"
#include "ANIM_action_legacy.hh"
#include "BLT_translation.hh"
#include "DEG_depsgraph.hh"
@@ -103,11 +105,7 @@ static void animdata_keyframe_list_get(ListBase *ob_list,
/* Loop all objects to get the list of keyframes used. */
LISTBASE_FOREACH (GpBakeOb *, elem, ob_list) {
Object *ob = elem->ob;
AnimData *adt = BKE_animdata_from_id(&ob->id);
if ((adt == nullptr) || (adt->action == nullptr)) {
continue;
}
LISTBASE_FOREACH (FCurve *, fcurve, &adt->action->curves) {
for (FCurve *fcurve : blender::animrig::legacy::fcurves_for_assigned_action(ob->adt)) {
int i;
BezTriple *bezt;
for (i = 0, bezt = fcurve->bezt; i < fcurve->totvert; i++, bezt++) {

View File

@@ -29,6 +29,8 @@
#include "BKE_report.hh"
#include "BKE_scene.hh"
#include "ANIM_action_legacy.hh"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_query.hh"
@@ -79,11 +81,7 @@ static void animdata_keyframe_list_get(ListBase *ob_list,
/* Loop all objects to get the list of keyframes used. */
LISTBASE_FOREACH (GpBakeOb *, elem, ob_list) {
Object *ob = elem->ob;
AnimData *adt = BKE_animdata_from_id(&ob->id);
if ((adt == nullptr) || (adt->action == nullptr)) {
continue;
}
LISTBASE_FOREACH (FCurve *, fcurve, &adt->action->curves) {
for (FCurve *fcurve : blender::animrig::legacy::fcurves_for_assigned_action(ob->adt)) {
int i;
BezTriple *bezt;
for (i = 0, bezt = fcurve->bezt; i < fcurve->totvert; i++, bezt++) {