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:
authorTon Roosendaal <ton@blender.org>2009-01-04 17:14:06 +0300
committerTon Roosendaal <ton@blender.org>2009-01-04 17:14:06 +0300
commitf7cb86df3a9ceccc4d649e42735732a608169157 (patch)
tree558a9ba43708a2213b1afa8f46d79f5daa140bc6 /source/blender/blenkernel/intern/key.c
parent74f9e98c828c17910405092785633373d4ae88e8 (diff)
2.5
Think global, act local! The old favorite G.scene gone! Man... that took almost 2 days. Also removed G.curscreen and G.edbo. Not everything could get solved; here's some notes. - modifiers now store current scene in ModifierData. This is not meant for permanent, but it can probably stick there until we cleaned the anim system and depsgraph to cope better with timing issues. - Game engine G.scene should become an argument for staring it. Didn't solve this yet. - Texture nodes should get scene cfra, but the current implementation is too tightly wrapped to do it easily.
Diffstat (limited to 'source/blender/blenkernel/intern/key.c')
-rw-r--r--source/blender/blenkernel/intern/key.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index 5540a262a1d..baf6e4630ee 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -993,7 +993,7 @@ static float *get_weights_array(Object *ob, char *vgroup)
return NULL;
}
-static int do_mesh_key(Object *ob, Mesh *me)
+static int do_mesh_key(Scene *scene, Object *ob, Mesh *me)
{
KeyBlock *k[4];
float cfra, ctime, t[4], delta, loc[3], size[3];
@@ -1017,11 +1017,11 @@ static int do_mesh_key(Object *ob, Mesh *me)
/* in do_key and cp_key the case a>tot is handled */
}
- cfra= G.scene->r.cfra;
+ cfra= scene->r.cfra;
for(a=0; a<me->totvert; a+=step, cfra+= delta) {
- ctime= bsystem_time(0, cfra, 0.0);
+ ctime= bsystem_time(scene, 0, cfra, 0.0);
if(calc_ipo_spec(me->key->ipo, KEY_SPEED, &ctime)==0) {
ctime /= 100.0;
CLAMP(ctime, 0.0, 1.0);
@@ -1056,7 +1056,7 @@ static int do_mesh_key(Object *ob, Mesh *me)
}
}
else {
- ctime= bsystem_time(ob, G.scene->r.cfra, 0.0);
+ ctime= bsystem_time(scene, ob, scene->r.cfra, 0.0);
if(calc_ipo_spec(me->key->ipo, KEY_SPEED, &ctime)==0) {
ctime /= 100.0;
@@ -1149,7 +1149,7 @@ static void do_rel_cu_key(Curve *cu, float ctime)
}
}
-static int do_curve_key(Curve *cu)
+static int do_curve_key(Scene *scene, Curve *cu)
{
KeyBlock *k[4];
float cfra, ctime, t[4], delta;
@@ -1172,11 +1172,11 @@ static int do_curve_key(Curve *cu)
/* in do_key and cp_key the case a>tot has been handled */
}
- cfra= G.scene->r.cfra;
+ cfra= scene->r.cfra;
for(a=0; a<tot; a+=step, cfra+= delta) {
- ctime= bsystem_time(0, cfra, 0.0);
+ ctime= bsystem_time(scene, 0, cfra, 0.0);
if(calc_ipo_spec(cu->key->ipo, KEY_SPEED, &ctime)==0) {
ctime /= 100.0;
CLAMP(ctime, 0.0, 1.0);
@@ -1198,7 +1198,7 @@ static int do_curve_key(Curve *cu)
}
else {
- ctime= bsystem_time(NULL, (float)G.scene->r.cfra, 0.0);
+ ctime= bsystem_time(scene, NULL, (float)scene->r.cfra, 0.0);
if(cu->key->type==KEY_RELATIVE) {
do_rel_cu_key(cu, ctime);
@@ -1221,7 +1221,7 @@ static int do_curve_key(Curve *cu)
return 1;
}
-static int do_latt_key(Object *ob, Lattice *lt)
+static int do_latt_key(Scene *scene, Object *ob, Lattice *lt)
{
KeyBlock *k[4];
float delta, cfra, ctime, t[4];
@@ -1236,11 +1236,11 @@ static int do_latt_key(Object *ob, Lattice *lt)
delta= lt->key->slurph;
delta/= (float)tot;
- cfra= G.scene->r.cfra;
+ cfra= scene->r.cfra;
for(a=0; a<tot; a++, cfra+= delta) {
- ctime= bsystem_time(0, cfra, 0.0);
+ ctime= bsystem_time(scene, 0, cfra, 0.0);
if(calc_ipo_spec(lt->key->ipo, KEY_SPEED, &ctime)==0) {
ctime /= 100.0;
CLAMP(ctime, 0.0, 1.0);
@@ -1257,7 +1257,7 @@ static int do_latt_key(Object *ob, Lattice *lt)
}
}
else {
- ctime= bsystem_time(NULL, (float)G.scene->r.cfra, 0.0);
+ ctime= bsystem_time(scene, NULL, (float)scene->r.cfra, 0.0);
if(lt->key->type==KEY_RELATIVE) {
KeyBlock *kb;
@@ -1294,7 +1294,7 @@ static int do_latt_key(Object *ob, Lattice *lt)
}
/* returns 1 when key applied */
-int do_ob_key(Object *ob)
+int do_ob_key(Scene *scene, Object *ob)
{
Key *key= ob_get_key(ob);
@@ -1339,16 +1339,16 @@ int do_ob_key(Object *ob)
}
else {
if(ob->ipoflag & OB_ACTION_KEY)
- do_all_object_actions(ob);
+ do_all_object_actions(scene, ob);
else {
- calc_ipo(key->ipo, bsystem_time(ob, G.scene->r.cfra, 0.0));
+ calc_ipo(key->ipo, bsystem_time(scene, ob, scene->r.cfra, 0.0));
execute_ipo((ID *)key, key->ipo);
}
- if(ob->type==OB_MESH) return do_mesh_key(ob, ob->data);
- else if(ob->type==OB_CURVE) return do_curve_key( ob->data);
- else if(ob->type==OB_SURF) return do_curve_key( ob->data);
- else if(ob->type==OB_LATTICE) return do_latt_key(ob, ob->data);
+ if(ob->type==OB_MESH) return do_mesh_key(scene, ob, ob->data);
+ else if(ob->type==OB_CURVE) return do_curve_key(scene, ob->data);
+ else if(ob->type==OB_SURF) return do_curve_key(scene, ob->data);
+ else if(ob->type==OB_LATTICE) return do_latt_key(scene, ob, ob->data);
}
return 0;