I have been trying to update a script I wrote for 2.49b to 2.6x. Right now, I have been trying to create an empty object with a specific name, location, and rotation. I found the bpy.ops.object.add function that will create an object with a specified location and rotation, but not a specified name. There is bpy.ops.object.add_named, but with it I cannot specify a specific location or rotation.
I have in my code:
e = bpy.ops.object.add(type="EMPTY",location=(x,0.0,-10.0),rotation=(0.0,0.0,0.0))
It appears that e is a set that contains the string “FINISHED” instead of being the newly created object like it was in 2.49b. It would be sufficient if I can rename the object once it has been created (or reset the location/rotation) but I don’t know how to access the newly created empty object since bpy.ops.object.add doesn’t seem to return it.
As I continue updating my code, I’ll probably use this thread for a lot more questions about how to update my script from 2.49b to 2.6x, so I hope nobody minds.