I think looking at your code your problem is the value (0,0,1) that is not the way the operator works, look the values it said to me in my code above. It seems the vector of moving is always in world space. I agree it would be immensely easy if they change it to work as your code.
It’s not that useful though. It’d be much nicer if we could just say “move 1 unit” along the “normal z axis”… which is how we do it in the interface as well. And I thought bpy.ops was supposed to do “interface style stuff”…
I’ll have to poke cam when he’s back from his holidays I guess…
Actually… after doing more tests… if I use my code, in the info window it prints out the translate values properly, but has the “constraint_orientation” as “GLOBAL” so I think even if you are correct about the way it’s “supposed” to work… there’s still a bug.
Well it took me a long while, and Ton even had a look for me… apparently it’s all my fault hehe
It didn’t work because it only works if you run this stuff inside the 3d view… not from the console or the text editor! Which I personally think is really crap…
So the only way to use bpy.ops properly is to run it for instance as an addon… eh… yeah… so… there ya go.
Ido, not if you’re using bpy.ops… the text editor is then the wrong context… it might do something, but not what you want if you want anything other than the default settings.
I think that console and text editor would be better don’t be part of the context. It would be much easier try things that just now don’t work because the context is the console or the text window.
Bao2—good point. But remember the console and text editor are also scriptable, just like every other part of Blender, so they cannot be treated specially without introducing further complications.