How to restore bone's center_point and end_point to default by script?

butaixianranbutaixianran Posts: 161

There are some high heels gonna change feet bone's center_point and end_point when wearing them. These high heels run following code in their .duf file:

{

"id" : "lFoot",

"url" : "/data/path/HighHeel.dsf#lFoot",

"name" : "lFoot",

"label" : "Left Foot",

"parent" : "#lShin",

"preview" : {

"type" : "bone",

"oriented_box" : {

"min" : [ -4.58, -13.362, -1.964 ],

"max" : [ 4.016, -1.565, 10.886 ]

},

"center_point" : [ 20.50789, 8.32, -4.65 ],

"end_point" : [ 22.5267, 5.493055, 0.3605399 ],

"rotation_order" : "ZYX"

}

},

 

It changes foot bone's head and tail's position, which changes character's zero pose forever. That is a big problem in some case.

When this happen, if you run "bone.clearAllTransformData()" in script, it will not restore to default pose, it will still be in high heeled pose.

 

So, How to restore a bone's center_point and end_point to default position by script?

Thanks!

 

Post edited by butaixianran on

Comments

  • butaixianranbutaixianran Posts: 161
    edited February 2022

    Ok, find out what really happened.  Those high heels did not change bone head and tail. They use a pose file called: pCTRLlFootHeeledShoe, which comes from G8 Female Starter.

    The label is: Foot Heeled Shoe

     

    And if you want to get bone's default head and tail position,try this:

    bone.getOrigin(true)

    bone.getOrigin(true)

     

     

    Post edited by butaixianran on
Sign In or Register to comment.