THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/01/2004 at 16:59, xxxxxxxx wrote:
Cinema 4D Version: 8..206
Language(s) : C++ ;
I'm trying to get the amount of knots in a SPLINE control thats sitting in the attribute manager.
I need to know when the SPLINE knots have changed, so I am using the SetDParameter method to check.
The problem is that the GetKnotCount()/GetKnots() always returns the values I previously set before the current values.
The code im using is
Bool SetDParameter(GeListNode *node, const DescID &id, const GeData &t_data, LONG &flags)
BaseContainer* data = ((BaseObject* )node)->GetDataInstance();
GeData ctlCurve = data->GetData(MYCONTROL);
SplineData *CurveData = (SplineData* )ctlCurve.GetCustomDataType(CUSTOMDATATYPE_SPLINE);
GePrint("Number of Knots: " + LongToString(CurveData->GetKnotCount()));
Heres a step by step instruction on my problem
If I add my objectdata object to the scene, because the SPLINE control hasn't been initialized, its empty.
Clicking once in the control creates a new knot at position 1.0 on the x, console remains empty
Clicking again creates a new knot(so I have 2 now) at position 0.0 on the x, console print 1
Now I have 2 knots, but the console only prints there is 1
if I click one of the knots in the control, and move it somewhere and let go, so there still is only 2 knots, the console prints 2 like it should.
Now, if I click to create a new knot, the console prints 2 (whle there is now 3 knots)
moving the new knot slighlty produces 3 in the console.
It always prints the previous knot information, and this is causing a problem for my plugin
Is this a bug or am I missing something?