Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Hi,
I have a function that looks like this:
Bool SubdividePolygonObject(PolygonObject* const objectPtr, const maxon::Int32 subdivisions, const maxon::Bool sds) { // Parameters for the modeling command BaseContainer modelingCommandParameters; modelingCommandParameters.SetBool(MDATA_SUBDIVIDE_HYPER, sds); modelingCommandParameters.SetInt32(MDATA_SUBDIVIDE_SUB, subdivisions); // Execute modeling command ModelingCommandData modelingCommandData; modelingCommandData.op = objectPtr; modelingCommandData.bc = &modelingCommandParameters; if (!SendModelingCommand(MCOMMAND_SUBDIVIDE, modelingCommandData)) return false; return true; }
Example usage:
BaseContainer cubeData; basicObjectData.SetVector(PRIM_CUBE_LEN, maxon::Vector(100.0)); cubeData.SetInt32(PRIM_CUBE_SUBX, 2); cubeData.SetInt32(PRIM_CUBE_SUBY, 2); cubeData.SetInt32(PRIM_CUBE_SUBZ, 2); PolygonObject* const objectPtr = static_cast<PolygonObject*>(GeneratePrimitive(nullptr, Ocube, cubeData, 1.0, false, hh->GetThread())); if (!SubdividePolygonObject(objectPtr, 5, true)) GePrint("Something went wrong."_s);
This works fine in R20 - R25, but returns false in 2023. What could be the reason?
false
Cheers, Frank
Interesting...
If I put all code aside, simply start Cinema 4D 2023, and do the following:
--> The cube does not change at all.
Is MCOMMAND_SUBDIVIDE maybe completely broken?
Hi Franck,
You are right, the UI command is not working if the document is on object mode; there is already a bug report open for that one. I do not know if both issues are related and if the fix will also modify the API behavior but for now you can change the mode to the ModelingCommandData like so.
modelingCommandData.mode = MODELINGCOMMANDMODE::POLYGONSELECTION;
If specifying the mode becomes mandatory i will update the documentation.
Cheers, Manuel
Thank you, that fixed it.