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:
-rw-r--r--source/blender/blenkernel/BKE_scene.h2
-rw-r--r--source/blender/blenkernel/intern/particle.c2
-rw-r--r--source/blender/blenkernel/intern/pointcache.c4
-rw-r--r--source/blender/blenkernel/intern/scene.c14
-rw-r--r--source/blender/collada/AnimationExporter.cpp4
-rw-r--r--source/blender/collada/AnimationExporter.h1
6 files changed, 12 insertions, 15 deletions
diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h
index a6bd90c4fd2..ad394f9fb1a 100644
--- a/source/blender/blenkernel/BKE_scene.h
+++ b/source/blender/blenkernel/BKE_scene.h
@@ -86,7 +86,7 @@ void scene_select_base(struct Scene *sce, struct Base *selbase);
int scene_check_setscene(struct Main *bmain, struct Scene *sce);
float BKE_curframe(struct Scene *scene);
-float BKE_nextframe(struct Scene *scene);
+float BKE_frame_to_ctime(struct Scene *scene, const float frame);
void scene_update_tagged(struct Main *bmain, struct Scene *sce);
void scene_clear_tagged(struct Main *bmain, struct Scene *sce);
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index f8d281c2951..76d08f6fff2 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -3427,7 +3427,7 @@ ModifierData *object_add_particle_system(Scene *scene, Object *ob, const char *n
psys->totpart=0;
psys->flag = PSYS_ENABLED|PSYS_CURRENT;
- psys->cfra = BKE_nextframe(scene);
+ psys->cfra = BKE_frame_to_ctime(scene, CFRA + 1);
DAG_scene_sort(G.main, scene);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 7a8162391d5..ba5b98ee3cd 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -2148,8 +2148,8 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra
if(timescale) {
time= BKE_curframe(scene);
- nexttime= BKE_nextframe(scene);
-
+ nexttime= BKE_frame_to_ctime(scene, CFRA+1);
+
*timescale= MAX2(nexttime - time, 0.0f);
}
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 2f24b7e735d..66d29b02263 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -914,20 +914,16 @@ int scene_check_setscene(Main *bmain, Scene *sce)
*/
float BKE_curframe(Scene *scene)
{
- float ctime = scene->r.cfra;
- ctime += scene->r.subframe;
- ctime *= scene->r.framelen;
-
- return ctime;
+ return BKE_frame_to_ctime(scene, scene->r.cfra);
}
-/* Similar to BKE_curframe(), but is used by physics sims to get "next time", which is defined as cfra+1 */
-float BKE_nextframe(Scene *scene)
+/* This function is used to obtain arbitrary fractional frames */
+float BKE_frame_to_ctime(Scene *scene, const float frame)
{
- float ctime = (float)(scene->r.cfra + 1);
+ float ctime = frame;
ctime += scene->r.subframe;
ctime *= scene->r.framelen;
-
+
return ctime;
}
diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp
index b115a96cfa1..7bd70e9f289 100644
--- a/source/blender/collada/AnimationExporter.cpp
+++ b/source/blender/collada/AnimationExporter.cpp
@@ -759,7 +759,7 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames , Ob
for (it = frames.begin(); it != frames.end(); it++) {
float mat[4][4], ipar[4][4];
- float ctime = bsystem_time(scene, ob_arm, *it, 0.0f);
+ float ctime = BKE_frame_to_ctime(scene, *it);
BKE_animsys_evaluate_animdata(scene , &ob_arm->id, ob_arm->adt, ctime, ADT_RECALC_ANIM);
where_is_pose_bone(scene, ob_arm, pchan, ctime, 1);
@@ -1265,7 +1265,7 @@ void AnimationExporter::sample_animation(float *v, std::vector<float> &frames, i
for (it = frames.begin(); it != frames.end(); it++) {
float mat[4][4], ipar[4][4];
- float ctime = bsystem_time(scene, ob_arm, *it, 0.0f);
+ float ctime = BKE_frame_to_ctime(scene, *it);
BKE_animsys_evaluate_animdata(scene , &ob_arm->id, ob_arm->adt, ctime, ADT_RECALC_ANIM);
diff --git a/source/blender/collada/AnimationExporter.h b/source/blender/collada/AnimationExporter.h
index 7f6c99b108f..c3a5c7a5383 100644
--- a/source/blender/collada/AnimationExporter.h
+++ b/source/blender/collada/AnimationExporter.h
@@ -38,6 +38,7 @@ extern "C"
#include "BKE_DerivedMesh.h"
#include "BKE_fcurve.h"
#include "BKE_animsys.h"
+#include "BKE_scene.h"
#ifdef NAN_BUILDINFO
extern char build_rev[];
#endif