Re: help,How to use C# code to get data from a graph

You can get the detail from the CStatObj structures. Other details from the CRenderMesh structure. Something like;

Code: Select all

if (IEntity* pEntity = gEnv->pEntitySystem->FindEntityByName("stat_check"))
if (IStatObj* pStatObj = pEntity->GetStatObj(0))
IStatObj::SStatistics stats;
IRenderAuxText::Draw2dLabel(25,25, 3, ColorF(0,255,0), false, "Entity Id:: %d", pEntity->GetId());
IRenderAuxText::Draw2dLabel(25,50, 3, ColorF(0,255,0), false, "Vertices: %d", stats.nVertices);
IRenderAuxText::Draw2dLabel(25,75, 3, ColorF(0,255,0), false, "Indices: %d", stats.nIndices);

if (IRenderMesh* pRenderMesh = pStatObj->GetRenderMesh())
int nTotalTriCount = 0;
for (CRenderChunk& chunk : pRenderMesh->GetChunks())
if (chunk.m_nMatFlags & MTL_FLAG_NODRAW || !chunk.pRE)
if (chunk.nNumIndices > 0)
nTotalTriCount += chunk.nNumIndices / 3;

IRenderAuxText::Draw2dLabel(25,100, 3, ColorF(0,255,0), false, "Loaded Tris: %d", pRenderMesh->GetIndicesCount() / 3);
IRenderAuxText::Draw2dLabel(25,125,3, ColorF(0,255,0), false, "Total Tris: %d", nTotalTriCount);

IRenderAuxText::Draw2dLabel(25,150, 3, ColorF(0,255,0), false, "Mesh memory usage: %d", stats.nMeshSizeLoaded);
CRYENGINE Technical Community Manager
Here to help the community and social channels grow and thrive.

My personal belongings;
Beginner Guides | My GitHub | Splash Plugin

Who is online

Users browsing this forum: No registered users and 1 guest