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

From Reallusion Wiki!
Jump to: navigation, search
m
m
Line 1: Line 1:
 
{{TOC}}
 
{{TOC}}
 
{{Parent|IC_Python_API:RL_Python_Modules|Modules}}
 
{{Parent|IC_Python_API:RL_Python_Modules|Modules}}
==Detailed Description==
+
== Detailed Description ==
 
This class providing common API global functions.
 
This class providing common API global functions.
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
Line 29: Line 29:
 
RLPy.RGlobal.EndAction()
 
RLPy.RGlobal.EndAction()
 
</syntaxhighlight>
 
</syntaxhighlight>
==Member Functions==
+
== Member Functions ==
===BeginAction===
+
 
 +
=== BeginAction ===
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
 
RLPy.RGlobal.BeginAction ( strAction )
 
RLPy.RGlobal.BeginAction ( strAction )
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Begin action.
 
Begin action.
====Parameters====
+
==== Parameters ====
 
<div style="margin-left: 2em;">
 
<div style="margin-left: 2em;">
 
'''strAction''' [IN] action name - string
 
'''strAction''' [IN] action name - string
 
</div>
 
</div>
 
-----
 
-----
===DoPluginTrialFollowUp===
+
=== DoPluginTrialFollowUp ===
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
 
RLPy.RGlobal.DoPluginTrialFollowUp ( strProductNamePath )
 
RLPy.RGlobal.DoPluginTrialFollowUp ( strProductNamePath )
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Trial Follow up (Internal use)
 
Trial Follow up (Internal use)
====Parameters====
+
==== Parameters ====
 
<div style="margin-left: 2em;">
 
<div style="margin-left: 2em;">
 
'''strProductNamePath''' [IN] Product name path - string
 
'''strProductNamePath''' [IN] Product name path - string
 
</div>
 
</div>
 
-----
 
-----
===DoSNVerification===
+
=== DoSNVerification ===
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
 
RLPy.RGlobal.DoSNVerification ( nProductID, strRegistry, strProductName, strSNFailTitle, strSNFailMsg, strSNExceedTitle, strSNExceedMsg )
 
RLPy.RGlobal.DoSNVerification ( nProductID, strRegistry, strProductName, strSNFailTitle, strSNFailMsg, strSNExceedTitle, strSNExceedMsg )
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Verify serial number.
 
Verify serial number.
====Parameters====
+
==== Parameters ====
 
<div style="margin-left: 2em;">
 
<div style="margin-left: 2em;">
 
'''nProductID''' [IN] product ID - int
 
'''nProductID''' [IN] product ID - int
Line 71: Line 72:
 
'''strSNExceedMsg''' [IN] exceed message - string
 
'''strSNExceedMsg''' [IN] exceed message - string
 
</div>
 
</div>
====Returns====
+
==== Returns ====
 
<div style="margin-left: 2em;">Remain days of trial version - bool
 
<div style="margin-left: 2em;">Remain days of trial version - bool
 
</div>
 
</div>
 
-----
 
-----
===GetEndTime===
+
=== EndAction ===
 +
<syntaxhighlight lang="Python">
 +
RLPy.RGlobal.EndAction ( )
 +
</syntaxhighlight>
 +
End action.
 +
-----
 +
=== GetEndTime ===
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
 
RLPy.RGlobal.GetEndTime ( )
 
RLPy.RGlobal.GetEndTime ( )
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Get end frame time.
 
Get end frame time.
====Returns====
+
==== Returns ====
 
<div style="margin-left: 2em;">End frame time - RLPy.RTime
 
<div style="margin-left: 2em;">End frame time - RLPy.RTime
 
</div>
 
</div>
 
-----
 
-----
===GetFps===
+
=== GetFps ===
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
 
RLPy.RGlobal.GetFps ( )
 
RLPy.RGlobal.GetFps ( )
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Get frame per second.
 
Get frame per second.
====Returns====
+
==== Returns ====
 
<div style="margin-left: 2em;">Frame rate - int
 
<div style="margin-left: 2em;">Frame rate - int
 
</div>
 
</div>
 
-----
 
-----
===GetMocapManager===
+
=== GetMocapManager ===
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
 
RLPy.RGlobal.GetMocapManager ( )
 
RLPy.RGlobal.GetMocapManager ( )
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Get mocap manager.
 
Get mocap manager.
====Returns====
+
==== Returns ====
 
<div style="margin-left: 2em;">Pointer to mocap manager - RLPy.RIMocapManager
 
<div style="margin-left: 2em;">Pointer to mocap manager - RLPy.RIMocapManager
 
</div>
 
</div>
 
-----
 
-----
===GetPath===
+
=== GetPath ===
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
 
RLPy.RGlobal.GetPath ( ePath, strPath )
 
RLPy.RGlobal.GetPath ( ePath, strPath )
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Get path.
 
Get path.
====Parameters====
+
==== Parameters ====
 
<div style="margin-left: 2em;">
 
<div style="margin-left: 2em;">
 
'''ePath''' [IN] path type - RLPy.EPathType
 
'''ePath''' [IN] path type - RLPy.EPathType
Line 129: Line 136:
 
'''strPath''' [OUT] path name - string
 
'''strPath''' [OUT] path name - string
 
</div>
 
</div>
====Return Values====
+
==== Return Values ====
 
<div style="margin-left: 2em;">
 
<div style="margin-left: 2em;">
 
'''RLPy.RStatus.Success''' Success
 
'''RLPy.RStatus.Success''' Success
Line 136: Line 143:
 
</div>
 
</div>
 
-----
 
-----
===GetProjectLength===
+
=== GetProjectLength ===
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
 
RLPy.RGlobal.GetProjectLength ( )
 
RLPy.RGlobal.GetProjectLength ( )
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Get project length.
 
Get project length.
====Returns====
+
==== Returns ====
 
<div style="margin-left: 2em;">Project length - RLPy.RTime
 
<div style="margin-left: 2em;">Project length - RLPy.RTime
 
</div>
 
</div>
 
-----
 
-----
===GetStartTime===
+
=== GetStartTime ===
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
 
RLPy.RGlobal.GetStartTime ( )
 
RLPy.RGlobal.GetStartTime ( )
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Get start frame time.
 
Get start frame time.
====Returns====
+
==== Returns ====
 
<div style="margin-left: 2em;">Start frame time - RLPy.RTime
 
<div style="margin-left: 2em;">Start frame time - RLPy.RTime
 
</div>
 
</div>
 
-----
 
-----
===GetTime===
+
=== GetTime ===
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
 
RLPy.RGlobal.GetTime ( )
 
RLPy.RGlobal.GetTime ( )
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Get current frame time.
 
Get current frame time.
====Returns====
+
==== Returns ====
 
<div style="margin-left: 2em;">Current time - RLPy.RTime
 
<div style="margin-left: 2em;">Current time - RLPy.RTime
 
</div>
 
</div>
 
-----
 
-----
===IsPlaying===
+
=== IsPlaying ===
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
 
RLPy.RGlobal.IsPlaying ( )
 
RLPy.RGlobal.IsPlaying ( )
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Is application playing?
 
Is application playing?
====Returns====
+
==== Returns ====
 
<div style="margin-left: 2em;">True when application playing - bool
 
<div style="margin-left: 2em;">True when application playing - bool
 
</div>
 
</div>
 
-----
 
-----
===Play===
+
=== Pause ===
 +
<syntaxhighlight lang="Python">
 +
RLPy.RGlobal.Pause ( )
 +
</syntaxhighlight>
 +
Pause the project.
 +
-----
 +
=== Play ===
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
 
RLPy.RGlobal.Play ( kStart, kEnd )
 
RLPy.RGlobal.Play ( kStart, kEnd )
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Play the project.
 
Play the project.
====Parameters====
+
==== Parameters ====
 
<div style="margin-left: 2em;">
 
<div style="margin-left: 2em;">
 
'''kStart''' [IN] start time - RLPy.RTime
 
'''kStart''' [IN] start time - RLPy.RTime
Line 184: Line 197:
 
</div>
 
</div>
 
-----
 
-----
===RemoveAllAnimations===
+
=== RemoveAllAnimations ===
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
 
RLPy.RGlobal.RemoveAllAnimations ( spObject )
 
RLPy.RGlobal.RemoveAllAnimations ( spObject )
Line 190: Line 203:
 
Remove all animations of object.
 
Remove all animations of object.
 
<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;">
 
'''spObject''' [IN] The object to remove animations - RLPy.RIObject
 
'''spObject''' [IN] The object to remove animations - RLPy.RIObject
 
</div>
 
</div>
====Return Values====
+
==== Return Values ====
 
<div style="margin-left: 2em;">
 
<div style="margin-left: 2em;">
 
'''RLPy.RStatus.Success''' Success
 
'''RLPy.RStatus.Success''' Success
Line 201: Line 214:
 
</div>
 
</div>
 
-----
 
-----
===RenderVideo===
+
=== RenderVideo ===
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
 
RLPy.RGlobal.RenderVideo ( )
 
RLPy.RGlobal.RenderVideo ( )
Line 207: Line 220:
 
Export project into video file.
 
Export project into video file.
 
<span style="background:#ffcccc">( Experimental API )</span>
 
<span style="background:#ffcccc">( Experimental API )</span>
====Return Values====
+
==== Return Values ====
 
<div style="margin-left: 2em;">
 
<div style="margin-left: 2em;">
 
'''RLPy.RStatus.Success''' Success
 
'''RLPy.RStatus.Success''' Success
Line 214: Line 227:
 
</div>
 
</div>
 
-----
 
-----
===SetTime===
+
=== SetTime ===
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
 
RLPy.RGlobal.SetTime ( kTime )
 
RLPy.RGlobal.SetTime ( kTime )
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Set current frame time.
 
Set current frame time.
====Parameters====
+
==== Parameters ====
 
<div style="margin-left: 2em;">
 
<div style="margin-left: 2em;">
 
'''kTime''' [IN] Specifies the time to set - RLPy.RTime
 
'''kTime''' [IN] Specifies the time to set - RLPy.RTime
 
</div>
 
</div>
====Return Values====
+
==== Return Values ====
 
<div style="margin-left: 2em;">
 
<div style="margin-left: 2em;">
 
'''RLPy.RStatus.Success''' Success
 
'''RLPy.RStatus.Success''' Success
Line 230: Line 243:
 
</div>
 
</div>
 
-----
 
-----
===TrialVersionRemainingDays===
+
=== Stop ===
 +
<syntaxhighlight lang="Python">
 +
RLPy.RGlobal.Stop ( )
 +
</syntaxhighlight>
 +
Stop playing. -----
 +
=== TrialVersionRemainingDays ===
 
<syntaxhighlight lang="Python">
 
<syntaxhighlight lang="Python">
 
RLPy.RGlobal.TrialVersionRemainingDays ( strBinPath, uProductID, strProductFold, strRegRoot )
 
RLPy.RGlobal.TrialVersionRemainingDays ( strBinPath, uProductID, strProductFold, strRegRoot )
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Get remain days of trial version.
 
Get remain days of trial version.
====Parameters====
+
==== Parameters ====
 
<div style="margin-left: 2em;">
 
<div style="margin-left: 2em;">
 
'''strBinPath''' [IN] bin file path - string
 
'''strBinPath''' [IN] bin file path - string
Line 245: Line 263:
 
'''kRegRoot''' [IN] registry root
 
'''kRegRoot''' [IN] registry root
 
</div>
 
</div>
====Returns====
+
==== Returns ====
 
<div style="margin-left: 2em;">Remain days of trial version - int
 
<div style="margin-left: 2em;">Remain days of trial version - int
 
</div>
 
</div>
-----
 
===EndAction===
 
<syntaxhighlight lang="Python">
 
RLPy.RGlobal.EndAction ( )
 
</syntaxhighlight>
 
End action.
 
-----
 
===Pause===
 
<syntaxhighlight lang="Python">
 
RLPy.RGlobal.Pause ( )
 
</syntaxhighlight>
 
Pause the project.
 
-----
 
===Stop===
 
<syntaxhighlight lang="Python">
 
RLPy.RGlobal.Stop ( )
 
</syntaxhighlight>
 
Stop playing.
 

Revision as of 01:09, 12 April 2019

Main article: Modules.

Detailed Description

This class providing common API global functions.

# 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()

Member Functions

BeginAction

RLPy.RGlobal.BeginAction ( strAction )

Begin action.

Parameters

strAction [IN] action name - string


DoPluginTrialFollowUp

RLPy.RGlobal.DoPluginTrialFollowUp ( strProductNamePath )

Trial Follow up (Internal use)

Parameters

strProductNamePath [IN] Product name path - string


DoSNVerification

RLPy.RGlobal.DoSNVerification ( nProductID, strRegistry, strProductName, strSNFailTitle, strSNFailMsg, strSNExceedTitle, strSNExceedMsg )

Verify serial number.

Parameters

nProductID [IN] product ID - int

strRegistry [IN] registry - string

strProductName [IN] product name - string

strSNFailTitle [IN] fail title - string

strSNFailMsg [IN] fail message - string

strSNExceedTitle [IN] exceed title - string

strSNExceedMsg [IN] exceed message - string

Returns

Remain days of trial version - bool

EndAction

RLPy.RGlobal.EndAction ( )

End action.


GetEndTime

RLPy.RGlobal.GetEndTime ( )

Get end frame time.

Returns

End frame time - RLPy.RTime

GetFps

RLPy.RGlobal.GetFps ( )

Get frame per second.

Returns

Frame rate - int

GetMocapManager

RLPy.RGlobal.GetMocapManager ( )

Get mocap manager.

Returns

Pointer to mocap manager - RLPy.RIMocapManager

GetPath

RLPy.RGlobal.GetPath ( ePath, strPath )

Get path.

Parameters

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

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail


GetProjectLength

RLPy.RGlobal.GetProjectLength ( )

Get project length.

Returns

Project length - RLPy.RTime

GetStartTime

RLPy.RGlobal.GetStartTime ( )

Get start frame time.

Returns

Start frame time - RLPy.RTime

GetTime

RLPy.RGlobal.GetTime ( )

Get current frame time.

Returns

Current time - RLPy.RTime

IsPlaying

RLPy.RGlobal.IsPlaying ( )

Is application playing?

Returns

True when application playing - bool

Pause

RLPy.RGlobal.Pause ( )

Pause the project.


Play

RLPy.RGlobal.Play ( kStart, kEnd )

Play the project.

Parameters

kStart [IN] start time - RLPy.RTime

kEnd [IN] end time - RLPy.RTime


RemoveAllAnimations

RLPy.RGlobal.RemoveAllAnimations ( spObject )

Remove all animations of object. ( Experimental API )

Parameters

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

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Remove failed


RenderVideo

RLPy.RGlobal.RenderVideo ( )

Export project into video file. ( Experimental API )

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Remove failed


SetTime

RLPy.RGlobal.SetTime ( kTime )

Set current frame time.

Parameters

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

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail


Stop

RLPy.RGlobal.Stop ( )

Stop playing. -----

TrialVersionRemainingDays

RLPy.RGlobal.TrialVersionRemainingDays ( strBinPath, uProductID, strProductFold, strRegRoot )

Get remain days of trial version.

Parameters

strBinPath [IN] bin file path - string

kProductID [IN] product ID

kProductFold [IN] product Folder

kRegRoot [IN] registry root

Returns

Remain days of trial version - int