PartOperation.TriangleCount is now live!

Hi friends!

You can now find out how many triangles are in your CSG PartOperations. Big thanks to @EchoReaper for this feature request. Keep them coming!

[Property] int PartOperation.TriangleCount [ReadOnly]

Original request:
http://devforum.roblox.com/t/triangles-read-only-property-of-partoperations/10989

Some caveats:

  • Meshing loading from online may not immediately have meshData upon game start, you’ll want to wait until it loads completely to get accurate data
20 Likes

Are we going to get this for MeshParts as well? (PartOperation isn’t inherited for MeshPart according to the wiki)
blob.png

5 Likes

What would you use it for?
Seems kinda impractical if you ask me.

1 Like

I don’t have a use case other than a counter, just posting if there is an inheritance problem or something along those lines.

Knowing how many polys a mesh has is always nice, because you aren’t always the one to make the mesh.

4 Likes

That right there is the prime use case.

  1. I want to know if a mesh I took from the toolbox is too high poly
  2. I want to check my place to see if I have anything ridiculously high poly I could optimize
  3. I just want a triangle count for my level

Those are other common use cases off the top of my head

8 Likes

This is useful for when you’re working on a big CSG project and need to know what the triangle count is so that you don’t go over. But now that meshes are out, it’s not as useful to me as it would have been before. Though if I ever convert a union to a mesh, I could use this to see how much my asset improved in poly count. It’s a nice thing to have.

Add one:

I want users to be able to use their own meshes for building in-game but need to regulate to make sure they don’t have too many triangles. For instance, @Maelstronomer could use this for Pilgrim Islands Reborn if he wants to limit player-made detail. A part count might not be enough since 50 5000 triangle meshes impact performance a lot more than 50 parts, so it’d be good to be able to make that differentiation.

Either way though, I’m super glad this is available to us now, even if it’s only for unions.

Does the triangle count start at 0 until the actual mesh loads or is it always the triangle count of the fully loaded mesh?
If it starts at 0, you could also use it to detect when a mesh has fully loaded.

It starts at 0, and then changes when the mesh loads (if it loads).

Note you can use it to check if things are loaded, but it isn’t recommended in case of failure. Instead, use content service.

It’s impossible to use ContentService to preload unions because the assetIds are not exposed to us. The closest thing we can do is put the union on-camera but at size 0,0,0 and hope it’s loaded when we need it.

4 Likes