Skip to content

Instantly share code, notes, and snippets.

@PierrickKoch
Created December 14, 2011 05:17
Show Gist options
  • Save PierrickKoch/1475376 to your computer and use it in GitHub Desktop.
Save PierrickKoch/1475376 to your computer and use it in GitHub Desktop.
Blender collada_import with imported_objects return
def diff_list(l1, l2):
return [obj for obj in l1 if obj not in l2]
import bpy
def objects_names():
return [obj.name for obj in bpy.data.objects]
def collada_importer(filepath):
l1=objects_names()
bpy.ops.wm.collada_import(filepath=filepath)
return diff_list(objects_names(), l1)
f='pioneer3dx.dae'
imported_objects = collada_importer(f)
# in case
import os
p=os.path.abspath(f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment