How to obtain all vertices of an object in C++.
-
Hello colleagues,
I used C++ to write the C4D S26 plugin on Windows 10,Get all vertices of an object,but There are no GetAllPoints in the document。
maxon::BaseArray<maxon::Vector >objectPoints = obj->GetAllPoints();GetAllPoints included in Python documentation,but not in C++.
How to obtain all vertices of an object in C++.Thanks in advance!
-
Hi this can be done via PointObject::GetPointR or
GetPointW
. GetPointW is if you want to modify the position otherwise use GetPointR if you only need to read them.So this will give use something like that where
obj
is a PointObject:iferr_scope_handler { return false; }; maxon::BaseArray<maxon::Vector>> pts; const Vector* const objPts = obj->GetPointR(); const Int32 objPtCount = obj->GetPointCount(); for (Int i = 0; i < objPtCount; ++i) { pts.Append(objPts[i]) iferr_return; }
Cheers,
Maxime. -
@m_adam Thanks