- I'm starting from a mesh in object mode.
- I insert an animation key (I position for example).
- I go to the graph editor.
- I select an f-curve.
- I add a generator type fmodifier.
- I choose the start and end frames.
It gives me this in Python:
import bpy bpy.ops.anim.keyframe_insert_menu (type = 'Rent') bpy.context.area.type = 'GRAPH_EDITOR' bpy.ops.graph.fmodifier_add (type = 'GENERATOR') bpy.context.object.use_restricted_range = True bpy.context.object.frame_start = 0 bpy.context.object.frame_end = 100
On the other hand, I do not know how to insert these additional lines in python which allow me to choose the degree of the polynomial as well as these coefficients.
I saw in the blender API this function corresponding to what I would like to do: url link: https://docs.blender.org/api/blender_python_api_current/bpy.types.FModifierGenerator.html?highlight=generator#bpy.types.FModifierGenerator
My question: How to correctly insert in the python script of the beginning this FModifierGenerator with its degree and its coefficients? I can not do it ... for example polynomial of degree 1:
1st coefficient = 2 2nd coefficient = 3