2
$\begingroup$

I want to rotate an object a bit every second for example. I thought of the mathematical floor operation. This operation seems to be implemented somewhat, as I can enter something like floor(10.1234) but I want something like this floor(#frame) which creates this error:

('unexpected EOF while parsing', ('<string>', 1, 13, 'floor(#frame)'))
$\endgroup$
  • $\begingroup$ The ‘#’ is not part of the variable ‘frame’ but simply indicates that it’s a shorthand driver. You would have more luck with ‘#floor(frame)’ - although ‘frame’ is an integer and ‘floor’ would round down to the nearest integer so it doesn’t make sense as it is... presumably you need to include some other factor such as ‘#floor(float(frame)/25)’ to jump once every 25 frames...? $\endgroup$ – Rich Sedman Sep 15 at 17:06
  • $\begingroup$ Thanks that solved the problem, obviously flooring a integer isn't useful... $\endgroup$ – user11914177 Sep 15 at 17:29
2
$\begingroup$

The ‘#’ is not part of the variable ‘frame’ but simply indicates to Blender that what you have entered should be interpreted as a Driver. In the case of '#frame' the driver simply returns the value 'frame' - the current frame of animation.

To use the floor function you should prefix the entire expression with '#' - ie, #floor(frame). In order to have the value step up by 1 on each 25th frame you could enter the expression #floor(float(frame)/25). This converts the 'frame' into a floating point value (technically not required - but still good practice), divides by 25 and rounds down to an integer. ie, on frames 0-24 it will produce 0, on frames 25-49 it will produce 1, 50-74 -> 2, 75-99 -> 3, etc.

| improve this answer | |
$\endgroup$
2
$\begingroup$

This isn't an answer to your question, (@Rich Sedman has covered that); it's an alternative.

For stepped, repeated actions, you might consider using a Cycles modifier with an offset on the f-Curve.

enter image description here

Depending on your case, it might be less fiddly, especially if there's compund animation.

enter image description here

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.