Monday, 8 March 2010

geeky geekerson

...heres the latest test from using bones to control mesh which controls cloth, basically trying to imitate a coat opening with the bottom half made of cloth, also hitting 'legs'...



heres the simpliest/briefest of notes i've made for myself to remember the steps i needed to follow;

"NEW MESH/CLOTH TESTING

start with 2 pieces of mesh with no visible joins, and creat skeleton to control them
skin - smooth bind top mesh

select bottom half as cloth - presets - heavy denim

select joining verts of cloth then shift-select joining verts of mesh and constrain with 'component to component'

add any 'passive' objects and animate."

these are the settings I used for the loose cloth belt (and like a sad geek decided to manually write all the values in just to make myself remember them, and then I CAPPED the values i frequently played with with a little description for myself so I could try to know what I was doing...)

"CREATED ENTIRE CLOTH AS 1 MESH, IE JACKET + BELT, ADDED LOOPS WHERE CLOTH BEGINS AND MESH ENDS, SELECTED CLOTH FACES AND 'MESH' - 'SEPARATE'
added Ncloth to loose belt, mde sure doesnt intersect with anything, selected CV's of where cloth ends, then shift-selected CV's of where mesh ends and added 'component to component'. made anything that may touch belt as 'create passive'.

Works well, may not need as too much interferance with cloth coat...

if object fast moving, increase stretch resistance

is dynamic - on
PLAY FROM CACHE - N/A (until final V./animation made)
THICKNESS - 0.1 ----- (GUESS - DETERMINATION AS TO HOW HEAVY/THICK CLOTH PIECE IS - INCREASE = LONGER CALCULATION TIME)
Bounce - 0
FRICTION - 0.355 ----- (HOW MUCH THE OBJECT IS AFFECTED BY FRICTION - INCREASE = MORE FRICTION)
DAMP - 4.57 ----- (AFFECTS HOW MUCH THE CLOTH WILL APPEAR 'DAMP' IE HEAVIER)
STICKINESS - -0.5 ----- (HOW MUCH THE CLOTH WITH STICK TO A SURFACE/OBJECT/)
collision flag - Face
self collision flag - vertex face
max self collision iterations - 10000
POINT MASS - 2.02 ------ (GUESS SIMULAR PRINCIPLE AS TO HOW MUCH MASS THE CLOTH HAS - GUESS SIMULAR TO SPACE SCALE - !!IMPORTANT!!)
rest length scale - 1
COLLIDE - on
SELF COLLIDE - on
collision layer - 0
wind shadow diffusion - 0
wind shadow distance - 0
air push distance - 0
air push vorticity - 0
push out - 0.5
push out radius - 5.183
crossover push - 0
trapped check - off
FORCE FIELD - double sided ----- (ACTIVATE CLOTH FORCE-FIELD ALONG NORMALS/INSIDE/INSIDE AND OUT - KEEPS DISTANCE FROM OTHER OBJECTS)
FIELD MAGNITUDE - 1 ----- (HOW POWERFUL FORCE FIELD IS)
FIELD DISTANCE - 0.755 ----- (HOW MUCH DISTANCE FORCE FIELD COVERS)
point force field - off
point field magnitude - 1
self attract - 0
point field distance - 2
local space output - on
display color R - 1
display color G - 0.8
display color B - 0
STRETCH RESISTANCE - 35.3 (NOW 80)
compression resistance - 30.4
bend resistance - 5.149
bend angle drop-off - 0.371
restitution tension - 1000
restitution angle - 360
shear resistance - 0
RIGIDITY - 0.1 ------ (HOW RIGID AS AN ENTIRE MESH THE CLOTH IS - IE 0= LOOSE CLOTH, 1= FROZEN CLOTH)
deform resistance - 0
input mesh attract - 0
input mesh damp - 0.5
wrinkle map scale - 1
bend angle scale - 1
sort links - off
add cross links - off
stretch damp - 0.1
self collide width scale - 1
self crossover push - 0
self trapped check - off
pressure - 0 ------ (ADDS MOVEMENT/WIND FROM ALL DIRECTIONS TO CLOTH AND BY HOW MUCH)
start pressure - 0 ----- (GUESS - WHEN PRESSURE WILL BEGIN ON TIMELINE)
incompressibility - 5
pressure damping - 0
pump rate - 0
air tightness - 1
seal holes - on
ignore solver gravity - off
ignore solver wind - off
wind self shadow - off
lift - 0.05
drag - 0.05
tangential drag - 0.102
lifespan - 1"

I found out today there was loads and loads of ways to creat stretchy bones in Maya, after using a long tutorial and a quick chat with Toke, I tried to find another easier way;

"create a single bone.

create 2 locators and snap them to each end of the joint.

rename the base joint to 'joint1' and the nub joint, 'joint2' and each corresponding locator as 'joint1_Loc' and 'joint2_Loc'.

select 'joint2_Loc' then shift select 'joint2' and add a 'point' constraint.

select 'joint1_Loc' then shift select 'joint1' and add a 'parent' constraint.

select 'joint1_Loc' then 'joint2_Loc' and add an 'aim' constraint, then vice versa as in;
select 'joint2_Loc' then 'joint1_Loc' and add an 'aim' constraint.

select 'joint1_Loc' then 'joint2_Loc' and add a 'point' constraint.

you should now be able to control the 'stretchy bone' with each corresponding locator (ie 'joint1_Loc' control will move entire joint,
and 'joint2_Loc' will control the nub joint making it stretchy.

i havent tested this out properly with a full rig, was just something i tried."

After creating the stretchy tongue, I found that I could only really control one section of the tongue at a time and I wanted to influence each section of the tongue with one controller (without using Driven Keys) and seeing as though I went through a slightly confusing tutorial using Nodes and the Hypergraph to creat stretchy tongue I felt adventurous enough to try on my own;


"add half influence from one object to another from an action (without using driven keys)

(eg tongue stretchy, 4 controllers linked to control 4 clusters on tongue. one controller doesnt affect any other clusters besides the one its parented too, when you want the tongue to stretch you want the other clusters/controllers to be influenced down the heirachy)

1. select all controllers you want affected, open Hypergraph and under 'Graph' select 'Add to Graph'

2. on Create Maya Nodes, scroll down to 'General Utilities' tab and add a 'Multiply/Divide' Node.

3. on the first controller (the one that'll affect the rest of them ie TongueTip_CTRL) click on the right arrow of the node, and select 'translate - translate Z' (dependant of character orientation, might need to see what axis the tongue will move 'forward') and connect it to, the 'Multiply/Divide Node - input1 - input1 Z (Z dependant on axis left controller from you just need to match them appropriately).

4. select the Multiply/Divide Node and under 'Attribute Editor' select 'Multiply' and change the value of input2 Z to something like 0.5 (dependant on how strong you want the 2nd controller to follow, 1 = 100% etc) and then on the channel box, lock the Input2 Z (you dont want that value to change to 0 ever, lots of badness.)

5. then from the multiply/Divide Node select 'Output - outputZ' and connect it to the 2nd controller under 'translate - translate z'

6. follow the same steps for each controller, keeping the same 0.5 value each time.

What we've just done is told Maya that whenever you move the 1st controller on the Z axis, the controller behind will follow it by 50%, and then the controller behind that will follow the 2nd controller by 50% and so on and so on."

phew, damn im boring and tbh, most of this is probably crap, but it's given me more understanding as i've gone along, no harm in sharing...