PDA

View Full Version : accessing .particleMatrix outside of pflow


Britton
12-21-2006, 04:54 PM
Hey folks,
Although this is particle flow related, it's really a scripting problem I'm having, so I figured I'd put this here...

Title says it all really, I'm trying to access the values I've placed in a particleMatrix from a script outside of particle flow, or more specifically as the flow's the final step update script. Normally I'd run this as a script operator and it'd work just fine, but in this case I need it to run independantly of a cache event, and thus outside of the entire flow.

As it stands, when I try to access particleMatrix, maxscript gives me an "Unknown Property" error. Since there's no appropriate place to put a channelsUsed handler, I can't enable the useMatrix property, which I'm guessing is the problem.

Anybody know a way around this? If I'm not being eloquent enough here to make sense (probably the case), I'll post a quick sample script.

super thanks!

HalfVector
12-21-2006, 09:22 PM
You can access to particle properties through the particleObjectExt interface.

So for example, if you want to get the TM for all active particles in a PF, you'll do:

for i = 1 to $'PF Source 01'.numParticles() do (
-- Set current particle
$'PF Source 01'.particleIndex = i
-- Current particle's TM
particleTM = $'PF Source 01'.particleTM
)

Bobo
12-21-2006, 10:05 PM
You can access to particle properties through the particleObjectExt interface.

So for example, if you want to get the TM for all active particles in a PF, you'll do:

for i = 1 to $'PF Source 01'.numParticles() do (
-- Set current particle
$'PF Source 01'.particleIndex = i
-- Current particle's TM
particleTM = $'PF Source 01'.particleTM
)


You can access .particleTM, but there does not seem to be a way to access .particleMatrix which is the custom particle script channel.

$PF_Source_01.particleIndex = 1
1

$PF_Source_01.particleTM
(matrix3 [-0.347798,-0.716754,0.604401] [-0.157189,-0.590944,-0.79125] [0.924299,-0.3702,0.0928629] [-14.3615,-67.5707,0])

$PF_Source_01.particleMatrix
-- Unknown property: "particleMatrix" in $PF_Source:PF Source 01 @ [-20.362289,-75.734695,0.000000]

Britton
12-22-2006, 10:40 PM
aw man, I was afraid of that! oh well, thanks for your help anyways guys, I probably would've messed around with this unsucessfully for days

...time to figure out a nice work around...

CGTalk Moderation
12-22-2006, 10:40 PM
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.