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

#4
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;
pStatObj->GetStatistics(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)
continue;
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);
}
}
Uniflare
CRYENGINE Technical Community Manager
Here to help the community and social channels grow and thrive.

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

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

#5
Thank you so much for your great help. I've been able to get these data. I'm really happy.
Image

I am sorry for not seeing the picture.
My question is: I can now get a .cgf performance data (as shown in the previous image), my definition is
Char * fileName = "D:\\C++\\Assets\\objects\\sphere.cgf";
IStatObj* pStatObj = gEnv->p3DEngine->LoadStatObj(fileName);
Can only get a fixed "sphere.cgf"
I want to get all * .cgf in the folder of objects at one time. What should I do?
Last edited by myt888 on Mon Mar 25, 2019 6:49 am, edited 4 times in total.

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

#8
I am sorry for not seeing the picture.
My question is: I can now get a .cgf performance data (as shown in the previous image), my definition is
Char * fileName = "D:\\C++\\Assets\\objects\\sphere.cgf";
IStatObj* pStatObj = gEnv->p3DEngine->LoadStatObj(fileName);
Can only get a fixed "sphere.cgf"
I want to get all * .cgf in the folder of objects at one time. What should I do?

Who is online

Users browsing this forum: No registered users and 4 guests