THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/01/2009 at 10:49, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 11
Platform: Windows ;
Language(s) : C++ ;
---------
Hey there everybody,
This is my first post on these forums. I'm a frequenter of C4DCafe but I've only recently started developing plugins.
Right now I'm having some issues invoking the Optimize command in Cinema4D. Here's the piece of code where I'm having trouble:
> \> //Optimize points on the objects \> //Create new Modeling Command Data \> ModelingCommandData cd_3; \> cd_3.doc = doc; \> //Also need a base container to pass Optimize command data \> BaseContainer bc; \> bc.SetReal(MDATA_OPTIMIZE_TOLERANCE, 0.01); \> bc.SetReal(MDATA_OPTIMIZE_POINTS, TRUE); \> bc.SetReal(MDATA_OPTIMIZE_POLYGONS, TRUE); \> bc.SetReal(MDATA_OPTIMIZE_UNUSEDPOINTS, TRUE); \> //Set the objects to be changed \> cd_3.op = (BaseObject\* ) cd_2.result->GetIndex(0); \> GePrint(((BaseObject\* ) cd_2.result->GetIndex(0))->GetName()); \> if(SendModelingCommand(MCOMMAND_OPTIMIZE, cd_3)) \> { \> cd_3.op->Message(MSG_UPDATE, NULL); \> //Optimize command doesn't return anything. \> } else { \> //Command failed \> return FALSE; \> } \>
When I do this, the object that I run the optimize command on doesn't actually get optimized. I tried this on a cylinder and my code did not result in the cap and the body points merging.
Any ideas?
Thank you,
Yilmaz Kiymaz