IC Python API:RLPy RIParticle
From Reallusion Wiki!
Revision as of 23:51, 14 April 2020 by Chuck (RL) (Talk | contribs)
- Main article: Modules.
- Last modified: 04/14/2020
Description
This class can access the particle systems in the scene and perform particle related operations e.g. naming particle systems, transform emission point. Currently, this class only works for iClone's native particle system, therefore, not compatible with PopcornFX.
Inheritance
RIBase > RIObject > RIParticle
Examples
1 particle = RLPy.RScene.FindObject( RLPy.EObjectType_Particle, "Robot bomb" )
2
3 # set transform key
4 control = particle.GetControl("Transform")
5 transform = RLPy.RTransform.IDENTITY
6 transform.T().x = 100.0
7 transform.T().y = 100.0
8 transform.T().z = 100.0
9 control.SetValue(RLPy.RTime(0), transform)
10
11 # set Parent
12 parent_prop = RLPy.RScene.FindObject(RLPy.EObjectType_Prop, "Box")
13 result = particle.SetParent(parent_prop)
14 result = particle.SetParent(None) #detach from parent
15
16 # link to & unlink
17 result = particle.LinkTo(parent_prop, RLPy.RTime(0))
18 result = particle.UnLink(RLPy.RTime(0))
19
20 # set name
21 particle.SetName( "new_name" )
22 #get bound
23 ret_max = RLPy.RVector3()
24 ret_center = RLPy.RVector3()
25 ret_min = RLPy.RVector3()
26 ret = particle.GetBounds( ret_max, ret_center, ret_min )
27 print(ret_pos.x)
28 #get pivot
29 ret_pos = RLPy.RVector3()
30 ret_rot = RLPy.RVector3()
31 particle.GetPivot( ret_pos, ret_rot )
32 print(ret_pos.x)
33 #clone object
34 clone_particle = particle.Clone()
35 print( clone_particle )
36 #is selected
37 RLPy.RScene.SelectObject(particle)
38 print(particle.IsSelected()) #True
Member Functions
GetEmit ( self )
Get the particle system's emission status.
See Also: SetEmit
Returns
- True if the particle system is emitting, else False - bool
1 particle = RLPy.RScene.FindObject( RLPy.EObjectType_Particle, "Robot bomb" )
2 if particle:
3 particle.SetEmit(RLPy.RTime(100), True)
4 RLPy.RGlobal.SetTime(RLPy.RTime( 100 ))
5 print(particle.GetEmit())
SetEmit ( self, kTime, bOn )
Set the particle system on or off at a given point in time by setting the Emit key.
See Also: GetEmit
Parameters
- kTime [IN] On / off point in time - RTime
- bOn [IN] Set the particle on or off - bool
Returns
- Success - RLPy.RStatus.Success
- Failure - RLPy.RStatus.Failure
1 particle = RLPy.RScene.FindObject( RLPy.EObjectType_Particle, "Robot bomb" )
2 if particle:
3 particle.SetEmit(RLPy.RTime(100), True)
4 RLPy.RGlobal.SetTime(RLPy.RTime( 100 ))
5 print(particle.GetEmit())