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:
authorLukas Tönne <lukas.toenne@gmail.com>2014-01-23 13:20:42 +0400
committerLukas Tönne <lukas.toenne@gmail.com>2014-01-23 13:20:42 +0400
commit6c1c6f22cea9729c40e02ed45374bad31fbca6dd (patch)
treec6433821f7ac73cd3f757d2de09afc1db00360ab /source/blender/blenkernel/intern/object_dupli.c
parent1713db203583a1b93143b14dfa77eb447697deac (diff)
Removed the omat matrix from DupliObject.
This was storing the original object matrix, which builds on the assumption that obmat is modified during dupli construction, which is a bad hack. Now the obmats are still modified, but this only happens outside of the dupli system itself and the original ("omat") is stored as local variables in the same place where the obmat manipulation takes place. This is easier to follow and avoids hidden hacks as much as possible. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D254
Diffstat (limited to 'source/blender/blenkernel/intern/object_dupli.c')
-rw-r--r--source/blender/blenkernel/intern/object_dupli.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c
index 41d411b9b1c..0671c8ea171 100644
--- a/source/blender/blenkernel/intern/object_dupli.c
+++ b/source/blender/blenkernel/intern/object_dupli.c
@@ -159,7 +159,6 @@ static DupliObject *make_dupli(const DupliContext *ctx,
dob->ob = ob;
mul_m4_m4m4(dob->mat, (float (*)[4])ctx->space_mat, mat);
- copy_m4_m4(dob->omat, ob->obmat);
dob->type = ctx->gen->type;
dob->animated = animated || ctx->animated; /* object itself or some parent is animated */
@@ -378,7 +377,6 @@ static void make_duplis_frames(const DupliContext *ctx)
BKE_object_where_is_calc_time(scene, ob, (float)scene->r.cfra);
dob = make_dupli(ctx, ob, ob->obmat, scene->r.cfra, false, false);
- copy_m4_m4(dob->omat, copyob.obmat);
}
}
@@ -839,7 +837,7 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem
ParticleCacheKey *cache;
float ctime, pa_time, scale = 1.0f;
float tmat[4][4], mat[4][4], pamat[4][4], vec[3], size = 0.0;
- float (*obmat)[4], (*oldobmat)[4];
+ float (*obmat)[4];
int a, b, hair = 0;
int totpart, totchild, totgroup = 0 /*, pa_num */;
int dupli_type_hack = !BKE_scene_use_new_shading_nodes(scene);
@@ -993,11 +991,9 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem
ob = oblist[b];
obmat = oblist[b]->obmat;
- oldobmat = obcopylist[b].obmat;
}
else {
obmat = ob->obmat;
- oldobmat = obcopy.obmat;
}
if (hair) {
@@ -1045,7 +1041,6 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem
dob = make_dupli(ctx, go->ob, mat, a, false, false);
dob->particle_system = psys;
- copy_m4_m4(dob->omat, obcopylist[b].obmat);
if (for_render)
psys_get_dupli_texture(psys, part, sim.psmd, pa, cpa, dob->uv, dob->orco);
}
@@ -1095,7 +1090,6 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem
dob = make_dupli(ctx, ob, mat, a, false, false);
dob->particle_system = psys;
- copy_m4_m4(dob->omat, oldobmat);
if (for_render)
psys_get_dupli_texture(psys, part, sim.psmd, pa, cpa, dob->uv, dob->orco);
/* XXX blender internal needs this to be set to dupligroup to render
@@ -1218,7 +1212,6 @@ void free_object_duplilist(ListBase *lb)
* solution is more complicated */
for (dob = lb->last; dob; dob = dob->prev) {
dob->ob->lay = dob->origlay;
- copy_m4_m4(dob->ob->obmat, dob->omat);
}
BLI_freelistN(lb);