scripting Collision meshes on imported Revit model

Hi, I have imported a large model from Revit, and I then wrote a python script that successfully applied DOP simplified collisions to all the thousands of actors. Here is part of one of the walls.


How can i stop the routine from creating mesh across the doorways, so that we can ‘walk around’ it in 3rd person?
Here’s the code i used, it does a basic job ok.

import unreal
asset_path =‘/game/…’
def add_box_collision (static_mesh):

# You could instead use .SPHERE, .CAPSULE, .NDOP10_X, .NDOP10_Y, .NDOP10_Z, .NDOP18, .NDOP26
shape_type = unreal.ScriptingCollisionShapeType.NDOP10_X
unreal.EditorStaticMeshLibrary.add_simple_collisions(static_mesh, shape_type)
unreal.EditorAssetLibrary.save_loaded_asset(static_mesh)

get a list of all Assets in the path.

all_assets = unreal.EditorAssetLibrary.list_assets(asset_path)
unreal.EditorFilterLibrary.by_class(all_assets,“Doors”,not,“”,“true”)

load them all into memory.

all_assets_loaded = [unreal.EditorAssetLibrary.load_asset(a) for a in all_assets]

filter the list to include

only Static Meshes.

static_mesh_assets = unreal.EditorFilterLibrary.by_class(all_assets_loaded, unreal.StaticMesh)

run the function above on each Static Mesh in the list.

list(map(add_box_collision, static_mesh_assets))

On a mesh like that it is often easier to set the collision to “use complex collision as simple” in the mesh properties. I don’t know how to do that in your script.

Simple collision is called simple for a reason. If the simple collision would be very complex then you can use the model itself as the collision model. That is what “use complex collision as simple” does.