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>2008-12-24 14:08:15 +0300
committerTon Roosendaal <ton@blender.org>2008-12-24 14:08:15 +0300
commite60e7f36679109a6c600f0029a60486e99d7995b (patch)
tree58cb1dfdc12d643283fbb1598b1c06a122c4fcaf /source/blender/blenkernel
parentbc5b56e2a8f962f7116b1d8ccdd20f07e2ff0d2b (diff)
2.5
Removed global "workob" from BKE, should now by passed on as an arg.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_action.h2
-rw-r--r--source/blender/blenkernel/BKE_object.h6
-rw-r--r--source/blender/blenkernel/intern/action.c38
-rw-r--r--source/blender/blenkernel/intern/blender.c2
-rw-r--r--source/blender/blenkernel/intern/constraint.c3
-rw-r--r--source/blender/blenkernel/intern/object.c42
6 files changed, 46 insertions, 47 deletions
diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h
index 37b1332170a..a0c8be7d7f8 100644
--- a/source/blender/blenkernel/BKE_action.h
+++ b/source/blender/blenkernel/BKE_action.h
@@ -133,7 +133,7 @@ void extract_pose_from_action(struct bPose *pose, struct bAction *act, float cti
/**
* Get the effects of the given action using a workob
*/
-void what_does_obaction(struct Object *ob, struct bAction *act, float cframe);
+void what_does_obaction(struct Object *ob, struct Object *workob, struct bAction *act, float cframe);
/**
* Iterate through the action channels of the action
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index a4a06b704bc..6d46aad5296 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -45,7 +45,9 @@ struct BulletSoftBody;
struct Group;
struct bAction;
-void clear_workob(void);
+void clear_workob(struct Object *workob);
+void what_does_parent(struct Object *ob, struct Object *workob);
+
void copy_baseflags(void);
void copy_objectflags(void);
struct SoftBody *copy_softbody(struct SoftBody *sb);
@@ -104,8 +106,6 @@ void where_is_object_time(struct Object *ob, float ctime);
void where_is_object(struct Object *ob);
void where_is_object_simul(struct Object *ob);
-void what_does_parent(struct Object *ob);
-
struct BoundBox *unit_boundbox(void);
void boundbox_set_from_min_max(struct BoundBox *bb, float min[3], float max[3]);
struct BoundBox *object_get_boundbox(struct Object *ob);
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 13ceced789b..beef3e1ef1d 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -1225,35 +1225,35 @@ static Object *get_parent_path(Object *ob)
/* For the calculation of the effects of an action at the given frame on an object
* This is currently only used for the action constraint
*/
-void what_does_obaction (Object *ob, bAction *act, float cframe)
+void what_does_obaction (Object *ob, Object *workob, bAction *act, float cframe)
{
ListBase tchanbase= {NULL, NULL};
- clear_workob();
- Mat4CpyMat4(workob.obmat, ob->obmat);
- Mat4CpyMat4(workob.parentinv, ob->parentinv);
- Mat4CpyMat4(workob.constinv, ob->constinv);
- workob.parent= ob->parent;
- workob.track= ob->track;
+ clear_workob(workob);
+ Mat4CpyMat4(workob->obmat, ob->obmat);
+ Mat4CpyMat4(workob->parentinv, ob->parentinv);
+ Mat4CpyMat4(workob->constinv, ob->constinv);
+ workob->parent= ob->parent;
+ workob->track= ob->track;
- workob.trackflag= ob->trackflag;
- workob.upflag= ob->upflag;
+ workob->trackflag= ob->trackflag;
+ workob->upflag= ob->upflag;
- workob.partype= ob->partype;
- workob.par1= ob->par1;
- workob.par2= ob->par2;
- workob.par3= ob->par3;
+ workob->partype= ob->partype;
+ workob->par1= ob->par1;
+ workob->par2= ob->par2;
+ workob->par3= ob->par3;
- workob.constraints.first = ob->constraints.first;
- workob.constraints.last = ob->constraints.last;
+ workob->constraints.first = ob->constraints.first;
+ workob->constraints.last = ob->constraints.last;
- strcpy(workob.parsubstr, ob->parsubstr);
- strcpy(workob.id.name, ob->id.name);
+ strcpy(workob->parsubstr, ob->parsubstr);
+ strcpy(workob->id.name, ob->id.name);
/* extract_ipochannels_from_action needs id's! */
- workob.action= act;
+ workob->action= act;
- extract_ipochannels_from_action(&tchanbase, &workob.id, act, "Object", bsystem_time(&workob, cframe, 0.0));
+ extract_ipochannels_from_action(&tchanbase, &workob->id, act, "Object", bsystem_time(workob, cframe, 0.0));
if (tchanbase.first) {
execute_ipochannels(&tchanbase);
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index 6cadd57e390..7c2d4502e5e 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -213,8 +213,6 @@ void initglobals(void)
G.windowstate = G_WINDOWSTATE_USERDEF;
#endif
- clear_workob(); /* object.c */
-
G.charstart = 0x0000;
G.charmin = 0x0000;
G.charmax = 0xffff;
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index cbdcfa56ff2..97a22f9d002 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -2046,8 +2046,9 @@ static void actcon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraint
free_pose(pose);
}
else if (cob->type == CONSTRAINT_OBTYPE_OBJECT) {
+ Object workob;
/* evaluate using workob */
- what_does_obaction(cob->ob, data->act, t);
+ what_does_obaction(cob->ob, &workob, data->act, t);
object_to_mat4(&workob, ct->matrix);
}
else {
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 2d7a5283b0c..51069c7d3ea 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -120,13 +120,12 @@
static void solve_parenting (Object *ob, Object *par, float obmat[][4], float slowmat[][4], int simul);
float originmat[3][3]; /* after where_is_object(), can be used in other functions (bad!) */
-Object workob;
-void clear_workob(void)
+void clear_workob(Object *workob)
{
- memset(&workob, 0, sizeof(Object));
+ memset(workob, 0, sizeof(Object));
- workob.size[0]= workob.size[1]= workob.size[2]= 1.0;
+ workob->size[0]= workob->size[1]= workob->size[2]= 1.0;
}
@@ -2106,29 +2105,30 @@ for a lamp that is the child of another object */
}
/* for calculation of the inverse parent transform, only used for editor */
-void what_does_parent(Object *ob)
+void what_does_parent(Object *ob, Object *workob)
{
- clear_workob();
- Mat4One(workob.obmat);
- Mat4One(workob.parentinv);
- Mat4One(workob.constinv);
- workob.parent= ob->parent;
- workob.track= ob->track;
+ clear_workob(workob);
+
+ Mat4One(workob->obmat);
+ Mat4One(workob->parentinv);
+ Mat4One(workob->constinv);
+ workob->parent= ob->parent;
+ workob->track= ob->track;
- workob.trackflag= ob->trackflag;
- workob.upflag= ob->upflag;
+ workob->trackflag= ob->trackflag;
+ workob->upflag= ob->upflag;
- workob.partype= ob->partype;
- workob.par1= ob->par1;
- workob.par2= ob->par2;
- workob.par3= ob->par3;
+ workob->partype= ob->partype;
+ workob->par1= ob->par1;
+ workob->par2= ob->par2;
+ workob->par3= ob->par3;
- workob.constraints.first = ob->constraints.first;
- workob.constraints.last = ob->constraints.last;
+ workob->constraints.first = ob->constraints.first;
+ workob->constraints.last = ob->constraints.last;
- strcpy(workob.parsubstr, ob->parsubstr);
+ strcpy(workob->parsubstr, ob->parsubstr);
- where_is_object(&workob);
+ where_is_object(workob);
}
BoundBox *unit_boundbox()