How to Obtain the .FBX Points of Objects in C++
-
Hello colleagues,
I used C++ to write the C4D S26 plugin on Windows 10, I import .FBX and want to obtain the world coordinates of each point in the composite shape. Thanks in advance!
BaseObject* obj = doc->GetActiveObject(); PointObject* pointObj = static_cast<PointObject*>(obj); Int32 pointCount = pointObj->GetPointCount(); Vector* points = pointObj->GetPointW(); const ::Matrix globalMtx = pointObj->GetMg(); for (Int32 i = 0; i < pointCount; ++i) { Vector site = pointObj->GetMg() * points[i]; GePrint("Frame " + String::IntToString(count) + ": " + String::VectorToString(site)); }
so, The point I picked is for this polygon
but,The coordinates I want are this combination image
-
Hello @pchg,
Thank you for reaching out to us. FBX has nothing to do with your question, as when you encounter your problem, the data long have been converted into Cinema 4D's scene format.
The reason why you encounter this discrepancy is because you access the points of the scene object instead of its deform cache. And since your horse model is under the influence of bones, it holds that deformed state in its deform cache. You can access that cache with BaseObject::GetDeformCache (S26.1). But note that this cache just as the generator cache is not always populated. In C++ we do not have a meaningful documentation of the geometry model, but we have one for Python. I would recommend having a look at it, especially geometry_caches_s26.py to understand how object caches work.
Cheers,
Ferdinand -
@ferdinand Thank you for your reply