IC8 Python API:RLPy RIProp

From Reallusion Wiki!
Jump to: navigation, search
Main article: iC8 Modules.
Last modified: 10/21/2026

Description

This class can be used to access basic information of prop objects and obtain the control or components of the prop to modify its the transform values and materials.

Class Methods

RLPy.RIProp.GetMaterialComponent(self)

Get material component of the object.

Returns

Pointer of the RIMaterialComponent object - RLPy.RIMaterialComponent

 1 prop = RLPy.RScene.FindObject(RLPy.EObjectType_Prop, "Box")
 2 # get component
 3 material_component = prop.GetMaterialComponent()
 4 mesh_list = prop.GetMeshNames()
 5 mesh_name = mesh_list[0]
 6 material_list = material_component.GetMaterialNames(mesh_name)
 7 material_name = material_list[0]
 8 
 9 # Modify material light - ambient channel
10 ambient_color = RLPy.RRgb.RED
11 
12 # Create Key
13 key = RLPy.RKey()
14 key.SetTime(RLPy.RTime(1200))
15 key.SetTransitionType(RLPy.ETransitionType_Linear)
16 key.SetTransitionStrength(50)
17 material_component.AddAmbientKey(key, mesh_name, material_name, ambient_color)
18 print(material_component.GetAmbientColor(mesh_name, material_name))

RLPy.RIProp.GetMorphComponent(self)

Get morph component of the object.

Returns

Pointer of the RIMorphComponent object - RLPy.RIMorphComponent

 1 prop = RLPy.RScene.FindObject(RLPy.EObjectType_Prop, "Box")
 2 # get component
 3 morph_component = prop.GetMorphComponent()
 4 result = morph_component.AddKey( "your_mesh_name", "your_morph_name", RLPy.RTime(67),  0.5, False, False )
 5  
 6 f_ret_weight = 0
 7 return_list = morph_component.GetWeight( "your_mesh_name", "your_morph_name", RLPy.RTime(67), f_ret_weight )
 8 f_ret_weight = return_list[1]
 9 print(f_ret_weight) # is 0.5
10  
11 result = morph_component.RemoveAllKeys("your_mesh_name", "your_morph_name")
12 morph_names = morph_component.GetMorphNames("your_mesh_name")

RLPy.RIProp.GetSkeletonComponent(self)

Get bone root of the object.

Returns

bone root - RLPy.RISkeletonComponent

 1 prop = RLPy.RScene.FindObject(RLPy.EObjectType_Prop, "Box")
 2 # get component
 3 bone = prop.GetSkeletonComponent()
 4 print(bone.GetClip(0))
 5  
 6 # get selected bone
 7 selected_bones = bone.GetSelectedBones()
 8 print(len(selected_bones))
 9  
10 # get root bone
11 root_bone = bone.GetRootBone()
12 print(root_bone)

RLPy.RIProp.IsDummy(self)

Check if prop state is dummy.

Experimental API

Returns

Boolvalue true if prop state is dummy; otherwise false.

1 prop = RLPy.RScene.FindObject(RLPy.EObjectType_Prop, "Box")
2 prop.SetDummy( True )
3 is_dummy = prop.IsDummy()
4 print( is_dummy )  #True

RLPy.RIProp.IsVisible(self, kTime )

Check if prop is visible.

Experimental API

Parameters

kTime[IN] Specifies the time to check if prop is visible - RLPy.RLTime

Returns

Boolvalue true if prop is visible; otherwise false.

1 # No example

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

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
1 prop = RLPy.RScene.FindObject(RLPy.EObjectType_Prop, "Box")
2 prop.SetDummy( True )
3 is_dummy = prop.IsDummy()
4 print( is_dummy )  #True

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

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
1 prop = RLPy.RScene.FindObject(RLPy.EObjectType_Prop, "Box")
2 #set pivot
3 pos = RLPy.RVector3( 10, 10, 10 )
4 rot = RLPy.RVector3( 0, 0, 0 )
5 ret = prop.SetPivot( pos, rot )
6 print(ret)

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

Experimental Function)Set visible status

Parameters

kTime[IN] Specifies the time to set visible - RLPy.RLTime
bVisible[IN] Visible status - bool

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
1 prop = RLPy.RScene.FindObject(RLPy.EObjectType_Prop, "Box")
2 ret = prop.SetVisible( RLPy.RTime( 67 ), false )
3 print(ret)

Description

This class can be used to access basic information of prop objects and obtain the control or components of the prop to modify its the transform values and materials.

Constructor & Destructor

__init__ (self, *args, **kwargs)

Initializes a new ri prop instance.

Parameters

  • args
  • kwargs

Member Functions

GetMaterialComponent (self)

Get the prop's Material Component, used to adjust the prop's material settings. See Also: RIMaterialComponent

GetMorphComponent (self)

Get the prop's Morph Component, used to adjust the prop's morph targets. See Also: RIMorphComponent

GetSkeletonComponent (self)

Get the prop's Skeleton Component, used for retrieving bone or clip related data. See Also: RISkeletonComponent

IsDummy (self)

Check whether or not the prop is a Dummy object. See Also: SetDummy

IsVisible (self, kTime)

Checks if prop is visible.

Parameters

  • kTime

MakeSubProp (self, bShowProgress=False)

Creates a sub-prop from this prop.

Parameters

  • bShowProgress (default: False)

ReplaceMesh (self, strMeshName, strObjFilePath)

Replaces mesh by loading obj file.

Parameters

  • strMeshName
  • strObjFilePath

SetDummy (self, bIsDummy)

Set the Dummy state for the prop. See Also: IsDummy

Parameters

  • bIsDummy

SetLinkOffsetKey (self, spTargetReachNode, spTargetBone, kTime)

For MDProp Set Link Offset Key by two reference positions.

Parameters

  • spTargetReachNode
  • spTargetBone
  • kTime

SetPivot (self, kPosition, kOrientation)

Set the transforma values for the prop's pivot point.

Parameters

  • kPosition
  • kOrientation

SetVisible (self, kTime, bVisible)

Set the prop's visibility at a given point in time.

Parameters

  • kTime
  • bVisible

Properties

thisown

Indicates whether this SWIG proxy owns the underlying C++ object.