All you need to do is constrain your object with maintain offset turned off, and then delete the constraint. So, a quick and easy way to do this with point and orient constraints.
delete `pointConstraint $obj $targetObj` ;
delete `orientConstraint $obj $targetObj` ;
This deletes the return (the name of the constraint) after running the constraint itself.
Similarly you could just use a parent constraint.
delete `parentConstraint $obj $targetObj` ;
Credit to John Riggs for showing me this trick.
Funny I found both this post and another dealing with the same thing:) figured you might like to see this one also.
ReplyDeletehttp://sugarandcyanide.com/blog/2009/07/05/a-quick-note-on-object-snapping/
That's another clever method! Shame though the author doesn't really say they weren't satisfied with the first method. It's essentially doing the same exact thing.
ReplyDelete