IC Python API:RLPy RScene

From Reallusion Wiki!
Revision as of 01:44, 26 March 2019 by Chuck (RL) (Talk | contribs)

Jump to: navigation, search
Main article: Modules.

Detailed Description

This class providing methods to access the current scene.

( Experimental Class )
# find avatar
avatar = RLPy.RScene.FindObject( RLPy.EObjectType_Avatar, "avatar_name" )
print(type(avatar)) #RLPy.RIAvatar

# find prop
prop = RLPy.RScene.FindObject( RLPy.EObjectType_Prop, "prop_name" )
print(type(prop)) #RLPy.RIProp

# find camera
camera = RLPy.RScene.FindObject( RLPy.EObjectType_Camera "camera_name" )
print(type(camera)) #RLPy.RICamera

# find particle
particle = RLPy.RScene.FindObject( RLPy.EObjectType_Particle, "particle_name" )
print(type(particle)) #RLPy.RIParticle

# find avatar and prop
result = RLPy.RScene.FindObjects( RLPy.EObjectType_Avatar RLPy.EObjectType_Prop, "same_name" )
print(len(result))
for i in range(len(result)):
print(type(result[i])) #RLPy.RIAvatar or RLPy.RIProp

result = RLPy.RScene.FindObjects( RLPy.EObjectType_Avatar RLPy.EObjectType_Prop )
print(len(result)) # all avatars and props

Member Functions

FindObject

RLPy.RScene.FindObject ( eType, strName )

Returns the first loaded object of EObjectType and matches the specified name. ( Experimental API )

Parameters

eType [IN] The type of object to find - RLPy.EObjectType

  • RLPy.EObjectType_Object
  • RLPy.EObjectType_Avatar
  • RLPy.EObjectType_Prop
  • RLPy.EObjectType_Camera
  • RLPy.EObjectType_Particle
  • RLPy.EObjectType_Light
  • RLPy.EObjectType_SpotLight
  • RLPy.EObjectType_PointLight
  • RLPy.EObjectType_DirectionalLight

strName [IN] The name of object to find - string

Returns

It returns null if no Object matches the type and name - RLPy.RIObject

FindObjects

RLPy.RScene.FindObjects ( args )

Returns a list of all objects of EObjectType type and matches the specified name. ( Experimental API )

Parameters

eType [IN] The type of object to find - RLPy.EObjectType

  • RLPy.EObjectType_Object
  • RLPy.EObjectType_Avatar
  • RLPy.EObjectType_Prop
  • RLPy.EObjectType_Camera
  • RLPy.EObjectType_Particle
  • RLPy.EObjectType_Light
  • RLPy.EObjectType_SpotLight
  • RLPy.EObjectType_PointLight
  • RLPy.EObjectType_DirectionalLight

strName [IN] The name of object to find - string

Returns

The array of objects found matching the type and name specified - list

GetAvatars

RLPy.RScene.GetAvatars ( args )

Get all avatars in the scene.

Parameters

eAvatarType [IN] avatar type - RLPy.EAvatarType

  • RLPy.EAvatarType_Standard
  • RLPy.EAvatarType_NonStandard
  • RLPy.EAvatarType_NonHuman
  • RLPy.EAvatarType_StandardSeries
  • RLPy.EAvatarType_All

Returns

Avatar list - list

GetProps

RLPy.RScene.GetProps ( )

Get all props in the scene. ( Experimental API )

Returns

Prop list - list

GetSelectedObjects

RLPy.RScene.GetSelectedObjects ( )

Get selected objects in the scene.

Returns

List of the selected objects - list

Hide

RLPy.RScene.Hide ( spObject )

Hide object in the scene. ( Experimental API )

Parameters

spObject [IN] Object to be hided - RLPy.RIObject


RemoveObject

RLPy.RScene.RemoveObject ( spObject )

Remove object from scene.

Parameters

spObject [IN] The object to remove - RLPy.RIObject

Return values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Remove failed


SelectObject

RLPy.RScene.SelectObject ( spObject )

Select object in the scene. ( Experimental API )

Parameters

spObject [IN] specified objects - RLPy.RIObject

Return values

RLPy.RStatus.Success Success to select object

RLPy.RStatus.Failure Fail while the object is not selectable or not exist


SelectObjects

RLPy.RScene.SelectObjects ( kObjects )

Select objects in the scene. ( Experimental API )

Parameters

kObjects [IN] List of the specified objects - RLPy.RIObject

Return values

RLPy.RStatus.Success Success to select object

RLPy.RStatus.Failure Fail while the object is not selectable or not exist


Show

RLPy.RScene.Show ( spObject )

Show object in the scene. ( Experimental API )

Parameters

spObject [IN] Object to be showed - RLPy.RIObject