Created
December 14, 2011 05:17
-
-
Save PierrickKoch/1475376 to your computer and use it in GitHub Desktop.
Blender collada_import with imported_objects return
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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