THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 14/04/2012 at 10:59, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 13 Demo
Platform:
Language(s) : C++ ;
---------
hiho,
i have got a rather diffuse question again. i can't get the SMC to work in c++. i am following the
sdk example with this slightly modified snippet :
PolygonObject *result = NULL;
// result is filled with points and polygons
BaseContainer bc;
bc.SetLong(MDATA_KNIFE_MODE, MDATA_KNIFE_MODE_PLANE);
bc.SetLong(MDATA_KNIFE_PLANE, MDATA_KNIFE_PLANE_YZ);
bc.SetBool(MDATA_KNIFE_PLANE_SLICING, TRUE);
bc.SetLong(MDATA_KNIFE_PLANE_CUTS, 4);
ModelingCommandData cd;
cd.doc = GetActiveDocument();
cd.bc = &bc;
cd.op = result;
if (SendModelingCommand(ID_MODELING_KNIFE_TOOL, cd)) GePrint("Beep");
BaseObject *res = static_cast<BaseObject*>(cd.result->GetIndex(0));
the last line gives me a runtime error "access violation reading ...." when i watch
the SMCData while debugging with VS cd.Result seems to be empty. so i have
got three questions.
1. how and where is it defined if SMC creates a new object. in python i can always read
the returned array. i am using the default flag, aka MODELINGCOMMANDFLAGS_0.
the help states for AtomArray* result
Resulting object array for commands that create new objects. Not used if MODELINGCOMMANDFLAGS_CREATEUNDO is set in flags.
2. where is the difference between the COMMAND parameters MCOMMAND_KNIFE and ID_MODELING_KNIFE_TOOL.
3. why is my array empty ?
i am calling SMC from a static baseobject method if this does matter.
edit : and it beeps , so SMC is true / executed ;)