Jump to content
Hash, Inc. - Animation:Master

Using Expressions i A:M


Recommended Posts

  • Replies 17
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Thanks for trying Seven, But the formula didn't work correctly.

Yes I know - I tried to explain - their is no real documentation - I have found - or Rodney could tell about - and I have not found any OUTPUT window in A:M so I can debug - my formula you have to experiment a little bit with yourself. I can do it too - it is funny - but in the same time with guys like heyvern - it is not so funny - trying to give some help.

:D

Link to comment
Share on other sites

This one is better... It is repeating every fifth second going from 100 percent to 0 percent.

 

The GetTime() function gives the time in decimals so with 30 FPS

00:00:00 gives 0 and divided by 5 gives 0

00:00:15 gives 0.5 and divided by 5 gives 0.1

00:01:00 gives 1 and divided by 5 gives 0.2

00:01:15 gives 1.5

...

00:04:15 gives 4.5

00:05:00 gives 5 and divided by 5 gives 1.0 and the remainder is 0

and the Mod() function gives the remainder

0 at time 00:00:00 Mod(GetTime(),5) gives 0

 

00:05:15 gives 5.5 and divided by 5 gives 1.1 and Mod() gives the remainder and that is 0.1

and everything starts again... doing the same as in the first 5 seconds.....

OK? You got?

:D

Pose1=

2*Mod(GetTime(),5)/10

gets the ball to decrease from 100 to 0 - every fifth second starting all over again

 

 

Pose1=

1-2*Mod(GetTime(),5)/10

gets the ball to increase from 0 to 100 - every fifth second starting all over again

post-50-1114977500.jpg

Link to comment
Share on other sites

I got it to work with 1*Mod(GetTime(),1)

 

But the problem now is the position of the bones. Bones get translated to positions correctly, but not rotated. The rotation of the bones at 0% is a constant through the pose.

Link to comment
Share on other sites

I forgot to mention that this is a good formula for automating simple cyclic pose such as breathing and eye blinks. Just make sure your pose is cyclic. For example for the eyes, 0% eyes open, 10% eyes closed, 20% eyes open and 100% eyes open (probably do not need to set this key) adjusting your percentages to your liking. While in the pose relationship window, right click on the pose slider and edit expressions and use that formula. Now your eyes will blink automaticly without setting any keyframes.

Link to comment
Share on other sites

I forgot to mention that this is a good formula for automating simple cyclic pose such as breathing and eye blinks. Just make sure your pose is cyclic. For example for the eyes, 0% eyes open, 10% eyes closed, 20% eyes open and 100% eyes open (probably do not need to set this key) adjusting your percentages to your liking. While in the pose relationship window, right click on the pose slider and edit expressions and use that formula. Now your eyes will blink automaticly without setting any keyframes.

I'm mystified by the magic of expressions. Sounds like a perfect subject for your first tutorial (wink, wink, nudge, nudge) ;)

Link to comment
Share on other sites

Changing this value 1*Mod(GetTime(),1) will determine how often it will repeat.

 

Ken, as for a tut, I don't know how or why it works, it just does. So the explanation in my last post is about the best I can do, sorry.

Link to comment
Share on other sites

Changing this value 1*Mod(GetTime(),1) will determine how often it will repeat.

 

Ken, as for a tut, I don't know how or why it works, it just does. So the explanation in my last post is about the best I can do, sorry.

No - that is not correct... I explained it to you....

:D

 

Mod() is a function letting you know the remainder of a division.

 

Mod(12,10) gives the value 2 as a result.... because 12/10 equals 1 with the remainder 2.

 

Mod(22,10) gives the value 2 as result... because 22/10 equals 2 with the remainder 2

 

Mod(32,10) gives the value 2 as result because 32/10 equals 3 with the remainder 2.

 

So you have to experiment... not using 10 that will give you a period of 10 seconds for the repetitions instead using some other value giving different repetion periods...

Link to comment
Share on other sites

Did a little more experimenting, I think I'm beginning to understand this. Changing the values on one side or the other will create a pause in the repetition or shorten the percentage of the pose.

 

Seven, here's what I came up with to speed up or slow down the cycle of the pose.

 

"1" is the constant

 

first value=.25

1/.25=4

second value=4

.25*Mod(GetTime(),4)

 

first value=3

1/3=.333333333333333333333333333333333333333333333333etc.

second value=.33334 (A:M rounds it off)

3*Mod(GetTime(),.33334)

Link to comment
Share on other sites

  • Admin

Isn't there a GetChor() function or is that totally off the mark?

I tried to dig up some info on it but alas... very little.

 

Edit: Ah.. looks like it is ChorTime() and not GetChor()...

Edited by Rodney
Link to comment
Share on other sites

Seven, your formula doesn't seem to work the way I want it. Your tutorial formula Mod(GetTime(),.3)/10 gives you 3% of the pose in 30 frames. (based on 30fps)

 

The formula 1*Mod(GetTime(),1) will give you 1 cycle (0-100%) of the pose in 30 frame.

 

4*Mod(GetTime(),.25) will give you 4 cycles of the pose in 30 frames. 60 frames it's 8 cycles of the pose.

Link to comment
Share on other sites

Have you had a look at my tutorial on expressions?

http://www.hash.com/forums/index.php?showtopic=14193

 

 

You have to understand how Mod() functions always giving you the remainder of a division.

 

Some examples:

0/3 gives the remainder 0

1/3 gives the remainder 1

2/3 gives the remainder 2

2.5/3 gives the remainder 2.5

And now we will have the same remainder 0 as before

3/3 gives the remainder 0

4/3 gives the remainder 1

5/3 gives the remainder 2

5.5 gives the remainder 2.5

And now we will have the same remainder - 0 - as twice before. Starting a new repetition.

6/3 gives the remainder 0

7/3 gives the remainder 1

 

Have you got it?

 

And to use the Mod() function to get the remainder - you have to write like this:

 

Mod(0,3) gives remainder 0

Mod(1,3) gives remainder 1

 

Have you got it?

 

But we do not want to write the values ourselves - we want to get them from the position on the timeline - GetTime() gives us the position on the timeline.

So if the animation is on frame 00:02:00 we will have the remainder 2

Mod(2,3) gives remainder 2

Mod(GetTime(),3) gives remainder 2 if we are at the position 00:02:00 at the timeline.

 

Have you got it?

Using 30 Frames Per Second - 30 FPS - for the animation and being on frame

00:02:29 GetTime() will give us the decimal value 2.9 - about that---

 

But we want to have the Pose set to about a hundred percent on that frame.

So we have to make a division with 3 to get 1 because 1 that is 100 percent.

 

On frame 00:00:00

Mod(GetTime(),3)/3 gives 0

 

 

On frame 00:00:15

Mod(GetTime(),3)/3 gives 0.5/3 that is about 16 percent

 

 

On frame 00:01:00

Mod(GetTime(),3)/3 gives 1/3 that is about 0.33 or in percent 33 percent

 

 

On frame 00:02:29

Mod(GetTime(),3)/3 gives 2.9/3 that is nealy 100 percent

 

On frame 00:03:00

Mod(GetTime(),3)/3 gives 0 and that is 0 percent

 

The repetion from 0 percent to a hundred percent starts all over again

 

Have you got it?

:D

Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...