IC Python API:RLPy RIProp

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

Inheritance

This class inherits public member functions from:

Detailed Description

This class is the interface to props in the scene. It provides methods to access various parts of an prop such as its name, transformation, etc. All methods of this class are implemented by

the system.
import RLPy
prop = RLPy.RScene.FindObject(RLPy.EObjectType_Prop, "Box")

# get Name
prop_name = prop.GetName()
print(prop_name) # Box

# set name
prop.SetName( "new_name" )

# set Transform key
control = prop.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)

# get component
skeleton = prop.GetSkeletonComponent()
print(skeleton.GetClipCount())

# set visible key
prop.SetVisible(RLPy.RTime(600), False)

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

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

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

#set pivot
pos = RLPy.RVector3( 10, 10, 10 )
rot = RLPy.RVector3( 0, 0, 0 )
ret = prop.SetPivot( pos, rot )
print(ret)

#get pivot
ret_pos = RLPy.RVector3()
ret_rot = RLPy.RVector3()
prop.GetPivot( ret_pos, ret_rot )
print(ret)

# dummy
prop.SetDummy( True )
is_dummy = prop.IsDummy()
print( is_dummy ) #True

#clone object
clone_prop = prop.Clone()
print( clone_prop )

#is selected
RLPy.RScene.SelectObject(prop)
print(prop.IsSelected()) #True

Operators

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

GetMaterialComponent

RLPy.RIProp.GetMaterialComponent ( self )

Get material component of the object.

Returns

Pointer of the RIMaterialComponent object - RLPy.RIMaterialComponent

GetMorphComponent

RLPy.RIProp.GetMorphComponent ( self )

Get morph component of the object.

Returns

Pointer of the RIMorphComponent object - RLPy.RIMorphComponent

GetSkeletonComponent

RLPy.RIProp.GetSkeletonComponent ( self )

Get bone root of the object.

Returns

Bone root - RLPy.RISkeletonComponent

IsDummy

RLPy.RIProp.IsDummy ( self )

Check if prop state is dummy. ( Experimental API )

Return Values

Bool value true if prop state is dummy; otherwise false.


SetDummy

RLPy.RIProp.SetDummy ( self, bIsDummy )

Set the prop state whether its dummy or not. ( Experimental API )

Parameters

bIsDummy [IN] takes prop state as bool value : true or false - bool

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail


SetPivot

RLPy.RIProp.SetPivot ( self, kPosition, kOrientation )

This function lets you re-position and re-orient the current object's pivot. ( Experimental API )

Parameters

kPosition [IN] pivot position - RLPy.RVector3f

kOrientation [IN] pivot orientation - RLPy.RVector3f

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail


SetVisible

RLPy.RIProp.SetVisible ( self, kTime, bVisible )

( Experimental Function ) Set visible status

Parameters

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

bVisible [IN] Visible status - bool

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail