How to determine the animation time of a random expression

How can I create an expression that does a random motion in rotation, but does it have a range of frames so that it does not get a very fast animation?
I created this expression:

Transform1.rotate.random(min=-1, max=1)

But the animation gets very fast and I wanted the ascent from -1 to 1 to last 20 frames, otherwise the animation gets very fast and I want a smooth movement. How do I add this time parameter so that the animation lasts 20 and repeats smoothly, going from the minimum to the maximum in that frame interval throughout the project?

Como eu posso criar uma expressão que faz um movimento aleatório na rotação, mas que possui um intervalo de frames para que não fique uma animação muito rápida?
Eu criei essa expressão:

Transform1.rotate.random(min=-1, max=1)

Mas a animação fica muito rápida e eu queria que a subida de -1 até 1 durasse 20 frames, caso contrário a animação fica muito rápida e eu quero um movimento suave. Como adiciono esse parâmetro de tempo para que a animação dure 20 e se repita de forma suave, indo do minimo ao máximo nesse intervalo de frames durante todo o projeto


How does the time parameter work? Can you give me an ex?

ex: time = 20f, I do not know how to apply

You probably want to use a more appropriate random function, like fbm noise. Ref:

I want to do a constant camera swing actually.

I could not apply these phrases you spoke, how do I use them?

Can you give an example of this in the rotate? (6.3 KB)

I did not find that knot wiggle, how did you find it? Is it extension?

It’s a custom node i made.
If you look inside, there’s just a ‘Transorm’ node with expressions on both ‘Translate’ and ‘Rotation’ parameters.

Nice. But I could not make the tremor softer, even leaving the low values ​​it trembled little and fast. I wanted a smooth movement that lasted 5 seconds or more. I did it manually, but if you want to add a way to let the movement gentler and how to control how long it takes to perform each movement.

Ah yes, i had forgotten about that feature.
I’ll try to craft a new version as soon as possible.

Done. (6.3 KB)

You just need to keyframe the ‘Intensity’ parameter, for both ‘Position’ and ‘Rotation’, to smooth in and out the effect.

By the way, there was already one available here :

Shake was exactly what I wanted, thank you. Your work is excellent!

Hallo Guys, i reopen this post because i am pretty much convinced that someone of you could help me! I try to explain:

I have 2 images (render), a room with an envirornment light and the other one with just the pass of a candle soft light. i am using the merge node (plus) to get both images togheter and this is fine, but i applied the random expression to the mix value because i would like that the candle light decrease and increase the streght slowly.

The point is that the expression i used “random(0,1,frame,1)” is generating every frame a different resoult. If i set “frame/24” the animation is picking the resoult every 24 frame but the resoult is not a soft transition but a drastic change. What i would need is to generate an animation that change every 15 frame let’s say, piking values between 0 and 1, but smooth changing simply the frequency of it and using smooth or bezier points intead of linear interpolation.

I would really appreciate if someone could help me because i am getting mad about it!
Thank you in advance!

did you try Perlin noise? ExprUtils — Natron 2.3.16 documentation

Hey thank you for the reply :slight_smile:

I tried now but i achieve to use that node…My imput is higher res than the project size (i use transform to zoom in and out the image), and even cropping and reformat i always get an error…

I am testing also the “crok_perlin_GL” as mask in the merge node the resolut is not bad but is not what i need…i would just need to change the multiplier (and gain and gamma) randomly and set the frequency for the animation.

This is not a node, but a function you can use in python expressions

oh ok, i am not expert sorry, but the point is that i don’t think noise in general is what i need, i don’t have to animate the flame of the candle… I just have to increase and decrease randomly the brightness of the image where the candle is… Same effect would be the blinking of a neon light almoust broken merged with an image with fix lighting. I just need to understend how to set the fequency and the amplitude inbetween 0 and 1 and set the keyes interpolation smooth.

Maybe @fabiof17 you could help me, i read many of your answer and you look a pro :raised_hands: