Forum

Bone rotation via RangeSlider

13 March 2019 16:11
Hello,

i made a little Sample, to show my Problem.
I want to make a Project, where I can controll the Bones with Rangesliders.

I could make it work, but i want to have an other result.
I want, that the last Bone on the right starts to rotate fron 0.0 to 0.5
and the second Bone in the middle from 0.5 to 1.

So they're not rotating at the same time, but are controlled with the same slider.

I hope i explained it well.

Here is my Project:
Bone_Rangeslider_PROJECT.zip

and here the builded version:
Bone_Rangeslider_BUILD.zip
Kind regards,

Bani
13 March 2019 19:21
Replace the two bone movement lines with these:
    m_armat.set_bone_tsr_rel(rig,"Bone.001",[0,0,0,1,1,1,0,0,rangeSlider.value>=0.5?(-rangeSlider.value+0.5)/2:0]); // middle bone
    m_armat.set_bone_tsr_rel(rig,"Bone.002",[0,0,0,1,1,1,0,0,rangeSlider.value<=0.5?(-rangeSlider.value)/2:-0.25]); // end bone
 
Please register or log in to leave a reply.