Create an empty parent and zero out the current location

Hi,
This is a very small and simple script that I wrote during my last project, but it saved me sooo much time in this project, since the animation was based on empties and objects, and not armatures.

if you select an object or several objects and run the script, it will create for each object a parent empty in the same location of the object’s pivot, the empties are generated in the last visibility layer.
if the object already has a parent then it will add the empty inbetween the hierarchy. so the object will get the new parent empty and the new parent empty will be the child of the old parent, so hierarchy stay the same with one more parent inbetween.
and the most important thing is that the object’s location and rotation is being Zeroed! while keeping its location.
so the Zero location of the object will be in the intial location - where your empty is.
That’s important because when you parent and object to an empty or any other object somewhere else then the zero position of the world, and choose keep transformations, the object’s zero postion will still be the world’s Zero, and if you will apply the location then your pivot will move to the world’s Zero.
but if you use the script then when ever you press ALT+G to zero the location then your object will go to its initial position - where the empty parent is located, similiar to how bones work.

I hope that was a clear explanation, if not I might do a small video that explains it.

If you use the script please use it with care. It worked mostly ok (and saved me a lot of time on my last project) but it can still have issues, right now the known issues are if your hierarchy have different scales. you better use it only when all your scales are applied.
another issue is if your object already has animation. since the new zero location of your object is where your object is then the whole animation will move according to the new zero position. if you do already have animation then to fix this problem you could use my multikeyaddon.

Ok, so many words for such a little script. but like I said, for an object/empty based animation (no armatures) it can boost the workflow a lot

1 Like