THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 30/04/2009 at 01:35, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 10.5 /11
Platform: Windows ; Mac OSX ;
Language(s) : C++ ;
---------
Hello all,
i am serching a way to cerate a polygon (ngon) from some existing point.
in particular i create with modelling Lib this point in a loop and then in next loop i need to cerate an Ngon.
Another problem:
here some code in may Descriptiontooldata::MouseInput
case SM_TYPE_CONTOUR:
{
if (i==0)
{
mymod= Modeling::Alloc();
mymod->InitObject((PolygonObject* )obj,0);
}
if ( i != 0)
{
if ( newpos == trackarr[0] )
{
mymod->CreateNgon((PolygonObject* )obj,index,i);
if (!mymod->Commit()) return FALSE;
EventAdd();
trackarr.Free();
longarr.Free();
Modeling::Free(mymod);
i=0;
break;
}
}
trackarr.Push(newpos);
index[i] = mymod->AddPoint(obj,newpos);
if (!mymod->Commit()) return FALSE;
i=i++;
break;
}
the main problem is this in the first loop (i=0) i alloc modelling and this is ok
then on each i increment i ad a point with mymod->AddPoint(obj,newpos);
but in the second loop this operation return 0 and not point virtual index, cinema4d trace tell me Modelling Kernel error.
any idea ?
Thanks
Franz