Recent versions of Blender do not generate any type of F-curve.

In particular, after inserting a key position image on the object, I would like to enter:

-for Xposition: f (t) = 8 * cos (t ^ 3)

-for Yposition: f (t) = 8 * sin (t ^ 3)

-for Zposition: f (t) = 0

which is impossible with an F-curve modifier, to create on the object a circular plane motion of radius 8 and accelerated

All that remains is Python.

1) A python script for this?

2) More generally, I'm looking for a tutorial elaborating a Python script to enter any type of mathematical function of a single variable, representing an F-curve related to any keyframe insertion.

Thank you for your help

  • $\begingroup$ What do you mean by "Recent versions of Blender do not generate any type of F-curve."? $\endgroup$ Mar 16 '18 at 12:30
  • $\begingroup$ for example,it's no possible to create a F-curve like this: Y(X)=exp(X)+(1-X)²/(1+X) Y(X)=arcsin(X) Y(x)=cos(X^3) $\endgroup$
    – kaloprat
    Mar 16 '18 at 12:40

The Driver System

Can use the driver system for this. An fcurve is a series of frame, value points. The value of an fcurve at any frame can be found via FCurve.evaluate(frame) A scripted expression driver evaluates its expression at each frame. context.scene.current_frame is already known to the driver namespace as frame, as are a considerable number of math methods and properties including sin, cos and pi

Type simple expressions directly into the property preceded by a hash "#".

enter image description here

Will show as purple if all is Ok. Can edit at any time by clicking on the driver. enter image description here

  • $\begingroup$ Just tested it. Cool, but frame really needs to be divided or you have jumpy cow disease. Since it's accelerating rapidly, better make it a high number if the scene is supposed to be longer than 2 seconds. $\endgroup$ Mar 16 '18 at 14:45
  • $\begingroup$ @Haunt_House Yes, for seconds divide frame by fps. or 100 or whatever . There is a bpy.utils.time_from_fame(frame) (or similar OTOMH) Thought that the frame was the typical blender unit of time for keyframes in an fcurve. Anyway the +/- nature of trig functions and a cubic can be expected to oscillate for all but low values of time. $\endgroup$
    – batFINGER
    Mar 16 '18 at 14:48
  • $\begingroup$ The scene might be in slow motion ( : $\endgroup$ Mar 16 '18 at 14:51

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.