THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 19/11/2007 at 05:49, xxxxxxxx wrote:
User Information:
Cinema 4D Version:
Platform:
Language(s) :
---------
Hello,
I´m a totally new to COFFEE, but I´d like to create a script doing the following:
1. Call an object
2. Get the polygons from 1.
3. Convert each polygon into an individual object
I thought, something like this would do the job:
> _var object = doc- >FindObject("Cube");
> var currentDoc = GetActiveDocument();
>
> var NoOfPolygons = object->GetPolygonCount();
> var i = 0;
>
> while (i <= NoOfPolygons) {
>
> var singlePolygon = object->GetPolygon(i);
>
> var newPolygon = new(PolygonObject);
> newPolygon->SetPolygon(singlePolygon);
>
> currentDoc->InsertObject(newPolygon, NULL, NULL);
>
> i++;
> }
>
> _
The polygon objects are created, but they don´t contain any points or position data. Currently I just don´t know what do, because the entire COFFEE construction is a bit confusing for me...
Thanks a lot in advance for your help and hints.
Best,
t.
P.S.: I´m on C4D 9.6