Page 1 of 1

how to parent bones without changing there global pos or rotation

Posted: Mon Nov 21, 2022 12:29 am
by Joh_Jos
Hi
I am new to scripting so I think this is a simple question but I can't get it!
I am trying to parent bones without changing there positions
first idea
I was thinking to store the pos data for the child and the parent bones then substract them to know the difference, and after parenting add the difference value
then i will have to deal with the rotation
I don't feel this should be so complicated

second idea
after some research I found the matrix but I can't understand how does it work?
is it like saving data before parent on LM.Vector2:new_local() and after parenting on another LM.Vector2:new_local()
when to create LM.Vector2:new_local() and when to create LM.Matrix:new_local() ? :roll:

Thank you guys

Re: how to parent bones without changing there global pos or rotation

Posted: Mon Nov 21, 2022 4:46 am
by synthsin75
Off hand, I'd say look at the reparent bone tool. It should be a good example.

Re: how to parent bones without changing there global pos or rotation

Posted: Wed Nov 23, 2022 9:23 pm
by Joh_Jos
Thank you this simple answer helped a lot :D
I kept looking for scripts using similar code forgetting the built-in scripts :oops: