• Maya

Adding a blend node

Add a blend node and a condition node to allow the animator to turn the spine stretch and squash effect on or off.


00:03

Now create a blend colors node,

00:07

this node is traditionally used with shader,

00:10

meaning you can blend between the color one values and the color two values here,

00:15

we can use it to blend between two values which will give

00:19

the animator the ability to turn the stretchiness on and off,

00:23

call it spine stretch blend

00:26

and copy it.

00:28

So this one is going to work in a similar way.

00:30

But we will use this to automatically turn

00:33

off the stretchiness when using the FK controls

00:37

or alternatively enable it when switching to IK.

00:42

If the stretchiness remains on, when using FK,

00:45

it will still be referencing the IK spine.

00:49

So we need to disable it.

00:51

Let's add IK to the name here. So we can differentiate between them.

00:56

OK?

00:57

Now,

00:57

set all the attributes on each to one because when the stretchiness is disabled,

01:02

we need the scale values to be set to one

01:05

again, which is the default value on the scale attributes.

01:09

So we have those set up

01:12

next, let's connect these to some of the key attributes. We added,

01:17

we added these attributes earlier so we could change the spine. So it only stretches

01:22

only squashes or does both

01:26

the stretchiness attribute here will be what we

01:28

use to control the blend colors node here.

01:33

So bring in the cock control

01:36

and simply connect stretchiness

01:38

to the spine stretch blend nodes, blender attribute.

01:43

We now need a condition node.

01:46

So let's open that

01:48

and rename this to spine stretch condition.

01:51

Let's move some of these

01:55

now connect the scale factors output X attribute

01:58

to the condition nodes first term attribute.

02:02

This is so we can use a condition node to check when the curve is stretching.

02:07

We can compare the 1st and 2nd terms here and determine what needs doing.

02:14

Now connect output R from the stretch blend node to the color if true R attribute.

02:21

So when the condition is true,

02:23

it will output the stretch value.

02:26

We can use the operation attribute to adjust how the torso scales.

02:31

But what we need are the not equal, greater or equal and less or equal options

02:39

which are equivalent to numbers 13 and five in the menu,

02:45

we need these attributes on the cock

02:47

control to adjust the condition nodes. Operation attributes.

02:51

The problem is if we connect them directly,

02:54

the stretch type attributes options will output 01 and two,

02:59

not 13 and five.

03:02

So these won't tie up to the correct operations.

03:06

So what we need to do is insert some kind of offset

03:09

which will change those values and push them on to the correct ones.

03:14

Create a plus minus average node

03:17

and opened it,

03:19

rename it to spine stretch control P ma

03:24

connect stretch type to input one D zero

03:28

and input one D one

03:30

and also input one D two.

03:34

So what this will do is add up all these values. So it will give us an offset.

03:39

If we change stretch type to stretch,

03:42

you see these values have now changed to one. So the output would be three.

03:47

We need the first option to be just one though

03:50

not zero.

03:52

So let's break the connection on input one D zero,

03:55

which means this will always be set to one.

03:58

So when the attribute is set to both,

04:00

this will output one now not zero.

04:03

OK. Let's connect this to the condition node. So we can check it

04:07

and you can see it in action

04:10

now connect output one D to the condition nodes, operation attribute.

04:16

So you see the operation is now set to greater or equal.

04:20

Meaning the spine will only stretch when the curve is longer than it should be.

04:25

If we set stretch type to both,

04:28

the output is now one from the plus minus average node.

04:32

So the operation is set to not equal, meaning the spine will stretch and squash.

04:38

Finally let's swap this to squash

04:42

and the operation is now less or equal.

04:44

Meaning the spine will only squash when the curve is shorter than it should be.

Video transcript

00:03

Now create a blend colors node,

00:07

this node is traditionally used with shader,

00:10

meaning you can blend between the color one values and the color two values here,

00:15

we can use it to blend between two values which will give

00:19

the animator the ability to turn the stretchiness on and off,

00:23

call it spine stretch blend

00:26

and copy it.

00:28

So this one is going to work in a similar way.

00:30

But we will use this to automatically turn

00:33

off the stretchiness when using the FK controls

00:37

or alternatively enable it when switching to IK.

00:42

If the stretchiness remains on, when using FK,

00:45

it will still be referencing the IK spine.

00:49

So we need to disable it.

00:51

Let's add IK to the name here. So we can differentiate between them.

00:56

OK?

00:57

Now,

00:57

set all the attributes on each to one because when the stretchiness is disabled,

01:02

we need the scale values to be set to one

01:05

again, which is the default value on the scale attributes.

01:09

So we have those set up

01:12

next, let's connect these to some of the key attributes. We added,

01:17

we added these attributes earlier so we could change the spine. So it only stretches

01:22

only squashes or does both

01:26

the stretchiness attribute here will be what we

01:28

use to control the blend colors node here.

01:33

So bring in the cock control

01:36

and simply connect stretchiness

01:38

to the spine stretch blend nodes, blender attribute.

01:43

We now need a condition node.

01:46

So let's open that

01:48

and rename this to spine stretch condition.

01:51

Let's move some of these

01:55

now connect the scale factors output X attribute

01:58

to the condition nodes first term attribute.

02:02

This is so we can use a condition node to check when the curve is stretching.

02:07

We can compare the 1st and 2nd terms here and determine what needs doing.

02:14

Now connect output R from the stretch blend node to the color if true R attribute.

02:21

So when the condition is true,

02:23

it will output the stretch value.

02:26

We can use the operation attribute to adjust how the torso scales.

02:31

But what we need are the not equal, greater or equal and less or equal options

02:39

which are equivalent to numbers 13 and five in the menu,

02:45

we need these attributes on the cock

02:47

control to adjust the condition nodes. Operation attributes.

02:51

The problem is if we connect them directly,

02:54

the stretch type attributes options will output 01 and two,

02:59

not 13 and five.

03:02

So these won't tie up to the correct operations.

03:06

So what we need to do is insert some kind of offset

03:09

which will change those values and push them on to the correct ones.

03:14

Create a plus minus average node

03:17

and opened it,

03:19

rename it to spine stretch control P ma

03:24

connect stretch type to input one D zero

03:28

and input one D one

03:30

and also input one D two.

03:34

So what this will do is add up all these values. So it will give us an offset.

03:39

If we change stretch type to stretch,

03:42

you see these values have now changed to one. So the output would be three.

03:47

We need the first option to be just one though

03:50

not zero.

03:52

So let's break the connection on input one D zero,

03:55

which means this will always be set to one.

03:58

So when the attribute is set to both,

04:00

this will output one now not zero.

04:03

OK. Let's connect this to the condition node. So we can check it

04:07

and you can see it in action

04:10

now connect output one D to the condition nodes, operation attribute.

04:16

So you see the operation is now set to greater or equal.

04:20

Meaning the spine will only stretch when the curve is longer than it should be.

04:25

If we set stretch type to both,

04:28

the output is now one from the plus minus average node.

04:32

So the operation is set to not equal, meaning the spine will stretch and squash.

04:38

Finally let's swap this to squash

04:42

and the operation is now less or equal.

04:44

Meaning the spine will only squash when the curve is shorter than it should be.

Was this information helpful?