The (probably not so well written) question is: Is there any way to get object data right after it is loaded through bpy.import_scene.obj function?
I mean when i import an obj file with this function i need to make some more transformation for it. When i select an object via name 'Mesh' (default name of object after import) all those functions works for other objects named 'Mesh' in my scene. I tried to get an last object from objects list in scene but they're arranged alphabeticaly, so it didn't worked well. When i tried to change object.name and apply next functions to it, it works only for one. All earlier instances of imported object are back to default.
How to solve that problem? Is there a option to get from scene last added object? Or maybe some way to 'mark' *obj object right after it is imported before next functions are applied? Or maybe there is a way to import *obj data straight into created earlier blank object.
cheers, regg
PS: Working on Blender 2.63
Operators don't return data they load, but you can use tagging this way...
for obj in bpy.data.objects:
obj.tag = True
bpy.import_scene.obj(filepath="somefile.obj")
imported_objects = [obj for obj in bpy.data.objects if obj.tag is False]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With