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

From Reallusion Wiki!
Jump to: navigation, search
m
m
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{TOC}}
 
{{TOC}}
 
{{Parent|IC_Python_API:RL_Python_Modules|Modules}}
 
{{Parent|IC_Python_API:RL_Python_Modules|Modules}}
== Detailed Description ==
+
{{last_modified}}
This class providing common API global functions.
+
<syntaxhighlight lang="Python">
+
# Get Secen info
+
print(RLPy.RGlobal.GetProjectLength()) # print project length of the current scene
+
print(RLPy.RGlobal.GetFps()) # print 60 FPS
+
+
# Time info
+
RLPy.RGlobal.SetTime(RLPy.RTime(30000)) # set time to 30s
+
print(RLPy.RGlobal.GetTime().GetValue()) # print 30000
+
print(RLPy.RGlobal.GetStartTime().GetValue()) # print start time
+
print(RLPy.RGlobal.GetEndTime().GetValue()) # print end time
+
+
# play control
+
RLPy.RGlobal.Play(RLPy.RTime(0), RLPy.RTime(1000)) # play form 0 to 1s
+
RLPy.RGlobal.Stop() # stop
+
RLPy.RGlobal.Pause() # pause
+
+
# Get Environment info
+
temp = ""
+
ret_list = RLPy.RGlobal.GetPath(RLPy.EPathType_Temp, temp) # print path,like: Temp,TemplateContent,CustomContent......
+
print(ret_list[1])
+
+
# undo / redo
+
RLPy.RGlobal.BeginAction("Motion")
+
# do something
+
RLPy.RGlobal.EndAction()
+
</syntaxhighlight>
+
== Member Functions ==
+
=== BeginAction ===
+
<syntaxhighlight lang="Python">
+
RLPy.RGlobal.BeginAction ( strAction )
+
</syntaxhighlight>
+
Begin action.
+
==== Parameters ====
+
<div style="margin-left: 2em;">
+
'''strAction''' [IN] action name - string
+
</div>
+
-----
+
=== DoPluginTrialFollowUp ===
+
<syntaxhighlight lang="Python">
+
RLPy.RGlobal.DoPluginTrialFollowUp ( strProductNamePath )
+
</syntaxhighlight>
+
Trial Follow up (Internal use)
+
==== Parameters ====
+
<div style="margin-left: 2em;">
+
'''strProductNamePath''' [IN] Product name path - string
+
</div>
+
-----
+
=== DoSNVerification ===
+
<syntaxhighlight lang="Python">
+
RLPy.RGlobal.DoSNVerification ( nProductID, strRegistry, strProductName, strSNFailTitle, strSNFailMsg, strSNExceedTitle, strSNExceedMsg )
+
</syntaxhighlight>
+
Verify serial number.
+
==== Parameters ====
+
<div style="margin-left: 2em;">
+
'''nProductID''' [IN] product ID - int
+
  
'''strRegistry''' [IN] registry - string
+
== Description ==
  
'''strProductName''' [IN] product name - string
+
This class provides global settings and information for the application, like querying project related settings like [[#GetFps ( )|GetFps]], [[#GetTime ( )|GetTime]], [[#GetScreenSize ( self, nWidth, nHeight )|GetScreenSize]], etc., and operations such as [[#SetTime ( )|SetTime]], [[#RenderVideo ( )|RenderVideo]], etc.
  
'''strSNFailTitle''' [IN] fail title - string
+
== Member Functions ==
  
'''strSNFailMsg''' [IN] fail message - string
+
=== GetProjectLength ( ) ===
  
'''strSNExceedTitle''' [IN] exceed title - string
+
Get the current project duration.
  
'''strSNExceedMsg''' [IN] exceed message - string
 
</div>
 
 
==== Returns ====
 
==== Returns ====
<div style="margin-left: 2em;">
+
:Project duration - [[IC_Python_API:RLPy_RTime|RTime]]
Remain days of trial version - bool
+
 
</div>
+
<syntaxhighlight lang="python" line='line'>
-----
+
print(RLPy.RGlobal.GetProjectLength()) # Print project duration for the current scene
=== EndAction ===
+
<syntaxhighlight lang="Python">
+
RLPy.RGlobal.EndAction ( )
+
 
</syntaxhighlight>
 
</syntaxhighlight>
End action.
 
-----
 
=== GetEndTime ===
 
<syntaxhighlight lang="Python">
 
RLPy.RGlobal.GetEndTime ( )
 
</syntaxhighlight>
 
Get end frame time.
 
==== Returns ====
 
<div style="margin-left: 2em;">
 
End frame time - RLPy.RTime
 
</div>
 
-----
 
=== GetFps ===
 
<syntaxhighlight lang="Python">
 
RLPy.RGlobal.GetFps ( )
 
</syntaxhighlight>
 
Get frame per second.
 
==== Returns ====
 
<div style="margin-left: 2em;">
 
Frame rate - int
 
</div>
 
<syntaxhighlight lang="Python">
 
# Get the project frames per second.
 
  
import RLPy
+
=== GetFps ( ) ===
# Get frames per second
+
 
print(RLPy.RGlobal.GetFps())
+
Get the frames-per-second for the current project. Currently fixed at 60 fps.
  
#60
 
</syntaxhighlight>
 
-----
 
=== GetMocapManager ===
 
<syntaxhighlight lang="Python">
 
RLPy.RGlobal.GetMocapManager ( )
 
</syntaxhighlight>
 
Get mocap manager.
 
 
==== Returns ====
 
==== Returns ====
<div style="margin-left: 2em;">
+
:Frame rate - int
Pointer to mocap manager - RLPy.RIMocapManager
+
 
</div>
+
<syntaxhighlight lang="python" line='line'>
-----
+
print(RLPy.RGlobal.GetFps()) # 60
=== GetPath ===
+
<syntaxhighlight lang="Python">
+
RLPy.RGlobal.GetPath ( ePath, strPath )
+
 
</syntaxhighlight>
 
</syntaxhighlight>
Get path.
 
==== Parameters ====
 
<div style="margin-left: 2em;">
 
'''ePath''' [IN] path type - RLPy.EPathType
 
*'''RLPy.EPathType_Temp Temporary folder.
 
*'''RLPy.EPathType_TemplateContent Template content folder.
 
*'''RLPy.EPathType_CustomContent Custom content folder.
 
*'''RLPy.EPathType_ProgramDefault Program default folder.
 
*'''RLPy.EPathType_Morph Morph data folder.
 
*'''RLPy.EPathType_CreateFace CreateFace data folder.
 
*'''RLPy.EPathType_Puppet Puppet data folder.
 
*'''RLPy.EPathType_FacialLayer Facial layer data folder.
 
*'''RLPy.EPathType_ShareTemplateContent Shared template content folder.
 
*'''RLPy.EPathType_Thumb Thumbnail folder.
 
*'''RLPy.EPathType_Image Image folder.
 
*'''RLPy.EPathType_CreatorAssets Creator assets folder.
 
*'''RLPy.EPathType_Resource Resource folder.
 
*'''RLPy.EPathType_FacialSystem Facial system folder.
 
*'''RLPy.EPathType_CustomWidget Custom widget folder.
 
*'''RLPy.EPathType_iCloneAssets iClone assets folder
 
  
'''strPath''' [OUT] path name - string
+
=== GetPath ( ) ===
</div>
+
==== Return Values ====
+
<div style="margin-left: 2em;">
+
'''RLPy.RStatus.Success''' Success
+
  
'''RLPy.RStatus.Failure''' Fail
+
This function can return the absolute paths for the following directories:
</div>
+
<syntaxhighlight lang="Python">
+
# Print out a few path locations (Individual path locations may vary).
+
  
import RLPy
+
{| class="wikitable"
 +
|-
 +
|RLPy.EPathType_Temp
 +
|Temporary folder
 +
|-
 +
|RLPy.EPathType_TemplateContent
 +
|Template content folder
 +
|-
 +
|RLPy.EPathType_CustomContent
 +
|Custom content folder
 +
|-
 +
|RLPy.EPathType_ProgramDefault
 +
|Program default folder
 +
|-
 +
|RLPy.EPathType_Morph
 +
|Morph data folder
 +
|-
 +
|RLPy.EPathType_CreateFace
 +
|CreateFace data folder
 +
|-
 +
|RLPy.EPathType_Puppet
 +
|Puppet data folder
 +
|-
 +
|RLPy.EPathType_FacialLayer
 +
|Facial layer data folder
 +
|-
 +
|RLPy.EPathType_ShareTemplateContent
 +
|Shared template content folder
 +
|-
 +
|RLPy.EPathType_Thumb
 +
|Thumbnail folder
 +
|-
 +
|RLPy.EPathType_Image
 +
|Image folder
 +
|-
 +
|RLPy.EPathType_CreatorAssets
 +
|Creator assets folder
 +
|-
 +
|RLPy.EPathType_Resource
 +
|Resource folder
 +
|-
 +
|RLPy.EPathType_FacialSystem
 +
|Facial system folder
 +
|-
 +
|RLPy.EPathType_CustomWidget
 +
|Custom widget folder
 +
|-
 +
|RLPy.EPathType_iCloneAssets
 +
|iClone assets folder
 +
|}
  
 +
==== Parameters ====
 +
:'''ePath''' [IN] path type - RLPy.EPathType
 +
:*RLPy.EPathType_Temp
 +
:*RLPy.EPathType_TemplateContent
 +
:*RLPy.EPathType_CustomContent
 +
:*RLPy.EPathType_ProgramDefault
 +
:*RLPy.EPathType_Morph
 +
:*RLPy.EPathType_CreateFace
 +
:*RLPy.EPathType_Puppet
 +
:*RLPy.EPathType_FacialLayer
 +
:*RLPy.EPathType_ShareTemplateContent
 +
:*RLPy.EPathType_Thumb
 +
:*RLPy.EPathType_Image
 +
:*RLPy.EPathType_CreatorAssets
 +
:*RLPy.EPathType_Resource
 +
:*RLPy.EPathType_FacialSystem
 +
:*RLPy.EPathType_CustomWidget
 +
:*RLPy.EPathType_iCloneAssets
 +
:'''strPath''' [OUT] path name - string
 +
 +
==== Returns ====
 +
:Success - RLPy.RStatus.Success
 +
:Failure - RLPy.RStatus.Failure
 +
 +
<syntaxhighlight lang="python" line='line'>
 
temp = ""
 
temp = ""
 
ret_list = RLPy.RGlobal.GetPath(RLPy.EPathType_Temp, temp)
 
ret_list = RLPy.RGlobal.GetPath(RLPy.EPathType_Temp, temp)
print("Temp folder: "+ret_list[1])
+
print(ret_list[0]) # success or faild
 +
print(ret_list[1]) # path
 +
</syntaxhighlight>
  
# Temp folder: C:\Users\User_Name\AppData\Local\Temp\iClone7Temp\iClone7Temp\
+
=== BeginAction ( ) ===
  
ret_list = RLPy.RGlobal.GetPath(RLPy.EPathType_TemplateContent, temp)
+
Perform undo and redo actions. This function is currently incomplete.
print("Template content folder: "+ret_list[1])
+
  
# Template content folder: C:\Users\Public\Documents\Reallusion\Template\iClone 7 Template
+
==== Parameters ====
 +
:'''strAction''' [IN] action name - string
  
ret_list = RLPy.RGlobal.GetPath(RLPy.EPathType_CustomContent, temp)
+
<syntaxhighlight lang="python" line='line'>
print("Custom content folder: "+ret_list[1])
+
RLPy.RGlobal.BeginAction('ActionName')
 +
RLPy.RGlobal.EndAction()
 +
</syntaxhighlight>
  
# Custom content folder: C:\Users\Public\Documents\Reallusion\Custom\iClone 7 Custom
+
=== EndAction ( ) ===
  
ret_list = RLPy.RGlobal.GetPath(RLPy.EPathType_ProgramDefault, temp)
+
Perform undo and redo actions. This function is currently incomplete
print("Program default folder: "+ret_list[1])
+
  
# Program default folder: C:\Program Files\Reallusion\iClone 7\Program\Default\
+
<syntaxhighlight lang="python" line='line'>
 +
# undo / redo
 +
RLPy.RGlobal.BeginAction("Motion")
 +
# do something
 +
RLPy.RGlobal.EndAction()
 +
</syntaxhighlight>
  
 +
=== Play ( ) ===
 +
 +
Controls the timeline playback.
 +
 +
==== Parameters ====
 +
:'''kStart''' [IN] start time - [[IC_Python_API:RLPy_RTime|RTime]]
 +
:'''kEnd''' [IN] end time - [[IC_Python_API:RLPy_RTime|RTime]]
 +
 +
<syntaxhighlight lang="python" line='line'>
 +
start_time = RLPy.RTime(0)
 +
end_time = RLPy.RTime(1000.0)
 +
RLPy.RGlobal.Play(start_time,end_time)
 
</syntaxhighlight>
 
</syntaxhighlight>
-----
+
 
=== GetProjectLength ===
+
=== Pause ( ) ===
<syntaxhighlight lang="Python">
+
 
RLPy.RGlobal.GetProjectLength ( )
+
Pause the timeline playback and keep the playhead in place.
 +
 
 +
<syntaxhighlight lang="python" line='line'>
 +
RLPy.RGlobal.Play(RLPy.RTime(0), RLPy.RTime(1000))
 +
RLPy.RGlobal.Pause()
 
</syntaxhighlight>
 
</syntaxhighlight>
Get project length.
 
==== Returns ====
 
<div style="margin-left: 2em;">
 
Project length - RLPy.RTime
 
</div>
 
<syntaxhighlight lang="Python">
 
# Retrieve the length of the project in ms.
 
  
import RLPy
+
=== Stop ( ) ===
  
# Fetch the current frame time in milliseconds.
+
Stop the timeline playback and return the playhead to the start marker.
time = RLPy.RGlobal.GetTime()
+
  
# Return the current frame time in milliseconds.
+
<syntaxhighlight lang="python" line='line'>
print(time.GetValue())
+
RLPy.RGlobal.Play(RLPy.RTime(0), RLPy.RTime(1000))
 +
RLPy.RGlobal.Stop()
 
</syntaxhighlight>
 
</syntaxhighlight>
-----
+
 
=== GetStartTime ===
+
=== IsPlaying ( ) ===
<syntaxhighlight lang="Python">
+
 
RLPy.RGlobal.GetStartTime ( )
+
Check if timeline playback is in progress.
 +
 
 +
==== Returns ====
 +
:Returns true when application playing - bool
 +
 
 +
<syntaxhighlight lang="python" line='line'>
 +
if(not RLPy.RGlobal.IsPlaying()):
 +
        RLPy.RGlobal.Play(RLPy.RTime(0), RLPy.RTime(1000))
 +
if(RLPy.RGlobal.IsPlaying()):
 +
        RLPy.RGlobal.Stop()
 
</syntaxhighlight>
 
</syntaxhighlight>
Get start frame time.
+
 
 +
=== GetTime ( ) ===
 +
 
 +
Get the current time for the scene according to the location of the playhead.
 +
 
 
==== Returns ====
 
==== Returns ====
<div style="margin-left: 2em;">
+
:current time - [[IC_Python_API:RLPy_RTime|RTime]]
Start frame time - RLPy.RTime
+
 
</div>
+
<syntaxhighlight lang="python" line='line'>
-----
+
time = RLPy.RGlobal.GetTime()
=== GetTime ===
+
print(time)
<syntaxhighlight lang="Python">
+
RLPy.RGlobal.GetTime ( )
+
 
</syntaxhighlight>
 
</syntaxhighlight>
Get current frame time.
+
 
 +
=== SetTime ( ) ===
 +
 
 +
Change the current time for the scene and update the playhead.
 +
 
 +
See Also: [[#GetTime ( )|GetTime]]
 +
 
 +
==== Parameters ====
 +
:'''kTime''' [IN] Specifies the time to set - [[IC_Python_API:RLPy_RTime|RTime]]
 +
 
 
==== Returns ====
 
==== Returns ====
<div style="margin-left: 2em;">
+
:Success - RLPy.RStatus.Success
Current time - RLPy.RTime
+
:Failure - RLPy.RStatus.Failure
</div>
+
 
-----
+
<syntaxhighlight lang="python" line='line'>
=== IsPlaying ===
+
result = RLPy.RGlobal.SetTime(RLPy.RTime(1000))
<syntaxhighlight lang="Python">
+
print(result) # Success or fail
RLPy.RGlobal.IsPlaying ( )
+
 
 +
time = RLPy.RGlobal.GetTime()
 +
print(time)
 
</syntaxhighlight>
 
</syntaxhighlight>
Is application playing?
+
 
 +
=== GetStartTime ( ) ===
 +
 
 +
Get the start time for the current project.
 +
 
 
==== Returns ====
 
==== Returns ====
<div style="margin-left: 2em;">
+
:Start frame time - [[IC_Python_API:RLPy_RTime|RTime]]
True when application playing - bool
+
</div>
+
<syntaxhighlight lang="Python">
+
# Check if the timeline playback is active.
+
  
import RLPy
+
<syntaxhighlight lang="python" line='line'>
 +
time = RLPy.RGlobal.GetStartTime()
 +
print(time)
 +
</syntaxhighlight>
  
print(RLPy.RGlobal.IsPlaying())
+
=== GetEndTime ( ) ===
  
# True / False
+
Get the end time for the current project.
</syntaxhighlight>
+
 
-----
+
==== Returns ====
=== Pause ===
+
:End frame time - [[IC_Python_API:RLPy_RTime|RTime]]
<syntaxhighlight lang="Python">
+
 
RLPy.RGlobal.Pause ( )
+
<syntaxhighlight lang="python" line='line'>
 +
time = RLPy.RGlobal.GetEndTime()
 +
print(time)
 
</syntaxhighlight>
 
</syntaxhighlight>
Pause the project.
 
-----
 
=== Play ===
 
<syntaxhighlight lang="Python">
 
RLPy.RGlobal.Play ( kStart, kEnd )
 
</syntaxhighlight>
 
Play the project.
 
==== Parameters ====
 
<div style="margin-left: 2em;">
 
'''kStart''' [IN] start time - RLPy.RTime
 
  
'''kEnd''' [IN] end time - RLPy.RTime
+
=== GetMocapManager ( ) ===
</div>
+
 
-----
+
Access the Mocap Manager and member functions for [[IC_Python_API:RLPy_RIMocapManager|RIMocapManager]].
=== RemoveAllAnimations ===
+
 
<syntaxhighlight lang="Python">
+
See Also: [[IC_Python_API:RLPy_RIMocapManager|RIMocapManager]]
RLPy.RGlobal.RemoveAllAnimations ( spObject )
+
 
 +
==== Returns ====
 +
:Pointer to mocap manager - [[IC_Python_API:RLPy_RIMocapManager|RIMocapManager]]
 +
 
 +
<syntaxhighlight lang="python" line='line'>
 +
mocap_manager = RLPy.RGlobal.GetMocapManager()
 +
print(mocap_manager.IsRunning()) # True or False
 
</syntaxhighlight>
 
</syntaxhighlight>
Remove all animations of object.
+
 
<span style="background:#ffcccc">( Experimental API )</span>
+
=== RemoveAllAnimations ( spObject  ) ===
 +
 
 +
Remove all animations on a given object and return '''RLPy.RStatus.Success''' if successful, else '''RLPy.RStatus.Failure'''.  Currently supports characters, props, accessories, particles, PopcornFX, lights, motion paths, cameras, wind, images, and global illumination. The timeline needs to update after execution in order to show the changes.
 +
 
 
==== Parameters ====
 
==== Parameters ====
<div style="margin-left: 2em;">
+
:'''spObject''' [IN] The object to remove animations - [[IC_Python_API:RLPy_RIObject|RIObject]]
'''spObject''' [IN] The object to remove animations - RLPy.RIObject
+
</div>
+
==== Return Values ====
+
<div style="margin-left: 2em;">
+
'''RLPy.RStatus.Success''' Success
+
  
'''RLPy.RStatus.Failure''' Remove failed
+
==== Returns ====
</div>
+
:Success - RLPy.RStatus.Success
-----
+
:Failure - RLPy.RStatus.Failure
=== RenderVideo ===
+
<syntaxhighlight lang="Python">
+
RLPy.RGlobal.RenderVideo ( )
+
</syntaxhighlight>
+
Export project into video file.
+
<span style="background:#ffcccc">( Experimental API )</span>
+
==== Return Values ====
+
<div style="margin-left: 2em;">
+
'''RLPy.RStatus.Success''' Success
+
  
'''RLPy.RStatus.Failure''' Remove failed
+
<syntaxhighlight lang="python" line='line'>
</div>
+
avatar_list = RLPy.RScene.GetAvatars()
-----
+
result = RLPy.RGlobal.RemoveAllAnimations( avatar_list[0] )
=== SetTime ===
+
print(result)
<syntaxhighlight lang="Python">
+
RLPy.RGlobal.SetTime ( kTime )
+
 
</syntaxhighlight>
 
</syntaxhighlight>
Set current frame time.
 
==== Parameters ====
 
<div style="margin-left: 2em;">
 
'''kTime''' [IN] Specifies the time to set - RLPy.RTime
 
</div>
 
==== Return Values ====
 
<div style="margin-left: 2em;">
 
'''RLPy.RStatus.Success''' Success
 
  
'''RLPy.RStatus.Failure''' Fail
+
=== RenderVideo ( ) ===
</div>
+
 
-----
+
Use the current iClone render settings to output a video.  Returns '''RLPy.RStatus.Success''' when successful, else '''RLPy.RStatus.Failure'''.
=== Stop ===
+
 
<syntaxhighlight lang="Python">
+
==== Returns ====
RLPy.RGlobal.Stop ( )
+
:Success - RLPy.RStatus.Success
 +
:Failure - RLPy.RStatus.Failure
 +
 
 +
<syntaxhighlight lang="python" line='line'>
 +
result = RLPy.RGlobal.RenderVideo()
 +
print(result)
 
</syntaxhighlight>
 
</syntaxhighlight>
Stop playing.
 
-----
 
=== TrialVersionRemainingDays ===
 
<syntaxhighlight lang="Python">
 
RLPy.RGlobal.TrialVersionRemainingDays ( strBinPath, uProductID, strProductFold, strRegRoot )
 
</syntaxhighlight>
 
Get remain days of trial version.
 
==== Parameters ====
 
<div style="margin-left: 2em;">
 
'''strBinPath''' [IN] bin file path - string
 
  
'''kProductID''' [IN] product ID
+
=== GetScreenSize ( self, nWidth, nHeight ) ===
  
'''kProductFold''' [IN] product Folder
+
Get the render  output size for the current scene.
 +
 
 +
==== Parameters ====
 +
:'''nWidth''' [IN] screen width in pixels - int
 +
:'''nHeight''' [IN] screen height in pixels - int
  
'''kRegRoot''' [IN] registry root
 
</div>
 
 
==== Returns ====
 
==== Returns ====
<div style="margin-left: 2em;">
+
:[Success/Fail, Width, Height] - list
Remain days of trial version - int
+
::Success - RLPy.RStatus.Success
</div>
+
::Failure - RLPy.RStatus.Failure
 +
::Width - int
 +
::Height - int
 +
 
 +
<syntaxhighlight lang="python" line='line'>
 +
width = 0
 +
height = 0
 +
result = RLPy.RGlobal.GetScreenSize(width, height)
 +
print(result[0]) # successful or failed
 +
print(result[1]) # width
 +
print(result[2]) # height
 +
</syntaxhighlight>

Latest revision as of 00:05, 14 April 2020

Main article: Modules.
Last modified: 04/14/2020

Description

This class provides global settings and information for the application, like querying project related settings like GetFps, GetTime, GetScreenSize, etc., and operations such as SetTime, RenderVideo, etc.

Member Functions

GetProjectLength ( )

Get the current project duration.

Returns

Project duration - RTime
1 print(RLPy.RGlobal.GetProjectLength()) # Print project duration for the current scene

GetFps ( )

Get the frames-per-second for the current project. Currently fixed at 60 fps.

Returns

Frame rate - int
1 print(RLPy.RGlobal.GetFps()) # 60

GetPath ( )

This function can return the absolute paths for the following directories:

RLPy.EPathType_Temp Temporary folder
RLPy.EPathType_TemplateContent Template content folder
RLPy.EPathType_CustomContent Custom content folder
RLPy.EPathType_ProgramDefault Program default folder
RLPy.EPathType_Morph Morph data folder
RLPy.EPathType_CreateFace CreateFace data folder
RLPy.EPathType_Puppet Puppet data folder
RLPy.EPathType_FacialLayer Facial layer data folder
RLPy.EPathType_ShareTemplateContent Shared template content folder
RLPy.EPathType_Thumb Thumbnail folder
RLPy.EPathType_Image Image folder
RLPy.EPathType_CreatorAssets Creator assets folder
RLPy.EPathType_Resource Resource folder
RLPy.EPathType_FacialSystem Facial system folder
RLPy.EPathType_CustomWidget Custom widget folder
RLPy.EPathType_iCloneAssets iClone assets folder

Parameters

ePath [IN] path type - RLPy.EPathType
  • RLPy.EPathType_Temp
  • RLPy.EPathType_TemplateContent
  • RLPy.EPathType_CustomContent
  • RLPy.EPathType_ProgramDefault
  • RLPy.EPathType_Morph
  • RLPy.EPathType_CreateFace
  • RLPy.EPathType_Puppet
  • RLPy.EPathType_FacialLayer
  • RLPy.EPathType_ShareTemplateContent
  • RLPy.EPathType_Thumb
  • RLPy.EPathType_Image
  • RLPy.EPathType_CreatorAssets
  • RLPy.EPathType_Resource
  • RLPy.EPathType_FacialSystem
  • RLPy.EPathType_CustomWidget
  • RLPy.EPathType_iCloneAssets
strPath [OUT] path name - string

Returns

Success - RLPy.RStatus.Success
Failure - RLPy.RStatus.Failure
1 temp = ""
2 ret_list = RLPy.RGlobal.GetPath(RLPy.EPathType_Temp, temp)
3 print(ret_list[0]) # success or faild
4 print(ret_list[1]) # path

BeginAction ( )

Perform undo and redo actions. This function is currently incomplete.

Parameters

strAction [IN] action name - string
1 RLPy.RGlobal.BeginAction('ActionName')
2 RLPy.RGlobal.EndAction()

EndAction ( )

Perform undo and redo actions. This function is currently incomplete

1 # undo / redo
2 RLPy.RGlobal.BeginAction("Motion")
3 # do something
4 RLPy.RGlobal.EndAction()

Play ( )

Controls the timeline playback.

Parameters

kStart [IN] start time - RTime
kEnd [IN] end time - RTime
1 start_time = RLPy.RTime(0)
2 end_time = RLPy.RTime(1000.0)
3 RLPy.RGlobal.Play(start_time,end_time)

Pause ( )

Pause the timeline playback and keep the playhead in place.

1 RLPy.RGlobal.Play(RLPy.RTime(0), RLPy.RTime(1000))
2 RLPy.RGlobal.Pause()

Stop ( )

Stop the timeline playback and return the playhead to the start marker.

1 RLPy.RGlobal.Play(RLPy.RTime(0), RLPy.RTime(1000))
2 RLPy.RGlobal.Stop()

IsPlaying ( )

Check if timeline playback is in progress.

Returns

Returns true when application playing - bool
1 if(not RLPy.RGlobal.IsPlaying()):
2         RLPy.RGlobal.Play(RLPy.RTime(0), RLPy.RTime(1000))
3 if(RLPy.RGlobal.IsPlaying()):
4         RLPy.RGlobal.Stop()

GetTime ( )

Get the current time for the scene according to the location of the playhead.

Returns

current time - RTime
1 time = RLPy.RGlobal.GetTime()
2 print(time)

SetTime ( )

Change the current time for the scene and update the playhead.

See Also: GetTime

Parameters

kTime [IN] Specifies the time to set - RTime

Returns

Success - RLPy.RStatus.Success
Failure - RLPy.RStatus.Failure
1 result = RLPy.RGlobal.SetTime(RLPy.RTime(1000))
2 print(result) # Success or fail
3 
4 time = RLPy.RGlobal.GetTime()
5 print(time)

GetStartTime ( )

Get the start time for the current project.

Returns

Start frame time - RTime
1 time = RLPy.RGlobal.GetStartTime()
2 print(time)

GetEndTime ( )

Get the end time for the current project.

Returns

End frame time - RTime
1 time = RLPy.RGlobal.GetEndTime()
2 print(time)

GetMocapManager ( )

Access the Mocap Manager and member functions for RIMocapManager.

See Also: RIMocapManager

Returns

Pointer to mocap manager - RIMocapManager
1 mocap_manager = RLPy.RGlobal.GetMocapManager()
2 print(mocap_manager.IsRunning()) # True or False

RemoveAllAnimations ( spObject )

Remove all animations on a given object and return RLPy.RStatus.Success if successful, else RLPy.RStatus.Failure. Currently supports characters, props, accessories, particles, PopcornFX, lights, motion paths, cameras, wind, images, and global illumination. The timeline needs to update after execution in order to show the changes.

Parameters

spObject [IN] The object to remove animations - RIObject

Returns

Success - RLPy.RStatus.Success
Failure - RLPy.RStatus.Failure
1 avatar_list = RLPy.RScene.GetAvatars()
2 result = RLPy.RGlobal.RemoveAllAnimations( avatar_list[0] )
3 print(result)

RenderVideo ( )

Use the current iClone render settings to output a video. Returns RLPy.RStatus.Success when successful, else RLPy.RStatus.Failure.

Returns

Success - RLPy.RStatus.Success
Failure - RLPy.RStatus.Failure
1 result = RLPy.RGlobal.RenderVideo()
2 print(result)

GetScreenSize ( self, nWidth, nHeight )

Get the render output size for the current scene.

Parameters

nWidth [IN] screen width in pixels - int
nHeight [IN] screen height in pixels - int

Returns

[Success/Fail, Width, Height] - list
Success - RLPy.RStatus.Success
Failure - RLPy.RStatus.Failure
Width - int
Height - int
1 width = 0
2 height = 0
3 result = RLPy.RGlobal.GetScreenSize(width, height)
4 print(result[0]) # successful or failed
5 print(result[1]) # width
6 print(result[2]) # height