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:
authorSergej Reich <sergej.reich@googlemail.com>2013-03-31 23:52:37 +0400
committerSergej Reich <sergej.reich@googlemail.com>2013-03-31 23:52:37 +0400
commit4e0e9eb994da96c19262ec2f2a2c33ed9b53852d (patch)
tree64ffe271e52e491c041c07852b3792fe05b312da
parent6382ebe67d6c1538e29204e0a42c254315b367dd (diff)
Draw relationship lines for rigid body constraints
Makes it easier to see what's connected to what.
-rw-r--r--source/blender/editors/space_view3d/drawobject.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index b448e0589ae..d203da06f12 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -37,6 +37,7 @@
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meta_types.h"
+#include "DNA_rigidbody_types.h"
#include "DNA_scene_types.h"
#include "DNA_smoke_types.h"
#include "DNA_world_types.h"
@@ -6957,6 +6958,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
/* not for sets, duplicators or picking */
if (dflag == 0 && (v3d->flag & V3D_HIDE_HELPLINES) == 0 && (v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
ListBase *list;
+ RigidBodyCon *rbc = ob ? ob->rigidbody_constraint : NULL;
/* draw hook center and offset line */
if (ob != scene->obedit) draw_hooks(ob);
@@ -7042,6 +7044,22 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
BKE_constraints_clear_evalob(cob);
}
+ /* draw rigid body constraint lines */
+ if (rbc) {
+ UI_ThemeColor(TH_WIRE);
+ setlinestyle(3);
+ glBegin(GL_LINES);
+ if (rbc->ob1) {
+ glVertex3fv(ob->obmat[3]);
+ glVertex3fv(rbc->ob1->obmat[3]);
+ }
+ if (rbc->ob2) {
+ glVertex3fv(ob->obmat[3]);
+ glVertex3fv(rbc->ob2->obmat[3]);
+ }
+ glEnd();
+ setlinestyle(0);
+ }
}
free_old_images();