THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 28/02/2009 at 14:07, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 10.1
Platform: Windows ; Mac OSX ;
Language(s) : C++ ;
---------
Hi,
in a generator object plugin (function GetVirtualObjects()), I create a plane primitive.
> \> BaseObject \*plane = BaseObject::Alloc(Oplane); \>
Now I want to get an editable PolygonObject from that, because I have to do several operation on the plane's points. How do I do that?
I have tried just calling plane->GetCache(), but the Cache is always NULL (I guess this is because the "plane" object is not in the document).
I also tried using the Modeling Command MCOMMAND_MAKEEDITABLE but it doesn't work. Same with MCOMMAND_CURRENTSTATETOOBJECT. After calling the command, the object "res" contains something, but whatever it is, it doesn't have any polygons or points. I guess this is again the case because the "plane" object is not in the document.
> \> BaseObject \*res = NULL; \> ModelingCommandData cd; \> cd.doc = doc; \> cd.op = plane; \> if (SendModelingCommand(MCOMMAND_MAKEEDITABLE, cd)) \> { \> BaseObject \*result = static_cast<BaseObject\*>(cd.result->GetIndex(0)); \> result->CopyTo(res, COPY_NO_ANIMATION|COPY_NO_BITS|COPY_NO_INTERNALS, NULL); \> BaseObject::Free(result); \> } \>
Much talk, little question: How do I create a plane mesh which I can manipulate?
Thanks in advanced for any help!
Greetings,
Jack