[Closed] Event Part count
hi, i was wondering why if i do
$'PF Source 01->Ev'.numParticles()
it’s working but if i do
Ev.numParticles()
it’s not.
actually the real code i m using is
(getnodebyname ddlEvent.selected).numparticles()
When “PF Source 01->Ev” is the full name of the Event node, that is exactly what you’ll need to use for getNodeByName to work, eg:
Ev = getNodeByName "PF Source 01->Ev"
Ev.numParticles()
Or am I missing something? Not sure what you are trying to do
Cheers,
Martijn
it will not work like this…
I m using 2 dropdownlists. One for the PFS and the second one with the Event (depending the first ddl selection
on ddlPFS selected PF do
(
(
myEvents = for p in (getPropNames (getNodeByName ddlPFS.items[PF]))
where
((classOf (propValue = getProperty (getNodeByName ddlPFS.items[PF]) p)) == Event)
collect
( (refs.dependentNodes propValue immediateOnly:true)[1] )
ddlEvent.items = (for i in myEvents collect i.name)
)
and i would like to know the max particles in my event using the .numparticles()
just concatenate the two, then?
e.g. if you have…
a = “PF Source 01”
b = “Ev”
then
getNodeByName (a + “->” + b)
?
if think u’re right
i tried this getnodebyname (a+b) and fergot the “->”
i ll try it now
thanks
btw i was wondering how i could get the highest value of my particle amount.
Because the .numparticles return the amount of the particles at the frame being.
get the ‘amount’ value / calculate from the rate+start/stop of the Birth event?
e.g.
(getNodeByName “Birth 01”).amount
no
e.g.
I’ve an age test sending from frame 15 to 25 my particle to the event “Ev” and i would like to get the maximum amount of particles going into it.
but if i m running my script at frame 0 i ll get back 0 particles.
Afaik, there’s no way to know beforehand how many particles go where at a given point in time (since pflow is history dependent), so as Richard pointed out you’ll need to iterate through the time range and count particles to get this information.
Martijn