Cleanup: improve naming and comments of scene frame/ctime functions
Confusingly, BKE_scene_frame_get did not match the frame number as expected by BKE_scene_frame_set. Instead it return the value after time remapping, which is commonly named "ctime". * Rename BKE_scene_frame_get to BKE_scene_ctime_get * Add a new BKE_scene_frame_get that matches BKE_scene_frame_set * Use int/float depending if fractional frame is expected
This commit is contained in:
@@ -101,7 +101,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, struct
|
||||
range_vn_i(faceMap, numPoly_src, 0);
|
||||
|
||||
struct Scene *scene = DEG_get_input_scene(ctx->depsgraph);
|
||||
frac = (BKE_scene_frame_get(scene) - bmd->start) / bmd->length;
|
||||
frac = (BKE_scene_ctime_get(scene) - bmd->start) / bmd->length;
|
||||
CLAMP(frac, 0.0f, 1.0f);
|
||||
if (bmd->flag & MOD_BUILD_FLAG_REVERSE) {
|
||||
frac = 1.0f - frac;
|
||||
|
||||
Reference in New Issue
Block a user