| Code: |
|
import bpy folder = "D:/cg/export" file = "test.obj" foo = bpy.ops.import_scene.obj(filepath=(folder + "/" + file)) print(foo) # foo = {'FINISHED'} # so how do i access the object i just imported? |
| CoDEmanX wrote: |
| importers should clear previous user selection and select all newly imported objects, thus you should be able to access them via
bpy.context.selected_objects |
| Code: |
|
bpy.ops.import_scene.obj(filepath=fullpath) imported = bpy.context.selected_objects[0] print(imported.name) |