virtualmesh
03-21-2006, 01:33 PM
I'm writing this on route and away from my workstation...typing from memory. excuse me for being so wordy. my question is at the bottom of the following background.
I was creating a buldging bicep bone on my character's humerus and wondered how to slow down the amount of X movement the nub bone on the bicep bone would move in conjunction with the two point helpers I linked to both the humerus and forearm bones.
1. positioned a point helper ("distBicepP") at the center of the forearm along where the radius bone would be then zero'd it's transform values.
2. positioned a second point helper ("distBicepD") at the center of the humerus bone where the bicep would buldge (front of the the humerus bone)
Now when the forearm and humerus bend at the elbow towards each other, these two point helpers will follow along their parent bones and get closer to each other until they are almost right on top of each other. of course the rotation at the elbow will not get this far...but I wanted to give some visual clue for these two helper objects and what they will do.
3. drew two more helper objects but positioned them both where the actual muscle bone ends would be. in this case, one would be where the elbow bends "bicepElbow" and the other just below the shoulder area "bicepShldr"
4. drew a single joint bone from the bicepShldr to the bicepElbow helpers and set it's bone properties to "stretch" and reset the Scale/Stretch values.
5. position constrained the nub bone from step 4 to bicepElbow helper
6. look-at contstrained the root bone from step 4 to bicepElbow helper while setting the upnode to be the bicepShldr helper, linked the root bone to bicepShldr helper.
7. replaced the nub bone's X position under the zero'd out pos controller to be an Expression Controller.
Expression Controller's settings:
set up one scalar constant variable called "Rcon" that was set to the distance between distBicepD and distBicepP helper objects: maxscript listener distance $[1] $[2] with both helper objects selected gave me my value for this variable. I took this value with the arm stretched out to it's max (Ik goal at the wrist moved until the elbow was straight).
set up two vector variables:
bE assigned to the bicepElbow point helper
bS assigned to the bicepShldr point helper
expression is:
if (length (bE-bS)-Rcon<10,(length (bE-bS)-Rcon/2),0
the 10 represents when the underlined value is assigned to the X position of the nub bone within the bicep muscle. if it's false then the nub bone should stay where it is. the value of 2 seemed to decrease the starting position of the nub bone.
I want to be able to make the position movement stop at a certain distance between bE and bS.
Question:
what would be a better equation to ensure that when the distance between bE and bS get less than 10 do A else if less than 2 do B else do C? basically, how would one write an if/else if/else statement within Expression Controller ?
I was creating a buldging bicep bone on my character's humerus and wondered how to slow down the amount of X movement the nub bone on the bicep bone would move in conjunction with the two point helpers I linked to both the humerus and forearm bones.
1. positioned a point helper ("distBicepP") at the center of the forearm along where the radius bone would be then zero'd it's transform values.
2. positioned a second point helper ("distBicepD") at the center of the humerus bone where the bicep would buldge (front of the the humerus bone)
Now when the forearm and humerus bend at the elbow towards each other, these two point helpers will follow along their parent bones and get closer to each other until they are almost right on top of each other. of course the rotation at the elbow will not get this far...but I wanted to give some visual clue for these two helper objects and what they will do.
3. drew two more helper objects but positioned them both where the actual muscle bone ends would be. in this case, one would be where the elbow bends "bicepElbow" and the other just below the shoulder area "bicepShldr"
4. drew a single joint bone from the bicepShldr to the bicepElbow helpers and set it's bone properties to "stretch" and reset the Scale/Stretch values.
5. position constrained the nub bone from step 4 to bicepElbow helper
6. look-at contstrained the root bone from step 4 to bicepElbow helper while setting the upnode to be the bicepShldr helper, linked the root bone to bicepShldr helper.
7. replaced the nub bone's X position under the zero'd out pos controller to be an Expression Controller.
Expression Controller's settings:
set up one scalar constant variable called "Rcon" that was set to the distance between distBicepD and distBicepP helper objects: maxscript listener distance $[1] $[2] with both helper objects selected gave me my value for this variable. I took this value with the arm stretched out to it's max (Ik goal at the wrist moved until the elbow was straight).
set up two vector variables:
bE assigned to the bicepElbow point helper
bS assigned to the bicepShldr point helper
expression is:
if (length (bE-bS)-Rcon<10,(length (bE-bS)-Rcon/2),0
the 10 represents when the underlined value is assigned to the X position of the nub bone within the bicep muscle. if it's false then the nub bone should stay where it is. the value of 2 seemed to decrease the starting position of the nub bone.
I want to be able to make the position movement stop at a certain distance between bE and bS.
Question:
what would be a better equation to ensure that when the distance between bE and bS get less than 10 do A else if less than 2 do B else do C? basically, how would one write an if/else if/else statement within Expression Controller ?
