serg2 Posted April 16, 2014 Posted April 16, 2014 How can I change the frequency Rand()? inspired by johnl3d post - "expression RGB(r,g, has anyone used this, or has instructions" http://www.hash.com/forums/index.php?showtopic=46209 Quote
Hash Fellow robcat2075 Posted April 16, 2014 Hash Fellow Posted April 16, 2014 Instead using the Rand every frame, set up counter that steps through x frames before the Rand is used again. Quote
serg2 Posted April 16, 2014 Author Posted April 16, 2014 Instead using the Rand every frame, set up counter that steps through x frames before the Rand is used again. I would like to have the opportunity to set the random amplitudes. Or understand where to insert a such counter. Quote
NancyGormezano Posted April 16, 2014 Posted April 16, 2014 Instead using the Rand every frame, set up counter that steps through x frames before the Rand is used again. I would like to have the opportunity to set the random amplitudes. Or understand where to insert a such counter. I just noticed that in 18a there is a new function AtTime(time, n) - perhaps that can be used? along with maybe If, gettime, trunc, round functions ? Is there a place somewhere, where there is a description of each (all) of these functions and what they do (along with maybe units?). I haven't used expressions - so I know nuthin'. Quote
serg2 Posted April 16, 2014 Author Posted April 16, 2014 Instead using the Rand every frame, set up counter that steps through x frames before the Rand is used again. I would like to have the opportunity to set the random amplitudes. Or understand where to insert a such counter. I just noticed that in 18a there is a new function AtTime(time, n) - perhaps that can be used? along with maybe If, gettime, trunc, round functions ? Is there a place somewhere, where there is a description of each (all) of these functions and what they do (along with maybe units?). I haven't used expressions - so I know nuthin'. soul-searching could not understand how they work AtTime() and SetFrame())) Quote
Hash Fellow robcat2075 Posted April 16, 2014 Hash Fellow Posted April 16, 2014 Here's AtTime.... New expression keyword "AtTime(time, n)", where time is the time for which You want to have the value for n , n is the Bone information example AtTime(GetTime()+SetFrame(2),..|..|..|..|Model1.Transform.Translate.Y) where GetTime()+SetFrame(2) , evaluates the Y position for Model1 at the current chor time + 2 frames SetFrames() is also a new keyword, setting the time value in frames based on the current fps, time value is always based on seconds I think these will indeed be helpful. I forgot we don't have actual variables. Lemme think about this a bit more but i have no doubt that what you want can be done. Quote
serg2 Posted April 16, 2014 Author Posted April 16, 2014 Here's AtTime.... New expression keyword "AtTime(time, n)", where time is the time for which You want to have the value for n , n is the Bone information example AtTime(GetTime()+SetFrame(2),..|..|..|..|Model1.Transform.Translate.Y) where GetTime()+SetFrame(2) , evaluates the Y position for Model1 at the current chor time + 2 frames SetFrames() is also a new keyword, setting the time value in frames based on the current fps, time value is always based on seconds I think these will indeed be helpful. I forgot we don't have actual variables. Lemme think about this a bit more but i have no doubt that what you want can be done. will try! Quote
Hash Fellow robcat2075 Posted April 16, 2014 Hash Fellow Posted April 16, 2014 Anyone know where the full list of expression definitions is? Quote
Admin Rodney Posted April 16, 2014 Admin Posted April 16, 2014 This is the closest I can recall to a list of functions and how they work: http://users.hol.gr/~sogou/animaster/functions.htm Examples of usage: http://users.hol.gr/~sogou/animaster/expressions.htm Of course many other resources (video tutorials etc.) to be found in the Expressions forum. Quote
Admin Rodney Posted April 16, 2014 Admin Posted April 16, 2014 I believe those are the same as what is covered in the Tech Ref: Quote
Hash Fellow robcat2075 Posted April 16, 2014 Hash Fellow Posted April 16, 2014 I'm trying to figure out a way to assign a value to a bone that it had at some specified time in the past. That ought to be possible without creating a circularity. Quote
itsjustme Posted April 16, 2014 Posted April 16, 2014 Here is a tutorial on the SetFrame(frame), AtTime(time,n) and GetTime() functions. Here is tutorial on the Abs() and RGB() functions. Here is a tutorial on the "Max()", "Min()" and "Round()" Expression functions. Hope that helps. Quote
johnl3d Posted April 17, 2014 Posted April 17, 2014 Thanks David ... always like more ways to timker Quote
Hash Fellow robcat2075 Posted April 17, 2014 Hash Fellow Posted April 17, 2014 Here's my mystery so far... If I set a Null's Y value to be equal to Sin(ChorTime()) it floats up and down in a sine wave manner as expected If i set another object's Y value to be equal to AtTime(1,the Null's Y value), the object takes the Null's Y value at 1 second and stays put there, as expected, even as the Null continues its sine wave motion. If I set the Null's Y value to be equal to Rand() it jumps up and down within a 0 to 1 range, as expected. If I scrub through 1 second the particular value it has at exactly 1 second is always the same, as expected. However... the object, which is set to use the Null's Y value at 1 second, doesn't stay put anymore. It is jumping up and down as if it were constantly tracking the Null's Y value instead of just taking the Y value at 1 second. Quote
itsjustme Posted April 17, 2014 Posted April 17, 2014 Here's my mystery so far... If I set a Null's Y value to be equal to Sin(ChorTime()) it floats up and down in a sine wave manner as expected If i set another object's Y value to be equal to AtTime(1,the Null's Y value), the object takes the Null's Y value at 1 second and stays put there, as expected, even as the Null continues its sine wave motion. If I set the Null's Y value to be equal to Rand() it jumps up and down within a 0 to 1 range, as expected. If I scrub through 1 second the particular value it has at exactly 1 second is always the same, as expected. However... the object, which is set to use the Null's Y value at 1 second, doesn't stay put anymore. It is jumping up and down as if it were constantly tracking the Null's Y value instead of just taking the Y value at 1 second. It could be because of the way the Rand() function generates it's random number. If it's truly random, and generated on each frame, it might change every time you go through the same frame...which I'm guessing would mess with something trying to predict where it will be on a given frame. Just a guess though, I could be totally wrong. Quote
Hash Fellow robcat2075 Posted April 17, 2014 Hash Fellow Posted April 17, 2014 Here's a example case. The vase's Y translation is on a Rand() expression. RandomTest.prj Pick any specific time like 1:00 and scrub to it, out of it, back to it, before it, back to it.... the vase will always land in the same spot at 1:00 The Rand() function generates a random sequence but the sequence is repeatable no matter how many times the animation is played. That is as it should be and the example behaves that way. Quote
itsjustme Posted April 17, 2014 Posted April 17, 2014 How can I change the frequency Rand()? inspired by johnl3d post - "expression RGB(r,g, has anyone used this, or has instructions" http://www.hash.com/forums/index.php?showtopic=46209 Maybe something like this project? Model1 moves Rand()*30, Model2 moves Round(..|..|..|..|..|..|Shortcut to Model1|Bones|Bone1.Transform.Translate.Y,15)...so, you would use something outside of the visible object (with a random movement) to generate movement on the visible object (which is only moving once a threshold is reached...in this case, 15). Hope that helps. Random_04_16_2014.prj Quote
itsjustme Posted April 17, 2014 Posted April 17, 2014 Here's a example case. The vase's Y translation is on a Rand() expression. RandomTest.prj Pick any specific time like 1:00 and scrub to it, out of it, back to it, before it, back to it.... the vase will always land in the same spot at 1:00 The Rand() function generates a random sequence but the sequence is repeatable no matter how many times the animation is played. That is as it should be and the example behaves that way. Hmmm, maybe it's a bug in the AtTime() function that is causing the problem? Quote
Hash Fellow robcat2075 Posted April 17, 2014 Hash Fellow Posted April 17, 2014 Hmmm, maybe it's a bug in the AtTime() function that is causing the problem? That is my first suspicion, but not supported by the case where we are sampling from a sine wave instead of a random noise wave. I dunno. Quote
Hash Fellow robcat2075 Posted April 17, 2014 Hash Fellow Posted April 17, 2014 Basically i want to sample and hold a value until i need to sample it anew. Quote
itsjustme Posted April 17, 2014 Posted April 17, 2014 Basically i want to sample and hold a value until i need to sample it anew. Some nested "If()" statements along with some "AtTime()" statements could probably get a few things like that done. What would be an example of what you would want to do, Robert? Quote
Hash Fellow robcat2075 Posted April 17, 2014 Hash Fellow Posted April 17, 2014 Basically i want to sample and hold a value until i need to sample it anew. Some nested "If()" statements along with some "AtTime()" statements could probably get a few things like that done. What would be an example of what you would want to do, Robert? Serg wants to get a random value captured less often than every frame Say, capture it on frame 0 and assign it to the Y property and then leave that value on that property for 5 frames. Then... Capture a new random value on frame 5 and assign it to the Y property and then leave that value on that property for 5 frames. And so on... Quote
Fuchur Posted April 17, 2014 Posted April 17, 2014 I forgot we don't have actual variables. Lemme think about this a bit more but i have no doubt that what you want can be done. Create a null and store the value you want to store in one of its channels. But in the end, what I think you will need is the possibility to access the current Value of a given value you want to set an expression in. I already asked Steffen for such a variable or function, but that may take a while to implement for the public release. Like that you could for instance use stuff like "curValue + rand() * 5" to generated quite nice things with it. Like that you would not have to use a complex function which would give you exactly the graph you need. (which can be quite hard) See you *Fuchur* Quote
Hash Fellow robcat2075 Posted April 17, 2014 Hash Fellow Posted April 17, 2014 Create a null and store the value you want to store in one of its channels. This will just transfer the problem to a different object. What I think you will need is the possibility to access the current Value of a given value. I already asked Steffen for one, but that may take a while to implement for the public release. This would make it much simpler. Currently you get a circularity or a crash if you try to assign a value from the same property, even a past value. Quote
johnl3d Posted April 17, 2014 Posted April 17, 2014 Side note when working on the randomizing color issue I was getting crashes although samples posted worked when I set up mine AM would stop responding and close. I decided to uninstall 18d completely then reinstalled it clean and then issue was resolved. (normally I would just install the update in a new folder i.e 18d and not delete earlier version) Quote
Hash Fellow robcat2075 Posted April 17, 2014 Hash Fellow Posted April 17, 2014 My observation so far... AtTime works properly if the target it is getting a value from is something that is keyframed. If the target is something being moved by an expression, AtTime does not work correctly. I didn't save my working example where the target was on a Sinewave expression and i can't recreate it today. Maybe i dreamed it. Quote
Hash Fellow robcat2075 Posted April 17, 2014 Hash Fellow Posted April 17, 2014 David, I watched your AtTime tutorial and I think i am using it correctly. Good tutorial! Here is a demonstratin project that shows teh difference between a keyframed target and an expressioned target. ExpressionTest08_keyframe_vs_expression.prj In both chors the Vase has an expression to set it to the Y value of the Null at 1.5 seconds. In Chor "Keyframed" the null is keyframed in a conventional manner to float up and down. In this chor the Vase stays in a fixed place, as expected. In Chor "Expressioned" the null is on a Sin() expression to make it float up and down. In this chor the vase does not stay fixed and follows the Null. Quote
itsjustme Posted April 17, 2014 Posted April 17, 2014 David, I watched your AtTime tutorial and I think i am using it correctly. Good tutorial! Here is a demonstratin project that shows teh difference between a keyframed target and an expressioned target. ExpressionTest08_keyframe_vs_expression.prj In both chors the Vase has an expression to set it to the Y value of the Null at 1.5 seconds. In Chor "Keyframed" the null is keyframed in a conventional manner to float up and down. In this chor the Vase stays in a fixed place, as expected. In Chor "Expressioned" the null is on a Sin() expression to make it float up and down. In this chor the vase does not stay fixed and follows the Null. Looks like AtTime() is for keyframed sources only. I don't know if Steffen can add Expression sources, might be worth asking. Quote
Hash Fellow robcat2075 Posted April 18, 2014 Hash Fellow Posted April 18, 2014 Now an A:M report. Hopefully Steffen can look at that. Quote
johnl3d Posted April 18, 2014 Posted April 18, 2014 working on idea using for now translate Y this expression If(Mod((ChorTime()*30),5)=0,Rand()*50,100) which keeps the model at 100 except every 5th frame takes random value this might be used to keep color for x number of frames then put a new color in to the next x number frame if values stored in null ...getting late will try more later ex1.mov ex1.zip Mod gives remainder and division by set number so here ChorTime()*30),5 = 0 every 5th frame Quote
Hash Fellow robcat2075 Posted April 20, 2014 Hash Fellow Posted April 20, 2014 Serg, here's a workaround... -Create the Rand() expression like you wanted to. -Set the FPS of the Project to the rate that you want your Rand function to change ( like 3 fps) -"Bake all actions" - set the interpolation of the baked random channel to Hold -set the Project FPS back to the original FPS. Quote
johnl3d Posted April 20, 2014 Posted April 20, 2014 sorry started new topic got this http://www.hash.com/forums/index.php?showtopic=46228&hl= Quote
Hash Fellow robcat2075 Posted May 2, 2014 Hash Fellow Posted May 2, 2014 Steffen has AtTime fixed in v18f so look for that when it comes out. He's also added something called CurrentValue that should let you use a current value in an expression as part of its new value. Quote
Fuchur Posted May 3, 2014 Posted May 3, 2014 Steffen has AtTime fixed in v18f so look for that when it comes out. He's also added something called CurrentValue that should let you use a current value in an expression as part of its new value. Sadly this does not work for all channels till now. If you find one where it doesnt please let Steffen know, since he has to implement it there too then... See you *Fuchur* Quote
Hash Fellow robcat2075 Posted May 4, 2014 Hash Fellow Posted May 4, 2014 Did Steffen ever put up an example of CurrentValue() in use? I haven't had any success with it so far. Quote
Fuchur Posted May 4, 2014 Posted May 4, 2014 Did Steffen ever put up an example of CurrentValue() in use? I haven't had any success with it so far. it just does not do what it should yet. i have already told steffen that but he is not available at the moment. See you *Fuchur* Quote
Recommended Posts
Join the conversation
You are posting as a guest. 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.