How to know how many primitives in one node?

   7305   4   0
User Avatar
Member
6 posts
Joined: May 2019
Offline
Hey guys
I would like to ask how to know how many primitives in one node? I mean automatically, because I don't want to count them one by one.

For example, I have this node which contains 8 primitives, How to get the 8 out of it, since it shows that the max prim num is 7. I want to use prim num “8” as a variable in Wrangle. Thank you very much.

Attachments:
Annotation 2020-02-03 103411.png (113.4 KB)

User Avatar
Staff
3459 posts
Joined: July 2005
Offline
if you middle mouse click on a node it will tell you lots of information about the geometry
if you have 8 prims, their numbers will be 0 - 7, since counting begins at 0
https://en.wikipedia.org/wiki/Zero-based_numbering [en.wikipedia.org]
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
6 posts
Joined: May 2019
Offline
goldfarb
if you middle mouse click on a node it will tell you lots of information about the geometry
if you have 8 prims, their numbers will be 0 - 7, since counting begins at 0
https://en.wikipedia.org/wiki/Zero-based_numbering [en.wikipedia.org]

Thank you for replying, however, what I actually need is that if there is a vex API that I could get the number?

I need that “8” automatically, no matter how many primitives, I could always get the number without a middle mouse check?
User Avatar
Member
6 posts
Joined: May 2019
Offline
nprimitives VEX function
Returns the number of primitives in the input or geometry file.
https://www.sidefx.com/docs/houdini/vex/functions/nprimitives.html [www.sidefx.com]


Thanks, man. I think this is the answer to the question!
User Avatar
Member
8034 posts
Joined: Sept. 2011
Offline
In an attribute wrangle, @numprimwill evaluate to the number of primitives in the first input.
Edited by jsmack - Feb. 3, 2020 15:41:25
  • Quick Links