THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/12/2004 at 04:57, xxxxxxxx wrote:
Cinema 4D Version: 8.206
Language(s) : C++ ;
I have a tag plugin that modifies the points of a spline object that the tag is on. I have a button for that tag plugin to remember the current state of the spline (the point locations), so I can reset it at anytime by clicking another button in the AM.
To keep a current state of the spline, I create an member array, and copy the SplineObject::GetPoint() values into my new array, like this
lPointCount = op->GetPointCount();
OriginalPoints = new Vector[lPointCount];
Vector *vadr = op->GetPoints();
for(j=0; j < lPointCount; j++)
// Store original point
OriginalPoints[j] = vadr[j];
OriginalPoints is a member variable.
My problem is, if I move the points of the spline using standard c4d tools, and then clicking the undo button in C4D, it NULL's my OriginalPoints variable, causing it crash on some functions of my plugin.
Why would undo reset my OriginalPoints variable?
This is a bad problem, as I'm saving the OriginalPoints array to the file, and if the user clicks undo first. It crashes C4D
On 26/12/2004 at 10:15, xxxxxxxx wrote:
Undo would call CopyTo. Do copy all of the data in the CopyTo function?
On 27/12/2004 at 08:25, xxxxxxxx wrote:
I didn't know Undo called CopyTo so consequently I wasn't passing the array.
It works a charm now, thanks again
On 27/12/2004 at 10:53, xxxxxxxx wrote:
Cool. Its the little things that get ya. It is easy to miss ( very easy ). 9-)