THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 07/04/2004 at 10:18, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 8.100
Platform:
Language(s) : C.O.F.F.E.E ;
---------
I'm trying to alter a polygon objects points positions. unfortunatly what i want to do causes crashes I can't explain. the following code, ist very similar to what I've tried and it works.
main ( the_Document, the_Object )
{
println("active");
var p=the_Object->GetPoint(0);
//if first points x-value is not -1
//run coffee program
if(p.x!=-1)
{
var angle=cos(3.141592654*46.055/180);
var array=the_Object->GetPoints();
var count = sizeof(array);
var i;
for (i = 1; i < count; i++)
{
//print(tostring(z)+" / " + tostring(angle) +"\n");
array _.x=array _.z*angle;
//array _.y=array _.z*angle;
}
the_Object->SetPoints(array);
//ensure that the first points x-value ist -1
p.x=-1;
the_Object->SetPoint(0,p);
}
}____
________
I get the list of points, change the x value and reset the list. perfekt. in the for-loop I've excluded a little code where i change the y value. if i enable it, i get a crash usually right away, sometimes i see the result and then it crashes. if I simply set the value of array[i].y to 0 , no problem. but as soon as i integrate the z value, kaboooom. Cinema crashes completely. if i do this : array[i].y = array[i].y+50; it works as well.
____really weird. and i just can't find a solution.