PDA

View Full Version : LScipt trouble with Bone Twist



Mythigo
05-05-2017, 09:00 AM
Can anyone tell me how to turn on the Twist feature under bone properties using LScript. I've searched around and just can't find an answer.

I'm stupid when it comes to any scripting, so bare with me. In LS Commander the commands I get are...

BoneTwist();
CommandInput("BoneTwistAmount 1");

I figured that since there is no value of 1 or 0 set in BoneTwist() it would toggle just like ParentInPlace(). Nope. When I set it to BoneTwist(0) or BoneTwist(1) it won't set it on or off. All I can get is the error message "Line 6, unable to locate function reference BoneTwist".

Here's the script I've been testing with...

@warnings

generic
{
SelectItem("lHand");
BoneTwist();
CommandInput("BoneTwistAmount 1");
}

MonroePoteet
05-11-2017, 06:47 AM
By removing the () from the BoneTwist function, it will resolve the reference but it still doesn't work. Without a parameter, I'd expect it to work as you describe: toggling the BoneTwist on or off for each successive call. Ideally, it would take the parameter as you suggest to explicitly specify on (1) or off (0). As you probably know, the Bone needs to be of type "Joint" rather than "Z axis", which can be done with the BoneType(2) function:

@warnings

generic
{
BoneType(2);
BoneTwist;
CommandInput("BoneTwistAmount 0.45");
}

Seems broken to me and probably worth a bug report (BoneTwist doesn't work) and an enhancement request (add on / off parameter to BoneTwist).

mTp

Mythigo
05-11-2017, 07:05 AM
Thanks. I appreciate the insight going forward.

MonroePoteet
05-11-2017, 09:25 AM
After another experiment: BoneTwist works to toggle the flag on and off when used with CommandInput:

@warnings

generic
{
BoneType(2);
CommandInput("BoneTwist");
CommandInput("BoneTwistAmount 0.45");
}

It'd still be nice to have an explicit on / off parameter.

mTp

Mythigo
05-11-2017, 09:57 AM
EXCELLENT! That worked perfectly. Thank you!