IC Python API:RLPy RDatatBlock
From Reallusion Wiki!
Revision as of 00:51, 28 March 2019 by Chuck (RL) (Talk | contribs) (Created page with "{{TOC}} {{Parent|IC_Python_API:RL_Python_Modules|Modules}} ==Detailed Description== A data block provide a mechanism for storing values associated with a plug-in. The develope...")
- Main article: Modules.
Detailed Description
A data block provide a mechanism for storing values associated with a plug-in.
The developer can access the animation through the data block, such as position, rotation, and scale.# Get a avatar in the scene
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
# Set Data
transform_control = avatar.GetControl("Transform")
data_block = transform_control.GetDataBlock() # get datablock of the control
data_block.SetData("Position/PositionX", RLPy.RTime(3000), RLPy.RVariant(100)) # set the position of x axis to 1000 at time 3000
# Get Data
print(data_block.GetData("Position/PositionX", RLPy.RTime(3000)).ToUInt32()) # values = 100
Member Functions
Clone
RLPy.RDataBlock.Clone ( self )
Clone. Supports cloning, which creates a new instance of a class with the same value as an existing instance.
Returns
Pointer to cloned data block - RLPy. RDataBlock
GetControl
RLPy.RDataBlock.GetControl ( self, strName )
Get control.
Parameters
strName [IN] control name - string
Returns
Pointer to control - RLPy.RControl
GetData
RLPy.RDataBlock.GetData ( self, strName, kTime, pReturnStatus = None )
Get data.
Parameters
strName [IN] data name - string
kTime [IN] Specifies the time to get data - RLPy.RTime
pReturnStatus [OUT] return status - RLPy.RStatus
Returns
RVariant data - RLPy.RVariant
SetData
RLPy.RDataBlock.SetData ( self, strName, kTime, kData )
Set data.
Parameters
strName [IN] data name - string
kTime [IN] Specifies the time to set data - RLPy.RTime
kData [OUT] data - RLPy.RVariant
Return Values
RLPy.RStatus.Success Success
RLPy.RStatus.Failure Fail