IC Python API:RLPy RCameraDofData

From Reallusion Wiki!
Jump to: navigation, search
Main article: Modules.

Description

RCameraDofData is used to store the DOF related settings for the camera. https://manual.reallusion.com/iClone_7/ENU/Content/iClone_7/Pro_7.4/10_Scene/Camera/The_Concept_of_DOF.htm

See also: RICamera

 1  #Set camera DOF data
 2 new_data = RLPy.RCameraDofData()
 3 new_data.SetEnable( True )
 4 new_data.SetFocus(20)
 5 new_data.SetRange(80)
 6 new_data.SetNearTransitionRegion(5)
 7 new_data.SetFarTransitionRegion(100)
 8 new_data.SetNearBlurScale(2)
 9 new_data.SetFarBlurScale(3)
10 new_data.SetMinBlendDistance(0.2)
11 new_data.SetCenterColorWeight(20)
12 new_data.SetEdgeDecayPower(1)
13     
14 #add dof key
15 dof_key = RLPy.RKey()
16 dof_key.SetTime(RLPy.RGlobal.GetTime())
17 camera = RLPy.RScene.FindObject(RLPy.EObjectType_Camera,"Camera")
18 camera.AddDofKey(dof_key, new_data)

Constructor

__init__ (self)

Create a camera Depth of Field settings data structure.

1 data = RLPy.RCameraDofData()

Member Functions

SetEnable( self, bEnable )

Whether or not to activate the DOF funcationalities.

Parameters

bEnable [IN] Whether to enable DOF - boolean
1 data = RLPy.RCameraDofData()
2 data.SetEnable( False )
3 data.SetEnable( True )

GetEnable( self )

Get the active state of the camera DOF.

Return

DOF active state - boolean
1 data = RLPy.RCameraDofData()
2 data.SetEnable( True )
3 print( data.GetEnable() )

SetFocus( self, fFocusData)

Set the camera DOF focus value.

Parameters

fFocusData [IN] DOF focus value - float
1 new_data = RLPy.RCameraDofData()
2 new_data.SetFocus(20)

GetFocus( self )

Get the camera DOF Focus value.

Return

DOF focus value - float
1 new_data = RLPy.RCameraDofData()
2 new_data.SetFocus(20)
3 print( new_data.GetFocus() )

SetRange( self, fRangeData)

Set the camera DOF range value.

Parameters

fRangeData [IN] DOF range value - float (ranges from 0.0 to 1000.0).
1 new_data = RLPy.RCameraDofData()
2 new_data.SetRange(20)

GetRange( self )

Get the camera DOF range value.

Return

DOF range value - float
1 new_data = RLPy.RCameraDofData()
2 new_data.SetRange(20)
3 print( new_data.GetRange() )

SetNearTransitionRegion( self, fNearTransitionRegion)

Get the camera DOF Near Transition Region.

Parameters

fNearTransitionRegion [IN] DOF Near Transition Region - float (ranges from 0.0 to 1000.0).
1 new_data = RLPy.RCameraDofData()
2 new_data.SetNearTransitionRegion(5)

GetNearTransitionRegion( self )

Get the camera DOF Near Transition Region.

Return

DOF Near Transition Region- float
1 new_data = RLPy.RCameraDofData()
2 new_data.SetNearTransitionRegion(5)
3 print( new_data.GetNearTransitionRegion() )

SetFarTransitionRegion( self, fFarTransitionRegion)

Get the DOF Far Transition Region.

Parameters

fFarTransitionRegion [IN] DOF Far Transition Region - float (ranges from 0.0 to 1000.0).
1 new_data = RLPy.RCameraDofData()
2 new_data.SetFarTransitionRegion(100)

GetFarTransitionRegion( self )

Get the camera DOF Far Transition Region.

Return

DOF Near Transition Region - float
1 new_data = RLPy.RCameraDofData()
2 new_data.SetFarTransitionRegion(5)
3 print( new_data.GetFarTransitionRegion() )

SetNearBlurScale( self, fNearBlurScale)

Get the camera DOF Near Blur.

Parameters

fNearBlurScale [IN] DOF Near Blur - float
1 new_data = RLPy.RCameraDofData()
2 new_data.SetNearBlurScale(2)

GetNearBlurScale( self )

Get the camera DOF Near Blur.

Return

DOF Near Blur - float
1 new_data = RLPy.RCameraDofData()
2 new_data.SetNearBlurScale(2)
3 print( new_data.GetNearBlurScale() )

SetFarBlurScale( self, fFarBlurScale)

Set the camera DOF Far Blur Scale.

Parameters

fFarBlurScale [IN] DOF Far Blur Scale - float
1 new_data = RLPy.RCameraDofData()
2 new_data.SetFarBlurScale(3)

GetFarBlurScale( self )

Get the camera DOF Far Blur Scale.

Return

DOF Far Blur Scale - float
1 new_data = RLPy.RCameraDofData()
2 new_data.SetFarBlurScale(3)
3 print( new_data.GetFarBlurScale() )

SetMinBlendDistance( self, fMinBlendDistance)

Set the camera DOF Min Blend Distance.

Parameters

fMinBlendDistance [IN] DOF Min Blend Distance - float
1 new_data = RLPy.RCameraDofData()
2 new_data.SetMinBlendDistance(0.2)

GetMinBlendDistance( self )

Get the camera DOF's Min Blend Distance。

Return

DOF Min Blend Distance - float
1 new_data = RLPy.RCameraDofData()
2 new_data.SetMinBlendDistance(0.2)
3 print( new_data.GetMinBlendDistance() )

SetCenterColorWeight( self, fCenterColorWeight)

Set the camera DOF's Center Color Weight.

Parameters

fCenterColorWeight [IN] DOF Center Color Weight - float
1 new_data = RLPy.RCameraDofData()
2 new_data.SetCenterColorWeight(20)

GetMinBlendDistance( self )

Get the Center Color Weight fo the camera DOF.

Return

DOF Center Color Weight - float
1 new_data = RLPy.RCameraDofData()
2 new_data.SetCenterColorWeight(20)
3 print( new_data.GetCenterColorWeight() )

SetEdgeDecayPower( self, fEdgeDecayPower)

Set the power of the edge decay for the camera DOF.

Parameters

fEdgeDecayPower [IN] DOF Edge Decay Power - float
1 new_data = RLPy.RCameraDofData()
2 new_data.SetEdgeDecayPower(20)

GetEdgeDecayPower( self )

Get the power of the edge decay for the camera DOF.

Return

DOF Edge Decay Power - float
1 new_data = RLPy.RCameraDofData()
2 new_data.SetEdgeDecayPower(20)
3 print( new_data.GetEdgeDecayPower() )