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/constraint.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/constraint.c')
-rw-r--r--source/blender/blenkernel/intern/constraint.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 82b1c71e56a..52448fca8d6 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -250,13 +250,16 @@ void unique_constraint_name (bConstraint *con, ListBase *list)
/* package an object/bone for use in constraint evaluation */
/* This function MEM_calloc's a bConstraintOb struct, that will need to be freed after evaluation */
-bConstraintOb *constraints_make_evalob (Object *ob, void *subdata, short datatype)
+bConstraintOb *constraints_make_evalob (Scene *scene, Object *ob, void *subdata, short datatype)
{
bConstraintOb *cob;
/* create regardless of whether we have any data! */
cob= MEM_callocN(sizeof(bConstraintOb), "bConstraintOb");
+ /* for system time, part of deglobalization, code nicer later with local time (ton) */
+ cob->scene= scene;
+
/* based on type of available data */
switch (datatype) {
case CONSTRAINT_OBTYPE_OBJECT:
@@ -1295,10 +1298,10 @@ static void followpath_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr
/* only happens on reload file, but violates depsgraph still... fix! */
if (cu->path==NULL || cu->path->data==NULL)
- makeDispListCurveTypes(ct->tar, 0);
+ makeDispListCurveTypes(cob->scene, ct->tar, 0);
if (cu->path && cu->path->data) {
- curvetime= bsystem_time(ct->tar, (float)ctime, 0.0) - data->offset;
+ curvetime= bsystem_time(cob->scene, ct->tar, (float)ctime, 0.0) - data->offset;
if (calc_ipo_spec(cu->ipo, CU_SPEED, &curvetime)==0) {
curvetime /= cu->pathlen;
@@ -1883,7 +1886,7 @@ static void pycon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraintT
/* this check is to make sure curve objects get updated on file load correctly.*/
if (cu->path==NULL || cu->path->data==NULL) /* only happens on reload file, but violates depsgraph still... fix! */
- makeDispListCurveTypes(ct->tar, 0);
+ makeDispListCurveTypes(cob->scene, ct->tar, 0);
}
/* firstly calculate the matrix the normal way, then let the py-function override
@@ -2050,7 +2053,7 @@ static void actcon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraint
else if (cob->type == CONSTRAINT_OBTYPE_OBJECT) {
Object workob;
/* evaluate using workob */
- what_does_obaction(cob->ob, &workob, data->act, t);
+ what_does_obaction(cob->scene, cob->ob, &workob, data->act, t);
object_to_mat4(&workob, ct->matrix);
}
else {
@@ -2965,7 +2968,7 @@ static void clampto_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstrain
/* only happens on reload file, but violates depsgraph still... fix! */
if (cu->path==NULL || cu->path->data==NULL)
- makeDispListCurveTypes(ct->tar, 0);
+ makeDispListCurveTypes(cob->scene, ct->tar, 0);
}
/* technically, this isn't really needed for evaluation, but we don't know what else