On 14/03/2017 at 03:59, xxxxxxxx wrote:
Originally posted by xxxxxxxx
I tried a different approach, based on an example python effector from the Python SDK (py_effector)
In that example there is no "return" present, and when I try my code (seen below) I have to include "return 1.0" otherwise I get an error:
"TypeError: main expected float or c4d.Vector, not None"
To not get this error, set the Effector mode to Full Control and return a bool instead (True if successful - usually at the end - and False in error cases). More information on this mode below.
Originally posted by xxxxxxxx
So, this code doesn't work, it throws no errors either, it does dump about a million "I shuffled" messages to the log every 5th frame. Why that is happening, I have no clue.. I assumed python effector executes once per frame..?
A Python Effector is executed 21 times for each frame in Parameter Control mode. This mode means the Effector is value driven.
main() is then called for each blend value to return its strength (see EffectorDataStruct::strengths). Retrieve the current blend value ID with MoData.GetBlendID().
In Parameter Control mode, a Python Effector main() is called from C++ EffectorData::CalcPointValue().
In Full Control mode, a Python Effector main() function is executed once per frame.
In this mode, main() is called from C++ EffectorData::ModifyPoints() to change the MoData returned by GeGetMoData().
EDIT: Provided accurate information for EffectorData::ModifyPoints() and EffectorData::CalcPointValue().