Hi
for my speaker_tools addon I’d like to be able to add and remove control points to an fcurve envelope modifier using the python API. This is not currently available… Unfortunately there is rust apon the rust of my C / C++ skills. I can remember enough to read the code and / or step thru the debugger to see whats going on, but am more than a little stuck when it comes to adding new functions.
Some notes.
Currently the code to add a control point is in
…\source\blender\editors\animation\fmodifier_ui.c
the button function ( fmod_envelope_addpoint_cb) uses a binary search to add the new control point, at the current frame, in the correct order or do nothing if a point already exists on that frame. This appears to be excess overhead, as I can simply edit the frame of added points to be on same frame or out of order, without any major problems albeit I haven’t tested this with complex envelopes.
My suggestion would be scrap this, and simply sort the UI and have an alert flag when two or more control points exist with same frame.
Then define the control_points add and remove methods in
…\source\blender\makesrna\intern\rna_fcurve_gen.c
this is where I get more than a little stuck.
Any help, tips, pointers would be most appreciated. Even a simple example to add a method to the control points collection that prints to the console would be extremely handy.
Thankyou.