THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/01/2009 at 05:40, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 10.1
Platform: Windows ; Mac ;
Language(s) : C++ ;
---------
Hi,
since I got the same problem as fused (see this thread), I tried to get a correctly triangulated model like this:
> \> void TriangulatePolygonObject(PolygonObject \*op, BaseDocument \*doc, PolygonObject \*res) \> { \> PolygonObject \*cObj = (PolygonObject\* )(op->GetClone(COPY_NO_BRANCHES|COPY_NO_BITS|COPY_NO_INTERNALS, NULL)); \> cObj->SetMg(op->GetMg()); \> \> ModelingCommandData cd; \> cd.doc = doc; \> cd.op = cObj; \> if (SendModelingCommand(MCOMMAND_TRIANGULATE, cd)) \> { \> PolygonObject \*result = (PolygonObject\* )(cd.result->GetIndex(0)); \> if(result) \> { \> result->CopyTo(res, COPY_NO_BRANCHES|COPY_NO_BITS|COPY_NO_INTERNALS, NULL); \> PolygonObject::Free(result); \> } \> } \> PolygonObject::Free(cObj); \> }
But it doesn't work. SendModelingCommand() always returns TRUE, indicating the command was executed. But result is always NULL. Where's the problem? I call the function like this:
> PolygonObject \*OrgObj = ToPoly(op); \> PolygonObject \*TriObj = PolygonObject::Alloc(OrgObj- >GetPointCount(), OrgObj->GetPolygonCount()); \> TriangulatePolygonObject(OrgObj, doc, TriObj); \>
Op is a plane, a landscape or any converted polygon object. Always the same NULL result.
Tahnks for any help!
Cheers,
Jack