THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 04/07/2008 at 23:04, xxxxxxxx wrote:
User Information:
Cinema 4D Version:
Platform:
Language(s) : C.O.F.F.E.E ;
---------
I created a spline object (set to Linear) to which I added the following COFFEE code, through a COFFEE tag:
> <code>
> main(doc,op)
> {
> var points,segments,current1,current2,vc1,vc2;
> points=new(array,5);
> points[0]=vector(-100,-100,0);
> points[1]=vector(0,100,0);
> points[2]=vector(100,-100,0);
> points[3]=vector(-50,0,0);
> points[4]=vector(50,0,0);
>
> segments=new(array,2);
>
> segments[0]=3;
> segments[1]=2;
>
> vc1=new(VariableChanged);
> if(!vc1)
> {
> println("Error 1");
> return;
> }
>
> vc2=new(VariableChanged);
> if(!vc2)
> {
> println("Error 2");
> return;
> }
>
> current1=op->GetPointCount();
> if(!vc1->Init(current1,5))
> {
> println("Error 3");
> return;
> }
>
> current2=op->GetSegmentCount();
>
> println(current2);
>
> if(!vc2->Init(current2,2))
> {
> println("Error 4");
> return;
> }
>
> if(!op->MultiMessage(MSG_POINTS_CHANGED,vc1))
> {
> println("Error 5");
> return;
> }
>
> if(!op->MultiMessage(MSG_SEGMENTS_CHANGED,vc2))
> {
> println("Error 6");
> return;
> }
>
> if(!op->SetPoints(points))
> {
> println("Error 7");
> return;
> }
>
> if(!op->SetSegments(segments))
> {
> println("Error 8");
> }
> op->Message(MSG_UPDATE);
> }
> </code>
I always get a report of "Error 8" in the console. Why is it failing to set the segments? Is it a bug or am I making a mistake?
Rui Batista