DragonFF
DragonFF copied to clipboard
export col with auto bound only from OBJ mesh for LOD
need this thing for far distance object don't want use manual to each collection
also remove suffix .dff on collision object name thank
I don't think this should be part of DragonFF, but you can use a script like this:
import bpy
def find_layer_collection(layer_coll, target_coll):
for layer in layer_coll.children:
if layer.collection == target_coll:
return layer
result = find_layer_collection(layer, target_coll)
if result:
return result
return None
context = bpy.context
objects = [obj for obj in context.scene.objects if obj.dff.type == 'OBJ']
collections = {obj.users_collection[0] for obj in objects}
for obj in objects:
obj.dff.type = 'COL'
for coll in collections:
context.view_layer.active_layer_collection = find_layer_collection(context.view_layer.layer_collection, coll)
coll.dff.auto_bounds = False
bpy.ops.collection.dff_generate_bounds('INVOKE_DEFAULT')
for obj in objects:
obj.dff.type = 'OBJ'
maybe need? it used on map testing / LOD export option (mean don't export collision mesh, only auto bound box)