Difference between revisions of "IC Python API:RLPy RScene"

From Reallusion Wiki!
Jump to: navigation, search
(Created page with "{{TOC}} {{Parent|IC_Python_API:RL_Python_Modules|Modules}} == Detailed Description == This class providing methods to access the current scene. <span style="background:#ffcccc...")
 
m
Line 3: Line 3:
 
== Detailed Description ==
 
== Detailed Description ==
 
This class providing methods to access the current scene.
 
This class providing methods to access the current scene.
<span style="background:#ffcccc"> ( Experimental Class ) </span> <syntaxhighlight lang="Python">
+
<span style="background:#ffcccc">( Experimental Class )</span> <syntaxhighlight lang="Python">
 
# find avatar
 
# find avatar
 
avatar = RLPy.RScene.FindObject( RLPy.EObjectType_Avatar, "avatar_name" )
 
avatar = RLPy.RScene.FindObject( RLPy.EObjectType_Avatar, "avatar_name" )
Line 35: Line 35:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Returns the first loaded object of EObjectType and matches the specified name.
 
Returns the first loaded object of EObjectType and matches the specified name.
<span style="background:#ffcccc"> ( Experimental API ) </span>
+
<span style="background:#ffcccc">( Experimental API )</span>
 
====Parameters====
 
====Parameters====
 
<div style="margin-left: 2em;">
 
<div style="margin-left: 2em;">
Line 58: Line 58:
 
===FindObjects===
 
===FindObjects===
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
RLPy.RScene.FindObjects ( args)
+
RLPy.RScene.FindObjects ( args )
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Returns a list of all objects of EObjectType type and matches the specified name.
 
Returns a list of all objects of EObjectType type and matches the specified name.
<span style="background:#ffcccc"> ( Experimental API ) </span>
+
<span style="background:#ffcccc">( Experimental API )</span>
 
====Parameters====
 
====Parameters====
 
<div style="margin-left: 2em;">
 
<div style="margin-left: 2em;">
Line 84: Line 84:
 
===GetAvatars===
 
===GetAvatars===
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
RLPy.RScene.GetAvatars ( args)
+
RLPy.RScene.GetAvatars ( args )
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Get all avatars in the scene.
 
Get all avatars in the scene.
Line 106: Line 106:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Get all props in the scene.
 
Get all props in the scene.
<span style="background:#ffcccc"> ( Experimental API ) </span>
+
<span style="background:#ffcccc">( Experimental API )</span>
 
====Returns====
 
====Returns====
 
<div style="margin-left: 2em;">Prop list - list
 
<div style="margin-left: 2em;">Prop list - list
Line 122: Line 122:
 
===Hide===
 
===Hide===
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
RLPy.RScene.Hide ( spObject)
+
RLPy.RScene.Hide ( spObject )
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Hide object in the scene.
 
Hide object in the scene.
<span style="background:#ffcccc"> ( Experimental API ) </span>
+
<span style="background:#ffcccc">( Experimental API )</span>
 
====Parameters====
 
====Parameters====
 
<div style="margin-left: 2em;">
 
<div style="margin-left: 2em;">
Line 134: Line 134:
 
===RemoveObject===
 
===RemoveObject===
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
RLPy.RScene.RemoveObject ( spObject)
+
RLPy.RScene.RemoveObject ( spObject )
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Remove object from scene.
 
Remove object from scene.
Line 152: Line 152:
 
===SelectObject===
 
===SelectObject===
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
RLPy.RScene.SelectObject ( spObject)
+
RLPy.RScene.SelectObject ( spObject )
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Select object in the scene.
 
Select object in the scene.
<span style="background:#ffcccc"> ( Experimental API ) </span>
+
<span style="background:#ffcccc">( Experimental API )</span>
 
====Parameters====
 
====Parameters====
 
<div style="margin-left: 2em;">
 
<div style="margin-left: 2em;">
Line 171: Line 171:
 
===SelectObjects===
 
===SelectObjects===
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
RLPy.RScene.SelectObjects ( kObjects)
+
RLPy.RScene.SelectObjects ( kObjects )
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Select objects in the scene.
 
Select objects in the scene.
<span style="background:#ffcccc"> ( Experimental API ) </span>
+
<span style="background:#ffcccc">( Experimental API )</span>
 
====Parameters====
 
====Parameters====
 
<div style="margin-left: 2em;">
 
<div style="margin-left: 2em;">
Line 190: Line 190:
 
===Show===
 
===Show===
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
RLPy.RScene.Show ( spObject)
+
RLPy.RScene.Show ( spObject )
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Show object in the scene.
 
Show object in the scene.
<span style="background:#ffcccc"> ( Experimental API ) </span>
+
<span style="background:#ffcccc">( Experimental API )</span>
 
====Parameters====
 
====Parameters====
 
<div style="margin-left: 2em;">
 
<div style="margin-left: 2em;">

Revision as of 00:44, 26 March 2019

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