seven Posted May 1, 2005 Share Posted May 1, 2005 Well I tried to give some answer to a question about using Expressions: http://www.hash.com/forums/index.php?showt...ndpost&p=102551 I can do a tutorial on this! But Why? I have already done so many! And their must be others - who can do the tutorials on Expressions! Here is the picture showing how to use the formula to get a pose to repeat: Quote Link to comment Share on other sites More sharing options...
mtpeak2 Posted May 1, 2005 Share Posted May 1, 2005 Thanks for trying Seven, But the formula didn't work correctly. Quote Link to comment Share on other sites More sharing options...
seven Posted May 1, 2005 Author Share Posted May 1, 2005 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. Quote Link to comment Share on other sites More sharing options...
seven Posted May 1, 2005 Author Share Posted May 1, 2005 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? 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 Quote Link to comment Share on other sites More sharing options...
mtpeak2 Posted May 1, 2005 Share Posted May 1, 2005 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. Quote Link to comment Share on other sites More sharing options...
mtpeak2 Posted May 1, 2005 Share Posted May 1, 2005 Sorry, I forgot to refresh the screen. Everything is working properly. Thanks for the help Seven. Quote Link to comment Share on other sites More sharing options...
mtpeak2 Posted May 1, 2005 Share Posted May 1, 2005 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. Quote Link to comment Share on other sites More sharing options...
KenH Posted May 1, 2005 Share Posted May 1, 2005 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) Quote Link to comment Share on other sites More sharing options...
mtpeak2 Posted May 1, 2005 Share Posted May 1, 2005 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. Quote Link to comment Share on other sites More sharing options...
seven Posted May 2, 2005 Author Share Posted May 2, 2005 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.... 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... Quote Link to comment Share on other sites More sharing options...
mtpeak2 Posted May 2, 2005 Share Posted May 2, 2005 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) Quote Link to comment Share on other sites More sharing options...
seven Posted May 2, 2005 Author Share Posted May 2, 2005 I have done a WINK tutorial! I am uploading it on a new topic: Tutorial on using an Expression for a Pose Quote Link to comment Share on other sites More sharing options...
Admin Rodney Posted May 2, 2005 Admin Share Posted May 2, 2005 (edited) 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 May 2, 2005 by Rodney Quote Link to comment Share on other sites More sharing options...
mtpeak2 Posted May 2, 2005 Share Posted May 2, 2005 Rodney, GetTime() works in an action and choreography, chorTime() works in just the choreography. Quote Link to comment Share on other sites More sharing options...
Admin Rodney Posted May 2, 2005 Admin Share Posted May 2, 2005 GetTime() works in an action and choreography, chorTime() works in just the choreography. Good info. Thanks! Quote Link to comment Share on other sites More sharing options...
mtpeak2 Posted May 2, 2005 Share Posted May 2, 2005 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. Quote Link to comment Share on other sites More sharing options...
seven Posted May 2, 2005 Author Share Posted May 2, 2005 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? Quote Link to comment Share on other sites More sharing options...
SotirisGougousis Posted December 10, 2007 Share Posted December 10, 2007 There's a VERY old tutorial here: http://users.hol.gr/~sogou/animaster/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.