The pfSystem Interface is exposed by the Particle Flow Source Class.
Methods:
<float><PF_Source>.getMultiplier <time>time
Returns the Quality multiplier depending on the Render State. See methods setRenderState and isRenderState below for more details on Render State.
A value of 1.0f means that the operator produces particles at 100% rate. A value of
0.5f means that the operator produces only half the particles that it is supposed
to generate. For example, if a Birth operator is set to produce 1000 particles total,
then when the multiplier is set to 0.5f, the operator will produce only 500 particles.
NOTE:The time parameter is reserved for future use. Pass 0f or any time value to call the method.
EXAMPLE
|
--Create a new Particle Flow Source in the Viewport
--from the Create tab, then get it by name from the scene
pfs = $'PF Source 001'
--> $PF_Source:PF Source 001 @ [2.536594,-48.031052,0.000000]
--Get the Multiplier while in Viewport state
pfs.getMultiplier 0f
--> 0.5
--Change the Particle Source State to Render
pfs.SetRenderState true
--> true
--Get the Multiplier again - when in Render State, the Source
--generates all particles!
pfs.getMultiplier 0f
--> 1.0
|
<integer><PF_Source>.getBornAllowance()
Returns the born allowance, which is currently the Upper Limit at time zero, same
as <PF_Source>.Particle_Amount_Limit
NOTE:
Implemented for future use.
<bool><PF_Source>.hasEmitter()
Returns true if the Particle System has emitter(s), false otherwise.
<integer><PF_Source>.getEmitterType <time>time
Returns the Emitter Type at the specified time.
<void><PF_Source>.getEmitterDimensions <time>time <&float array>dimensions
dimensions is In and Out parameter
Returns the Emitter Dimensions at the specified time as an array of floats stored
in the by-reference variable.
<mesh><PF_Source>.getEmitterGeometry <time>time
Returns the Emitter geometry at the specified time as mesh.
<bool><PF_Source>.isEmitterGeometryAnimated()
Returns true if the Emitter geometry is animated, false otherwise.
<void><PF_Source>.setRenderState <bool>renderState
Sets the render State of the Particle System to the supplied boolean value. See explanation
below.
<bool><PF_Source>.isRenderState()
Returns true if the Particle System is in render state, false otherwise.
IMPORTANT:
|
A Particle Flow particle system has two states: render and viewport. At any given moment it is exclusively
in the one state or the other. The particle system may have different parameters during
render and viewport (i.e. Multiplier value, or emitter geometry etc.) therefore it's
important to know what state it is in. It is possible to switch the state of a particle
system using the setRenderState method. A Particle Flow particle system alternates its state automatically when the rendering starts and
when the rendering ends
|
<time><PF_Source>.getIntegrationStep()
Returns the Integration Step as time value.
<integer><PF_Source>.getUpdateType()
Returns the Update Type as integer.
0: Complete
1: Forward
<integer><PF_Source>.numParticlesSelected()
Returns the number of selected particles.
<index><PF_Source>.getSelectedParticleID <index>index
Returns the particle ID of the indexed particle.
<bool><PF_Source>.isParticleSelected <index>index
Returns true if the indexed particle is selected, false otherwise.
<integer><PF_Source>.numActionListsSelected()
Returns the number of selected Action Lists.
<node><PF_Source>.getSelectedActionList <index>index
Returns the indexed Action List.
<bool><PF_Source>.isActionListSelected <index>index
Returns true if the indexed Action List is selected, false otherwise.
EXAMPLES AND RESULTS:
|
--Create a new Particle Flow Source in the Viewport
--from the Create tab, then get it by name from the scene
pf = $'PF Source 001'
--> $PF_Source:PF Source 001 @ [0.000000,0.000000,0.000000]
--Get the number of particles that the Source can give birth to
pf.getBornAllowance()
--> 100000
--Check whether the Source has an emitter
pf.hasEmitter()
--> true
--Get the emitter type
pf.getEmitterType 0
--> 0
dim = #()--define an empty array
--> #()
--get the Emitter dimensions,
--pass the empty array variable by reference
pf.getEmitterDimensions 0 &dim
--> OK
--look into the previously empty array -
--the dimensions are in it
Dim
--> #(20.0, 20.0)
--Get the Emitter Geometry as TriMesh on frame 0
m = pf.getEmitterGeometry 0
--> TriMesh
m.numverts--check the number of vertices
--> 4
m.numfaces--check the number of faces
--> 2
--Check if the emitter geometry is animated
pf.isEmitterGeometryAnimated()
--> false
--Set and get the render state
pf.setRenderState false
--> OK
pf.isRenderState()
--> false
pf.setRenderState true
--> OK
pf.isRenderState()
--> true
--Get the viewport integration step
pf.getIntegrationStep()
--> 1f
--Get the update type - 0 means Complete!
pf.getUpdateType()
--> 0
--Get the number of selected particles
pf.numParticlesSelected()
--> 0
--Check if particle 1 is selected
pf.isParticleSelected 1
--> false
--Get the number of selected Action Lists in the UI
pf.numActionListsSelected()
--> 0
--In the UI, select the first Action List and try again:
pf.numActionListsSelected()
--> 1
--Get the node of the Action List you just selected:
pf.getSelectedActionList 1
--> $Event:Event 01 @ [0.000000,0.000000,0.000000]
|
This Interface is available in:
PF_Source : GeometryClass