Python Scripting Question...

Hello, I have question regarding Blender scripting.

I have made an armature from script like below:

bpy.ops.object.armature_add(view_align = False, enter_editmode = False, location = (0, 0, 0), rotation = (0, 0, 0), layers = (True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False))

As you can see the location supposed to be on (0, 0, 0), in the properties panel it shows that the armature right in the correct position.

But why in 3D View panel the armature located not in the (0, 0, 0)?

===

And I just want to know why if I use the code directly in the Text Editor Panel and then run script it always return “Python Script Fail look into the console now?”

Thank you :slight_smile:

It is putting the origin(orange dot in your pic) of the armature at 0,0,0, and the bone at your 3d cursor location. As for the text editor, I’m assuming that line is the only thing you’re using? If that’s the case, the error you’re getting is from not importing the bpy module: import bpy.

you may wanna set the 3d cursor to 0,0,0 before running the operator

bpy.context.scene.cursor_location = (0,0,0)

Ohhh, okay thanks it works now…