I'm writing a function that should return the frame when a field reaches a certain value in the property window.
To be more specific here the function:
def getFrameFromPercentagePosition(context, pCurveObject, pPercentagePosition):
context.scene.frame_current = 1
while pCurveObject.data.bevel_factor_end < pPercentagePosition:
context.scene.update()
context.scene.frame_current += 1
return context.scene.frame_current
The field bevel_factor_end is animated between 0 and 1 and I want to know the frame when its value reaches the pPercentagePosition
value.
But, after some debugging, I've found out that pCurveObject.data.bevel_factor_end
is always 1.0 in this script. However, when I do manually in the interactive console by asking the bevel_factor_end of the active object, it gives me the right value.
How can I make sure that a got the correct value for this property?