TransWikia.com

How to Separate Mesh by "Loose Parts" through Python API?

Blender Asked on November 17, 2021

I would like to automate the process of modifying a .fbx file but I’m not quite sure why my code isn’t working. All I’m doing is importing a .fbx file, separating the mesh by "Loose Parts", and then exporting it back out. Any thoughts?

import bpy

bpy.ops.import_scene.fbx(filepath="C:/Users/'user'/Downloads/Futuristic_ghetto_building/Futuristic ghetto building_one_Mesh_fbx.fbx")
bpy.ops.object.select_all(action='DESELECT')

buildings = bpy.data.objects['Plane']
buildings.select = True
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.separate(type='LOOSE')

Note: The code isn’t exporting anything right now for testing purposes

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP