PDA

View Full Version : Bicep/Thigh Twist


raimZ
10-15-2006, 12:24 AM
Hi all, i've spent hours upon hours trying to figure out how to get a proper bicep and thigh twist. I'm using 5 cubes lined along the particular bone, which will eventually be used to deform the envelope. So far, i can manage to create a twist, but it just isn't correct. The cube closest to the root twists too much.

I've done a search and came up with this thread http://forums.cgsociety.org/newthread.php?do=newthread&f=24
but done in 3dsmax. Looks really cool though. Any ideas on how i can do this in xsi?

Hopefully somebody can help me out.
Cheers.

dwigfor
10-15-2006, 01:13 AM
Check out www.3dquakers.com (http://www.3dquakers.com) if you'd like to purchase a video tutorial that covers twisting arms/legs.

Also, your link seems to be wrong - creates a new post, for me.

tuna
10-15-2006, 01:38 AM
There are quite a few ways to do this in XSI. You can simply constrain the object to the bone and offset it with an expression (remove the bone's rotation divided by # to get an offset), or you can parent it and use an expression, or you can simply use the makebiceproll or makeforearmroll in-built commands to create them.

I've seen the 3dquakers methods and found them to be very complex and didnt even work in FK.

[edit] your link points to the reply for this page.

Sbowling
10-15-2006, 03:44 AM
Hi all, i've spent hours upon hours trying to figure out how to get a proper bicep and thigh twist. I'm using 5 cubes lined along the particular bone, which will eventually be used to deform the envelope. So far, i can manage to create a twist, but it just isn't correct. The cube closest to the root twists too much.


This is actually real easy. There are two ways I've seen these setup. One would be to set the rotation expression relative to the parent rotating object such as

parentobject.local.rotx * 0.5

If this expression is applied to the x rotation channel of an object that is the child of "parentobject" it will rotate half of what parent object is rotated. You could then just copy the child object with the expression already applied to it and position and parent it to the original child object. Now the first child object will rotate half of what the "parentobject" rotates and the second object will rotate half of what the child object. The reason why it does this is because the second child object is inheriting the rotation of the first child object it is parented to. To adjust the rotation of the entire chain you just need to make sure the total rotation (rotx) values are equal one so that the rotation of the last rotator object isn't over or under rotating.

The other way I've seen parent each twist object to the bone and doesn't parent them together, so each expression has to be individually customized. For example the first object will be set to rotate *.25, the second would need to be rotated *.5 and the third would need to be rotated *.75. I prefer the first way for it's simplicity.

Here's a little script that will setup a basic upper arm rig. Paste it into the script editor in a new scene and run it.


'******************Create basic skeleton setup

Create2DSkeleton 0, -3.74915180455534E-29, 0, 2, -3.74915180455534E-29, 0, -90, 0, 0, 4

Create2DSkeleton 2, 1.86830969364834E-17, 0, 6, 1.86830969364834E-17, 0, -90, 0, 0, 4

AppendBone "eff1", 9.4868533622988, 0, 1.37204981880989

GetPrim "Null"

Translate , 6, 0, -3, siRelative, siView, siObj, siXYZ, , , , , , , , , , 0

SetValue "null.null.primary_icon", 8

ApplyOp "SkeletonUpVector", "bone1;null", 3, siPersistentOperation, , 0

'************** create and position cubes

CreatePrim "Cube", "MeshSurface"

SetValue "cube.cube.length", 1

Translate , 2.50521707646226, 0, 0, siRelative, siGlobal, siObj, siXYZ, , , , , , , , , , 0

Duplicate "cube", , 2, 1, 1, 0, 0, 1, 0, 1, , , , , , , , , , , 0

Translate , 1, 0, 0, siRelative, siGlobal, siObj, siXYZ, , , , , , , , , , 0

Duplicate "cube1", , 2, 1, 1, 0, 0, 1, 0, 1, , , , , , , , , , , 0

Duplicate "cube2", , 2, 1, 1, 0, 0, 1, 0, 1, , , , , , , , , , , 0

SelectObj "eff,root1", , True

SetValue "eff.eff.primary_icon", 2

SetValue "eff.eff.size", 0.5

SelectObj "root1", , True

SetValue "root1.root.primary_icon", 2

SetValue "root1.root.size", 0.25

'************************** Parent objects

ParentObj "eff", "root1"

SelectObj "root1"

SelectObj "cube3"

ParentObj "B:cube2", "cube3"

SelectObj "B:cube2"

ParentObj "B:cube1", "cube2"

SelectObj "B:cube1"

ParentObj "B:cube", "cube1"

SelectObj "B:cube"

ParentObj "B:bone1", "cube"

SelectObj "B:bone1"

'**************** set expressions

SetExpr "cube.kine.local.rotx", "-bone1.kine.local.rotx"

'**** the above expression rotates the top cube

'**** opposite of the arm bone to keep its rotation

'**** even with the shoulder

SetExpr "cube1.kine.local.rotx", "bone1.kine.local.rotx * .33"

SetExpr "cube2.kine.local.rotx", "bone1.kine.local.rotx * .33"

SetExpr "cube3.kine.local.rotx", "bone1.kine.local.rotx * .33"

raimZ
10-15-2006, 07:47 AM
Here's that thread that got me inspired again

http://forums.cgsociety.org/showthread.php?t=261270

Thanks for the quick reply guys!

dwigfor: the 3dquakers demo video was my main source of reference. I would love to buy it but i just spent a bunch of money on the digital-tutors xsi set to get me started. i'm a noob with xsi. loving it. I think i've learnt a ton trying to figure it out this on my own compiling tips from these forums and tutorials around the web.

After posting the thread I set off to try to figure it out again. What I did was have my cubes parented to the bicep bone. For the cube closest to the root, I gave it a direction constraint and aligned it to the length of the bone. Then I created a null, match translated it to the root of the bicep and moved it forward in global mode. This null became my up vector under the direction constraint (just had to match the correct axis). I gave the next cube down the line the simple "bicep.kine.local.rotx * 0.75" expression, it is rotating relative to the first cube. I added this to expressions to the next 2 but with 0.5 and 0.25 values. the last cube i left alone. This expression makes forearm roll a breeze.

Haha sbowling that's pretty much the only script I know. But this set-up seems to work, it has broken or twisted like crazy yet. I'll be animating it soon so we'll see :D. I'm going to copy that script and give it a shot. Scripting is scary for me, I barely understand flash actionscript which i'm learning this semester.

What do you guys think of my solution? Does it sound like too much of a hack cos I used the simplest of expressions? Should I post the rig?

pooby
10-15-2006, 03:28 PM
What's the best method for doing the forearm twist?

-taking into consideration hand orientation constraint (for when resting on a table), so it works with IK and FK blending?
The tricky part I find is that you can just take the hand bone's twist rotation for an expression, as, when the hand is at 90degrees to the forearm, you have to use a completely different axis.

I managed to get a working version involving an upvector parented to the hand whose translation is linked to the hand rotation to keep it above the arm. then a small chain in the forearm which uses the upvector's location to feed rotational info back to the twist nulls..
It works fine but I'm sure there's a much more direct method.

Womball
10-15-2006, 03:49 PM
Would it be just easier to add an extra bone in the middle of the arm to rotate the forearm? The bicep shouldn't twist that much since its attachment is in the forarem, plus the elbow can only move in one direction. At most I would think you would need a blend shape to change the the shape of the end of the muscle whenever the forearm twisted. But I could be wrong!

Sbowling
10-17-2006, 03:35 AM
Haha sbowling that's pretty much the only script I know. But this set-up seems to work, it has broken or twisted like crazy yet. I'll be animating it soon so we'll see :D. I'm going to copy that script and give it a shot. Scripting is scary for me, I barely understand flash actionscript which I'm learning this semester.


Most of the script I posted is just copy and paste from the script editor. Since it's VBscript it's also very easy to understand. You can pretty much read the script and understand exactly what it's doing. Before using XSI I couldn't do anything with scripting in other programs. Now I write basic scripts for everything.

Be sure to run the script and check out the way everything is parented together. You can even run the script in individual sections to really see what's going on. Just select the first section (Create basic skeleton setup) in the script editor and run it, then select the next (create and position cubes) and run it and so on. This seems to be one of the better ways I've found of setting up arm twists.

withanar
10-19-2006, 09:11 AM
All of XSI's kinematics rotations are calculated in quaternion space, then converted through a matrix to euler. As a result, there is an infinite set of possible euler solutions that work.

When you pose or orientation constrain object A to object B, object A might solve it's euler rot-x to be 0, 180, 360, etc, depending on what quadrant it flips into. For the most part, XSI tries to keep these rotations continuous so that when you plot rotations, your curve doesn't suddenly skip up or down by 90 units.

In the case of expressions however, such as when you need to isolate the x, y, z rotations and use them to distribute custom deformations, this kind of flipping can destroy your expression or animation link.

The solution is simple:
When you constrain object A to object B, also set keyframes on the rotation of object A. I usually set them of value 0 at frame 0. This will always tell XSI to solve the rotations in the quadrant closest to 0, and you will get consistent, predictable results.

XSI can do this because constraints live in global space, while you are free to manipulate local space with keyframes or expressions. While global space will override the final results, local space can still influence how global space chooses its qudrant.

mr-doOo
10-19-2006, 05:10 PM
XSI have built in functions to do this. Search MakeBicepsRoll and MakeForeArmRoll in the SDK doc.

raimZ
10-19-2006, 05:59 PM
Thanx for the reply guys, I checked out the script on doing the bicep roll and stuff from the sdk guides. I couldn't get it to work. Probably due to my lack of ability in scripting. However I think I finally got a rig, that can do pretty extreme poses. its got the bicep and thigh twists. I just used a combination of simple expressions, contraints all over, and up vectors. I'm quite happy with it. I think it was good i didn't know how to use the built in functions, it gave me a chance to learn XSI's rigging capabilities, which are fantastic. You can just try this and that, awesome and you just don't wanna stop, cos you come up with another idea of how connect things.

Sbowling
10-20-2006, 06:19 AM
XSI have built in functions to do this. Search MakeBicepsRoll and MakeForeArmRoll in the SDK doc.

It also has a built in rigging system, but it's not really something you would want to use in production. Just because they are built in doesn't mean they are the best way to do it (no disrespect to M.I.)

Knowing how to do this stuff by hand is invaluable if you are going to be doing any serious animation. When I first got XSI I started out by using the built in rigs and quickly found out that when I had a problem I was completely clueless on how to fix them. Now I build my own rigs and while they aren't perfect, I can find problems and fix them much faster than when using the prebuilt rigs. Also, since the rigs are built specifically for each job they are much more flexible and do what I need much better than a "generic" rig.

Sbowling
10-20-2006, 06:29 AM
However I think I finally got a rig, that can do pretty extreme poses. its got the bicep and thigh twists. I just used a combination of simple expressions, contraints all over, and up vectors.

Just a little word of caution. I created a rig with constraings all over the place and found that when I made my character turn around 180 degrees or more (using the animation controlls, not the SRT that everything is parented to) the leg and arm twists would pop around 180 degrees also and the leg and arm mesh areas would become twisted. If you turn the character around without a mesh enveloped to the rig, you wouldn't notice it because the objects rotate 180 degrees over 1 frame, so they don't really look like they move at all. The way I found to deal with this was to use Expressions instead of constraints where needed.

mr-doOo
10-20-2006, 10:16 AM
It also has a built in rigging system, but it's not really something you would want to use in production. Just because they are built in doesn't mean they are the best way to do it (no disrespect to M.I.)

Knowing how to do this stuff by hand is invaluable if you are going to be doing any serious animation..

Hi
Have you ever tried to understand what is behind the xsi biceps roll and forearm roll?
If you want a real biceps roll you need to isolate the inverse roll of the first bone and you can t do this without trouble if you re not dealing with quaternions! why?? because of the fact that the biceps euler rotx will change depending of the order you are making your rotations. Same thing about the forearmroll and specially the "Spinepointat" functions that you can use to build your own Spine(or someting else) with your personalized number of controls and whatever you want, and have the 720 deg rotation without filp feature.
So the only way to have the exact roll is to do it with SCOPs, that is not a user or artist friendly way.
those function also prevent 180 deg flip as much as they can and surely better than constraint or expressions.
I m not saying to use the default rig, I don t like it . But if you look into the character SDK, you ll find some good little tools that will help a lot and are a good starting point to build your own rig.

just my 2 euros.
LF

mdee
10-20-2006, 11:23 AM
It also has a built in rigging system, but it's not really something you would want to use in production. Just because they are built in doesn't mean they are the best way to do it (no disrespect to M.I.)

Knowing how to do this stuff by hand is invaluable if you are going to be doing any serious animation.

I find some functions in CDK very usefull, used them in many production rigs with no problems - especially all kind of rolls. Real time saver and if you really think about it - they are optimal solutions for many tasks. They are very artist (and rigger :) ) friendly and dop not flip easily :).

Of course if you know theory behind them and can do it by hand it helps a lot

Sbowling
10-22-2006, 04:28 AM
Hi
Have you ever tried to understand what is behind the xsi biceps roll and forearm roll?


Nope. :D



If you want a real biceps roll you need to isolate the inverse roll of the first bone and you can t do this without trouble if you re not dealing with quaternions! why?? because of the fact that the biceps euler rotx will change depending of the order you are making your rotations. Same thing about the forearmroll and specially the "Spinepointat" functions that you can use to build your own Spine(or someting else) with your personalized number of controls and whatever you want, and have the 720 deg rotation without filp feature.
So the only way to have the exact roll is to do it with SCOPs, that is not a user or artist friendly way.



I haven't yet taken the time to learn scripted operators, but it's on my to do list. If you are using Foundation, and you run into a problem on the basic rig or any part that uses scripted
operators and you do have problems, it's probably going to be messy to fix. For the kind of work I do (mostly cartoony), the bicep roll I posted works fine. It's easy to set up and easy to use and can be scripted very easily with only a little manual work needed to hook the arm up to the rest of the body. In fact, if/when I come up with a standard naming convention I could have it completely scripted.

those function also prevent 180 deg flip as much as they can and surely better than constraint or expressions.


I've definitely had my problems with constraint flipping, but at least now I know to check for it when rigging. I was unaware that constraints could cause flipping and ran into it in the problem in middle of attempting to animate a character who had to turn around more than 180 degrees.


I m not saying to use the default rig, I don t like it . But if you look into the character SDK, you ll find some good little tools that will help a lot and are a good starting point to build your own rig.

just my 2 euros.
LF

I will definitely look into this stuff closer. One of the things I didn't like about the XSI rig is that it's fairly messy looking. If I can get the benefits of easy scripted rigging (even though I still like to know all the details about this stuff) without the clutter and mess of the XSI rig it could be a real time saver. Since I no longer use Foundation, I probably could learn a lot by pulling them apart.

BTW, sorry if I come off as a know-it-all at times. I can be very enthusiastic at times, but I'm definitely not an expert. While some of the things I show as examples can seem quite simple to the "pros", they are miles above what was possible in the program I used to use.

tuna
10-22-2006, 04:58 AM
For the kind of work I do (mostly cartoony), the bicep roll I posted works fine.


From a quick test of your script, the bicep roll flips when manipulating the arm in IK mode, and also when you manipulate the arm in FK (although it doesnt flip in ADD mode).

The flip starts when the arms are positioned as if you were dangling them, (hands by hips), then the upper most box flips completely when you contract it further (if you placed your left hand on your right hip, for example). When you undo this, or just abduct it again, the flipping remains and the rig is completely borked. Does this seriously not happen to you?

This is why I'm enjoying using the Makebiceproll and Makeforearmroll as I mentioned previously, because it's a super simple and fast way to tackle both this problem you get from expressions, and also the forearm problem about perpendicular wrist rotations that pooby mentioned.

colony
10-24-2006, 03:53 PM
Forearm twist from CDK worked fine for me - because you can animate offset. But bicep roll was not perfect. When character rise arms - it flips(. and no any offset for tweaking it. That's why I use FK to rotate twist bones when problems occurs.

Sbowling
10-25-2006, 12:25 AM
From a quick test of your script, the bicep roll flips when manipulating the arm in IK mode, and also when you manipulate the arm in FK (although it doesnt flip in ADD mode).


Ok, that was a real quick script I wrote as a simple example of setting up the roll, not really designed to be production ready. The one I use for production doesn't have any flipping problems. I'll go through the script again when I have some time and fix what's causing the problem.

CGTalk Moderation
10-25-2006, 12:25 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.