[Bf-blender-cvs] [747843516f3] blender2.8: Draw relationship lines for rigid body constraints
Sybren A. Stüvel
noreply at git.blender.org
Thu Jun 28 15:33:16 CEST 2018
Commit: 747843516f3c1e3f3f576464d97f2e82981cc436
Author: Sybren A. Stüvel
Date: Thu Jun 28 15:20:55 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB747843516f3c1e3f3f576464d97f2e82981cc436
Draw relationship lines for rigid body constraints
===================================================================
M source/blender/draw/modes/object_mode.c
===================================================================
diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c
index 887a1cb7721..288a7f80e1e 100644
--- a/source/blender/draw/modes/object_mode.c
+++ b/source/blender/draw/modes/object_mode.c
@@ -35,6 +35,7 @@
#include "DNA_object_force_types.h"
#include "DNA_lightprobe_types.h"
#include "DNA_particle_types.h"
+#include "DNA_rigidbody_types.h"
#include "DNA_view3d_types.h"
#include "DNA_world_types.h"
@@ -1939,6 +1940,19 @@ static void DRW_shgroup_relationship_lines(OBJECT_StorageList *stl, Object *ob)
DRW_shgroup_call_dynamic_add(stl->g_data->relationship_lines, ob->obmat[3]);
}
}
+
+ if (ob->rigidbody_constraint) {
+ Object *rbc_ob1 = ob->rigidbody_constraint->ob1;
+ Object *rbc_ob2 = ob->rigidbody_constraint->ob2;
+ if (rbc_ob1 && DRW_check_object_visible_within_active_context(rbc_ob1)) {
+ DRW_shgroup_call_dynamic_add(stl->g_data->relationship_lines, rbc_ob1->obmat[3]);
+ DRW_shgroup_call_dynamic_add(stl->g_data->relationship_lines, ob->obmat[3]);
+ }
+ if (rbc_ob2 && DRW_check_object_visible_within_active_context(rbc_ob2)) {
+ DRW_shgroup_call_dynamic_add(stl->g_data->relationship_lines, rbc_ob2->obmat[3]);
+ DRW_shgroup_call_dynamic_add(stl->g_data->relationship_lines, ob->obmat[3]);
+ }
+ }
}
static void DRW_shgroup_object_center(OBJECT_StorageList *stl, Object *ob, ViewLayer *view_layer, View3D *v3d)
More information about the Bf-blender-cvs
mailing list