Skip to content

Instantly share code, notes, and snippets.

@traversaro
Last active December 28, 2015 09:29
Show Gist options
  • Save traversaro/7479806 to your computer and use it in GitHub Desktop.
Save traversaro/7479806 to your computer and use it in GitHub Desktop.
Script for extracting meshes from arboris-python collada files
import bpy
#unselect everything
# <insert code here, this can vary depending on your situation>
bpy.ops.object.select_all()
# gather list of items of interest.
candidate_list = [item.name for item in bpy.data.objects if (item.name == "l_hand_mesh" or item.name == "l_hand")]
# select them only.
for object_name in candidate_list:
bpy.data.objects[object_name].select = False
# remove all selected.
bpy.ops.object.delete()
# remove the meshes, they have no users anymore.
#for item in bpy.data.meshes:
# bpy.data.meshes.remove(item)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment