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:
authorJulian Eisel <julian@blender.org>2022-06-30 19:36:42 +0300
committerJulian Eisel <julian@blender.org>2022-06-30 19:38:44 +0300
commit65166e145b4d6292abc289b71894c53b25c186ba (patch)
tree707513038d00a964d7a400ac8e7e22251fffb02d
parent66de653784ab06ccea46413de6b2f086b5a69d30 (diff)
Cleanup: Remove scene frame macros (`CFRA` et al.)
Removes the following macros for scene/render frame values: - `CFRA` - `SUBFRA` - `SFRA` - `EFRA` These macros don't add much, other than saving a few characters when typing. It's not immediately clear what they refer to, they just hide what they actually access. Just be explicit and clear about that. Plus these macros gave read and write access to the variables, so eyesores like this would be done (eyesore because it looks like assigning to a constant): ``` CFRA = some_frame_nbr; ``` Reviewed By: sergey Differential Revision: https://developer.blender.org/D15311
-rw-r--r--source/blender/blenkernel/intern/gpencil_curve.c2
-rw-r--r--source/blender/blenkernel/intern/gpencil_geom.cc4
-rw-r--r--source/blender/blenkernel/intern/image.cc2
-rw-r--r--source/blender/blenkernel/intern/pointcache.c24
-rw-r--r--source/blender/blenkernel/intern/sound.c18
-rw-r--r--source/blender/draw/engines/eevee/eevee_engine.c6
-rw-r--r--source/blender/draw/engines/overlay/overlay_extra.c7
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c12
-rw-r--r--source/blender/editors/animation/anim_draw.c24
-rw-r--r--source/blender/editors/animation/anim_markers.c12
-rw-r--r--source/blender/editors/animation/anim_motion_paths.c8
-rw-r--r--source/blender/editors/animation/anim_ops.c14
-rw-r--r--source/blender/editors/animation/keyframes_edit.c4
-rw-r--r--source/blender/editors/animation/keyframes_general.c8
-rw-r--r--source/blender/editors/animation/keyframing.c19
-rw-r--r--source/blender/editors/armature/pose_lib.c4
-rw-r--r--source/blender/editors/armature/pose_lib_2.c2
-rw-r--r--source/blender/editors/armature/pose_slide.c4
-rw-r--r--source/blender/editors/armature/pose_transform.c6
-rw-r--r--source/blender/editors/gpencil/annotate_draw.c8
-rw-r--r--source/blender/editors/gpencil/annotate_paint.c2
-rw-r--r--source/blender/editors/gpencil/editaction_gpencil.c14
-rw-r--r--source/blender/editors/gpencil/gpencil_add_blank.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_add_monkey.c4
-rw-r--r--source/blender/editors/gpencil/gpencil_add_stroke.c4
-rw-r--r--source/blender/editors/gpencil/gpencil_bake_animation.cc8
-rw-r--r--source/blender/editors/gpencil/gpencil_convert.c8
-rw-r--r--source/blender/editors/gpencil/gpencil_data.c6
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c12
-rw-r--r--source/blender/editors/gpencil/gpencil_fill.c6
-rw-r--r--source/blender/editors/gpencil/gpencil_interpolate.c8
-rw-r--r--source/blender/editors/gpencil/gpencil_merge.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_mesh.cc4
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c4
-rw-r--r--source/blender/editors/gpencil/gpencil_primitive.c4
-rw-r--r--source/blender/editors/gpencil/gpencil_sculpt_paint.c4
-rw-r--r--source/blender/editors/gpencil/gpencil_select.c2
-rw-r--r--source/blender/editors/io/io_alembic.c8
-rw-r--r--source/blender/editors/io/io_gpencil_export.c12
-rw-r--r--source/blender/editors/io/io_gpencil_import.c6
-rw-r--r--source/blender/editors/io/io_obj.c8
-rw-r--r--source/blender/editors/mask/mask_add.c6
-rw-r--r--source/blender/editors/mask/mask_draw.c2
-rw-r--r--source/blender/editors/mask/mask_editaction.c2
-rw-r--r--source/blender/editors/mask/mask_ops.c8
-rw-r--r--source/blender/editors/mask/mask_shapekey.c8
-rw-r--r--source/blender/editors/object/object_add.cc2
-rw-r--r--source/blender/editors/physics/particle_edit.c6
-rw-r--r--source/blender/editors/physics/physics_fluid.c8
-rw-r--r--source/blender/editors/render/render_opengl.cc15
-rw-r--r--source/blender/editors/render/render_preview.cc2
-rw-r--r--source/blender/editors/screen/screen_ops.c28
-rw-r--r--source/blender/editors/space_action/action_edit.c10
-rw-r--r--source/blender/editors/space_action/action_select.c12
-rw-r--r--source/blender/editors/space_action/space_action.c8
-rw-r--r--source/blender/editors/space_clip/clip_draw.c10
-rw-r--r--source/blender/editors/space_clip/clip_editor.c6
-rw-r--r--source/blender/editors/space_clip/clip_graph_ops.c8
-rw-r--r--source/blender/editors/space_clip/clip_ops.c10
-rw-r--r--source/blender/editors/space_clip/clip_utils.c12
-rw-r--r--source/blender/editors/space_clip/tracking_ops.c9
-rw-r--r--source/blender/editors/space_clip/tracking_ops_track.c4
-rw-r--r--source/blender/editors/space_graph/graph_edit.c18
-rw-r--r--source/blender/editors/space_graph/graph_ops.c8
-rw-r--r--source/blender/editors/space_graph/graph_select.c8
-rw-r--r--source/blender/editors/space_image/image_buttons.c2
-rw-r--r--source/blender/editors/space_image/image_draw.c3
-rw-r--r--source/blender/editors/space_image/image_ops.c8
-rw-r--r--source/blender/editors/space_nla/nla_edit.c6
-rw-r--r--source/blender/editors/space_nla/nla_select.c6
-rw-r--r--source/blender/editors/space_nla/space_nla.c4
-rw-r--r--source/blender/editors/space_node/drawnode.cc2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_add.c4
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c14
-rw-r--r--source/blender/editors/space_sequencer/sequencer_select.c10
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_gizmo_ruler.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_utils.c2
-rw-r--r--source/blender/editors/transform/transform_convert_action.c12
-rw-r--r--source/blender/editors/transform/transform_convert_armature.c4
-rw-r--r--source/blender/editors/transform/transform_convert_gpencil.c2
-rw-r--r--source/blender/editors/transform/transform_convert_graph.c14
-rw-r--r--source/blender/editors/transform/transform_convert_mask.c4
-rw-r--r--source/blender/editors/transform/transform_convert_nla.c14
-rw-r--r--source/blender/editors/transform/transform_convert_object.c4
-rw-r--r--source/blender/editors/transform/transform_convert_sequencer.c4
-rw-r--r--source/blender/editors/transform/transform_convert_sequencer_image.c10
-rw-r--r--source/blender/editors/transform/transform_mode_timescale.c4
-rw-r--r--source/blender/editors/transform/transform_snap_object.cc2
-rw-r--r--source/blender/editors/transform/transform_snap_sequencer.c2
-rw-r--r--source/blender/editors/util/ed_util_imbuf.c2
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c4
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c4
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c4
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencilshrinkwrap.c4
-rw-r--r--source/blender/io/gpencil/intern/gpencil_io_capi.cc4
-rw-r--r--source/blender/io/wavefront_obj/exporter/obj_exporter.cc6
-rw-r--r--source/blender/makesdna/DNA_scene_types.h4
-rw-r--r--source/blender/sequencer/intern/strip_relations.c2
-rw-r--r--source/blender/windowmanager/gizmo/intern/wm_gizmo_target_props.c2
100 files changed, 356 insertions, 349 deletions
diff --git a/source/blender/blenkernel/intern/gpencil_curve.c b/source/blender/blenkernel/intern/gpencil_curve.c
index 20b8342f090..d68b322e4c5 100644
--- a/source/blender/blenkernel/intern/gpencil_curve.c
+++ b/source/blender/blenkernel/intern/gpencil_curve.c
@@ -501,7 +501,7 @@ void BKE_gpencil_convert_curve(Main *bmain,
}
/* Check if there is an active frame and add if needed. */
- bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_ADD_COPY);
+ bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, GP_GETFRAME_ADD_COPY);
/* Read all splines of the curve and create a stroke for each. */
LISTBASE_FOREACH (Nurb *, nu, &cu->nurb) {
diff --git a/source/blender/blenkernel/intern/gpencil_geom.cc b/source/blender/blenkernel/intern/gpencil_geom.cc
index 0445a1540c7..d0075a7d161 100644
--- a/source/blender/blenkernel/intern/gpencil_geom.cc
+++ b/source/blender/blenkernel/intern/gpencil_geom.cc
@@ -2706,7 +2706,7 @@ bool BKE_gpencil_convert_mesh(Main *bmain,
gpl_fill = BKE_gpencil_layer_addnew(gpd, element_name, true, false);
}
bGPDframe *gpf_fill = BKE_gpencil_layer_frame_get(
- gpl_fill, CFRA + frame_offset, GP_GETFRAME_ADD_NEW);
+ gpl_fill, scene->r.cfra + frame_offset, GP_GETFRAME_ADD_NEW);
int i;
for (i = 0; i < mpoly_len; i++) {
const MPoly *mp = &mpoly[i];
@@ -2781,7 +2781,7 @@ bool BKE_gpencil_convert_mesh(Main *bmain,
gpl_stroke = BKE_gpencil_layer_addnew(gpd, element_name, true, false);
}
bGPDframe *gpf_stroke = BKE_gpencil_layer_frame_get(
- gpl_stroke, CFRA + frame_offset, GP_GETFRAME_ADD_NEW);
+ gpl_stroke, scene->r.cfra + frame_offset, GP_GETFRAME_ADD_NEW);
gpencil_generate_edgeloops(ob_eval,
gpd,
diff --git a/source/blender/blenkernel/intern/image.cc b/source/blender/blenkernel/intern/image.cc
index afde8893b93..0c4dc3c87f3 100644
--- a/source/blender/blenkernel/intern/image.cc
+++ b/source/blender/blenkernel/intern/image.cc
@@ -1582,7 +1582,7 @@ static void stampdata(
}
if (use_dynamic && scene->r.stamp & R_STAMP_MARKER) {
- const char *name = BKE_scene_find_last_marker_name(scene, CFRA);
+ const char *name = BKE_scene_find_last_marker_name(scene, scene->r.cfra);
if (name) {
STRNCPY(text, name);
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 21217a7f9bf..5d8025dce8a 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -2920,7 +2920,7 @@ int BKE_ptcache_id_reset(Scene *scene, PTCacheID *pid, int mode)
BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0);
}
else if (after) {
- BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_AFTER, CFRA);
+ BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_AFTER, scene->r.cfra);
}
return (reset || clear || after);
@@ -3162,8 +3162,8 @@ void BKE_ptcache_bake(PTCacheBaker *baker)
PTCacheID *pid = &baker->pid;
PointCache *cache = NULL;
float frameleno = scene->r.framelen;
- int cfrao = CFRA;
- int startframe = MAXFRAME, endframe = baker->anim_init ? scene->r.sfra : CFRA;
+ int cfrao = scene->r.cfra;
+ int startframe = MAXFRAME, endframe = baker->anim_init ? scene->r.sfra : scene->r.cfra;
int bake = baker->bake;
int render = baker->render;
@@ -3270,7 +3270,7 @@ void BKE_ptcache_bake(PTCacheBaker *baker)
}
}
- CFRA = startframe;
+ scene->r.cfra = startframe;
scene->r.framelen = 1.0;
/* bake */
@@ -3282,21 +3282,21 @@ void BKE_ptcache_bake(PTCacheBaker *baker)
stime = ptime = PIL_check_seconds_timer();
- for (int fr = CFRA; fr <= endframe; fr += baker->quick_step, CFRA = fr) {
+ for (int fr = scene->r.cfra; fr <= endframe; fr += baker->quick_step, scene->r.cfra = fr) {
BKE_scene_graph_update_for_newframe(depsgraph);
if (baker->update_progress) {
- float progress = ((float)(CFRA - startframe) / (float)(endframe - startframe));
+ float progress = ((float)(scene->r.cfra - startframe) / (float)(endframe - startframe));
baker->update_progress(baker->bake_job, progress, &cancel);
}
if (G.background) {
- printf("bake: frame %d :: %d\n", CFRA, endframe);
+ printf("bake: frame %d :: %d\n", scene->r.cfra, endframe);
}
else {
ctime = PIL_check_seconds_timer();
- fetd = (ctime - ptime) * (endframe - CFRA) / baker->quick_step;
+ fetd = (ctime - ptime) * (endframe - scene->r.cfra) / baker->quick_step;
if (use_timer || fetd > 60.0) {
use_timer = true;
@@ -3307,7 +3307,7 @@ void BKE_ptcache_bake(PTCacheBaker *baker)
printf("Baked for %s, current frame: %i/%i (%.3fs), ETC: %s\r",
run,
- CFRA - startframe + 1,
+ scene->r.cfra - startframe + 1,
endframe - startframe + 1,
ctime - ptime,
etd);
@@ -3321,7 +3321,7 @@ void BKE_ptcache_bake(PTCacheBaker *baker)
break;
}
- CFRA += 1;
+ scene->r.cfra += 1;
}
if (use_timer) {
@@ -3330,7 +3330,7 @@ void BKE_ptcache_bake(PTCacheBaker *baker)
printf("\nBake %s %s (%i frames simulated).\n",
(cancel ? "canceled after" : "finished in"),
run,
- CFRA - startframe);
+ scene->r.cfra - startframe);
}
/* clear baking flag */
@@ -3379,7 +3379,7 @@ void BKE_ptcache_bake(PTCacheBaker *baker)
}
scene->r.framelen = frameleno;
- CFRA = cfrao;
+ scene->r.cfra = cfrao;
if (bake) { /* already on cfra unless baking */
BKE_scene_graph_update_for_newframe(depsgraph);
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 343a829cf76..f459b5a82ac 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -804,7 +804,7 @@ void BKE_sound_set_scene_volume(Scene *scene, float volume)
}
AUD_Sequence_setAnimationData(scene->sound_scene,
AUD_AP_VOLUME,
- CFRA,
+ scene->r.cfra,
&volume,
(scene->audio.flag & AUDIO_VOLUME_ANIMATED) != 0);
}
@@ -855,7 +855,7 @@ static double get_cur_time(Scene *scene)
/* We divide by the current framelen to take into account time remapping.
* Otherwise we will get the wrong starting time which will break A/V sync.
* See T74111 for further details. */
- return FRA2TIME((CFRA + SUBFRA) / (double)scene->r.framelen);
+ return FRA2TIME((scene->r.cfra + scene->r.subframe) / (double)scene->r.framelen);
}
void BKE_sound_play_scene(Scene *scene)
@@ -911,7 +911,7 @@ void BKE_sound_seek_scene(Main *bmain, Scene *scene)
int animation_playing;
const double one_frame = 1.0 / FPS;
- const double cur_time = FRA2TIME(CFRA);
+ const double cur_time = FRA2TIME(scene->r.cfra);
AUD_Device_lock(sound_device);
@@ -1131,13 +1131,13 @@ static void sound_update_base(Scene *scene, Object *object, void *new_set)
mat4_to_quat(quat, object->obmat);
AUD_SequenceEntry_setAnimationData(
- strip->speaker_handle, AUD_AP_LOCATION, CFRA, object->obmat[3], 1);
+ strip->speaker_handle, AUD_AP_LOCATION, scene->r.cfra, object->obmat[3], 1);
AUD_SequenceEntry_setAnimationData(
- strip->speaker_handle, AUD_AP_ORIENTATION, CFRA, quat, 1);
+ strip->speaker_handle, AUD_AP_ORIENTATION, scene->r.cfra, quat, 1);
AUD_SequenceEntry_setAnimationData(
- strip->speaker_handle, AUD_AP_VOLUME, CFRA, &speaker->volume, 1);
+ strip->speaker_handle, AUD_AP_VOLUME, scene->r.cfra, &speaker->volume, 1);
AUD_SequenceEntry_setAnimationData(
- strip->speaker_handle, AUD_AP_PITCH, CFRA, &speaker->pitch, 1);
+ strip->speaker_handle, AUD_AP_PITCH, scene->r.cfra, &speaker->pitch, 1);
AUD_SequenceEntry_setSound(strip->speaker_handle, speaker->sound->playback_handle);
AUD_SequenceEntry_setMuted(strip->speaker_handle, mute);
}
@@ -1172,8 +1172,8 @@ void BKE_sound_update_scene(Depsgraph *depsgraph, Scene *scene)
if (scene->camera) {
mat4_to_quat(quat, scene->camera->obmat);
AUD_Sequence_setAnimationData(
- scene->sound_scene, AUD_AP_LOCATION, CFRA, scene->camera->obmat[3], 1);
- AUD_Sequence_setAnimationData(scene->sound_scene, AUD_AP_ORIENTATION, CFRA, quat, 1);
+ scene->sound_scene, AUD_AP_LOCATION, scene->r.cfra, scene->camera->obmat[3], 1);
+ AUD_Sequence_setAnimationData(scene->sound_scene, AUD_AP_ORIENTATION, scene->r.cfra, quat, 1);
}
AUD_destroySet(scene->speaker_handles);
diff --git a/source/blender/draw/engines/eevee/eevee_engine.c b/source/blender/draw/engines/eevee/eevee_engine.c
index 0cdeeaf314f..ffe0863fb9f 100644
--- a/source/blender/draw/engines/eevee/eevee_engine.c
+++ b/source/blender/draw/engines/eevee/eevee_engine.c
@@ -451,8 +451,8 @@ static void eevee_render_to_image(void *vedata,
}
EEVEE_PrivateData *g_data = ved->stl->g_data;
- int initial_frame = CFRA;
- float initial_subframe = SUBFRA;
+ int initial_frame = scene->r.cfra;
+ float initial_subframe = scene->r.subframe;
float shuttertime = (do_motion_blur) ? scene->eevee.motion_blur_shutter : 0.0f;
int time_steps_tot = (do_motion_blur) ? max_ii(1, scene->eevee.motion_blur_steps) : 1;
g_data->render_timesteps = time_steps_tot;
@@ -588,7 +588,7 @@ static void eevee_render_to_image(void *vedata,
/* Restore original viewport size. */
DRW_render_viewport_size_set((int[2]){g_data->size_orig[0], g_data->size_orig[1]});
- if (CFRA != initial_frame || SUBFRA != initial_subframe) {
+ if (scene->r.cfra != initial_frame || scene->r.subframe != initial_subframe) {
/* Restore original frame number. This is because the render pipeline expects it. */
RE_engine_frame_set(engine, initial_frame, initial_subframe);
}
diff --git a/source/blender/draw/engines/overlay/overlay_extra.c b/source/blender/draw/engines/overlay/overlay_extra.c
index f875254a685..9d478310104 100644
--- a/source/blender/draw/engines/overlay/overlay_extra.c
+++ b/source/blender/draw/engines/overlay/overlay_extra.c
@@ -1353,7 +1353,7 @@ static void OVERLAY_volume_extra(OVERLAY_ExtraCallBuffers *cb,
/* Don't show smoke before simulation starts, this could be made an option in the future. */
const bool draw_velocity = (fds->draw_velocity && fds->fluid &&
- CFRA >= fds->point_cache[0]->startframe);
+ scene->r.cfra >= fds->point_cache[0]->startframe);
/* Show gridlines only for slices with no interpolation. */
const bool show_gridlines = (fds->show_gridlines && fds->fluid &&
@@ -1546,8 +1546,9 @@ void OVERLAY_extra_cache_populate(OVERLAY_Data *vedata, Object *ob)
(md = BKE_modifiers_findby_type(ob, eModifierType_Fluid)) &&
(BKE_modifier_is_enabled(scene, md, eModifierMode_Realtime)) &&
(((FluidModifierData *)md)->domain != NULL) &&
- (CFRA >= (((FluidModifierData *)md)->domain->cache_frame_start)) &&
- (CFRA <= (((FluidModifierData *)md)->domain->cache_frame_end));
+ (scene->r.cfra >=
+ (((FluidModifierData *)md)->domain->cache_frame_start)) &&
+ (scene->r.cfra <= (((FluidModifierData *)md)->domain->cache_frame_end));
float *color;
int theme_id = DRW_object_wire_theme_get(ob, view_layer, &color);
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 7dac1286526..729e8533d50 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -4747,13 +4747,13 @@ static void achannel_setting_slider_cb(bContext *C, void *id_poin, void *fcu_poi
RNA_id_pointer_create(id, &id_ptr);
/* Get NLA context for value remapping */
- const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(depsgraph,
- (float)CFRA);
+ const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(
+ depsgraph, (float)scene->r.cfra);
NlaKeyframingContext *nla_context = BKE_animsys_get_nla_keyframing_context(
&nla_cache, &id_ptr, adt, &anim_eval_context);
/* get current frame and apply NLA-mapping to it (if applicable) */
- cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP);
+ cfra = BKE_nla_tweakedit_remap(adt, (float)scene->r.cfra, NLATIME_CONVERT_UNMAP);
/* Get flags for keyframing. */
flag = ANIM_get_keyframing_flags(scene, true);
@@ -4803,8 +4803,8 @@ static void achannel_setting_slider_shapekey_cb(bContext *C, void *key_poin, voi
RNA_id_pointer_create((ID *)key, &id_ptr);
/* Get NLA context for value remapping */
- const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(depsgraph,
- (float)CFRA);
+ const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(
+ depsgraph, (float)scene->r.cfra);
NlaKeyframingContext *nla_context = BKE_animsys_get_nla_keyframing_context(
&nla_cache, &id_ptr, key->adt, &anim_eval_context);
@@ -4872,7 +4872,7 @@ static void achannel_setting_slider_nla_curve_cb(bContext *C,
float cfra;
/* get current frame - *no* NLA mapping should be done */
- cfra = (float)CFRA;
+ cfra = (float)scene->r.cfra;
/* get flags for keyframing */
flag = ANIM_get_keyframing_flags(scene, true);
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c
index ee1522c7b76..d9dcbf1d57e 100644
--- a/source/blender/editors/animation/anim_draw.c
+++ b/source/blender/editors/animation/anim_draw.c
@@ -120,9 +120,9 @@ void ANIM_draw_framerange(Scene *scene, View2D *v2d)
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformThemeColorShadeAlpha(TH_BACK, -25, -100);
- if (SFRA < EFRA) {
- immRectf(pos, v2d->cur.xmin, v2d->cur.ymin, (float)SFRA, v2d->cur.ymax);
- immRectf(pos, (float)EFRA, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
+ if (scene->r.sfra < scene->r.efra) {
+ immRectf(pos, v2d->cur.xmin, v2d->cur.ymin, (float)scene->r.sfra, v2d->cur.ymax);
+ immRectf(pos, (float)scene->r.efra, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
}
else {
immRectf(pos, v2d->cur.xmin, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
@@ -135,11 +135,11 @@ void ANIM_draw_framerange(Scene *scene, View2D *v2d)
immBegin(GPU_PRIM_LINES, 4);
- immVertex2f(pos, (float)SFRA, v2d->cur.ymin);
- immVertex2f(pos, (float)SFRA, v2d->cur.ymax);
+ immVertex2f(pos, (float)scene->r.sfra, v2d->cur.ymin);
+ immVertex2f(pos, (float)scene->r.sfra, v2d->cur.ymax);
- immVertex2f(pos, (float)EFRA, v2d->cur.ymin);
- immVertex2f(pos, (float)EFRA, v2d->cur.ymax);
+ immVertex2f(pos, (float)scene->r.efra, v2d->cur.ymin);
+ immVertex2f(pos, (float)scene->r.efra, v2d->cur.ymax);
immEnd();
immUnbindProgram();
@@ -530,7 +530,7 @@ static bool find_prev_next_keyframes(struct bContext *C, int *r_nextfra, int *r_
bool donenext = false, doneprev = false;
int nextcount = 0, prevcount = 0;
- cfranext = cfraprev = (float)(CFRA);
+ cfranext = cfraprev = (float)(scene->r.cfra);
/* seed up dummy dopesheet context with flags to perform necessary filtering */
if ((scene->flag & SCE_KEYS_NO_SELONLY) == 0) {
@@ -559,7 +559,7 @@ static bool find_prev_next_keyframes(struct bContext *C, int *r_nextfra, int *r_
aknext = ED_keylist_find_next(keylist, cfranext);
if (aknext) {
- if (CFRA == (int)aknext->cfra) {
+ if (scene->r.cfra == (int)aknext->cfra) {
/* make this the new starting point for the search and ignore */
cfranext = aknext->cfra;
}
@@ -577,7 +577,7 @@ static bool find_prev_next_keyframes(struct bContext *C, int *r_nextfra, int *r_
akprev = ED_keylist_find_prev(keylist, cfraprev);
if (akprev) {
- if (CFRA == (int)akprev->cfra) {
+ if (scene->r.cfra == (int)akprev->cfra) {
/* make this the new starting point for the search */
}
else {
@@ -599,14 +599,14 @@ static bool find_prev_next_keyframes(struct bContext *C, int *r_nextfra, int *r_
*r_prevfra = cfraprev;
}
else {
- *r_prevfra = CFRA - (cfranext - CFRA);
+ *r_prevfra = scene->r.cfra - (cfranext - scene->r.cfra);
}
if (donenext) {
*r_nextfra = cfranext;
}
else {
- *r_nextfra = CFRA + (CFRA - cfraprev);
+ *r_nextfra = scene->r.cfra + (scene->r.cfra - cfraprev);
}
return true;
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index ad06b185132..03a2caf4b7d 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -104,7 +104,7 @@ int ED_markers_post_apply_transform(
ListBase *markers, Scene *scene, int mode, float value, char side)
{
TimeMarker *marker;
- float cfra = (float)CFRA;
+ float cfra = (float)scene->r.cfra;
int changed_tot = 0;
/* sanity check - no markers, or locked markers */
@@ -1497,8 +1497,8 @@ static void ED_markers_select_leftright(bAnimContext *ac,
}
LISTBASE_FOREACH (TimeMarker *, marker, markers) {
- if ((mode == MARKERS_LRSEL_LEFT && marker->frame <= CFRA) ||
- (mode == MARKERS_LRSEL_RIGHT && marker->frame >= CFRA)) {
+ if ((mode == MARKERS_LRSEL_LEFT && marker->frame <= scene->r.cfra) ||
+ (mode == MARKERS_LRSEL_RIGHT && marker->frame >= scene->r.cfra)) {
marker->flag |= SELECT;
}
}
@@ -1754,11 +1754,11 @@ static int ed_marker_camera_bind_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- marker = ED_markers_find_nearest_marker(markers, CFRA);
- if ((marker == NULL) || (marker->frame != CFRA)) {
+ marker = ED_markers_find_nearest_marker(markers, scene->r.cfra);
+ if ((marker == NULL) || (marker->frame != scene->r.cfra)) {
marker = MEM_callocN(sizeof(TimeMarker), "Camera TimeMarker");
marker->flag = SELECT;
- marker->frame = CFRA;
+ marker->frame = scene->r.cfra;
BLI_addtail(markers, marker);
/* deselect all others, so that the user can then move it without problems */
diff --git a/source/blender/editors/animation/anim_motion_paths.c b/source/blender/editors/animation/anim_motion_paths.c
index b15bd3db678..23c1d68b4d6 100644
--- a/source/blender/editors/animation/anim_motion_paths.c
+++ b/source/blender/editors/animation/anim_motion_paths.c
@@ -391,7 +391,7 @@ void animviz_calc_motionpaths(Depsgraph *depsgraph,
return;
}
- const int cfra = CFRA;
+ const int cfra = scene->r.cfra;
int sfra = INT_MAX, efra = INT_MIN;
switch (range) {
case ANIMVIZ_CALC_RANGE_CURRENT_FRAME:
@@ -485,7 +485,7 @@ void animviz_calc_motionpaths(Depsgraph *depsgraph,
sfra,
efra,
efra - sfra + 1);
- for (CFRA = sfra; CFRA <= efra; CFRA++) {
+ for (scene->r.cfra = sfra; scene->r.cfra <= efra; scene->r.cfra++) {
if (range == ANIMVIZ_CALC_RANGE_CURRENT_FRAME) {
/* For current frame, only update tagged. */
BKE_scene_graph_update_tagged(depsgraph, bmain);
@@ -496,14 +496,14 @@ void animviz_calc_motionpaths(Depsgraph *depsgraph,
}
/* perform baking for targets */
- motionpaths_calc_bake_targets(targets, CFRA);
+ motionpaths_calc_bake_targets(targets, scene->r.cfra);
}
/* reset original environment */
/* NOTE: We don't always need to reevaluate the main scene, as the depsgraph
* may be a temporary one that works on a subset of the data.
* We always have to restore the current frame though. */
- CFRA = cfra;
+ scene->r.cfra = cfra;
if (range != ANIMVIZ_CALC_RANGE_CURRENT_FRAME && restore) {
motionpaths_calc_update_scene(depsgraph);
}
diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c
index f3972cb45df..c7e755fb6df 100644
--- a/source/blender/editors/animation/anim_ops.c
+++ b/source/blender/editors/animation/anim_ops.c
@@ -142,14 +142,14 @@ static void change_frame_apply(bContext *C, wmOperator *op)
/* set the new frame number */
if (scene->r.flag & SCER_SHOW_SUBFRAME) {
- CFRA = (int)frame;
- SUBFRA = frame - (int)frame;
+ scene->r.cfra = (int)frame;
+ scene->r.subframe = frame - (int)frame;
}
else {
- CFRA = round_fl_to_int(frame);
- SUBFRA = 0.0f;
+ scene->r.cfra = round_fl_to_int(frame);
+ scene->r.subframe = 0.0f;
}
- FRAMENUMBER_MIN_CLAMP(CFRA);
+ FRAMENUMBER_MIN_CLAMP(scene->r.cfra);
/* do updates */
DEG_id_tag_update(&scene->id, ID_RECALC_FRAME_CHANGE);
@@ -382,7 +382,7 @@ static int anim_set_sfra_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- frame = CFRA;
+ frame = scene->r.cfra;
/* if Preview Range is defined, set the 'start' frame for that */
if (PRVRANGEON) {
@@ -437,7 +437,7 @@ static int anim_set_efra_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- frame = CFRA;
+ frame = scene->r.cfra;
/* if Preview Range is defined, set the 'end' frame for that */
if (PRVRANGEON) {
diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c
index f8277cf6a85..88207f7d514 100644
--- a/source/blender/editors/animation/keyframes_edit.c
+++ b/source/blender/editors/animation/keyframes_edit.c
@@ -831,7 +831,7 @@ static short snap_bezier_cframe(KeyframeEditData *ked, BezTriple *bezt)
{
const Scene *scene = ked->scene;
if (bezt->f2 & SELECT) {
- bezt->vec[1][0] = (float)CFRA;
+ bezt->vec[1][0] = (float)scene->r.cfra;
}
return 0;
}
@@ -929,7 +929,7 @@ static short mirror_bezier_cframe(KeyframeEditData *ked, BezTriple *bezt)
const Scene *scene = ked->scene;
if (bezt->f2 & SELECT) {
- mirror_bezier_xaxis_ex(bezt, CFRA);
+ mirror_bezier_xaxis_ex(bezt, scene->r.cfra);
}
return 0;
diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c
index 30f500f9674..dd88752af14 100644
--- a/source/blender/editors/animation/keyframes_general.c
+++ b/source/blender/editors/animation/keyframes_general.c
@@ -921,7 +921,7 @@ short copy_animedit_keys(bAnimContext *ac, ListBase *anim_data)
}
/* in case 'relative' paste method is used */
- animcopy_cfra = CFRA;
+ animcopy_cfra = scene->r.cfra;
/* everything went fine */
return 0;
@@ -1245,13 +1245,13 @@ eKeyPasteError paste_animedit_keys(bAnimContext *ac,
/* methods of offset */
switch (offset_mode) {
case KEYFRAME_PASTE_OFFSET_CFRA_START:
- offset = (float)(CFRA - animcopy_firstframe);
+ offset = (float)(scene->r.cfra - animcopy_firstframe);
break;
case KEYFRAME_PASTE_OFFSET_CFRA_END:
- offset = (float)(CFRA - animcopy_lastframe);
+ offset = (float)(scene->r.cfra - animcopy_lastframe);
break;
case KEYFRAME_PASTE_OFFSET_CFRA_RELATIVE:
- offset = (float)(CFRA - animcopy_cfra);
+ offset = (float)(scene->r.cfra - animcopy_cfra);
break;
case KEYFRAME_PASTE_OFFSET_NONE:
offset = 0.0f;
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index aa99a4e50c3..2fa8907de71 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -1947,7 +1947,8 @@ static int insert_key_exec(bContext *C, wmOperator *op)
Object *obedit = CTX_data_edit_object(C);
bool ob_edit_mode = false;
- float cfra = (float)CFRA; /* XXX for now, don't bother about all the yucky offset crap */
+ float cfra = (float)
+ scene->r.cfra; /* XXX for now, don't bother about all the yucky offset crap */
int num_channels;
const bool confirm = op->flag & OP_IS_INVOKE;
@@ -2168,7 +2169,8 @@ static int delete_key_exec(bContext *C, wmOperator *op)
static int delete_key_using_keying_set(bContext *C, wmOperator *op, KeyingSet *ks)
{
Scene *scene = CTX_data_scene(C);
- float cfra = (float)CFRA; /* XXX for now, don't bother about all the yucky offset crap */
+ float cfra = (float)
+ scene->r.cfra; /* XXX for now, don't bother about all the yucky offset crap */
int num_channels;
const bool confirm = op->flag & OP_IS_INVOKE;
@@ -2344,7 +2346,7 @@ void ANIM_OT_keyframe_clear_v3d(wmOperatorType *ot)
static int delete_key_v3d_without_keying_set(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- float cfra = (float)CFRA;
+ float cfra = (float)scene->r.cfra;
int selected_objects_len = 0;
int selected_objects_success_len = 0;
@@ -2494,7 +2496,7 @@ static int insert_key_button_exec(bContext *C, wmOperator *op)
char *path;
uiBut *but;
const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(
- CTX_data_depsgraph_pointer(C), (float)CFRA);
+ CTX_data_depsgraph_pointer(C), (float)scene->r.cfra);
bool changed = false;
int index;
const bool all = RNA_boolean_get(op->ptr, "all");
@@ -2663,7 +2665,8 @@ static int delete_key_button_exec(bContext *C, wmOperator *op)
PropertyRNA *prop = NULL;
Main *bmain = CTX_data_main(C);
char *path;
- float cfra = (float)CFRA; /* XXX for now, don't bother about all the yucky offset crap */
+ float cfra = (float)
+ scene->r.cfra; /* XXX for now, don't bother about all the yucky offset crap */
bool changed = false;
int index;
const bool all = RNA_boolean_get(op->ptr, "all");
@@ -2835,7 +2838,7 @@ void ANIM_OT_keyframe_clear_button(wmOperatorType *ot)
bool autokeyframe_cfra_can_key(const Scene *scene, ID *id)
{
- float cfra = (float)CFRA; /* XXX for now, this will do */
+ float cfra = (float)scene->r.cfra; /* XXX for now, this will do */
/* only filter if auto-key mode requires this */
if (IS_AUTOKEY_ON(scene) == 0) {
@@ -3065,7 +3068,7 @@ bool ED_autokeyframe_object(bContext *C, Scene *scene, Object *ob, KeyingSet *ks
* 3) Free the extra info.
*/
ANIM_relative_keyingset_add_source(&dsources, &ob->id, NULL, NULL);
- ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA);
+ ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)scene->r.cfra);
BLI_freelistN(&dsources);
return true;
@@ -3085,7 +3088,7 @@ bool ED_autokeyframe_pchan(
* 3) Free the extra info.
*/
ANIM_relative_keyingset_add_source(&dsources, &ob->id, &RNA_PoseBone, pchan);
- ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA);
+ ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)scene->r.cfra);
BLI_freelistN(&dsources);
return true;
diff --git a/source/blender/editors/armature/pose_lib.c b/source/blender/editors/armature/pose_lib.c
index ea54c3014ca..b8e7c2624fd 100644
--- a/source/blender/editors/armature/pose_lib.c
+++ b/source/blender/editors/armature/pose_lib.c
@@ -448,7 +448,7 @@ static int poselib_add_menu_invoke(bContext *C, wmOperator *op, const wmEvent *U
ICON_NONE,
"POSELIB_OT_pose_add",
"frame",
- CFRA);
+ scene->r.cfra);
/* Replace existing - sub-menu. */
uiItemMenuF(
@@ -1113,7 +1113,7 @@ static void poselib_keytag_pose(bContext *C, Scene *scene, tPoseLib_PreviewData
/* perform actual auto-keying now */
if (autokey) {
/* insert keyframes for all relevant bones in one go */
- ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA);
+ ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)scene->r.cfra);
BLI_freelistN(&dsources);
}
diff --git a/source/blender/editors/armature/pose_lib_2.c b/source/blender/editors/armature/pose_lib_2.c
index 9ee289145c4..d866062cec0 100644
--- a/source/blender/editors/armature/pose_lib_2.c
+++ b/source/blender/editors/armature/pose_lib_2.c
@@ -134,7 +134,7 @@ static void poselib_keytag_pose(bContext *C, Scene *scene, PoseBlendData *pbd)
}
/* Perform actual auto-keying. */
- ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA);
+ ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)scene->r.cfra);
BLI_freelistN(&dsources);
/* send notifiers for this */
diff --git a/source/blender/editors/armature/pose_slide.c b/source/blender/editors/armature/pose_slide.c
index 0efa32ec63a..38c99c2ef60 100644
--- a/source/blender/editors/armature/pose_slide.c
+++ b/source/blender/editors/armature/pose_slide.c
@@ -2061,12 +2061,12 @@ static int pose_propagate_exec(bContext *C, wmOperator *op)
if (mode == POSE_PROPAGATE_SMART_HOLDS) {
/* We store in endFrame the end frame of the "long keyframe" (i.e. a held value) starting
* from the keyframe that occurs after the current frame. */
- modeData.end_frame = pose_propagate_get_boneHoldEndFrame(pfl, (float)CFRA);
+ modeData.end_frame = pose_propagate_get_boneHoldEndFrame(pfl, (float)scene->r.cfra);
}
/* Go through propagating pose to keyframes, curve by curve. */
for (ld = pfl->fcurves.first; ld; ld = ld->next) {
- pose_propagate_fcurve(op, pfl->ob, (FCurve *)ld->data, (float)CFRA, modeData);
+ pose_propagate_fcurve(op, pfl->ob, (FCurve *)ld->data, (float)scene->r.cfra, modeData);
}
}
diff --git a/source/blender/editors/armature/pose_transform.c b/source/blender/editors/armature/pose_transform.c
index f0b0218d7e0..cfc6b0b6b6e 100644
--- a/source/blender/editors/armature/pose_transform.c
+++ b/source/blender/editors/armature/pose_transform.c
@@ -1201,7 +1201,7 @@ static int pose_clear_transform_generic_exec(bContext *C,
KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, default_ksName);
/* insert keyframes */
- ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)CFRA);
+ ANIM_apply_keyingset(C, &dsources, NULL, ks, MODIFYKEY_MODE_INSERT, (float)scene->r.cfra);
/* now recalculate paths */
if (ob_iter->pose->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS) {
@@ -1343,8 +1343,8 @@ static int pose_clear_user_transforms_exec(bContext *C, wmOperator *op)
View3D *v3d = CTX_wm_view3d(C);
Scene *scene = CTX_data_scene(C);
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
- const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(depsgraph,
- (float)CFRA);
+ const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(
+ depsgraph, (float)scene->r.cfra);
const bool only_select = RNA_boolean_get(op->ptr, "only_selected");
FOREACH_OBJECT_IN_MODE_BEGIN (view_layer, v3d, OB_ARMATURE, OB_MODE_POSE, ob) {
diff --git a/source/blender/editors/gpencil/annotate_draw.c b/source/blender/editors/gpencil/annotate_draw.c
index f720f261ad5..ae09aea28d3 100644
--- a/source/blender/editors/gpencil/annotate_draw.c
+++ b/source/blender/editors/gpencil/annotate_draw.c
@@ -841,7 +841,8 @@ void ED_annotation_draw_2dimage(const bContext *C)
}
/* draw it! */
- annotation_draw_data_all(scene, gpd, offsx, offsy, sizex, sizey, CFRA, dflag, area->spacetype);
+ annotation_draw_data_all(
+ scene, gpd, offsx, offsy, sizex, sizey, scene->r.cfra, dflag, area->spacetype);
}
void ED_annotation_draw_view2d(const bContext *C, bool onlyv2d)
@@ -877,7 +878,7 @@ void ED_annotation_draw_view2d(const bContext *C, bool onlyv2d)
}
annotation_draw_data_all(
- scene, gpd, 0, 0, region->winx, region->winy, CFRA, dflag, area->spacetype);
+ scene, gpd, 0, 0, region->winx, region->winy, scene->r.cfra, dflag, area->spacetype);
}
void ED_annotation_draw_view3d(
@@ -928,7 +929,8 @@ void ED_annotation_draw_view3d(
}
/* draw it! */
- annotation_draw_data_all(scene, gpd, offsx, offsy, winx, winy, CFRA, dflag, v3d->spacetype);
+ annotation_draw_data_all(
+ scene, gpd, offsx, offsy, winx, winy, scene->r.cfra, dflag, v3d->spacetype);
}
void ED_annotation_draw_ex(
diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c
index 8c393cc4f3f..dd935e4f5f5 100644
--- a/source/blender/editors/gpencil/annotate_paint.c
+++ b/source/blender/editors/gpencil/annotate_paint.c
@@ -1568,7 +1568,7 @@ static void annotation_paint_initstroke(tGPsdata *p,
add_frame_mode = GP_GETFRAME_ADD_NEW;
}
- p->gpf = BKE_gpencil_layer_frame_get(p->gpl, CFRA, add_frame_mode);
+ p->gpf = BKE_gpencil_layer_frame_get(p->gpl, scene->r.cfra, add_frame_mode);
if (p->gpf == NULL) {
p->status = GP_STATUS_ERROR;
diff --git a/source/blender/editors/gpencil/editaction_gpencil.c b/source/blender/editors/gpencil/editaction_gpencil.c
index c7d0d9e0e35..8a98dcb57fc 100644
--- a/source/blender/editors/gpencil/editaction_gpencil.c
+++ b/source/blender/editors/gpencil/editaction_gpencil.c
@@ -371,7 +371,7 @@ bool ED_gpencil_anim_copybuf_copy(bAnimContext *ac)
}
/* in case 'relative' paste method is used */
- gpencil_anim_copy_cfra = CFRA;
+ gpencil_anim_copy_cfra = scene->r.cfra;
/* clean up */
ANIM_animdata_freelist(&anim_data);
@@ -403,13 +403,13 @@ bool ED_gpencil_anim_copybuf_paste(bAnimContext *ac, const short offset_mode)
/* methods of offset (eKeyPasteOffset) */
switch (offset_mode) {
case KEYFRAME_PASTE_OFFSET_CFRA_START:
- offset = (CFRA - gpencil_anim_copy_firstframe);
+ offset = (scene->r.cfra - gpencil_anim_copy_firstframe);
break;
case KEYFRAME_PASTE_OFFSET_CFRA_END:
- offset = (CFRA - gpencil_anim_copy_lastframe);
+ offset = (scene->r.cfra - gpencil_anim_copy_lastframe);
break;
case KEYFRAME_PASTE_OFFSET_CFRA_RELATIVE:
- offset = (CFRA - gpencil_anim_copy_cfra);
+ offset = (scene->r.cfra - gpencil_anim_copy_cfra);
break;
case KEYFRAME_PASTE_OFFSET_NONE:
offset = 0;
@@ -518,7 +518,7 @@ static bool gpencil_frame_snap_nearestsec(bGPDframe *gpf, Scene *scene)
static bool gpencil_frame_snap_cframe(bGPDframe *gpf, Scene *scene)
{
if (gpf->flag & GP_FRAME_SELECT) {
- gpf->framenum = (int)CFRA;
+ gpf->framenum = (int)scene->r.cfra;
}
return false;
}
@@ -560,8 +560,8 @@ static bool gpencil_frame_mirror_cframe(bGPDframe *gpf, Scene *scene)
int diff;
if (gpf->flag & GP_FRAME_SELECT) {
- diff = CFRA - gpf->framenum;
- gpf->framenum = CFRA + diff;
+ diff = scene->r.cfra - gpf->framenum;
+ gpf->framenum = scene->r.cfra + diff;
}
return false;
diff --git a/source/blender/editors/gpencil/gpencil_add_blank.c b/source/blender/editors/gpencil/gpencil_add_blank.c
index 2f22fad53e7..e8e6d328804 100644
--- a/source/blender/editors/gpencil/gpencil_add_blank.c
+++ b/source/blender/editors/gpencil/gpencil_add_blank.c
@@ -76,7 +76,7 @@ void ED_gpencil_create_blank(bContext *C, Object *ob, float UNUSED(mat[4][4]))
bGPDlayer *layer = BKE_gpencil_layer_addnew(gpd, "GP_Layer", true, false);
/* frames */
- BKE_gpencil_frame_addnew(layer, CFRA);
+ BKE_gpencil_frame_addnew(layer, scene->r.cfra);
/* update depsgraph */
DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
diff --git a/source/blender/editors/gpencil/gpencil_add_monkey.c b/source/blender/editors/gpencil/gpencil_add_monkey.c
index 65ee732f6a9..bc046e89d21 100644
--- a/source/blender/editors/gpencil/gpencil_add_monkey.c
+++ b/source/blender/editors/gpencil/gpencil_add_monkey.c
@@ -844,8 +844,8 @@ void ED_gpencil_create_monkey(bContext *C, Object *ob, float mat[4][4])
/* frames */
/* NOTE: No need to check for existing, as this will take care of it for us */
- bGPDframe *frameFills = BKE_gpencil_frame_addnew(Fills, CFRA);
- bGPDframe *frameLines = BKE_gpencil_frame_addnew(Lines, CFRA);
+ bGPDframe *frameFills = BKE_gpencil_frame_addnew(Fills, scene->r.cfra);
+ bGPDframe *frameLines = BKE_gpencil_frame_addnew(Lines, scene->r.cfra);
/* generate strokes */
gps = BKE_gpencil_stroke_add(frameFills, color_Skin, 270, 75, false);
diff --git a/source/blender/editors/gpencil/gpencil_add_stroke.c b/source/blender/editors/gpencil/gpencil_add_stroke.c
index bc5fe9b5cfb..e24964c4832 100644
--- a/source/blender/editors/gpencil/gpencil_add_stroke.c
+++ b/source/blender/editors/gpencil/gpencil_add_stroke.c
@@ -211,8 +211,8 @@ void ED_gpencil_create_stroke(bContext *C, Object *ob, float mat[4][4])
bGPDlayer *lines = BKE_gpencil_layer_addnew(gpd, "Lines", true, false);
/* frames */
- bGPDframe *frame_color = BKE_gpencil_frame_addnew(colors, CFRA);
- bGPDframe *frame_lines = BKE_gpencil_frame_addnew(lines, CFRA);
+ bGPDframe *frame_color = BKE_gpencil_frame_addnew(colors, scene->r.cfra);
+ bGPDframe *frame_lines = BKE_gpencil_frame_addnew(lines, scene->r.cfra);
UNUSED_VARS(frame_color);
/* generate stroke */
diff --git a/source/blender/editors/gpencil/gpencil_bake_animation.cc b/source/blender/editors/gpencil/gpencil_bake_animation.cc
index 66f53bea326..e480852a9bb 100644
--- a/source/blender/editors/gpencil/gpencil_bake_animation.cc
+++ b/source/blender/editors/gpencil/gpencil_bake_animation.cc
@@ -265,7 +265,7 @@ static int gpencil_bake_grease_pencil_animation_exec(bContext *C, wmOperator *op
}
/* Move scene to new frame. */
- CFRA = i;
+ scene->r.cfra = i;
BKE_scene_graph_update_for_newframe(depsgraph);
/* Loop all objects in the list. */
@@ -285,7 +285,7 @@ static int gpencil_bake_grease_pencil_animation_exec(bContext *C, wmOperator *op
/* Apply time modifier. */
int remap_cfra = BKE_gpencil_time_modifier_cfra(
- depsgraph, scene, elem->ob, gpl_src, CFRA, false);
+ depsgraph, scene, elem->ob, gpl_src, scene->r.cfra, false);
/* Duplicate frame. */
bGPDframe *gpf_src = BKE_gpencil_layer_frame_get(
gpl_src, remap_cfra, GP_GETFRAME_USE_PREV);
@@ -293,7 +293,7 @@ static int gpencil_bake_grease_pencil_animation_exec(bContext *C, wmOperator *op
continue;
}
bGPDframe *gpf_dst = BKE_gpencil_frame_duplicate(gpf_src, true);
- gpf_dst->framenum = CFRA + frame_offset;
+ gpf_dst->framenum = scene->r.cfra + frame_offset;
gpf_dst->flag &= ~GP_FRAME_SELECT;
BLI_addtail(&gpl_dst->frames, gpf_dst);
@@ -337,7 +337,7 @@ static int gpencil_bake_grease_pencil_animation_exec(bContext *C, wmOperator *op
}
}
/* Return scene frame state and DB to original state. */
- CFRA = oldframe;
+ scene->r.cfra = oldframe;
BKE_scene_graph_update_for_newframe(depsgraph);
/* Free memory. */
diff --git a/source/blender/editors/gpencil/gpencil_convert.c b/source/blender/editors/gpencil/gpencil_convert.c
index 0601d009bf7..25b5466e260 100644
--- a/source/blender/editors/gpencil/gpencil_convert.c
+++ b/source/blender/editors/gpencil/gpencil_convert.c
@@ -1271,7 +1271,7 @@ static void gpencil_layer_to_curve(bContext *C,
Collection *collection = CTX_data_collection(C);
Scene *scene = CTX_data_scene(C);
- bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_USE_PREV);
+ bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, GP_GETFRAME_USE_PREV);
bGPDstroke *prev_gps = NULL;
Object *ob;
Curve *cu;
@@ -1414,7 +1414,7 @@ static bool gpencil_convert_check_has_valid_timing(bContext *C, bGPDlayer *gpl,
int i;
bool valid = true;
- if (!gpl || !(gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_USE_PREV)) ||
+ if (!gpl || !(gpf = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, GP_GETFRAME_USE_PREV)) ||
!(gps = gpf->strokes.first)) {
return false;
}
@@ -1481,7 +1481,7 @@ static bool gpencil_convert_poll(bContext *C)
* and if we are not in edit mode!
*/
return ((area && area->spacetype == SPACE_VIEW3D) && (gpl = BKE_gpencil_layer_active_get(gpd)) &&
- (gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_USE_PREV)) &&
+ (gpf = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, GP_GETFRAME_USE_PREV)) &&
(gpf->strokes.first) && (!GPENCIL_ANY_EDIT_MODE(gpd)));
}
@@ -1811,7 +1811,7 @@ static int image_to_gpencil_exec(bContext *C, wmOperator *op)
/* Add layer and frame. */
bGPdata *gpd = (bGPdata *)ob->data;
bGPDlayer *gpl = BKE_gpencil_layer_addnew(gpd, "Image Layer", true, false);
- bGPDframe *gpf = BKE_gpencil_frame_addnew(gpl, CFRA);
+ bGPDframe *gpf = BKE_gpencil_frame_addnew(gpl, scene->r.cfra);
done = BKE_gpencil_from_image(sima, gpd, gpf, size, is_mask);
if (done) {
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index 6843c42d2d0..b7ac73b9692 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -226,7 +226,7 @@ static int gpencil_layer_add_exec(bContext *C, wmOperator *op)
bGPDlayer *gpl = BKE_gpencil_layer_addnew(gpd, DATA_("GP_Layer"), true, false);
/* Add a new frame to make it visible in Dopesheet. */
if (gpl != NULL) {
- gpl->actframe = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_ADD_NEW);
+ gpl->actframe = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, GP_GETFRAME_ADD_NEW);
}
}
}
@@ -646,12 +646,12 @@ static int gpencil_frame_duplicate_exec(bContext *C, wmOperator *op)
}
if (mode == 0) {
- BKE_gpencil_frame_addcopy(gpl_active, CFRA);
+ BKE_gpencil_frame_addcopy(gpl_active, scene->r.cfra);
}
else {
LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
if ((gpl->flag & GP_LAYER_LOCKED) == 0) {
- BKE_gpencil_frame_addcopy(gpl, CFRA);
+ BKE_gpencil_frame_addcopy(gpl, scene->r.cfra);
}
}
}
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 5028baf1589..06f3c169fa9 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -1718,7 +1718,7 @@ static int gpencil_strokes_paste_exec(bContext *C, wmOperator *op)
* we are obliged to add a new frame if one
* doesn't exist already
*/
- gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_ADD_NEW);
+ gpf = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, GP_GETFRAME_ADD_NEW);
if (gpf) {
/* Create new stroke */
bGPDstroke *new_stroke = BKE_gpencil_stroke_duplicate(gps, true, true);
@@ -1971,7 +1971,7 @@ static int gpencil_blank_frame_add_exec(bContext *C, wmOperator *op)
{
bGPdata *gpd = ED_gpencil_data_get_active(C);
Scene *scene = CTX_data_scene(C);
- int cfra = CFRA;
+ int cfra = scene->r.cfra;
bGPDlayer *active_gpl = BKE_gpencil_layer_active_get(gpd);
@@ -2075,7 +2075,7 @@ static int gpencil_actframe_delete_exec(bContext *C, wmOperator *op)
Scene *scene = CTX_data_scene(C);
- bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_USE_PREV);
+ bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, GP_GETFRAME_USE_PREV);
/* if there's no existing Grease-Pencil data there, add some */
if (gpd == NULL) {
@@ -2150,7 +2150,7 @@ static int gpencil_actframe_delete_all_exec(bContext *C, wmOperator *op)
CTX_DATA_BEGIN (C, bGPDlayer *, gpl, editable_gpencil_layers) {
/* try to get the "active" frame - but only if it actually occurs on this frame */
- bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_USE_PREV);
+ bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, GP_GETFRAME_USE_PREV);
if (gpf == NULL) {
continue;
@@ -3818,7 +3818,7 @@ static int gpencil_strokes_reproject_exec(bContext *C, wmOperator *op)
/* update frame to get the new location of objects */
if ((mode == GP_REPROJECT_SURFACE) && (cfra_prv != gpf->framenum)) {
cfra_prv = gpf->framenum;
- CFRA = gpf->framenum;
+ scene->r.cfra = gpf->framenum;
BKE_scene_graph_update_for_newframe(depsgraph);
}
@@ -3846,7 +3846,7 @@ static int gpencil_strokes_reproject_exec(bContext *C, wmOperator *op)
CTX_DATA_END;
/* return frame state and DB to original state */
- CFRA = oldframe;
+ scene->r.cfra = oldframe;
BKE_scene_graph_update_for_newframe(depsgraph);
if (sctx != NULL) {
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index 3f06dbfdbb3..5305c764b3a 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -1748,7 +1748,7 @@ static tGPDfill *gpencil_session_init_fill(bContext *C, wmOperator *op)
tgpf->v3d = tgpf->area->spacedata.first;
tgpf->depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
tgpf->win = CTX_wm_window(C);
- tgpf->active_cfra = CFRA;
+ tgpf->active_cfra = scene->r.cfra;
tgpf->reports = op->reports;
/* Setup space conversions. */
@@ -2222,8 +2222,8 @@ static int gpencil_fill_modal(bContext *C, wmOperator *op, const wmEvent *event)
/* Hash of selected frames. */
GHash *frame_list = BLI_ghash_int_new_ex(__func__, 64);
- /* If not multi-frame and there is no frame in CFRA for the active layer, create
- * a new frame. */
+ /* If not multi-frame and there is no frame in scene->r.cfra for the active layer,
+ * create a new frame. */
if (!is_multiedit) {
tgpf->gpf = BKE_gpencil_layer_frame_get(
tgpf->gpl,
diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c
index 0039dbae674..e7a4f2fe2dc 100644
--- a/source/blender/editors/gpencil/gpencil_interpolate.c
+++ b/source/blender/editors/gpencil/gpencil_interpolate.c
@@ -483,10 +483,10 @@ static void gpencil_interpolate_set_points(bContext *C, tGPDinterpolate *tgpi)
tgpil = MEM_callocN(sizeof(tGPDinterpolate_layer), "GPencil Interpolate Layer");
tgpil->gpl = gpl;
- bGPDframe *gpf = gpencil_get_previous_keyframe(gpl, CFRA);
+ bGPDframe *gpf = gpencil_get_previous_keyframe(gpl, scene->r.cfra);
tgpil->prevFrame = BKE_gpencil_frame_duplicate(gpf, true);
- gpf = gpencil_get_next_keyframe(gpl, CFRA);
+ gpf = gpencil_get_next_keyframe(gpl, scene->r.cfra);
tgpil->nextFrame = BKE_gpencil_frame_duplicate(gpf, true);
BLI_addtail(&tgpi->ilayers, tgpil);
@@ -750,7 +750,7 @@ static int gpencil_interpolate_invoke(bContext *C, wmOperator *op, const wmEvent
tGPDinterpolate *tgpi = NULL;
/* Cannot interpolate if not between 2 frames. */
- int cfra = CFRA;
+ int cfra = scene->r.cfra;
bGPDframe *gpf_prv = gpencil_get_previous_keyframe(gpl, cfra);
bGPDframe *gpf_next = gpencil_get_next_keyframe(gpl, cfra);
if (ELEM(NULL, gpf_prv, gpf_next)) {
@@ -1221,7 +1221,7 @@ static int gpencil_interpolate_seq_exec(bContext *C, wmOperator *op)
GP_SpaceConversion gsc;
gpencil_point_conversion_init(C, &gsc);
- int cfra = CFRA;
+ int cfra = scene->r.cfra;
GP_Interpolate_Settings *ipo_settings = &ts->gp_interpolate;
const int step = RNA_int_get(op->ptr, "step");
diff --git a/source/blender/editors/gpencil/gpencil_merge.c b/source/blender/editors/gpencil/gpencil_merge.c
index 06343dcad43..8ff3f20cef3 100644
--- a/source/blender/editors/gpencil/gpencil_merge.c
+++ b/source/blender/editors/gpencil/gpencil_merge.c
@@ -113,7 +113,7 @@ static bGPDstroke *gpencil_prepare_stroke(bContext *C, wmOperator *op, int totpo
else {
add_frame_mode = GP_GETFRAME_ADD_NEW;
}
- bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, add_frame_mode);
+ bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, add_frame_mode);
/* stroke */
bGPDstroke *gps = BKE_gpencil_stroke_new(MAX2(ob->actcol - 1, 0), totpoints, brush->size);
diff --git a/source/blender/editors/gpencil/gpencil_mesh.cc b/source/blender/editors/gpencil/gpencil_mesh.cc
index aee00d4ede3..b27e1c75746 100644
--- a/source/blender/editors/gpencil/gpencil_mesh.cc
+++ b/source/blender/editors/gpencil/gpencil_mesh.cc
@@ -283,7 +283,7 @@ static int gpencil_bake_mesh_animation_exec(bContext *C, wmOperator *op)
}
/* Move scene to new frame. */
- CFRA = i;
+ scene->r.cfra = i;
BKE_scene_graph_update_for_newframe(depsgraph);
/* Loop all objects in the list. */
@@ -325,7 +325,7 @@ static int gpencil_bake_mesh_animation_exec(bContext *C, wmOperator *op)
}
/* Return scene frame state and DB to original state. */
- CFRA = oldframe;
+ scene->r.cfra = oldframe;
BKE_scene_graph_update_for_newframe(depsgraph);
/* Remove unused materials. */
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 7c7f532f087..70486138556 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -2166,7 +2166,7 @@ static void gpencil_paint_initstroke(tGPsdata *p,
if (gpl->actframe && gpl->actframe->strokes.first) {
if (ts->gpencil_flags & GP_TOOL_FLAG_RETAIN_LAST) {
short frame_mode = IS_AUTOKEY_ON(scene) ? GP_GETFRAME_ADD_COPY : GP_GETFRAME_USE_PREV;
- gpl->actframe = BKE_gpencil_layer_frame_get(gpl, CFRA, frame_mode);
+ gpl->actframe = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, frame_mode);
}
has_layer_to_erase = true;
break;
@@ -2204,7 +2204,7 @@ static void gpencil_paint_initstroke(tGPsdata *p,
bool need_tag = p->gpl->actframe == NULL;
bGPDframe *actframe = p->gpl->actframe;
- p->gpf = BKE_gpencil_layer_frame_get(p->gpl, CFRA, add_frame_mode);
+ p->gpf = BKE_gpencil_layer_frame_get(p->gpl, scene->r.cfra, add_frame_mode);
/* Only if there wasn't an active frame, need update. */
if (need_tag) {
DEG_id_tag_update(&p->gpd->id, ID_RECALC_GEOMETRY);
diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c
index b57b8145749..befff611d58 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -292,7 +292,7 @@ static void gpencil_primitive_set_initdata(bContext *C, tGPDprimitive *tgpi)
Scene *scene = CTX_data_scene(C);
ToolSettings *ts = scene->toolsettings;
Brush *brush = tgpi->brush;
- int cfra = CFRA;
+ int cfra = scene->r.cfra;
bGPDlayer *gpl = CTX_data_active_gpencil_layer(C);
@@ -1195,7 +1195,7 @@ static void gpencil_primitive_init(bContext *C, wmOperator *op)
tgpi->orign_type = RNA_enum_get(op->ptr, "type");
/* set current frame number */
- tgpi->cframe = CFRA;
+ tgpi->cframe = scene->r.cfra;
/* set GP datablock */
tgpi->gpd = gpd;
diff --git a/source/blender/editors/gpencil/gpencil_sculpt_paint.c b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
index f25d5937ac4..b68240362c5 100644
--- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c
+++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
@@ -1013,7 +1013,7 @@ static void gpencil_brush_clone_add(bContext *C, tGP_BrushEditData *gso)
gpl = CTX_data_active_gpencil_layer(C);
}
bGPDframe *gpf = BKE_gpencil_layer_frame_get(
- gpl, CFRA, IS_AUTOKEY_ON(scene) ? GP_GETFRAME_ADD_NEW : GP_GETFRAME_USE_PREV);
+ gpl, scene->r.cfra, IS_AUTOKEY_ON(scene) ? GP_GETFRAME_ADD_NEW : GP_GETFRAME_USE_PREV);
if (gpf == NULL) {
continue;
}
@@ -1336,7 +1336,7 @@ static void gpencil_sculpt_brush_init_stroke(bContext *C, tGP_BrushEditData *gso
bGPdata *gpd = gso->gpd;
Scene *scene = gso->scene;
- int cfra = CFRA;
+ int cfra = scene->r.cfra;
/* only try to add a new frame if this is the first stroke, or the frame has changed */
if ((gpd == NULL) || (cfra == gso->cfra)) {
diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c
index e903d11a1e0..a19265720e8 100644
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@ -759,7 +759,7 @@ static bool gpencil_select_same_layer(bContext *C)
bool changed = false;
CTX_DATA_BEGIN (C, bGPDlayer *, gpl, editable_gpencil_layers) {
- bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_USE_PREV);
+ bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, GP_GETFRAME_USE_PREV);
bGPDstroke *gps;
bool found = false;
diff --git a/source/blender/editors/io/io_alembic.c b/source/blender/editors/io/io_alembic.c
index 0e8e0f83597..0068586730f 100644
--- a/source/blender/editors/io/io_alembic.c
+++ b/source/blender/editors/io/io_alembic.c
@@ -144,10 +144,10 @@ static int wm_alembic_export_exec(bContext *C, wmOperator *op)
/* Take some defaults from the scene, if not specified explicitly. */
Scene *scene = CTX_data_scene(C);
if (params.frame_start == INT_MIN) {
- params.frame_start = SFRA;
+ params.frame_start = scene->r.sfra;
}
if (params.frame_end == INT_MIN) {
- params.frame_end = EFRA;
+ params.frame_end = scene->r.efra;
}
const bool as_background_job = RNA_boolean_get(op->ptr, "as_background_job");
@@ -248,8 +248,8 @@ static void wm_alembic_export_draw(bContext *C, wmOperator *op)
Scene *scene = CTX_data_scene(C);
if (scene != NULL && RNA_boolean_get(op->ptr, "init_scene_frame_range")) {
- RNA_int_set(op->ptr, "start", SFRA);
- RNA_int_set(op->ptr, "end", EFRA);
+ RNA_int_set(op->ptr, "start", scene->r.sfra);
+ RNA_int_set(op->ptr, "end", scene->r.efra);
RNA_boolean_set(op->ptr, "init_scene_frame_range", false);
}
diff --git a/source/blender/editors/io/io_gpencil_export.c b/source/blender/editors/io/io_gpencil_export.c
index 6e5ae9f3cba..3f905dd7de0 100644
--- a/source/blender/editors/io/io_gpencil_export.c
+++ b/source/blender/editors/io/io_gpencil_export.c
@@ -153,9 +153,9 @@ static int wm_gpencil_export_svg_exec(bContext *C, wmOperator *op)
.v3d = v3d,
.ob = ob,
.mode = GP_EXPORT_TO_SVG,
- .frame_start = CFRA,
- .frame_end = CFRA,
- .frame_cur = CFRA,
+ .frame_start = scene->r.cfra,
+ .frame_end = scene->r.cfra,
+ .frame_cur = scene->r.cfra,
.flag = flag,
.scale = 1.0f,
.select_mode = select_mode,
@@ -306,9 +306,9 @@ static int wm_gpencil_export_pdf_exec(bContext *C, wmOperator *op)
.v3d = v3d,
.ob = ob,
.mode = GP_EXPORT_TO_PDF,
- .frame_start = SFRA,
- .frame_end = EFRA,
- .frame_cur = CFRA,
+ .frame_start = scene->r.sfra,
+ .frame_end = scene->r.efra,
+ .frame_cur = scene->r.cfra,
.flag = flag,
.scale = 1.0f,
.select_mode = select_mode,
diff --git a/source/blender/editors/io/io_gpencil_import.c b/source/blender/editors/io/io_gpencil_import.c
index 45f5441616f..9ac64407dcf 100644
--- a/source/blender/editors/io/io_gpencil_import.c
+++ b/source/blender/editors/io/io_gpencil_import.c
@@ -90,9 +90,9 @@ static int wm_gpencil_import_svg_exec(bContext *C, wmOperator *op)
.v3d = v3d,
.ob = NULL,
.mode = GP_IMPORT_FROM_SVG,
- .frame_start = CFRA,
- .frame_end = CFRA,
- .frame_cur = CFRA,
+ .frame_start = scene->r.cfra,
+ .frame_end = scene->r.cfra,
+ .frame_cur = scene->r.cfra,
.flag = flag,
.scale = scale,
.select_mode = 0,
diff --git a/source/blender/editors/io/io_obj.c b/source/blender/editors/io/io_obj.c
index 53fa4788d0e..79ec7ebf2a5 100644
--- a/source/blender/editors/io/io_obj.c
+++ b/source/blender/editors/io/io_obj.c
@@ -208,11 +208,11 @@ static bool wm_obj_export_check(bContext *C, wmOperator *op)
int end = RNA_int_get(op->ptr, "end_frame");
/* Set the defaults. */
if (start == INT_MIN) {
- start = SFRA;
+ start = scene->r.sfra;
changed = true;
}
if (end == INT_MAX) {
- end = EFRA;
+ end = scene->r.efra;
changed = true;
}
/* Fix user errors. */
@@ -266,7 +266,7 @@ void WM_OT_obj_export(struct wmOperatorType *ot)
"Export multiple frames instead of the current frame only");
RNA_def_int(ot->srna,
"start_frame",
- INT_MIN, /* wm_obj_export_check uses this to set SFRA. */
+ INT_MIN, /* wm_obj_export_check uses this to set scene->r.sfra. */
INT_MIN,
INT_MAX,
"Start Frame",
@@ -275,7 +275,7 @@ void WM_OT_obj_export(struct wmOperatorType *ot)
INT_MAX);
RNA_def_int(ot->srna,
"end_frame",
- INT_MAX, /* wm_obj_export_check uses this to set EFRA. */
+ INT_MAX, /* wm_obj_export_check uses this to set scene->r.efra. */
INT_MIN,
INT_MAX,
"End Frame",
diff --git a/source/blender/editors/mask/mask_add.c b/source/blender/editors/mask/mask_add.c
index 7ac326cb00c..df30870007f 100644
--- a/source/blender/editors/mask/mask_add.c
+++ b/source/blender/editors/mask/mask_add.c
@@ -258,7 +258,7 @@ static bool add_vertex_subdivide(const bContext *C, Mask *mask, const float co[2
&u,
NULL)) {
Scene *scene = CTX_data_scene(C);
- const float ctime = CFRA;
+ const float ctime = scene->r.cfra;
MaskSplinePoint *new_point;
int point_index = point - spline->points;
@@ -295,7 +295,7 @@ static bool add_vertex_extrude(const bContext *C,
const float co[2])
{
Scene *scene = CTX_data_scene(C);
- const float ctime = CFRA;
+ const float ctime = scene->r.cfra;
MaskSpline *spline;
MaskSplinePoint *point;
@@ -394,7 +394,7 @@ static bool add_vertex_extrude(const bContext *C,
static bool add_vertex_new(const bContext *C, Mask *mask, MaskLayer *mask_layer, const float co[2])
{
Scene *scene = CTX_data_scene(C);
- const float ctime = CFRA;
+ const float ctime = scene->r.cfra;
MaskSpline *spline;
MaskSplinePoint *new_point = NULL, *ref_point = NULL;
diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c
index 4662fe9d1a8..4c01154ba49 100644
--- a/source/blender/editors/mask/mask_draw.c
+++ b/source/blender/editors/mask/mask_draw.c
@@ -802,7 +802,7 @@ void ED_mask_draw_frames(
mask_layer_shape = mask_layer_shape->next) {
int frame = mask_layer_shape->frame;
- // draw_keyframe(i, CFRA, sfra, framelen, 1);
+ // draw_keyframe(i, scene->r.cfra, sfra, framelen, 1);
int height = (frame == cfra) ? 22 : 10;
int x = (frame - sfra) * framelen;
immVertex2i(pos, x, region_bottom);
diff --git a/source/blender/editors/mask/mask_editaction.c b/source/blender/editors/mask/mask_editaction.c
index 8a23a53a5d2..9819532224e 100644
--- a/source/blender/editors/mask/mask_editaction.c
+++ b/source/blender/editors/mask/mask_editaction.c
@@ -304,7 +304,7 @@ static bool snap_mask_layer_nearestsec(MaskLayerShape *mask_layer_shape, Scene *
static bool snap_mask_layer_cframe(MaskLayerShape *mask_layer_shape, Scene *scene)
{
if (mask_layer_shape->flag & MASK_SHAPE_SELECT) {
- mask_layer_shape->frame = (int)CFRA;
+ mask_layer_shape->frame = (int)scene->r.cfra;
}
return false;
}
diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c
index 14976d860f6..d34b274c111 100644
--- a/source/blender/editors/mask/mask_ops.c
+++ b/source/blender/editors/mask/mask_ops.c
@@ -856,7 +856,7 @@ static int slide_point_modal(bContext *C, wmOperator *op, const wmEvent *event)
/* Don't key sliding feather UW's. */
if ((data->action == SLIDE_ACTION_FEATHER && data->uw) == false) {
if (IS_AUTOKEY_ON(scene)) {
- ED_mask_layer_shape_auto_key(data->mask_layer, CFRA);
+ ED_mask_layer_shape_auto_key(data->mask_layer, scene->r.cfra);
}
}
@@ -1262,7 +1262,7 @@ static int slide_spline_curvature_modal(bContext *C, wmOperator *op, const wmEve
if (event->type == slide_data->event_invoke_type && event->val == KM_RELEASE) {
/* Don't key sliding feather UW's. */
if (IS_AUTOKEY_ON(scene)) {
- ED_mask_layer_shape_auto_key(slide_data->mask_layer, CFRA);
+ ED_mask_layer_shape_auto_key(slide_data->mask_layer, scene->r.cfra);
}
WM_event_add_notifier(C, NC_MASK | NA_EDITED, slide_data->mask);
@@ -1525,7 +1525,7 @@ static int mask_switch_direction_exec(bContext *C, wmOperator *UNUSED(op))
if (changed_layer) {
if (IS_AUTOKEY_ON(scene)) {
- ED_mask_layer_shape_auto_key(mask_layer, CFRA);
+ ED_mask_layer_shape_auto_key(mask_layer, scene->r.cfra);
}
}
}
@@ -1587,7 +1587,7 @@ static int mask_normals_make_consistent_exec(bContext *C, wmOperator *UNUSED(op)
if (changed_layer) {
if (IS_AUTOKEY_ON(scene)) {
- ED_mask_layer_shape_auto_key(mask_layer, CFRA);
+ ED_mask_layer_shape_auto_key(mask_layer, scene->r.cfra);
}
}
}
diff --git a/source/blender/editors/mask/mask_shapekey.c b/source/blender/editors/mask/mask_shapekey.c
index 55145f27012..48944c081a8 100644
--- a/source/blender/editors/mask/mask_shapekey.c
+++ b/source/blender/editors/mask/mask_shapekey.c
@@ -33,7 +33,7 @@
static int mask_shape_key_insert_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
- const int frame = CFRA;
+ const int frame = scene->r.cfra;
Mask *mask = CTX_data_edit_mask(C);
bool changed = false;
@@ -76,7 +76,7 @@ void MASK_OT_shape_key_insert(wmOperatorType *ot)
static int mask_shape_key_clear_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
- const int frame = CFRA;
+ const int frame = scene->r.cfra;
Mask *mask = CTX_data_edit_mask(C);
bool changed = false;
@@ -122,7 +122,7 @@ void MASK_OT_shape_key_clear(wmOperatorType *ot)
static int mask_shape_key_feather_reset_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
- const int frame = CFRA;
+ const int frame = scene->r.cfra;
Mask *mask = CTX_data_edit_mask(C);
bool changed = false;
@@ -214,7 +214,7 @@ void MASK_OT_shape_key_feather_reset(wmOperatorType *ot)
static int mask_shape_key_rekey_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- const int frame = CFRA;
+ const int frame = scene->r.cfra;
Mask *mask = CTX_data_edit_mask(C);
bool changed = false;
diff --git a/source/blender/editors/object/object_add.cc b/source/blender/editors/object/object_add.cc
index 041a1383b28..41aaede8d6f 100644
--- a/source/blender/editors/object/object_add.cc
+++ b/source/blender/editors/object/object_add.cc
@@ -1984,7 +1984,7 @@ static int object_speaker_add_exec(bContext *C, wmOperator *op)
AnimData *adt = BKE_animdata_ensure_id(&ob->id);
NlaTrack *nlt = BKE_nlatrack_add(adt, nullptr, is_liboverride);
NlaStrip *strip = BKE_nla_add_soundstrip(bmain, scene, static_cast<Speaker *>(ob->data));
- strip->start = CFRA;
+ strip->start = scene->r.cfra;
strip->end += strip->start;
/* hook them up */
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 0e03feba340..64d5ee91215 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -1512,7 +1512,7 @@ static void PE_update_selection(Depsgraph *depsgraph, Scene *scene, Object *ob,
}
}
- psys_cache_edit_paths(depsgraph, scene, ob, edit, CFRA, G.is_rendering);
+ psys_cache_edit_paths(depsgraph, scene, ob, edit, scene->r.cfra, G.is_rendering);
/* disable update flag */
LOOP_POINTS {
@@ -1647,11 +1647,11 @@ void PE_update_object(Depsgraph *depsgraph, Scene *scene, Object *ob, int usefla
* and flagging with PEK_HIDE will prevent selection. This might get restored once this is
* supported in drawing (but doesn't make much sense for hair anyways). */
if (edit->psys && edit->psys->part->type == PART_EMITTER) {
- PE_hide_keys_time(scene, edit, CFRA);
+ PE_hide_keys_time(scene, edit, scene->r.cfra);
}
/* regenerate path caches */
- psys_cache_edit_paths(depsgraph, scene, ob, edit, CFRA, G.is_rendering);
+ psys_cache_edit_paths(depsgraph, scene, ob, edit, scene->r.cfra, G.is_rendering);
/* disable update flag */
LOOP_POINTS {
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index 96195bdcc2e..80de8fae072 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -256,8 +256,8 @@ static void fluid_bake_sequence(FluidJob *job)
frame = is_first_frame ? fds->cache_frame_start : (*pause_frame);
/* Save orig frame and update scene frame. */
- orig_frame = CFRA;
- CFRA = frame;
+ orig_frame = scene->r.cfra;
+ scene->r.cfra = frame;
/* Loop through selected frames. */
for (; frame <= fds->cache_frame_end; frame++) {
@@ -280,7 +280,7 @@ static void fluid_bake_sequence(FluidJob *job)
*(job->progress) = progress;
}
- CFRA = frame;
+ scene->r.cfra = frame;
/* Update animation system. */
ED_update_for_newframe(job->bmain, job->depsgraph);
@@ -293,7 +293,7 @@ static void fluid_bake_sequence(FluidJob *job)
}
/* Restore frame position that we were on before bake. */
- CFRA = orig_frame;
+ scene->r.cfra = orig_frame;
}
static void fluid_bake_endjob(void *customdata)
diff --git a/source/blender/editors/render/render_opengl.cc b/source/blender/editors/render/render_opengl.cc
index d907a52543c..7bd9812a178 100644
--- a/source/blender/editors/render/render_opengl.cc
+++ b/source/blender/editors/render/render_opengl.cc
@@ -494,7 +494,8 @@ static void screen_opengl_render_apply(const bContext *C, OGLRender *oglrender)
for (view_id = 0; view_id < oglrender->views_len; view_id++) {
context.view_id = view_id;
context.gpu_offscreen = oglrender->ofs;
- oglrender->seq_data.ibufs_arr[view_id] = SEQ_render_give_ibuf(&context, CFRA, chanshown);
+ oglrender->seq_data.ibufs_arr[view_id] = SEQ_render_give_ibuf(
+ &context, scene->r.cfra, chanshown);
}
}
@@ -1136,12 +1137,12 @@ static bool screen_opengl_render_anim_step(bContext *C, wmOperator *op)
RenderResult *rr;
/* go to next frame */
- if (CFRA < oglrender->nfra) {
- CFRA++;
+ if (scene->r.cfra < oglrender->nfra) {
+ scene->r.cfra++;
}
- while (CFRA < oglrender->nfra) {
+ while (scene->r.cfra < oglrender->nfra) {
BKE_scene_graph_update_for_newframe(depsgraph);
- CFRA++;
+ scene->r.cfra++;
}
is_movie = BKE_imtype_is_movie(scene->r.im_format.imtype);
@@ -1184,7 +1185,7 @@ static bool screen_opengl_render_anim_step(bContext *C, wmOperator *op)
}
if (oglrender->render_frames == nullptr ||
- BLI_BITMAP_TEST_BOOL(oglrender->render_frames, CFRA - PSFRA)) {
+ BLI_BITMAP_TEST_BOOL(oglrender->render_frames, scene->r.cfra - PSFRA)) {
/* render into offscreen buffer */
screen_opengl_render_apply(C, oglrender);
}
@@ -1204,7 +1205,7 @@ finally: /* Step the frame and bail early if needed */
oglrender->nfra += scene->r.frame_step;
/* stop at the end or on error */
- if (CFRA >= PEFRA || !ok) {
+ if (scene->r.cfra >= PEFRA || !ok) {
screen_opengl_render_end(C, static_cast<OGLRender *>(op->customdata));
return false;
}
diff --git a/source/blender/editors/render/render_preview.cc b/source/blender/editors/render/render_preview.cc
index addcedc4481..97bbcaa102f 100644
--- a/source/blender/editors/render/render_preview.cc
+++ b/source/blender/editors/render/render_preview.cc
@@ -805,7 +805,7 @@ static Scene *object_preview_scene_create(const struct ObjectPreviewData *previe
Scene *scene = BKE_scene_add(preview_data->pr_main, "Object preview scene");
/* Preview need to be in the current frame to get a thumbnail similar of what
* viewport displays. */
- CFRA = preview_data->cfra;
+ scene->r.cfra = preview_data->cfra;
ViewLayer *view_layer = static_cast<ViewLayer *>(scene->view_layers.first);
Depsgraph *depsgraph = DEG_graph_new(
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index d35bd5ab2fe..c616ca2b5eb 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -2951,9 +2951,9 @@ static int frame_offset_exec(bContext *C, wmOperator *op)
int delta = RNA_int_get(op->ptr, "delta");
- CFRA += delta;
- FRAMENUMBER_MIN_CLAMP(CFRA);
- SUBFRA = 0.0f;
+ scene->r.cfra += delta;
+ FRAMENUMBER_MIN_CLAMP(scene->r.cfra);
+ scene->r.subframe = 0.0f;
areas_do_frame_follow(C, false);
@@ -2992,7 +2992,7 @@ static int frame_jump_exec(bContext *C, wmOperator *op)
Scene *scene = CTX_data_scene(C);
wmTimer *animtimer = CTX_wm_screen(C)->animtimer;
- /* Don't change CFRA directly if animtimer is running as this can cause
+ /* Don't change scene->r.cfra directly if animtimer is running as this can cause
* first/last frame not to be actually shown (bad since for example physics
* simulations aren't reset properly).
*/
@@ -3010,10 +3010,10 @@ static int frame_jump_exec(bContext *C, wmOperator *op)
}
else {
if (RNA_boolean_get(op->ptr, "end")) {
- CFRA = PEFRA;
+ scene->r.cfra = PEFRA;
}
else {
- CFRA = PSFRA;
+ scene->r.cfra = PSFRA;
}
areas_do_frame_follow(C, true);
@@ -3062,7 +3062,7 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- float cfra = (float)(CFRA);
+ float cfra = (float)(scene->r.cfra);
/* Initialize binary-tree-list for getting keyframes. */
struct AnimKeylist *keylist = ED_keylist_create();
@@ -3104,9 +3104,9 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op)
}
while ((ak != NULL) && (done == false)) {
- if (CFRA != (int)ak->cfra) {
+ if (scene->r.cfra != (int)ak->cfra) {
/* this changes the frame, so set the frame and we're done */
- CFRA = (int)ak->cfra;
+ scene->r.cfra = (int)ak->cfra;
done = true;
}
else {
@@ -3165,20 +3165,20 @@ static void SCREEN_OT_keyframe_jump(wmOperatorType *ot)
static int marker_jump_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- int closest = CFRA;
+ int closest = scene->r.cfra;
const bool next = RNA_boolean_get(op->ptr, "next");
bool found = false;
/* find matching marker in the right direction */
LISTBASE_FOREACH (TimeMarker *, marker, &scene->markers) {
if (next) {
- if ((marker->frame > CFRA) && (!found || closest > marker->frame)) {
+ if ((marker->frame > scene->r.cfra) && (!found || closest > marker->frame)) {
closest = marker->frame;
found = true;
}
}
else {
- if ((marker->frame < CFRA) && (!found || closest < marker->frame)) {
+ if ((marker->frame < scene->r.cfra) && (!found || closest < marker->frame)) {
closest = marker->frame;
found = true;
}
@@ -3192,7 +3192,7 @@ static int marker_jump_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- CFRA = closest;
+ scene->r.cfra = closest;
areas_do_frame_follow(C, true);
@@ -4714,7 +4714,7 @@ static int screen_animation_step_invoke(bContext *C, wmOperator *UNUSED(op), con
if (sad->flag & ANIMPLAY_FLAG_JUMPED) {
DEG_id_tag_update(&scene->id, ID_RECALC_FRAME_CHANGE);
#ifdef PROFILE_AUDIO_SYNCH
- old_frame = CFRA;
+ old_frame = scene->r.cfra;
#endif
}
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c
index 2ac10736eea..e97b666810c 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -730,7 +730,7 @@ static void insert_gpencil_key(bAnimContext *ac,
Scene *scene = ac->scene;
bGPdata *gpd = (bGPdata *)ale->id;
bGPDlayer *gpl = (bGPDlayer *)ale->data;
- BKE_gpencil_layer_frame_get(gpl, CFRA, add_frame_mode);
+ BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, add_frame_mode);
/* Check if the gpd changes to tag only once. */
if (gpd != *gpd_old) {
BKE_gpencil_tag(gpd);
@@ -827,8 +827,8 @@ static void insert_action_keys(bAnimContext *ac, short mode)
}
/* insert keyframes */
- const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(ac->depsgraph,
- (float)CFRA);
+ const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(
+ ac->depsgraph, (float)scene->r.cfra);
for (ale = anim_data.first; ale; ale = ale->next) {
switch (ale->type) {
case ANIMTYPE_GPLAYER:
@@ -1696,8 +1696,8 @@ static int actkeys_framejump_exec(bContext *C, wmOperator *UNUSED(op))
/* set the new current frame value, based on the average time */
if (ked.i1) {
Scene *scene = ac.scene;
- CFRA = round_fl_to_int(ked.f1 / ked.i1);
- SUBFRA = 0.0f;
+ scene->r.cfra = round_fl_to_int(ked.f1 / ked.i1);
+ scene->r.subframe = 0.0f;
}
/* set notifier that things have changed */
diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c
index f5dc2104d66..d1a8592ae9d 100644
--- a/source/blender/editors/space_action/action_select.c
+++ b/source/blender/editors/space_action/action_select.c
@@ -1026,7 +1026,7 @@ static void columnselect_action_keys(bAnimContext *ac, short mode)
ce = MEM_callocN(sizeof(CfraElem), "cfraElem");
BLI_addtail(&ked.list, ce);
- ce->cfra = (float)CFRA;
+ ce->cfra = (float)scene->r.cfra;
break;
case ACTKEYS_COLUMNSEL_MARKERS_COLUMN: /* list of selected markers */
@@ -1352,10 +1352,10 @@ static void actkeys_select_leftright(bAnimContext *ac, short leftright, short se
if (leftright == ACTKEYS_LRSEL_LEFT) {
ked.f1 = MINAFRAMEF;
- ked.f2 = (float)(CFRA + 0.1f);
+ ked.f2 = (float)(scene->r.cfra + 0.1f);
}
else {
- ked.f1 = (float)(CFRA - 0.1f);
+ ked.f1 = (float)(scene->r.cfra - 0.1f);
ked.f2 = MAXFRAMEF;
}
@@ -1402,8 +1402,8 @@ static void actkeys_select_leftright(bAnimContext *ac, short leftright, short se
TimeMarker *marker;
for (marker = markers->first; marker; marker = marker->next) {
- if (((leftright == ACTKEYS_LRSEL_LEFT) && (marker->frame < CFRA)) ||
- ((leftright == ACTKEYS_LRSEL_RIGHT) && (marker->frame >= CFRA))) {
+ if (((leftright == ACTKEYS_LRSEL_LEFT) && (marker->frame < scene->r.cfra)) ||
+ ((leftright == ACTKEYS_LRSEL_RIGHT) && (marker->frame >= scene->r.cfra))) {
marker->flag |= SELECT;
}
else {
@@ -1473,7 +1473,7 @@ static int actkeys_select_leftright_invoke(bContext *C, wmOperator *op, const wm
/* determine which side of the current frame mouse is on */
x = UI_view2d_region_to_view_x(v2d, event->mval[0]);
- if (x < CFRA) {
+ if (x < scene->r.cfra) {
RNA_enum_set(op->ptr, "mode", ACTKEYS_LRSEL_LEFT);
}
else {
diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c
index 3e3905e5263..3e507f73d1a 100644
--- a/source/blender/editors/space_action/space_action.c
+++ b/source/blender/editors/space_action/space_action.c
@@ -98,9 +98,9 @@ static SpaceLink *action_create(const ScrArea *area, const Scene *scene)
BLI_addtail(&saction->regionbase, region);
region->regiontype = RGN_TYPE_WINDOW;
- region->v2d.tot.xmin = (float)(SFRA - 10);
+ region->v2d.tot.xmin = (float)(scene->r.sfra - 10);
region->v2d.tot.ymin = (float)(-area->winy) / 3.0f;
- region->v2d.tot.xmax = (float)(EFRA + 10);
+ region->v2d.tot.xmax = (float)(scene->r.efra + 10);
region->v2d.tot.ymax = 0.0f;
region->v2d.cur = region->v2d.tot;
@@ -561,8 +561,8 @@ static void action_listener(const wmSpaceTypeListenerParams *params)
LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
if (region->regiontype == RGN_TYPE_WINDOW) {
Scene *scene = wmn->reference;
- region->v2d.tot.xmin = (float)(SFRA - 4);
- region->v2d.tot.xmax = (float)(EFRA + 4);
+ region->v2d.tot.xmin = (float)(scene->r.sfra - 4);
+ region->v2d.tot.xmax = (float)(scene->r.efra + 4);
break;
}
}
diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c
index 171fb580fb7..78174160eb8 100644
--- a/source/blender/editors/space_clip/clip_draw.c
+++ b/source/blender/editors/space_clip/clip_draw.c
@@ -131,7 +131,7 @@ static void draw_movieclip_cache(SpaceClip *sc, ARegion *region, MovieClip *clip
{
float x;
int *points, totseg, i, a;
- float sfra = SFRA, efra = EFRA, framelen = region->winx / (efra - sfra + 1);
+ float sfra = scene->r.sfra, efra = scene->r.efra, framelen = region->winx / (efra - sfra + 1);
MovieTracking *tracking = &clip->tracking;
MovieTrackingObject *act_object = BKE_tracking_object_get_active(tracking);
MovieTrackingTrack *act_track = BKE_tracking_track_get_active(&clip->tracking);
@@ -245,14 +245,16 @@ static void draw_movieclip_cache(SpaceClip *sc, ARegion *region, MovieClip *clip
/* solver keyframes */
immUniformColor4ub(175, 255, 0, 255);
- draw_keyframe(act_object->keyframe1 + clip->start_frame - 1, CFRA, sfra, framelen, 2, pos);
- draw_keyframe(act_object->keyframe2 + clip->start_frame - 1, CFRA, sfra, framelen, 2, pos);
+ draw_keyframe(
+ act_object->keyframe1 + clip->start_frame - 1, scene->r.cfra, sfra, framelen, 2, pos);
+ draw_keyframe(
+ act_object->keyframe2 + clip->start_frame - 1, scene->r.cfra, sfra, framelen, 2, pos);
immUnbindProgram();
/* movie clip animation */
if ((sc->mode == SC_MODE_MASKEDIT) && sc->mask_info.mask) {
- ED_mask_draw_frames(sc->mask_info.mask, region, CFRA, sfra, efra);
+ ED_mask_draw_frames(sc->mask_info.mask, region, scene->r.cfra, sfra, efra);
}
}
diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c
index cf7c3b51ae3..9a690f36aab 100644
--- a/source/blender/editors/space_clip/clip_editor.c
+++ b/source/blender/editors/space_clip/clip_editor.c
@@ -1046,7 +1046,7 @@ static int prefetch_get_start_frame(const bContext *C)
{
Scene *scene = CTX_data_scene(C);
- return SFRA;
+ return scene->r.sfra;
}
static int prefetch_get_final_frame(const bContext *C)
@@ -1057,10 +1057,10 @@ static int prefetch_get_final_frame(const bContext *C)
int end_frame;
/* check whether all the frames from prefetch range are cached */
- end_frame = EFRA;
+ end_frame = scene->r.efra;
if (clip->len) {
- end_frame = min_ii(end_frame, SFRA + clip->len - 1);
+ end_frame = min_ii(end_frame, scene->r.sfra + clip->len - 1);
}
return end_frame;
diff --git a/source/blender/editors/space_clip/clip_graph_ops.c b/source/blender/editors/space_clip/clip_graph_ops.c
index d07cf09ffa6..67565a88bab 100644
--- a/source/blender/editors/space_clip/clip_graph_ops.c
+++ b/source/blender/editors/space_clip/clip_graph_ops.c
@@ -629,8 +629,8 @@ static int view_all_exec(bContext *C, wmOperator *UNUSED(op))
NULL);
/* set extents of view to start/end frames */
- v2d->cur.xmin = (float)SFRA;
- v2d->cur.xmax = (float)EFRA;
+ v2d->cur.xmin = (float)scene->r.sfra;
+ v2d->cur.xmax = (float)scene->r.efra;
if (userdata.min < userdata.max) {
v2d->cur.ymin = userdata.min;
@@ -675,8 +675,8 @@ void ED_clip_graph_center_current_frame(Scene *scene, ARegion *region)
float extra = BLI_rctf_size_x(&v2d->cur) / 2.0f;
/* set extents of view to start/end frames */
- v2d->cur.xmin = (float)CFRA - extra;
- v2d->cur.xmax = (float)CFRA + extra;
+ v2d->cur.xmin = (float)scene->r.cfra - extra;
+ v2d->cur.xmax = (float)scene->r.cfra + extra;
}
static int center_current_frame_exec(bContext *C, wmOperator *UNUSED(op))
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c
index f5bf850791a..f276c2acd1a 100644
--- a/source/blender/editors/space_clip/clip_ops.c
+++ b/source/blender/editors/space_clip/clip_ops.c
@@ -1061,9 +1061,9 @@ static void change_frame_apply(bContext *C, wmOperator *op)
Scene *scene = CTX_data_scene(C);
/* set the new frame number */
- CFRA = RNA_int_get(op->ptr, "frame");
- FRAMENUMBER_MIN_CLAMP(CFRA);
- SUBFRA = 0.0f;
+ scene->r.cfra = RNA_int_get(op->ptr, "frame");
+ FRAMENUMBER_MIN_CLAMP(scene->r.cfra);
+ scene->r.subframe = 0.0f;
/* do updates */
DEG_id_tag_update(&scene->id, ID_RECALC_FRAME_CHANGE);
@@ -1084,7 +1084,7 @@ static int frame_from_event(bContext *C, const wmEvent *event)
int framenr = 0;
if (region->regiontype == RGN_TYPE_WINDOW) {
- float sfra = SFRA, efra = EFRA, framelen = region->winx / (efra - sfra + 1);
+ float sfra = scene->r.sfra, efra = scene->r.efra, framelen = region->winx / (efra - sfra + 1);
framenr = sfra + event->mval[0] / framelen;
}
@@ -1399,7 +1399,7 @@ static void do_sequence_proxy(void *pjv,
ProxyJob *pj = pjv;
MovieClip *clip = pj->clip;
Scene *scene = pj->scene;
- int sfra = SFRA, efra = EFRA;
+ int sfra = scene->r.sfra, efra = scene->r.efra;
ProxyThread *handles;
int tot_thread = BLI_task_scheduler_num_threads();
int width, height;
diff --git a/source/blender/editors/space_clip/clip_utils.c b/source/blender/editors/space_clip/clip_utils.c
index 01f2b24c8a4..221b87a8b5a 100644
--- a/source/blender/editors/space_clip/clip_utils.c
+++ b/source/blender/editors/space_clip/clip_utils.c
@@ -617,8 +617,8 @@ void clip_draw_sfra_efra(View2D *v2d, Scene *scene)
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformColor4f(0.0f, 0.0f, 0.0f, 0.4f);
- immRectf(pos, v2d->cur.xmin, v2d->cur.ymin, (float)SFRA, v2d->cur.ymax);
- immRectf(pos, (float)EFRA, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
+ immRectf(pos, v2d->cur.xmin, v2d->cur.ymin, (float)scene->r.sfra, v2d->cur.ymax);
+ immRectf(pos, (float)scene->r.efra, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
GPU_blend(GPU_BLEND_NONE);
@@ -628,10 +628,10 @@ void clip_draw_sfra_efra(View2D *v2d, Scene *scene)
GPU_line_width(1.0f);
immBegin(GPU_PRIM_LINES, 4);
- immVertex2f(pos, (float)SFRA, v2d->cur.ymin);
- immVertex2f(pos, (float)SFRA, v2d->cur.ymax);
- immVertex2f(pos, (float)EFRA, v2d->cur.ymin);
- immVertex2f(pos, (float)EFRA, v2d->cur.ymax);
+ immVertex2f(pos, (float)scene->r.sfra, v2d->cur.ymin);
+ immVertex2f(pos, (float)scene->r.sfra, v2d->cur.ymax);
+ immVertex2f(pos, (float)scene->r.efra, v2d->cur.ymin);
+ immVertex2f(pos, (float)scene->r.efra, v2d->cur.ymax);
immEnd();
immUnbindProgram();
diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c
index ca224b04da5..7f113108b02 100644
--- a/source/blender/editors/space_clip/tracking_ops.c
+++ b/source/blender/editors/space_clip/tracking_ops.c
@@ -1267,7 +1267,8 @@ static int frame_jump_exec(bContext *C, wmOperator *op)
}
delta = pos == 1 ? 1 : -1;
- while (sc->user.framenr + delta >= SFRA && sc->user.framenr + delta <= EFRA) {
+ while (sc->user.framenr + delta >= scene->r.sfra &&
+ sc->user.framenr + delta <= scene->r.efra) {
int framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, sc->user.framenr + delta);
MovieTrackingMarker *marker = BKE_tracking_marker_get_exact(track, framenr);
@@ -1286,7 +1287,7 @@ static int frame_jump_exec(bContext *C, wmOperator *op)
delta = pos == 3 ? 1 : -1;
framenr += delta;
- while (framenr + delta >= SFRA && framenr + delta <= EFRA) {
+ while (framenr + delta >= scene->r.sfra && framenr + delta <= scene->r.efra) {
MovieReconstructedCamera *cam = BKE_tracking_camera_get_reconstructed(
tracking, object, framenr);
@@ -1300,8 +1301,8 @@ static int frame_jump_exec(bContext *C, wmOperator *op)
}
}
- if (CFRA != sc->user.framenr) {
- CFRA = sc->user.framenr;
+ if (scene->r.cfra != sc->user.framenr) {
+ scene->r.cfra = sc->user.framenr;
DEG_id_tag_update(&scene->id, ID_RECALC_FRAME_CHANGE);
WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene);
diff --git a/source/blender/editors/space_clip/tracking_ops_track.c b/source/blender/editors/space_clip/tracking_ops_track.c
index d5223d57490..f6fd2980c19 100644
--- a/source/blender/editors/space_clip/tracking_ops_track.c
+++ b/source/blender/editors/space_clip/tracking_ops_track.c
@@ -131,10 +131,10 @@ static bool track_markers_initjob(bContext *C, TrackMarkersJob *tmj, bool backwa
if (sequence) {
if (backwards) {
- tmj->efra = SFRA;
+ tmj->efra = scene->r.sfra;
}
else {
- tmj->efra = EFRA;
+ tmj->efra = scene->r.efra;
}
tmj->efra = BKE_movieclip_remap_scene_to_clip_frame(clip, tmj->efra);
}
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index 324da039daa..7e8bca88744 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -156,10 +156,10 @@ static void insert_graph_keys(bAnimContext *ac, eGraphKeys_InsertKey_Types mode)
x = sipo->cursorTime;
}
else if (adt) {
- x = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP);
+ x = BKE_nla_tweakedit_remap(adt, (float)scene->r.cfra, NLATIME_CONVERT_UNMAP);
}
else {
- x = (float)CFRA;
+ x = (float)scene->r.cfra;
}
/* Normalize units of cursor's value. */
@@ -178,7 +178,7 @@ static void insert_graph_keys(bAnimContext *ac, eGraphKeys_InsertKey_Types mode)
}
else {
const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(
- ac->depsgraph, (float)CFRA);
+ ac->depsgraph, (float)scene->r.cfra);
for (ale = anim_data.first; ale; ale = ale->next) {
FCurve *fcu = (FCurve *)ale->key_data;
@@ -211,12 +211,12 @@ static void insert_graph_keys(bAnimContext *ac, eGraphKeys_InsertKey_Types mode)
AnimData *adt = ANIM_nla_mapping_get(ac, ale);
/* Adjust current frame for NLA-mapping. */
- float cfra = (float)CFRA;
+ float cfra = (float)scene->r.cfra;
if ((sipo) && (sipo->mode == SIPO_MODE_DRIVERS)) {
cfra = sipo->cursorTime;
}
else if (adt) {
- cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP);
+ cfra = BKE_nla_tweakedit_remap(adt, (float)scene->r.cfra, NLATIME_CONVERT_UNMAP);
}
const float curval = evaluate_fcurve_only_curve(fcu, cfra);
@@ -1106,8 +1106,8 @@ static int graphkeys_sound_bake_exec(bContext *C, wmOperator *op)
}
/* Determine extents of the baking. */
- sbi.cfra = start = CFRA;
- end = CFRA + sbi.length - 1;
+ sbi.cfra = start = scene->r.cfra;
+ end = scene->r.cfra + sbi.length - 1;
/* Filter anim channels. */
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_CURVE_VISIBLE | ANIMFILTER_FCURVESONLY |
@@ -2130,8 +2130,8 @@ static int graphkeys_framejump_exec(bContext *C, wmOperator *UNUSED(op))
}
else {
/* Animation Mode - Affects current frame (int) */
- CFRA = round_fl_to_int(sum_time / num_keyframes);
- SUBFRA = 0.0f;
+ scene->r.cfra = round_fl_to_int(sum_time / num_keyframes);
+ scene->r.subframe = 0.0f;
}
sipo->cursorVal = sum_value / (float)num_keyframes;
diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c
index 158f2eae88f..8deea21318c 100644
--- a/source/blender/editors/space_graph/graph_ops.c
+++ b/source/blender/editors/space_graph/graph_ops.c
@@ -72,21 +72,21 @@ static void graphview_cursor_apply(bContext *C, wmOperator *op)
* NOTE: sync this part of the code with ANIM_OT_change_frame
*/
/* 1) frame is rounded to the nearest int, since frames are ints */
- CFRA = round_fl_to_int(frame);
+ scene->r.cfra = round_fl_to_int(frame);
if (scene->r.flag & SCER_LOCK_FRAME_SELECTION) {
/* Clip to preview range
* NOTE: Preview range won't go into negative values,
* so only clamping once should be fine.
*/
- CLAMP(CFRA, PSFRA, PEFRA);
+ CLAMP(scene->r.cfra, PSFRA, PEFRA);
}
else {
/* Prevent negative frames */
- FRAMENUMBER_MIN_CLAMP(CFRA);
+ FRAMENUMBER_MIN_CLAMP(scene->r.cfra);
}
- SUBFRA = 0.0f;
+ scene->r.subframe = 0.0f;
DEG_id_tag_update(&scene->id, ID_RECALC_FRAME_CHANGE);
}
diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c
index 70f9e4a60d9..a36bd5c1461 100644
--- a/source/blender/editors/space_graph/graph_select.c
+++ b/source/blender/editors/space_graph/graph_select.c
@@ -1209,7 +1209,7 @@ static void columnselect_graph_keys(bAnimContext *ac, short mode)
ce = MEM_callocN(sizeof(CfraElem), "cfraElem");
BLI_addtail(&ked.list, ce);
- ce->cfra = (float)CFRA;
+ ce->cfra = (float)scene->r.cfra;
break;
case GRAPHKEYS_COLUMNSEL_MARKERS_COLUMN: /* list of selected markers */
@@ -1521,10 +1521,10 @@ static void graphkeys_select_leftright(bAnimContext *ac, short leftright, short
if (leftright == GRAPHKEYS_LRSEL_LEFT) {
ked.f1 = MINAFRAMEF;
- ked.f2 = (float)(CFRA + 0.1f);
+ ked.f2 = (float)(scene->r.cfra + 0.1f);
}
else {
- ked.f1 = (float)(CFRA - 0.1f);
+ ked.f1 = (float)(scene->r.cfra - 0.1f);
ked.f2 = MAXFRAMEF;
}
@@ -1605,7 +1605,7 @@ static int graphkeys_select_leftright_invoke(bContext *C, wmOperator *op, const
/* determine which side of the current frame mouse is on */
x = UI_view2d_region_to_view_x(v2d, event->mval[0]);
- if (x < CFRA) {
+ if (x < scene->r.cfra) {
RNA_enum_set(op->ptr, "mode", GRAPHKEYS_LRSEL_LEFT);
}
else {
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c
index d0c21f85472..0a774ee679c 100644
--- a/source/blender/editors/space_image/image_buttons.c
+++ b/source/blender/editors/space_image/image_buttons.c
@@ -1218,7 +1218,7 @@ void uiTemplateImageInfo(uiLayout *layout, bContext *C, Image *ima, ImageUser *i
if (ELEM(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) {
/* don't use iuser->framenr directly because it may not be updated if auto-refresh is off */
Scene *scene = CTX_data_scene(C);
- const int framenr = BKE_image_user_frame_get(iuser, CFRA, NULL);
+ const int framenr = BKE_image_user_frame_get(iuser, scene->r.cfra, NULL);
char str[MAX_IMAGE_INFO_LEN];
int duration = 0;
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index 048c7345b97..f6f9428213f 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -515,7 +515,8 @@ void draw_image_cache(const bContext *C, ARegion *region)
SpaceImage *sima = CTX_wm_space_image(C);
Scene *scene = CTX_data_scene(C);
Image *image = ED_space_image(sima);
- float x, cfra = CFRA, sfra = SFRA, efra = EFRA, framelen = region->winx / (efra - sfra + 1);
+ float x, cfra = scene->r.cfra, sfra = scene->r.sfra, efra = scene->r.efra,
+ framelen = region->winx / (efra - sfra + 1);
Mask *mask = NULL;
if (!ED_space_image_show_cache(sima)) {
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 537132ac428..b77bdc11ca5 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -3580,9 +3580,9 @@ static void change_frame_apply(bContext *C, wmOperator *op)
Scene *scene = CTX_data_scene(C);
/* set the new frame number */
- CFRA = RNA_int_get(op->ptr, "frame");
- FRAMENUMBER_MIN_CLAMP(CFRA);
- SUBFRA = 0.0f;
+ scene->r.cfra = RNA_int_get(op->ptr, "frame");
+ FRAMENUMBER_MIN_CLAMP(scene->r.cfra);
+ scene->r.subframe = 0.0f;
/* do updates */
DEG_id_tag_update(&scene->id, ID_RECALC_FRAME_CHANGE);
@@ -3603,7 +3603,7 @@ static int frame_from_event(bContext *C, const wmEvent *event)
int framenr = 0;
if (region->regiontype == RGN_TYPE_WINDOW) {
- float sfra = SFRA, efra = EFRA, framelen = region->winx / (efra - sfra + 1);
+ float sfra = scene->r.sfra, efra = scene->r.efra, framelen = region->winx / (efra - sfra + 1);
framenr = sfra + event->mval[0] / framelen;
}
diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c
index 81520445000..50f00aed867 100644
--- a/source/blender/editors/space_nla/nla_edit.c
+++ b/source/blender/editors/space_nla/nla_edit.c
@@ -625,7 +625,7 @@ static int nlaedit_add_actionclip_exec(bContext *C, wmOperator *op)
}
scene = ac.scene;
- cfra = (float)CFRA;
+ cfra = (float)scene->r.cfra;
/* get action to use */
act = BLI_findlink(&bmain->actions, RNA_enum_get(op->ptr, "action"));
@@ -901,7 +901,7 @@ static int nlaedit_add_sound_exec(bContext *C, wmOperator *UNUSED(op))
}
scene = ac.scene;
- cfra = CFRA;
+ cfra = scene->r.cfra;
/* get a list of the editable tracks being shown in the NLA */
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_SEL |
@@ -2388,7 +2388,7 @@ static int nlaedit_snap_exec(bContext *C, wmOperator *op)
/* calculate new start position based on snapping mode */
switch (mode) {
case NLAEDIT_SNAP_CFRA: /* to current frame */
- strip->start = (float)CFRA;
+ strip->start = (float)scene->r.cfra;
break;
case NLAEDIT_SNAP_NEAREST_FRAME: /* to nearest frame */
strip->start = floorf(start + 0.5f);
diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c
index 1efb91bc99f..d51bfce6355 100644
--- a/source/blender/editors/space_nla/nla_select.c
+++ b/source/blender/editors/space_nla/nla_select.c
@@ -455,10 +455,10 @@ static void nlaedit_select_leftright(bContext *C,
/* get range, and get the right flag-setting mode */
if (leftright == NLAEDIT_LRSEL_LEFT) {
xmin = MINAFRAMEF;
- xmax = (float)(CFRA + 0.1f);
+ xmax = (float)(scene->r.cfra + 0.1f);
}
else {
- xmin = (float)(CFRA - 0.1f);
+ xmin = (float)(scene->r.cfra - 0.1f);
xmax = MAXFRAMEF;
}
@@ -540,7 +540,7 @@ static int nlaedit_select_leftright_invoke(bContext *C, wmOperator *op, const wm
/* determine which side of the current frame mouse is on */
x = UI_view2d_region_to_view_x(v2d, event->mval[0]);
- if (x < CFRA) {
+ if (x < scene->r.cfra) {
RNA_enum_set(op->ptr, "mode", NLAEDIT_LRSEL_LEFT);
}
else {
diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c
index c50278518de..13035a9d5fd 100644
--- a/source/blender/editors/space_nla/space_nla.c
+++ b/source/blender/editors/space_nla/space_nla.c
@@ -87,9 +87,9 @@ static SpaceLink *nla_create(const ScrArea *area, const Scene *scene)
BLI_addtail(&snla->regionbase, region);
region->regiontype = RGN_TYPE_WINDOW;
- region->v2d.tot.xmin = (float)(SFRA - 10);
+ region->v2d.tot.xmin = (float)(scene->r.sfra - 10);
region->v2d.tot.ymin = (float)(-area->winy) / 3.0f;
- region->v2d.tot.xmax = (float)(EFRA + 10);
+ region->v2d.tot.xmax = (float)(scene->r.efra + 10);
region->v2d.tot.ymax = 0.0f;
region->v2d.cur = region->v2d.tot;
diff --git a/source/blender/editors/space_node/drawnode.cc b/source/blender/editors/space_node/drawnode.cc
index 6806d715004..66e07c804b6 100644
--- a/source/blender/editors/space_node/drawnode.cc
+++ b/source/blender/editors/space_node/drawnode.cc
@@ -329,7 +329,7 @@ static void node_buts_image_user(uiLayout *layout,
Scene *scene = CTX_data_scene(C);
char numstr[32];
- const int framenr = BKE_image_user_frame_get(iuser, CFRA, nullptr);
+ const int framenr = BKE_image_user_frame_get(iuser, scene->r.cfra, nullptr);
BLI_snprintf(numstr, sizeof(numstr), IFACE_("Frame: %d"), framenr);
uiItemL(layout, numstr, ICON_NONE);
}
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c
index 0f6d6930530..dd6d58ee5a2 100644
--- a/source/blender/editors/space_sequencer/sequencer_add.c
+++ b/source/blender/editors/space_sequencer/sequencer_add.c
@@ -192,7 +192,7 @@ static int sequencer_generic_invoke_xy_guess_channel(bContext *C, int type)
Sequence *seq;
Scene *scene = CTX_data_scene(C);
Editing *ed = SEQ_editing_ensure(scene);
- int timeline_frame = (int)CFRA;
+ int timeline_frame = (int)scene->r.cfra;
int proximity = INT_MAX;
if (!ed || !ed->seqbasep) {
@@ -218,7 +218,7 @@ static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, i
{
Scene *scene = CTX_data_scene(C);
- int timeline_frame = (int)CFRA;
+ int timeline_frame = (int)scene->r.cfra;
/* Effect strips don't need a channel initialized from the mouse. */
if (!(flag & SEQPROP_NOCHAN) && RNA_struct_property_is_set(op->ptr, "channel") == 0) {
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index d507c9ae6bc..79eeb3c0374 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -265,7 +265,7 @@ static int sequencer_gap_remove_exec(bContext *C, wmOperator *op)
const bool do_all = RNA_boolean_get(op->ptr, "all");
const Editing *ed = SEQ_editing_get(scene);
- SEQ_edit_remove_gaps(scene, ed->seqbasep, CFRA, do_all);
+ SEQ_edit_remove_gaps(scene, ed->seqbasep, scene->r.cfra, do_all);
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS);
@@ -304,7 +304,7 @@ static int sequencer_gap_insert_exec(bContext *C, wmOperator *op)
Scene *scene = CTX_data_scene(C);
const int frames = RNA_int_get(op->ptr, "frames");
const Editing *ed = SEQ_editing_get(scene);
- SEQ_transform_offset_after_frame(scene, ed->seqbasep, frames, CFRA);
+ SEQ_transform_offset_after_frame(scene, ed->seqbasep, frames, scene->r.cfra);
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
@@ -423,7 +423,7 @@ static int sequencer_snap_invoke(bContext *C, wmOperator *op, const wmEvent *UNU
int snap_frame;
- snap_frame = CFRA;
+ snap_frame = scene->r.cfra;
RNA_int_set(op->ptr, "frame", snap_frame);
return sequencer_snap_exec(C, op);
@@ -1465,7 +1465,7 @@ static int sequencer_split_invoke(bContext *C, wmOperator *op, const wmEvent *ev
View2D *v2d = UI_view2d_fromcontext(C);
int split_side = RNA_enum_get(op->ptr, "side");
- int split_frame = CFRA;
+ int split_frame = scene->r.cfra;
if (split_side == SEQ_SIDE_MOUSE) {
if (ED_operator_sequencer_active(C) && v2d) {
@@ -2091,12 +2091,12 @@ static bool strip_jump_internal(Scene *scene,
const bool do_center)
{
bool changed = false;
- int timeline_frame = CFRA;
+ int timeline_frame = scene->r.cfra;
int next_frame = SEQ_time_find_next_prev_edit(
scene, timeline_frame, side, do_skip_mute, do_center, false);
if (next_frame != timeline_frame) {
- CFRA = next_frame;
+ scene->r.cfra = next_frame;
changed = true;
}
@@ -3408,7 +3408,7 @@ static int sequencer_strip_transform_fit_exec(bContext *C, wmOperator *op)
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if (seq->flag & SELECT && seq->type != SEQ_TYPE_SOUND_RAM) {
- const int timeline_frame = CFRA;
+ const int timeline_frame = scene->r.cfra;
StripElem *strip_elem = SEQ_render_give_stripelem(scene, seq, timeline_frame);
if (strip_elem == NULL) {
diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c
index cfdbeaf0658..3f48404053d 100644
--- a/source/blender/editors/space_sequencer/sequencer_select.c
+++ b/source/blender/editors/space_sequencer/sequencer_select.c
@@ -589,8 +589,8 @@ static void sequencer_select_side_of_frame(const bContext *C,
const float x = UI_view2d_region_to_view_x(v2d, mval[0]);
LISTBASE_FOREACH (Sequence *, seq_iter, SEQ_active_seqbase_get(ed)) {
- if (((x < CFRA) && (SEQ_time_right_handle_frame_get(scene, seq_iter) <= CFRA)) ||
- ((x >= CFRA) && (SEQ_time_left_handle_frame_get(scene, seq_iter) >= CFRA))) {
+ if (((x < scene->r.cfra) && (SEQ_time_right_handle_frame_get(scene, seq_iter) <= scene->r.cfra)) ||
+ ((x >= scene->r.cfra) && (SEQ_time_left_handle_frame_get(scene, seq_iter) >= scene->r.cfra))) {
/* Select left or right. */
seq_iter->flag |= SELECT;
recurs_sel_seq(seq_iter);
@@ -603,8 +603,8 @@ static void sequencer_select_side_of_frame(const bContext *C,
TimeMarker *tmarker;
for (tmarker = scene->markers.first; tmarker; tmarker = tmarker->next) {
- if (((x < CFRA) && (tmarker->frame <= CFRA)) ||
- ((x >= CFRA) && (tmarker->frame >= CFRA))) {
+ if (((x < scene->r.cfra) && (tmarker->frame <= scene->r.cfra)) ||
+ ((x >= scene->r.cfra) && (tmarker->frame >= scene->r.cfra))) {
tmarker->flag |= SELECT;
}
else {
@@ -1443,7 +1443,7 @@ static int sequencer_select_side_of_frame_exec(bContext *C, wmOperator *op)
if (extend == false) {
ED_sequencer_deselect_all(scene);
}
- const int timeline_frame = CFRA;
+ const int timeline_frame = scene->r.cfra;
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
bool test = false;
switch (side) {
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index b9e4c19295d..5405867be56 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1294,7 +1294,7 @@ static void draw_viewport_name(ARegion *region, View3D *v3d, int xoffset, int *y
static void draw_selected_name(
Scene *scene, ViewLayer *view_layer, Object *ob, int xoffset, int *yoffset)
{
- const int cfra = CFRA;
+ const int cfra = scene->r.cfra;
const char *msg_pin = " (Pinned)";
const char *msg_sep = " : ";
diff --git a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c
index 96f242dba9f..62dc461e05c 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c
@@ -523,7 +523,7 @@ static bool view3d_ruler_to_gpencil(bContext *C, wmGizmoGroup *gzgroup)
gpl->flag |= GP_LAYER_HIDE | GP_LAYER_IS_RULER;
}
- gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_ADD_NEW);
+ gpf = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, GP_GETFRAME_ADD_NEW);
BKE_gpencil_free_strokes(gpf);
for (ruler_item = gzgroup_ruler_item_first_get(gzgroup); ruler_item;
@@ -577,7 +577,7 @@ static bool view3d_ruler_from_gpencil(const bContext *C, wmGizmoGroup *gzgroup)
gpl = view3d_ruler_layer_get(scene->gpd);
if (gpl) {
bGPDframe *gpf;
- gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_USE_PREV);
+ gpf = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, GP_GETFRAME_USE_PREV);
if (gpf) {
bGPDstroke *gps;
for (gps = gpf->strokes.first; gps; gps = gps->next) {
diff --git a/source/blender/editors/space_view3d/view3d_utils.c b/source/blender/editors/space_view3d/view3d_utils.c
index 306394ce53d..1fabdef8da2 100644
--- a/source/blender/editors/space_view3d/view3d_utils.c
+++ b/source/blender/editors/space_view3d/view3d_utils.c
@@ -633,7 +633,7 @@ bool ED_view3d_camera_autokey(const Scene *scene,
const bool do_translate)
{
if (autokeyframe_cfra_can_key(scene, id_key)) {
- const float cfra = (float)CFRA;
+ const float cfra = (float)scene->r.cfra;
ListBase dsources = {NULL, NULL};
/* add data-source override for the camera object */
diff --git a/source/blender/editors/transform/transform_convert_action.c b/source/blender/editors/transform/transform_convert_action.c
index ba62f6f1fea..71a78321e12 100644
--- a/source/blender/editors/transform/transform_convert_action.c
+++ b/source/blender/editors/transform/transform_convert_action.c
@@ -326,7 +326,7 @@ void createTransActionData(bContext *C, TransInfo *t)
/* which side of the current frame should be allowed */
if (t->mode == TFM_TIME_EXTEND) {
- t->frame_side = transform_convert_frame_side_dir_get(t, (float)CFRA);
+ t->frame_side = transform_convert_frame_side_dir_get(t, (float)scene->r.cfra);
}
else {
/* normal transform - both sides of current frame are considered */
@@ -341,10 +341,10 @@ void createTransActionData(bContext *C, TransInfo *t)
* higher scaling ratios, but is faster than converting all points)
*/
if (adt) {
- cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP);
+ cfra = BKE_nla_tweakedit_remap(adt, (float)scene->r.cfra, NLATIME_CONVERT_UNMAP);
}
else {
- cfra = (float)CFRA;
+ cfra = (float)scene->r.cfra;
}
if (ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE)) {
@@ -399,7 +399,7 @@ void createTransActionData(bContext *C, TransInfo *t)
continue;
}
- cfra = (float)CFRA;
+ cfra = (float)scene->r.cfra;
{
AnimData *adt;
@@ -447,10 +447,10 @@ void createTransActionData(bContext *C, TransInfo *t)
adt = ANIM_nla_mapping_get(&ac, ale);
if (adt) {
- cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP);
+ cfra = BKE_nla_tweakedit_remap(adt, (float)scene->r.cfra, NLATIME_CONVERT_UNMAP);
}
else {
- cfra = (float)CFRA;
+ cfra = (float)scene->r.cfra;
}
if (ale->type == ANIMTYPE_GPLAYER) {
diff --git a/source/blender/editors/transform/transform_convert_armature.c b/source/blender/editors/transform/transform_convert_armature.c
index a031a6cd45b..1613218ca29 100644
--- a/source/blender/editors/transform/transform_convert_armature.c
+++ b/source/blender/editors/transform/transform_convert_armature.c
@@ -93,8 +93,8 @@ static void autokeyframe_pose(
KeyingSet *active_ks = ANIM_scene_get_active_keyingset(scene);
ListBase nla_cache = {NULL, NULL};
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
- const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(depsgraph,
- (float)CFRA);
+ const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(
+ depsgraph, (float)scene->r.cfra);
eInsertKeyFlags flag = 0;
/* flag is initialized from UserPref keyframing settings
diff --git a/source/blender/editors/transform/transform_convert_gpencil.c b/source/blender/editors/transform/transform_convert_gpencil.c
index a88d42b7f30..4bd02b0a45b 100644
--- a/source/blender/editors/transform/transform_convert_gpencil.c
+++ b/source/blender/editors/transform/transform_convert_gpencil.c
@@ -685,7 +685,7 @@ void createTransGPencil(bContext *C, TransInfo *t)
bGPdata *gpd = obact->data;
BLI_assert(gpd != NULL);
- const int cfra_scene = CFRA;
+ const int cfra_scene = scene->r.cfra;
const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
const bool use_multiframe_falloff = (ts->gp_sculpt.flag & GP_SCULPT_SETT_FLAG_FRAME_FALLOFF) !=
diff --git a/source/blender/editors/transform/transform_convert_graph.c b/source/blender/editors/transform/transform_convert_graph.c
index 1444268baf5..d93fff72de6 100644
--- a/source/blender/editors/transform/transform_convert_graph.c
+++ b/source/blender/editors/transform/transform_convert_graph.c
@@ -239,7 +239,7 @@ void createTransGraphEditData(bContext *C, TransInfo *t)
/* which side of the current frame should be allowed */
/* XXX we still want this mode, but how to get this using standard transform too? */
if (t->mode == TFM_TIME_EXTEND) {
- t->frame_side = transform_convert_frame_side_dir_get(t, (float)CFRA);
+ t->frame_side = transform_convert_frame_side_dir_get(t, (float)scene->r.cfra);
}
else {
/* normal transform - both sides of current frame are considered */
@@ -264,10 +264,10 @@ void createTransGraphEditData(bContext *C, TransInfo *t)
* higher scaling ratios, but is faster than converting all points)
*/
if (adt) {
- cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP);
+ cfra = BKE_nla_tweakedit_remap(adt, (float)scene->r.cfra, NLATIME_CONVERT_UNMAP);
}
else {
- cfra = (float)CFRA;
+ cfra = (float)scene->r.cfra;
}
for (i = 0, bezt = fcu->bezt; i < fcu->totvert; i++, bezt++) {
@@ -370,10 +370,10 @@ void createTransGraphEditData(bContext *C, TransInfo *t)
* higher scaling ratios, but is faster than converting all points)
*/
if (adt) {
- cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP);
+ cfra = BKE_nla_tweakedit_remap(adt, (float)scene->r.cfra, NLATIME_CONVERT_UNMAP);
}
else {
- cfra = (float)CFRA;
+ cfra = (float)scene->r.cfra;
}
unit_scale = ANIM_unit_mapping_get_factor(
@@ -561,10 +561,10 @@ void createTransGraphEditData(bContext *C, TransInfo *t)
* higher scaling ratios, but is faster than converting all points)
*/
if (adt) {
- cfra = BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP);
+ cfra = BKE_nla_tweakedit_remap(adt, (float)scene->r.cfra, NLATIME_CONVERT_UNMAP);
}
else {
- cfra = (float)CFRA;
+ cfra = (float)scene->r.cfra;
}
for (i = 0, bezt = fcu->bezt; i < fcu->totvert; i++, bezt++) {
diff --git a/source/blender/editors/transform/transform_convert_mask.c b/source/blender/editors/transform/transform_convert_mask.c
index b07d2bda0c5..f035cfc7aa9 100644
--- a/source/blender/editors/transform/transform_convert_mask.c
+++ b/source/blender/editors/transform/transform_convert_mask.c
@@ -117,7 +117,7 @@ static void MaskPointToTransData(Scene *scene,
const bool is_sel_any = MASKPOINT_ISSEL_ANY(point);
float parent_matrix[3][3], parent_inverse_matrix[3][3];
- BKE_mask_point_parent_matrix_get(point, CFRA, parent_matrix);
+ BKE_mask_point_parent_matrix_get(point, scene->r.cfra, parent_matrix);
invert_m3_m3(parent_inverse_matrix, parent_matrix);
if (is_prop_edit || is_sel_point) {
@@ -455,7 +455,7 @@ void special_aftertrans_update__mask(bContext *C, TransInfo *t)
if (IS_AUTOKEY_ON(t->scene)) {
Scene *scene = t->scene;
- if (ED_mask_layer_shape_auto_key_select(mask, CFRA)) {
+ if (ED_mask_layer_shape_auto_key_select(mask, scene->r.cfra)) {
WM_event_add_notifier(C, NC_MASK | ND_DATA, &mask->id);
DEG_id_tag_update(&mask->id, 0);
}
diff --git a/source/blender/editors/transform/transform_convert_nla.c b/source/blender/editors/transform/transform_convert_nla.c
index 2fa8fcf65ba..b2c0cc553a7 100644
--- a/source/blender/editors/transform/transform_convert_nla.c
+++ b/source/blender/editors/transform/transform_convert_nla.c
@@ -87,7 +87,7 @@ void createTransNlaData(bContext *C, TransInfo *t)
/* which side of the current frame should be allowed */
if (t->mode == TFM_TIME_EXTEND) {
- t->frame_side = transform_convert_frame_side_dir_get(t, (float)CFRA);
+ t->frame_side = transform_convert_frame_side_dir_get(t, (float)scene->r.cfra);
}
else {
/* normal transform - both sides of current frame are considered */
@@ -108,10 +108,10 @@ void createTransNlaData(bContext *C, TransInfo *t)
/* transition strips can't get directly transformed */
if (strip->type != NLASTRIP_TYPE_TRANSITION) {
if (strip->flag & NLASTRIP_FLAG_SELECT) {
- if (FrameOnMouseSide(t->frame_side, strip->start, (float)CFRA)) {
+ if (FrameOnMouseSide(t->frame_side, strip->start, (float)scene->r.cfra)) {
count++;
}
- if (FrameOnMouseSide(t->frame_side, strip->end, (float)CFRA)) {
+ if (FrameOnMouseSide(t->frame_side, strip->end, (float)scene->r.cfra)) {
count++;
}
}
@@ -122,7 +122,7 @@ void createTransNlaData(bContext *C, TransInfo *t)
/* stop if trying to build list if nothing selected */
if (count == 0) {
/* clear temp metas that may have been created but aren't needed now
- * because they fell on the wrong side of CFRA
+ * because they fell on the wrong side of scene->r.cfra
*/
for (ale = anim_data.first; ale; ale = ale->next) {
NlaTrack *nlt = (NlaTrack *)ale->data;
@@ -181,12 +181,12 @@ void createTransNlaData(bContext *C, TransInfo *t)
tdn->h2[0] = strip->end;
tdn->h2[1] = yval;
- center[0] = (float)CFRA;
+ center[0] = (float)scene->r.cfra;
center[1] = yval;
center[2] = 0.0f;
/* set td's based on which handles are applicable */
- if (FrameOnMouseSide(t->frame_side, strip->start, (float)CFRA)) {
+ if (FrameOnMouseSide(t->frame_side, strip->start, (float)scene->r.cfra)) {
/* just set tdn to assume that it only has one handle for now */
tdn->handle = -1;
@@ -206,7 +206,7 @@ void createTransNlaData(bContext *C, TransInfo *t)
td->extra = tdn;
td++;
}
- if (FrameOnMouseSide(t->frame_side, strip->end, (float)CFRA)) {
+ if (FrameOnMouseSide(t->frame_side, strip->end, (float)scene->r.cfra)) {
/* if tdn is already holding the start handle,
* then we're doing both, otherwise, only end */
tdn->handle = (tdn->handle) ? 2 : 1;
diff --git a/source/blender/editors/transform/transform_convert_object.c b/source/blender/editors/transform/transform_convert_object.c
index 47e78656861..26d57ae1e58 100644
--- a/source/blender/editors/transform/transform_convert_object.c
+++ b/source/blender/editors/transform/transform_convert_object.c
@@ -732,8 +732,8 @@ static void autokeyframe_object(
KeyingSet *active_ks = ANIM_scene_get_active_keyingset(scene);
ListBase dsources = {NULL, NULL};
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
- const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(depsgraph,
- (float)CFRA);
+ const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(
+ depsgraph, (float)scene->r.cfra);
eInsertKeyFlags flag = 0;
/* Get flags used for inserting keyframes. */
diff --git a/source/blender/editors/transform/transform_convert_sequencer.c b/source/blender/editors/transform/transform_convert_sequencer.c
index 849641fd320..dcc1739606f 100644
--- a/source/blender/editors/transform/transform_convert_sequencer.c
+++ b/source/blender/editors/transform/transform_convert_sequencer.c
@@ -90,7 +90,7 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *r_count, int *r_flag)
if (t->mode == TFM_TIME_EXTEND) {
/* *** Extend Transform *** */
- int cfra = CFRA;
+ int cfra = scene->r.cfra;
int left = SEQ_time_left_handle_frame_get(scene, seq);
int right = SEQ_time_right_handle_frame_get(scene, seq);
@@ -489,7 +489,7 @@ void createTransSeqData(TransInfo *t)
}
tc->custom.type.free_cb = freeSeqData;
- t->frame_side = transform_convert_frame_side_dir_get(t, (float)CFRA);
+ t->frame_side = transform_convert_frame_side_dir_get(t, (float)scene->r.cfra);
count = SeqTransCount(t, ed->seqbasep);
diff --git a/source/blender/editors/transform/transform_convert_sequencer_image.c b/source/blender/editors/transform/transform_convert_sequencer_image.c
index 46606d5814f..8be454b540c 100644
--- a/source/blender/editors/transform/transform_convert_sequencer_image.c
+++ b/source/blender/editors/transform/transform_convert_sequencer_image.c
@@ -173,19 +173,19 @@ static bool autokeyframe_sequencer_image(bContext *C,
bool changed = false;
if (do_rot) {
prop = RNA_struct_find_property(&ptr, "rotation");
- changed |= ED_autokeyframe_property(C, scene, &ptr, prop, -1, CFRA, false);
+ changed |= ED_autokeyframe_property(C, scene, &ptr, prop, -1, scene->r.cfra, false);
}
if (do_loc) {
prop = RNA_struct_find_property(&ptr, "offset_x");
- changed |= ED_autokeyframe_property(C, scene, &ptr, prop, -1, CFRA, false);
+ changed |= ED_autokeyframe_property(C, scene, &ptr, prop, -1, scene->r.cfra, false);
prop = RNA_struct_find_property(&ptr, "offset_y");
- changed |= ED_autokeyframe_property(C, scene, &ptr, prop, -1, CFRA, false);
+ changed |= ED_autokeyframe_property(C, scene, &ptr, prop, -1, scene->r.cfra, false);
}
if (do_scale) {
prop = RNA_struct_find_property(&ptr, "scale_x");
- changed |= ED_autokeyframe_property(C, scene, &ptr, prop, -1, CFRA, false);
+ changed |= ED_autokeyframe_property(C, scene, &ptr, prop, -1, scene->r.cfra, false);
prop = RNA_struct_find_property(&ptr, "scale_y");
- changed |= ED_autokeyframe_property(C, scene, &ptr, prop, -1, CFRA, false);
+ changed |= ED_autokeyframe_property(C, scene, &ptr, prop, -1, scene->r.cfra, false);
}
return changed;
diff --git a/source/blender/editors/transform/transform_mode_timescale.c b/source/blender/editors/transform/transform_mode_timescale.c
index 4130f6dc034..1474bc4591a 100644
--- a/source/blender/editors/transform/transform_mode_timescale.c
+++ b/source/blender/editors/transform/transform_mode_timescale.c
@@ -59,7 +59,7 @@ static void applyTimeScaleValue(TransInfo *t, float value)
* (this is only valid when not in NLA)
*/
AnimData *adt = (t->spacetype != SPACE_NLA) ? td->extra : NULL;
- float startx = CFRA;
+ float startx = scene->r.cfra;
float fac = value;
/* take proportional editing into account */
@@ -107,7 +107,7 @@ void initTimeScale(TransInfo *t)
t->mode = TFM_TIME_SCALE;
t->transform = applyTimeScale;
- /* recalculate center2d to use CFRA and mouse Y, since that's
+ /* recalculate center2d to use scene->r.cfra and mouse Y, since that's
* what is used in time scale */
if ((t->flag & T_OVERRIDE_CENTER) == 0) {
t->center_global[0] = t->scene->r.cfra;
diff --git a/source/blender/editors/transform/transform_snap_object.cc b/source/blender/editors/transform/transform_snap_object.cc
index 8a1eca3a6f7..817474f795e 100644
--- a/source/blender/editors/transform/transform_snap_object.cc
+++ b/source/blender/editors/transform/transform_snap_object.cc
@@ -2623,7 +2623,7 @@ static eSnapMode snapCamera(const SnapObjectContext *sctx,
if ((tracking_object->flag & TRACKING_OBJECT_CAMERA) == 0) {
BKE_tracking_camera_get_reconstructed_interpolate(
- tracking, tracking_object, CFRA, reconstructed_camera_mat);
+ tracking, tracking_object, scene->r.cfra, reconstructed_camera_mat);
invert_m4_m4(reconstructed_camera_imat, reconstructed_camera_mat);
}
diff --git a/source/blender/editors/transform/transform_snap_sequencer.c b/source/blender/editors/transform/transform_snap_sequencer.c
index 7972410ad67..5ac526b1e91 100644
--- a/source/blender/editors/transform/transform_snap_sequencer.c
+++ b/source/blender/editors/transform/transform_snap_sequencer.c
@@ -191,7 +191,7 @@ static void seq_snap_target_points_build(Scene *scene,
int i = 0;
if (snap_mode & SEQ_SNAP_TO_CURRENT_FRAME) {
- snap_data->target_snap_points[i] = CFRA;
+ snap_data->target_snap_points[i] = scene->r.cfra;
i++;
}
diff --git a/source/blender/editors/util/ed_util_imbuf.c b/source/blender/editors/util/ed_util_imbuf.c
index cf6f26652a7..fc5fb9f9c28 100644
--- a/source/blender/editors/util/ed_util_imbuf.c
+++ b/source/blender/editors/util/ed_util_imbuf.c
@@ -291,7 +291,7 @@ static void sequencer_sample_apply(bContext *C, wmOperator *op, const wmEvent *e
Scene *scene = CTX_data_scene(C);
SpaceSeq *sseq = (SpaceSeq *)CTX_wm_space_data(C);
ARegion *region = CTX_wm_region(C);
- ImBuf *ibuf = sequencer_ibuf_get(bmain, region, depsgraph, scene, sseq, CFRA, 0, NULL);
+ ImBuf *ibuf = sequencer_ibuf_get(bmain, region, depsgraph, scene, sseq, scene->r.cfra, 0, NULL);
ImageSampleInfo *info = op->customdata;
float fx, fy;
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c b/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c
index d59d2cb52fc..bd8fd9f72ad 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c
@@ -182,7 +182,7 @@ void generic_bake_deform_stroke(
LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) {
if (retime) {
- CFRA = gpf->framenum;
+ scene->r.cfra = gpf->framenum;
BKE_scene_graph_update_for_newframe(depsgraph);
}
LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
@@ -193,7 +193,7 @@ void generic_bake_deform_stroke(
/* Return frame state and DB to original state. */
if (retime) {
- CFRA = oldframe;
+ scene->r.cfra = oldframe;
BKE_scene_graph_update_for_newframe(depsgraph);
}
}
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c
index 96e649bf7a1..30f1a004338 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c
@@ -129,7 +129,7 @@ static void bakeModifier(Main *UNUSED(bmain),
/* Apply lattice effects on this frame
* NOTE: this assumes that we don't want lattice animation on non-keyframed frames.
*/
- CFRA = gpf->framenum;
+ scene->r.cfra = gpf->framenum;
BKE_scene_graph_update_for_newframe(depsgraph);
/* Recalculate lattice data. */
@@ -153,7 +153,7 @@ static void bakeModifier(Main *UNUSED(bmain),
}
/* Return frame state and DB to original state. */
- CFRA = oldframe;
+ scene->r.cfra = oldframe;
BKE_scene_graph_update_for_newframe(depsgraph);
}
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c
index df66251159c..1d62e930caa 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c
@@ -163,7 +163,7 @@ static void bakeModifier(Main *UNUSED(bmain),
LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) {
/* apply mirror effects on this frame */
- CFRA = gpf->framenum;
+ scene->r.cfra = gpf->framenum;
BKE_scene_graph_update_for_newframe(depsgraph);
/* compute mirror effects on this frame */
@@ -172,7 +172,7 @@ static void bakeModifier(Main *UNUSED(bmain),
}
/* return frame state and DB to original state */
- CFRA = oldframe;
+ scene->r.cfra = oldframe;
BKE_scene_graph_update_for_newframe(depsgraph);
}
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilshrinkwrap.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilshrinkwrap.c
index cd2373dcb26..017287239ea 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilshrinkwrap.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilshrinkwrap.c
@@ -135,7 +135,7 @@ static void bakeModifier(Main *UNUSED(bmain),
LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) {
/* Apply shrinkwrap effects on this frame. */
- CFRA = gpf->framenum;
+ scene->r.cfra = gpf->framenum;
BKE_scene_graph_update_for_newframe(depsgraph);
/* Recalculate shrinkwrap data. */
@@ -163,7 +163,7 @@ static void bakeModifier(Main *UNUSED(bmain),
}
/* Return frame state and DB to original state. */
- CFRA = oldframe;
+ scene->r.cfra = oldframe;
BKE_scene_graph_update_for_newframe(depsgraph);
}
diff --git a/source/blender/io/gpencil/intern/gpencil_io_capi.cc b/source/blender/io/gpencil/intern/gpencil_io_capi.cc
index 84b273bc570..ac5f8cf7c8d 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_capi.cc
+++ b/source/blender/io/gpencil/intern/gpencil_io_capi.cc
@@ -112,7 +112,7 @@ static bool gpencil_io_export_pdf(Depsgraph *depsgraph,
continue;
}
- CFRA = i;
+ scene->r.cfra = i;
BKE_scene_graph_update_for_newframe(depsgraph);
exporter->prepare_camera_params(scene, iparams);
exporter->frame_number_set(i);
@@ -122,7 +122,7 @@ static bool gpencil_io_export_pdf(Depsgraph *depsgraph,
result = exporter->write();
/* Back to original frame. */
exporter->frame_number_set(iparams->frame_cur);
- CFRA = iparams->frame_cur;
+ scene->r.cfra = iparams->frame_cur;
BKE_scene_camera_switch_update(scene);
BKE_scene_graph_update_for_newframe(depsgraph);
break;
diff --git a/source/blender/io/wavefront_obj/exporter/obj_exporter.cc b/source/blender/io/wavefront_obj/exporter/obj_exporter.cc
index b0938084efb..77d4f6268bc 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_exporter.cc
+++ b/source/blender/io/wavefront_obj/exporter/obj_exporter.cc
@@ -323,7 +323,7 @@ void exporter_main(bContext *C, const OBJExportParams &export_params)
char filepath_with_frames[FILE_MAX];
/* Used to reset the Scene to its original state. */
- const int original_frame = CFRA;
+ const int original_frame = scene->r.cfra;
for (int frame = export_params.start_frame; frame <= export_params.end_frame; frame++) {
const bool filepath_ok = append_frame_to_filename(filepath, frame, filepath_with_frames);
@@ -332,11 +332,11 @@ void exporter_main(bContext *C, const OBJExportParams &export_params)
return;
}
- CFRA = frame;
+ scene->r.cfra = frame;
obj_depsgraph.update_for_newframe();
fprintf(stderr, "Writing to %s\n", filepath_with_frames);
export_frame(obj_depsgraph.get(), export_params, filepath_with_frames);
}
- CFRA = original_frame;
+ scene->r.cfra = original_frame;
}
} // namespace blender::io::obj
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index c45b06f8c85..f8fcd78d63b 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -2054,10 +2054,6 @@ extern const char *RE_engine_id_CYCLES;
#define V3D_CAMERA_SCENE(scene, v3d) \
((!(v3d)->scenelock && (v3d)->camera) ? (v3d)->camera : (scene)->camera)
-#define CFRA (scene->r.cfra)
-#define SUBFRA (scene->r.subframe)
-#define SFRA (scene->r.sfra)
-#define EFRA (scene->r.efra)
#define PRVRANGEON (scene->r.flag & SCER_PRV_RANGE)
#define PSFRA ((PRVRANGEON) ? (scene->r.psfra) : (scene->r.sfra))
#define PEFRA ((PRVRANGEON) ? (scene->r.pefra) : (scene->r.efra))
diff --git a/source/blender/sequencer/intern/strip_relations.c b/source/blender/sequencer/intern/strip_relations.c
index 1132c4dd69d..f89974b8fef 100644
--- a/source/blender/sequencer/intern/strip_relations.c
+++ b/source/blender/sequencer/intern/strip_relations.c
@@ -250,7 +250,7 @@ void SEQ_relations_free_imbuf(Scene *scene, ListBase *seqbase, bool for_render)
SEQ_prefetch_stop(scene);
for (seq = seqbase->first; seq; seq = seq->next) {
- if (for_render && SEQ_time_strip_intersects_frame(scene, seq, CFRA)) {
+ if (for_render && SEQ_time_strip_intersects_frame(scene, seq, scene->r.cfra)) {
continue;
}
diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_target_props.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_target_props.c
index 1c257424297..80876dfd798 100644
--- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_target_props.c
+++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_target_props.c
@@ -343,7 +343,7 @@ void WM_gizmo_target_property_anim_autokey(bContext *C,
{
if (gz_prop->prop != NULL) {
Scene *scene = CTX_data_scene(C);
- const float cfra = (float)CFRA;
+ const float cfra = (float)scene->r.cfra;
const int index = gz_prop->index == -1 ? 0 : gz_prop->index;
ED_autokeyframe_property(C, scene, &gz_prop->ptr, gz_prop->prop, index, cfra, false);
}