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/editors/space_view3d
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/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c5
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 23252804b36..ad5f393f956 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1960,6 +1960,7 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas
RegionView3D *rv3d = ar->regiondata;
ListBase *lb;
LodLevel *savedlod;
+ float savedobmat[4][4];
DupliObject *dob_prev = NULL, *dob, *dob_next = NULL;
Base tbase = {NULL};
BoundBox bb, *bb_tmp; /* use a copy because draw_object, calls clear_mesh_caches */
@@ -1982,6 +1983,7 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas
/* Make sure lod is updated from dupli's position */
+ copy_m4_m4(savedobmat, dob->ob->obmat);
copy_m4_m4(dob->ob->obmat, dob->mat);
savedlod = dob->ob->currentlod;
BKE_object_lod_update(dob->ob, rv3d->viewinv[3]);
@@ -2069,11 +2071,12 @@ static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Bas
tbase.object->dtx = dtx;
tbase.object->transflag = transflag;
tbase.object->currentlod = savedlod;
+ copy_m4_m4(tbase.object->obmat, savedobmat);
}
/* Transp afterdraw disabled, afterdraw only stores base pointers, and duplis can be same obj */
- free_object_duplilist(lb); /* does restore */
+ free_object_duplilist(lb);
if (use_displist)
glDeleteLists(displist, 1);
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index dcbcb127f5c..595e6dd98f2 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -987,7 +987,10 @@ short view3d_opengl_select(ViewContext *vc, unsigned int *buffer, unsigned int b
lb = object_duplilist(G.main->eval_ctx, scene, base->object);
for (dob = lb->first; dob; dob = dob->next) {
+ float omat[4][4];
+
tbase.object = dob->ob;
+ copy_m4_m4(omat, dob->ob->obmat);
copy_m4_m4(dob->ob->obmat, dob->mat);
/* extra service: draw the duplicator in drawtype of parent */
@@ -1000,7 +1003,7 @@ short view3d_opengl_select(ViewContext *vc, unsigned int *buffer, unsigned int b
tbase.object->dt = dt;
tbase.object->dtx = dtx;
- copy_m4_m4(dob->ob->obmat, dob->omat);
+ copy_m4_m4(dob->ob->obmat, omat);
}
free_object_duplilist(lb);
}