Particle count

   3314   8   1
User Avatar
Member
253 posts
Joined: July 2006
Offline
Inside a dopNetwork, how do we find the particle count for a stream ?

I'd like to use this number to drive a parameter in the same network.
User Avatar
Member
319 posts
Joined:
Offline
Off the top of my head, can you use something like


npoints(“../”+opinput(“.”,0))



?
User Avatar
Member
319 posts
Joined:
Offline
Tried it, doesn't seem to work. Although I did get it to work if you look outside the popnet for the node. I.e. append a null to your popnet node (outside the popnet) and ref that null in the npoints expression.


npoints(“../../null1”)


I used it in the amp field of a force pop, and it grabbed the number of points in the pop stream just fine.
User Avatar
Member
8595 posts
Joined: July 2007
Online
if you want to use it inside of DOPnet on the node belonging to some stream you'd probably need to do:
npointsgroup(“..:$OBJ/Geometry”, “stream_popstream1”)
where “stream_popstream1” is of course name of your stream or group you want to get pointcount for

I assumed following would work for current stream as well, however it returns 0 for me maybe a bug:
npointsgroup(“..:$OBJ/Geometry”, opstreamname(“.”))
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
253 posts
Joined: July 2006
Offline
Thanks Dean and tamte.

I've always found dop expressions pretty cryptic. Do you have good resources, links, tutorials, information in general that I could use ?

edit: There's no opstreamname expression in the docs, maybe it was replaced with something else ?
User Avatar
Member
8595 posts
Joined: July 2007
Online
`opstreamname(“.”)` works on it's own and returns name of the current stream, however using it in former expression seems not to be able to replace explicit name, which seems weird
regarding docs, maybe it was just never added there, but that function is heavily used by POP nodes
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
253 posts
Joined: July 2006
Offline
Oh, ok. What about some resources regarding dop expressions ? So I can make good use of them.
User Avatar
Member
253 posts
Joined: July 2006
Offline
So trying to understand this

npointsgroup(“..:$OBJ/Geometry”, “stream_popstream1”)

I see the expression takes a surface node as the first argument, am I to conclude that ..:$OBJ/Geometry is a surface node?

Where is it ?

What is $OBJ ?

Docs say: “This value is the index of the specific object being processed by the node.” But I can't make sense out of it.

I understand .. ( two periods ) means 1 level up.

What does “:” do ?


And again most importantly, forgive me for asking, where is this info in the help files? Or what tutorials, etc. should I see regarding this syntax ?
User Avatar
Member
8595 posts
Joined: July 2007
Online
that's how you access data from DOP sim
in this case Geometry Data of Current object as $OBJ is id of current object, or actually it should have been $OBJID

http://www.sidefx.com/docs/houdini14.0/dyno/io#idm140132764773680 [sidefx.com]
Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links