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?
Cheers,
Frank