IC Python API:RLPy RIParticle

From Reallusion Wiki!
Jump to: navigation, search
Main article: Modules.


This class inherits public member functions from:

Detailed Description

( Experimental Class ) This class is the interface to particles in the scene. It provides methods to access various parts of a particle such as emit, transformation, etc. All methods of this class are implemented by

the system.
particle = RLPy.RScene.FindObject( RLPy.EObjectType_Particle, "Robot bomb" )

# set transform key
control = particle.GetControl("Transform")
transform = RLPy.RTransform.IDENTITY
transform.T().x = 100.0
transform.T().y = 100.0
transform.T().z = 100.0
control.SetValue(RLPy.RTime(0), transform)

# set emit key
particle.SetEmit(RLPy.RTime(100), True)
RLPy.RGlobal.SetTime(RLPy.RTime( 100 ))
print(particle.GetEmit()) # return True

prop2 = RLPy.RScene.FindObject(RLPy.EObjectType_Prop, "Box2")
# set Parent
result = particle.SetParent(prop2)
result = particle.SetParent(None) #detach from parent

# link to & unlink
result = particle.LinkTo(prop2, RLPy.RTime(0))
result = particle.UnLink(RLPy.RTime(0))

# set name
particle.SetName( "new_name" )

#get bound
ret_max = RLPy.RVector3()
ret_center = RLPy.RVector3()
ret_min = RLPy.RVector3()
ret = particle.GetBounds( ret_max, ret_center, ret_min )

#get pivot
ret_pos = RLPy.RVector3()
ret_rot = RLPy.RVector3()
particle.GetPivot( ret_pos, ret_rot )

#clone object
clone_particle = particle.Clone()
print( clone_particle )

#is selected
print(particle.IsSelected()) #True


This class supports the following operators:

Member Operation Syntax Description Example
__eq__ Equality a == b If the values of two operands are equal, then the condition becomes true. (a == b) is not true.

Member Functions


RLPy.RIParticle.GetEmit ( self )

Get current emit state of the particle.


The emit on/off state - bool


RLPy.RIParticle.SetEmit ( self, kTime, bOn )

Set the emit state of the particle.


kTime [IN] Specifies the time to set - RLPy.RTime

bOn [IN] The emit on/off state - bool

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail