cubik 0.1.0

OpenGL/glium-based multiplayer game engine
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import bpy
import sys

bpy.ops.object.select_all(action='DESELECT')
for collection in bpy.data.collections:
	if collection.name.endswith('_merge'):
		print(f'Merging {collection.name}...')
		bpy.ops.object.select_same_collection(collection=collection.name)
		if len(bpy.context.selected_objects) == 0:
			continue
		bpy.context.view_layer.objects.active = bpy.context.selected_objects[0]
		bpy.ops.object.join()
		bpy.context.active_object.name = collection.name[:-6]
		bpy.ops.object.select_all(action='DESELECT')

bpy.ops.export_scene.obj(filepath=sys.argv[-1], path_mode='RELATIVE')