Number of verts from an info CHOP?

Info chops currently return the number of points in a sop, even for very large / heavy sops quickly.
However, there’s no channel for number of vertices.

I realize that vertices are components of primitives, so maybe there are performance implications to calculating this for an info chop in the general sense, but thought I’d throw it out there :slight_smile:

I’m able to achieve what I need a different way atm with a script CHOP using the following line:
numVerts = sum([len(prim) for prim in sop.prims])

However,for a sop of ~5000 verts, this almost takes a solid millisecond to calculate, so wondering if it would be faster done through c++/info chop. Not a super critical thing though.

Thanks!

1 Like

Seconding @lucasm request here. Would be quite handy to be able to query the num of vertices comfortably indeed :slight_smile:

1 Like

Good request, but in the meantime have you tried measuring the performance by using the ‘Unique Points’ option of the Facet SOP ?

Are there any other parameters that need to be set in the facet SOP to get parity between points ↔ verts? I tried with a simple cube to just turn on Unique Points, but MMC on the node shows 24 verts still and 8 points.

Not sure I get the same results:
Box SOP: 24 vertices, 24 points
→ Facet SOP #1: Consolidate points fast: 24 vertices, 8 points
→ Face SOP #2: Unique points: 24 vertices, 24 points

Can you send the toe?

Scratch my previous :slight_smile: your method works! had some other toggles switched I believe.

Here’s the performance comparison - the python expression/one liner is ~ 2.2x faster still, at least on this human mesh I use a lot.

I see now.

So I’ve gone ahead and added new member: SOP.numVertices.

In my rotating humanoid test:

Unique Points: 3.2 msec
Expression: sum([len(prim) for prim in op(‘out2’).prims]) : 2.5 msec
Expression: op(‘out2’).numVertices: 0.2 msec

This will be in builds 2020.43750 and later.

Cheers,
Rob.

woo! Thank you @rob.
Just out of curiosity, how many verts were in the mesh you tested with? trying to gauge how fast that is relative to what I tested with (excluding cpu speed etc)

It was 9582 verts in the default humanoid.fbx (around 3k polys)

2 Likes