Clearing Object Origin 2.49?

Hi All,

I am working on a script and I need to clear the objects origin like when pressing ALT-O.

Does anyone have any code or tips on how to do that?

Thanks!

I ended up with something like this…


    # Reset the origin of this object.
    MAT=Blender.Mathutils.Matrix([1.0,0.0,0.0,0.0],[0.0,1.0,0.0,0.0],[0.0,0.0,1.0,0.0],[0.0,0.0,0.0,1.0])
    obBase.setMatrix(MAT) 

Does this make sense?

This nulifies location and rotation and sets SCALE to (1,1,1). If different in the original object - you’re loosing data.

So what is the solution?

I have a script that mostly works, it involves multi-level parenting. Sometime the child at the bottom of the stack gets out of wack. If I select the object manually and press ALT-O it jumps to the correct place. What line/s of code can I put in my script to simulate pressing ALT-O?

I dont know, really… Im having problems with some missing API regarding armatures and renaming bones before re-linking the same objects. At me, those object seems to “move” a little after re-linking to armature ----> the same move happens when I click the ALT-O combinations… sooooooo may it is related??? Link_1 Link_2

Will send a .blend later today incl. code so that you (or somebody else) can check the effect and MAY BE advise on a solution… i’ve lost 10 days on trying to solve this issue in several ways, but no success to me by now.

May be issues are related??

@ Atom - See my thread here… Go back to the initial BLEND-file… You may try ALT-O on the original “Cube.084”, i.e. the lower cube, the object the we deal in the first exercise… You may notice that it moves the same way as at linking in the armature… That is what I mean saying your issue and mine expressed here and in the other two threads (Link_1 Link_2) is of a similar nature (perhaps). At least the visual result is the same move!