On 17/04/2018 at 01:47, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 16+
Platform:
Language(s) : C++ ;
---------
here is what I do to get the matrices of the particles in matrix object.
BaseTag *mographTag = op->GetTag(ID_MOTAGDATA);
if (mographTag != nullptr)
{
GetMoDataMessage moMsg;
mographTag->Message(MSG_GET_MODATA, &moMsg);
if (moMsg.modata != nullptr)
{
Int32 particleCount = moMsg.modata->GetCount();
MDArray<Matrix> mdmat = moMsg.modata->GetMatrixArray(MODATA_MATRIX);
}
}
the problem: the matrices don't take into account any deformers affecting the matrix object particles.
and getting the GetDeformCache() returns a polygon object (cube for example) at the required location it is kinda overkill, and I don't know how to extract the data from a single poly object!! (don't tell me to quantize the point count and divide then send it as multiple separate objects, this is a bad design).
edit:
that cube object can be 27 cubes in 1 polygon object, its matrices are wrong (but the points local position matches the position of the matrix object particles), yet it is overkill as I mentioned before (to extract a matrix from 8 points... (this is only if I know they are cubes, what if they are spheres or any other shape..).