IC8 Python API:RLPy RIPopcornFXObject
Contents
- 1 Description
- 2 Class Methods
- 2.1 RLPy.RIPopcornFXObject.AddAttributeKey(self, strName, kTime, kValue )
- 2.2 RLPy.RIPopcornFXObject.ClearMeshSamplerTarget(self, strSamplerName )
- 2.3 RLPy.RIPopcornFXObject.GetAttributeCount(self)
- 2.4 RLPy.RIPopcornFXObject.GetAttributeName(self, nIndex )
- 2.5 RLPy.RIPopcornFXObject.GetAttributeValue(self, nIndex )
- 2.6 RLPy.RIPopcornFXObject.GetEmit(self)
- 2.7 RLPy.RIPopcornFXObject.GetEmitKeyCount(self)
- 2.8 RLPy.RIPopcornFXObject.GetLoopInterval(self)
- 2.9 RLPy.RIPopcornFXObject.GetMeshSamplerTarget(self, strSamplerName )
- 2.10 RLPy.RIPopcornFXObject.GetSamplerList(self, eType )
- 2.11 RLPy.RIPopcornFXObject.IsLoop(self)
- 2.12 RLPy.RIPopcornFXObject.RemoveEmitKeys(self)
- 2.13 RLPy.RIPopcornFXObject.SetEmit(self, kTime, bOn )
- 2.14 RLPy.RIPopcornFXObject.SetLoop(self, bLoop )
- 2.15 RLPy.RIPopcornFXObject.SetLoopInterval(self, fEmissionInterval )
- 2.16 RLPy.RIPopcornFXObject.SetMeshSamplerTarget(self, strSamplerName, spObject )
- 3 Description
- 4 Constructor & Destructor
- 5 Member Functions
- 5.1 AddAttributeKey (self, strName, kTime, kValue)
- 5.2 ClearMeshSamplerTarget (self, strSamplerName)
- 5.3 GetAttributeCount (self)
- 5.4 GetAttributeName (self, nIndex)
- 5.5 GetAttributeValue (self, nIndex)
- 5.6 GetEmit (self)
- 5.7 GetEmitKeyCount (self)
- 5.8 GetLoopInterval (self)
- 5.9 GetMeshSamplerTarget (self, strSamplerName)
- 5.10 GetSamplerList (self, eType)
- 5.11 IsLoop (self)
- 5.12 RemoveEmitKeys (self)
- 5.13 SetEmit (self, kTime, bOn)
- 5.14 SetLoop (self, bLoop)
- 5.15 SetLoopInterval (self, fEmissionInterval)
- 5.16 SetMeshSamplerTarget (self, strSamplerName, spObject)
- 6 Properties
- Main article: iC8 Modules.
- Last modified: 10/21/2026
Description
This class is the interface to PopcornFX object in the scene. It provides methods to access various parts of a PopcornFX object such as emit, loop, transformation, etc. All methods of this class are implemented internally.
Class Methods
RLPy.RIPopcornFXObject.AddAttributeKey(self, strName, kTime, kValue )
Add an attribute key to this PopcornFX object.
Experimental API
Parameters
- kTime[IN] The time at which to add the key - RLPy.RLTime
- kValue[IN] The value of the attribute must have four floating point numbers. The maximum and minimum values of each attribute are different - float
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 popcorn = RLPy.RScene.FindObject( RLPy.EObjectType_PopcornFX, "Trail Emitter" )
2 #Add attribute key
3 key_time = RLPy.RTime(67)
4 new_attr_value = (2,0,0,0) # must have four floating point numbers.
5 popcorn.AddAttributeKey(attr_name, key_time, new_attr_value)
RLPy.RIPopcornFXObject.ClearMeshSamplerTarget(self, strSamplerName )
Clear target object of Mesh Sample by name.
Experimental API
Parameters
- strSamplerName[IN] sampler name - string
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 popcorn = RLPy.RScene.FindObject( RLPy.EObjectType_PopcornFX, "Trail Emitter" )
2 #Clear mesh sampler target
3 mesh_sampler_names = popcorn.GetSamplerList(RLPy.EPopcornFxSamplerType_MESH)
4 if len(mesh_sampler_names) > 0:
5 sampler_name = mesh_sampler_names[0]
6 prop = RLPy.RScene.FindObject(RLPy.EObjectType_Prop, "Box")
7 ret = popcorn.SetMeshSamplerTarget(sampler_name, prop)
8 if ret == RLPy.RStatus.Success:
9 target = popcorn.GetMeshSamplerTarget(sampler_name)
10 if target != None:
11 print(target.GetID() == prop.GetID()) #True
12 ret = popcorn.ClearMeshSamplerTarget(sampler_name)
13 print(ret is RLPy.RStatus.Success) #True
RLPy.RIPopcornFXObject.GetAttributeCount(self)
Get the number of all attributes of this Popcorn object.
Experimental API
Returns
Returns the number of attributes - int
1 popcorn = RLPy.RScene.FindObject( RLPy.EObjectType_PopcornFX, "Trail Emitter" )
2 #Get attribute count
3 attr_qty = popcorn.GetAttributeCount()
4 print(attr_qty)
RLPy.RIPopcornFXObject.GetAttributeName(self, nIndex )
Get attribute names by index.
Experimental API
Parameters
- nIndex[IN] attribute index - int
Returns
Returns the attribute name - string
1 popcorn = RLPy.RScene.FindObject( RLPy.EObjectType_PopcornFX, "Trail Emitter" )
2 #Get the name of the 2nd attribute
3 attr_name = popcorn.GetAttributeName(2)
4 print(attr_name) #alignMode
RLPy.RIPopcornFXObject.GetAttributeValue(self, nIndex )
Get attribute value by index.
Experimental API
Parameters
- nIndex[IN] attribute index - int
Returns
Returns the attribute value - float
1 popcorn = RLPy.RScene.FindObject( RLPy.EObjectType_PopcornFX, "Trail Emitter" )
2 #Get the value for the 3rd attribute
3 attr_value = popcorn.GetAttributeValue(3)
4 print(attr_value) #(0,0,0,0)
RLPy.RIPopcornFXObject.GetEmit(self)
Get current emit state of the particle.
Experimental API
Returns
Returns the emit on/off state - bool
1 popcorn = RLPy.RScene.FindObject( RLPy.EObjectType_PopcornFX, "Trail Emitter" )
2 print(popcorn.GetEmit())
RLPy.RIPopcornFXObject.GetEmitKeyCount(self)
Get the current number of emit keys.
Experimental API
Returns
Return keys count - int
1 # No example
RLPy.RIPopcornFXObject.GetLoopInterval(self)
Get the current popcorn object how many seconds per loop will be emit once.
Experimental API
Returns
Returns emission interval - float
1 popcorn = RLPy.RScene.FindObject( RLPy.EObjectType_PopcornFX, "Trail Emitter" )
2 #Get loop interval
3 print(popcorn.GetLoopInterval()) #5
RLPy.RIPopcornFXObject.GetMeshSamplerTarget(self, strSamplerName )
Get target of Mesh Sampler by name.
Experimental API
Parameters
- strSamplerName[IN] sampler name - string
Returns
Return sampler target object - RLPy.RIObject
1 popcorn = RLPy.RScene.FindObject( RLPy.EObjectType_PopcornFX, "Trail Emitter" )
2 #Get sampler target
3 mesh_sampler_names = popcorn.GetSamplerList(RLPy.EPopcornFxSamplerType_MESH)
4 if len(mesh_sampler_names) > 0:
5 sampler_name = mesh_sampler_names[0]
6 prop = RLPy.RScene.FindObject(RLPy.EObjectType_Prop, "Box")
7 ret = popcorn.SetMeshSamplerTarget(sampler_name, prop)
8 if ret == RLPy.RStatus.Success:
9 target = popcorn.GetMeshSamplerTarget(sampler_name)
RLPy.RIPopcornFXObject.GetSamplerList(self, eType )
Get the Sampler list of this object based on the type.
Experimental API
Parameters
- eType[IN] sampler type - RLPy.EPopcornFxSamplerType
- RLPy.EPopcornFxSamplerType_MESH
- RLPy.EPopcornFxSamplerType_IMAGE
- RLPy.EPopcornFxSamplerType_SOUND
- RLPy.EPopcornFxSamplerType_TEXT
- RLPy.EPopcornFxSamplerType_PATH
- RLPy.EPopcornFxSamplerType_CURVE
Returns
Return all sampler names of this type - string
1 popcorn = RLPy.RScene.FindObject( RLPy.EObjectType_PopcornFX, "Trail Emitter" )
2 #Get sampler list
3 mesh_sampler_names = popcorn.GetSamplerList(RLPy.EPopcornFxSamplerType_MESH)
RLPy.RIPopcornFXObject.IsLoop(self)
Set this popcorn object to enable loop emit or disable loop mode.
Experimental API
Parameters
- bLoop[IN] Loop mode or not.
- fEmissionInterval[IN] the number of seconds between each loop.
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 popcorn = RLPy.RScene.FindObject( RLPy.EObjectType_PopcornFX, "Trail Emitter" )
2 print(popcorn.IsLoop())
RLPy.RIPopcornFXObject.RemoveEmitKeys(self)
Remove all emit keys of this Popcorn object.
Experimental API
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 popcorn = RLPy.RScene.FindObject( RLPy.EObjectType_PopcornFX, "Trail Emitter" )
2 #Remove all emit keys
3 popcorn.RemoveEmitKeys()
RLPy.RIPopcornFXObject.SetEmit(self, kTime, bOn )
Set the emit state of the particle.
Experimental API
Parameters
- kTime[IN] Specifies the time to set - RLPy.RLTime
- bOn[IN] The emit on/off state - bool
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 popcorn = RLPy.RScene.FindObject( RLPy.EObjectType_PopcornFX, "Trail Emitter" )
2 popcorn.SetEmit(RLPy.RTime(100), True)
RLPy.RIPopcornFXObject.SetLoop(self, bLoop )
Set this popcorn object to enable loop emit or disable loop mode.
Experimental API
Parameters
- bLoop[IN] Loop mode or not - bool
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 popcorn = RLPy.RScene.FindObject( RLPy.EObjectType_PopcornFX, "Trail Emitter" )
2 popcorn.SetLoop(True)
RLPy.RIPopcornFXObject.SetLoopInterval(self, fEmissionInterval )
Set every second interval to emit.
Experimental API
Parameters
- fEmissionInterval[IN] the number of seconds between each loop - float
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 popcorn = RLPy.RScene.FindObject( RLPy.EObjectType_PopcornFX, "Trail Emitter" )
2 #Set loop interval
3 popcorn.SetLoop(True)
4 popcorn.SetLoopInterval(5)
RLPy.RIPopcornFXObject.SetMeshSamplerTarget(self, strSamplerName, spObject )
Set target object of Mesh Sample by name.
Experimental API
Parameters
- strSamplerName[IN] sampler name - string
- spObject[IN] sampler target object - RLPy.RIObject
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 popcorn = RLPy.RScene.FindObject( RLPy.EObjectType_PopcornFX, "Trail Emitter" )
2 #Set sampler target
3 mesh_sampler_names = popcorn.GetSamplerList(RLPy.EPopcornFxSamplerType_MESH)
4 if len(mesh_sampler_names) > 0:
5 sampler_name = mesh_sampler_names[0]
6 prop = RLPy.RScene.FindObject(RLPy.EObjectType_Prop, "Box")
7 ret = popcorn.SetMeshSamplerTarget(sampler_name, prop)
Description
This class is the interface to PopcornFX object in the scene. It provides methods to access various parts of a PopcornFX object such as emit, loop, transformation, etc. All methods of this class are implemented internally.
Constructor & Destructor
__init__ (self, *args, **kwargs)
Initializes a new ri popcorn fx object instance.
Parameters
- args
- kwargs
Member Functions
AddAttributeKey (self, strName, kTime, kValue)
Adds an attribute key of this PopcornFX object.
Parameters
- strName
- kTime
- kValue
ClearMeshSamplerTarget (self, strSamplerName)
Clears target object of Mesh Sample by name.
Parameters
- strSamplerName
GetAttributeCount (self)
Gets the number of all attributes of this Popcorn object.
GetAttributeName (self, nIndex)
Gets attribute names by index.
Parameters
- nIndex
GetAttributeValue (self, nIndex)
Gets attribute value by index.
Parameters
- nIndex
GetEmit (self)
Gets current emit state of the particle.
GetEmitKeyCount (self)
Gets the current number of emit keys.
GetLoopInterval (self)
Gets the current popcorn object how many seconds per loop will be emit once.
GetMeshSamplerTarget (self, strSamplerName)
Gets target of Mesh Sampler by name.
Parameters
- strSamplerName
GetSamplerList (self, eType)
Gets the Sampler list of this object based on the type.
Parameters
- eType
IsLoop (self)
Returns whether this PopcornFX object is set to loop.
RemoveEmitKeys (self)
Removes all emit keys of this Popcorn object.
SetEmit (self, kTime, bOn)
Sets the emit state of the particle.
Parameters
- kTime
- bOn
SetLoop (self, bLoop)
Sets this popcorn object to enable loop emit or disable loop mode.
Parameters
- bLoop
SetLoopInterval (self, fEmissionInterval)
Sets every second interval to emit.
Parameters
- fEmissionInterval
SetMeshSamplerTarget (self, strSamplerName, spObject)
Sets target object of Mesh Sample by name.
Parameters
- strSamplerName
- spObject
Properties
thisown
Indicates whether this SWIG proxy owns the underlying C++ object.