Skip to content

Commit 4ba4435

Browse files
committed
The Ground Motion tool now takes into account certain unselected elements
Unselected objects from the foundation group are now also parented to the ground for user convenience. One can add neighboring buildings to this group so that they share the ground motion more easily, so selecting these structures and suppressing discretization etc. is not necessary.
1 parent 75a038e commit 4ba4435

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

kk_bullet_constraints_builder.zip

353 Bytes
Binary file not shown.

kk_bullet_constraints_builder/tools.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,6 +1363,17 @@ def tool_groundMotion(scene):
13631363

13641364
# Find passive mesh objects in selection
13651365
objs = [obj for obj in selection if obj.type == 'MESH' and not obj.hide and obj.is_visible(bpy.context.scene) and obj.rigid_body != None and obj.rigid_body.type == 'PASSIVE' and len(obj.data.vertices) > 0]
1366+
1367+
# Exceptionally also include unselected objects from the foundation group (for user convenience)
1368+
# One can add neighboring buildings to this group so that they share the ground motion more easily, so selecting these structures and suppressing discretization etc. is not necessary.
1369+
if len(props.preprocTools_fix_nam) > 0:
1370+
foundationName = props.preprocTools_fix_nam
1371+
if foundationName in bpy.data.groups:
1372+
grp = bpy.data.groups[foundationName]
1373+
for obj in grp.objects:
1374+
if obj.type == 'MESH' and not obj.hide and obj.is_visible(bpy.context.scene) and obj.rigid_body != None and obj.rigid_body.type == 'PASSIVE' and len(obj.data.vertices) > 0:
1375+
objs.append(obj)
1376+
13661377
if len(objs) == 0:
13671378
print("No passive rigid body elements selected, nothing attached to the ground.")
13681379
else:
@@ -1488,6 +1499,9 @@ def tool_groundMotion(scene):
14881499

14891500
else: print("No text file defined.");
14901501

1502+
# Deselect all objects.
1503+
bpy.ops.object.select_all(action='DESELECT')
1504+
14911505
# Revert to start selection
14921506
for obj in selection: obj.select = 1
14931507
bpy.context.scene.objects.active = selectionActive

0 commit comments

Comments
 (0)