Save Load Pose data


I want to create a pose archive to save and load ANY objects transform including Biped and CAT. the mechanism is simple:

/* on save ... */
tm = obj.transform
if isvalidnode (parent = obj.parent) do tm *= inverse parent.transform
-- writing tm to file

/* on load ... */
tm = -- reading tm from file
if isvalidnode (parent = obj.parent) do tm *= parent.transform
obj.transfom = tm

it works for most cases, but it’s not working on some parts of the complex rigs. Do you think this is a correct method?