PDA

View Full Version : Event Part count


holycause
03-08-2009, 07:01 PM
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()

magicm
03-08-2009, 08:42 PM
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

holycause
03-08-2009, 08:48 PM
it will not work like this.. :P

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()

ZeBoxx2
03-08-2009, 08:56 PM
just concatenate the two, then?

e.g. if you have...
a = "PF Source 01"
b = "Ev"

then

getNodeByName (a + "->" + b)

?

holycause
03-08-2009, 09:12 PM
if think u're right

i tried this getnodebyname (a+b) and fergot the "->"

i ll try it now

thanks

holycause
03-08-2009, 09:19 PM
it's working fine thx dude

holycause
03-08-2009, 09:44 PM
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.

ZeBoxx2
03-08-2009, 11:41 PM
get the 'amount' value / calculate from the rate+start/stop of the Birth event?

e.g.
(getNodeByName "Birth 01").amount

holycause
03-09-2009, 12:24 AM
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.

magicm
03-09-2009, 01:28 AM
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.
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

CGTalk Moderation
03-09-2009, 01:28 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.