Partial cleanup of timing system, with some guidance from Joshua:
* Fractional frames support has been changed to use a new var, scene->r.subframe. This is a 0.0-1.0 float representing a subframe interval, used in generating a final float frame number to evaluate animation system etc. * Changed frame_to_float() and some instances of bsystem_time() into a convenience function: float BKE_curframe(scene) which retrieves the floating point current frame, after subframe and frame length corrections. * Removed blur_offs and field_offs globals. These are now stored in render, used to generate a scene->r.subframe before render database processing.
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
#include "BKE_modifier.h"
|
||||
#include "BKE_object.h"
|
||||
#include "BKE_particle.h"
|
||||
#include "BKE_scene.h"
|
||||
|
||||
|
||||
static void initData(ModifierData *md)
|
||||
@@ -106,7 +107,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
||||
frac = bsystem_time(md->scene, ob, md->scene->r.cfra,
|
||||
bmd->start - 1.0f) / bmd->length;
|
||||
} else {
|
||||
frac = md->scene->r.cfra - bmd->start / bmd->length;
|
||||
frac = BKE_curframe(md->scene) - bmd->start / bmd->length;
|
||||
}
|
||||
CLAMP(frac, 0.0, 1.0);
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "BKE_modifier.h"
|
||||
#include "BKE_object.h"
|
||||
#include "BKE_pointcache.h"
|
||||
#include "BKE_scene.h"
|
||||
|
||||
|
||||
static void initData(ModifierData *md)
|
||||
@@ -119,7 +120,7 @@ static void deformVerts(
|
||||
CDDM_apply_vert_coords(dm, vertexCos);
|
||||
CDDM_calc_normals(dm);
|
||||
|
||||
current_time = bsystem_time (md->scene, ob, ( float ) md->scene->r.cfra, 0.0 );
|
||||
current_time = BKE_curframe(md->scene);
|
||||
|
||||
if(G.rt > 0)
|
||||
printf("current_time %f, collmd->time %f\n", current_time, collmd->time);
|
||||
|
||||
@@ -39,13 +39,14 @@
|
||||
#include "BLI_edgehash.h"
|
||||
|
||||
#include "BKE_cdderivedmesh.h"
|
||||
#include "BKE_deform.h"
|
||||
#include "BKE_lattice.h"
|
||||
#include "BKE_mesh.h"
|
||||
#include "BKE_modifier.h"
|
||||
#include "BKE_object.h"
|
||||
#include "BKE_particle.h"
|
||||
#include "BKE_scene.h"
|
||||
#include "BKE_utildefines.h"
|
||||
#include "BKE_deform.h"
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
@@ -682,7 +683,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
|
||||
timestep= psys_get_timestep(&sim);
|
||||
|
||||
//if(part->flag & PART_GLOB_TIME)
|
||||
cfra=bsystem_time(scene, 0,(float)scene->r.cfra,0.0);
|
||||
cfra= BKE_curframe(scene);
|
||||
//else
|
||||
// cfra=bsystem_time(scene, ob,(float)scene->r.cfra,0.0);
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "BKE_DerivedMesh.h"
|
||||
#include "BKE_object.h"
|
||||
#include "BKE_deform.h"
|
||||
#include "BKE_scene.h"
|
||||
|
||||
#include "depsgraph_private.h"
|
||||
|
||||
@@ -247,7 +248,7 @@ static void waveModifier_do(WaveModifierData *md,
|
||||
MVert *mvert = NULL;
|
||||
MDeformVert *dvert = NULL;
|
||||
int defgrp_index;
|
||||
float ctime = bsystem_time(scene, ob, (float)scene->r.cfra, 0.0);
|
||||
float ctime = BKE_curframe(scene);
|
||||
float minfac =
|
||||
(float)(1.0 / exp(wmd->width * wmd->narrow * wmd->width * wmd->narrow));
|
||||
float lifefac = wmd->height;
|
||||
|
||||
Reference in New Issue
Block a user