Difference between revisions of "IC Python API:RLPy RVisemeSmoothOption"
Chuck (RL) (Talk | contribs) (Created page with "{{TOC}} {{Parent|IC_Python_API:RL_Python_Modules|Modules}} ==Detailed Description== The smooth options of the viseme clip. The developer can set the smooth value to smooth the...") |
Chuck (RL) (Talk | contribs) m |
||
(2 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}} | ||
− | == | + | |
− | + | == Description == | |
− | + | ||
− | + | This class is responsible for recording viseme smooth and strength settings for parts of the mouth: jaw, lips and tongue. These settings can be fed into a [[IC_Python_API:RLPy_RIVisemeComponent|RIVisemeComponent]] using [[IC_Python_API:RLPy_RIVisemeComponent#AddVisemeOptionClip|RIVisemeComponent.AddVisemeOptionClip()]]. | |
− | == | + | |
− | === | + | <syntaxhighlight lang="python" line='line'> |
− | + | # Get avatar viseme component | |
− | + | avatar_list = RLPy.RScene.GetAvatars() | |
+ | avatar = avatar_list[0] | ||
+ | viseme_component = avatar.GetVisemeComponent() | ||
+ | |||
+ | # Add viseme option clip | ||
+ | smooth_option = RLPy.RVisemeSmoothOption() | ||
+ | smooth_option.SetStrengthEnable(True, True, True) | ||
+ | smooth_option.SetStrengthValue(0, 0, 1) | ||
+ | start_time = RLPy.RGlobal.GetTime() | ||
+ | clip_name = "Default" | ||
+ | result = viseme_component.AddVisemeOptionClip(smooth_option, start_time, clip_name) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ||
− | ==== | + | == Member Functions == |
− | + | ||
− | + | === SetStrengthEnable ( self, bJawEnable, bLipsEnable, bTongueEnable ) === | |
− | - | + | |
− | + | Enable/disable viseme strengthening for parts of the mouth. | |
− | <syntaxhighlight lang=" | + | |
− | RLPy.RVisemeSmoothOption. | + | See Also: [[#SetStrengthValue ( self, fJaw, fLips, fTongue )|SetStrengthValue]] |
+ | |||
+ | ==== Parameters ==== | ||
+ | :'''bJawEnable''' [IN] Enable/disable jaw strength - bool | ||
+ | :'''bLipsEnable''' [IN] Enable/disable lips strength - bool | ||
+ | :'''bTongueEnable''' [IN] Enable/disable tongue strength - bool | ||
+ | |||
+ | <syntaxhighlight lang="python" line='line'> | ||
+ | # Set strength enable | ||
+ | viseme_smooth_option = RLPy.RVisemeSmoothOption() | ||
+ | jaw_enable = True | ||
+ | lips_enble = False | ||
+ | tongue_enble = True | ||
+ | viseme_smooth_option.SetStrengthEnable(jaw_enable, lips_enble, tongue_enble) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ||
− | ==== | + | === SetStrengthValue ( self, fJaw, fLips, fTongue ) === |
− | + | ||
− | + | Set the viseme strength values for parts of the mouth. | |
− | + | ||
− | + | ==== Parameters ==== | |
− | <syntaxhighlight lang=" | + | :'''fJaw''' [IN] Strength value of jaw - float [0.0,1.0] |
− | RLPy.RVisemeSmoothOption. | + | :'''fLips''' [IN] Strength value of lips - float [0.0,1.0] |
+ | :'''fTongue''' [IN] Strength value of tongue - float [0.0,1.0] | ||
+ | |||
+ | <syntaxhighlight lang="python" line='line'> | ||
+ | # Set strength value | ||
+ | viseme_smooth_option = RLPy.RVisemeSmoothOption() | ||
+ | jaw_value = 0.4 | ||
+ | lips_value = 0.5 | ||
+ | tongue_value = 0.6 | ||
+ | viseme_smooth_option.SetStrengthValue(jaw_value, lips_value, tongue_value) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ||
− | ==== | + | === SetSmoothEnable ( self, bJawEnable, bLipsEnable, bTongueEnable ) === |
− | + | ||
− | + | Enable/disable viseme smoothing for parts of the mouth. | |
− | - | + | |
− | + | ==== Parameters ==== | |
− | <syntaxhighlight lang=" | + | :'''bJawEnable''' [IN] Enable/disable jaw smoothing - bool |
− | RLPy.RVisemeSmoothOption. | + | :'''bLipsEnable''' [IN] Enable/disable lips smoothing - bool |
+ | :'''bTongueEnable''' [IN] Enable/disable tongue smoothing - bool | ||
+ | |||
+ | <syntaxhighlight lang="python" line='line'> | ||
+ | # Set smooth enable | ||
+ | viseme_smooth_option = RLPy.RVisemeSmoothOption() | ||
+ | jaw_enable = False | ||
+ | lips_enble = True | ||
+ | tongue_enble = False | ||
+ | viseme_smooth_option.SetSmoothEnable(jaw_enable, lips_enble, tongue_enble) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ||
− | ==== | + | === SetSmoothValue ( self, fJaw, fLips, fTongue ) === |
− | + | ||
− | + | Set the viseme smoothing values for parts of the mouth. | |
− | + | ||
− | + | See Also: [[#SetSmoothEnable ( self, bJawEnable, bLipsEnable, bTongueEnable )|SetSmoothEnable]] | |
− | <syntaxhighlight lang=" | + | |
− | RLPy.RVisemeSmoothOption. | + | ==== Parameters ==== |
+ | :'''fJaw''' [IN] Smooth value for the jaw - float [0.0,1.0] | ||
+ | :'''fLips''' [IN] Smooth value for the lips - float [0.0,1.0] | ||
+ | :'''fTongue''' [IN] Smooth value for the tongue - float [0.0,1.0] | ||
+ | |||
+ | <syntaxhighlight lang="python" line='line'> | ||
+ | # Set strength value | ||
+ | viseme_smooth_option = RLPy.RVisemeSmoothOption() | ||
+ | jaw_value = 0.4 | ||
+ | lips_value = 0.2 | ||
+ | tongue_value = 0.7 | ||
+ | viseme_smooth_option.SetSmoothValue(jaw_value, lips_value, tongue_value) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | + | === GetStrengthEnableSetting ( self ) === | |
− | + | Get all the viseme strengthening states for the mouth parts. | |
− | + | ||
− | + | See Also: [[#GetStrengthValueSetting ( self )|GetStrengthValueSetting]] | |
− | === | + | |
− | <syntaxhighlight lang=" | + | ==== Returns ==== |
− | RLPy.RVisemeSmoothOption. | + | Viseme trengthening states for the jaw, lips and tongue - bool list |
+ | |||
+ | <syntaxhighlight lang="python" line='line'> | ||
+ | # Get strength enable state | ||
+ | viseme_smooth_option = RLPy.RVisemeSmoothOption() | ||
+ | enable_list = viseme_smooth_option.GetStrengthEnableSetting() | ||
+ | print(enable_list[0]) # Jaw strength enable status | ||
+ | print(enable_list[1]) # Lips strength enable status | ||
+ | print(enable_list[2]) # Tongue strength enable status | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | + | === GetSmoothEnableSetting ( self ) === | |
− | + | Get all the viseme smoothing states for the mouth parts. | |
− | + | ||
− | + | See Also: [[#GetSmoothValueSetting ( self )|GetSmoothValueSetting]] | |
− | === | + | |
− | <syntaxhighlight lang=" | + | ==== Returns ==== |
− | RLPy.RVisemeSmoothOption. | + | Viseme smoothing states for the jaw, lips and tongue - bool list |
+ | |||
+ | <syntaxhighlight lang="python" line='line'> | ||
+ | # Get smooth enable state | ||
+ | viseme_smooth_option = RLPy.RVisemeSmoothOption() | ||
+ | enable_list = viseme_smooth_option.GetSmoothEnableSetting() | ||
+ | print(enable_list[0]) # Jaw smooth enable status | ||
+ | print(enable_list[1]) # Lips smooth enable status | ||
+ | print(enable_list[2]) # Tongue smooth enable status | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | + | === GetStrengthValueSetting ( self ) === | |
− | + | Get all the viseme strength values for the mouth parts. | |
− | + | ||
− | + | See Also: [[#GetStrengthEnableSetting ( self )|GetStrengthEnableSetting]] | |
− | === | + | |
− | <syntaxhighlight lang=" | + | ==== Returns ==== |
− | RLPy.RVisemeSmoothOption. | + | Strength values for the jaw, lips and tongue - float list |
+ | |||
+ | <syntaxhighlight lang="python" line='line'> | ||
+ | # Get strength values | ||
+ | viseme_smooth_option = RLPy.RVisemeSmoothOption() | ||
+ | value_list = viseme_smooth_option.GetStrengthValueSetting() | ||
+ | print(value_list[0]) # Jaw strength value | ||
+ | print(value_list[1]) # Lips strength value | ||
+ | print(value_list[2]) # Tongue strength value | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | + | === GetSmoothValueSetting ( self ) === | |
− | + | Get all the viseme smoothing values for the mouth parts. | |
− | </ | + | |
+ | See Also: [[#GetSmoothEnableSetting ( self )|GetSmoothEnableSetting]] | ||
+ | |||
+ | ==== Returns ==== | ||
+ | Smoothing values for the jaw, lips and tongue - float list | ||
+ | |||
+ | <syntaxhighlight lang="python" line='line'> | ||
+ | # Get smooth values | ||
+ | viseme_smooth_option = RLPy.RVisemeSmoothOption() | ||
+ | value_list = viseme_smooth_option.GetSmoothValueSetting() | ||
+ | print(value_list[0]) # Jaw smooth value | ||
+ | print(value_list[1]) # Lips smooth value | ||
+ | print(value_list[2]) # Tongue smooth value | ||
+ | </syntaxhighlight> |
Latest revision as of 18:00, 9 November 2020
Contents
- 1 Description
- 2 Member Functions
- 2.1 SetStrengthEnable ( self, bJawEnable, bLipsEnable, bTongueEnable )
- 2.2 SetStrengthValue ( self, fJaw, fLips, fTongue )
- 2.3 SetSmoothEnable ( self, bJawEnable, bLipsEnable, bTongueEnable )
- 2.4 SetSmoothValue ( self, fJaw, fLips, fTongue )
- 2.5 GetStrengthEnableSetting ( self )
- 2.6 GetSmoothEnableSetting ( self )
- 2.7 GetStrengthValueSetting ( self )
- 2.8 GetSmoothValueSetting ( self )
- Main article: Modules.
Description
This class is responsible for recording viseme smooth and strength settings for parts of the mouth: jaw, lips and tongue. These settings can be fed into a RIVisemeComponent using RIVisemeComponent.AddVisemeOptionClip().
1 # Get avatar viseme component
2 avatar_list = RLPy.RScene.GetAvatars()
3 avatar = avatar_list[0]
4 viseme_component = avatar.GetVisemeComponent()
5
6 # Add viseme option clip
7 smooth_option = RLPy.RVisemeSmoothOption()
8 smooth_option.SetStrengthEnable(True, True, True)
9 smooth_option.SetStrengthValue(0, 0, 1)
10 start_time = RLPy.RGlobal.GetTime()
11 clip_name = "Default"
12 result = viseme_component.AddVisemeOptionClip(smooth_option, start_time, clip_name)
Member Functions
SetStrengthEnable ( self, bJawEnable, bLipsEnable, bTongueEnable )
Enable/disable viseme strengthening for parts of the mouth.
See Also: SetStrengthValue
Parameters
- bJawEnable [IN] Enable/disable jaw strength - bool
- bLipsEnable [IN] Enable/disable lips strength - bool
- bTongueEnable [IN] Enable/disable tongue strength - bool
1 # Set strength enable
2 viseme_smooth_option = RLPy.RVisemeSmoothOption()
3 jaw_enable = True
4 lips_enble = False
5 tongue_enble = True
6 viseme_smooth_option.SetStrengthEnable(jaw_enable, lips_enble, tongue_enble)
SetStrengthValue ( self, fJaw, fLips, fTongue )
Set the viseme strength values for parts of the mouth.
Parameters
- fJaw [IN] Strength value of jaw - float [0.0,1.0]
- fLips [IN] Strength value of lips - float [0.0,1.0]
- fTongue [IN] Strength value of tongue - float [0.0,1.0]
1 # Set strength value
2 viseme_smooth_option = RLPy.RVisemeSmoothOption()
3 jaw_value = 0.4
4 lips_value = 0.5
5 tongue_value = 0.6
6 viseme_smooth_option.SetStrengthValue(jaw_value, lips_value, tongue_value)
SetSmoothEnable ( self, bJawEnable, bLipsEnable, bTongueEnable )
Enable/disable viseme smoothing for parts of the mouth.
Parameters
- bJawEnable [IN] Enable/disable jaw smoothing - bool
- bLipsEnable [IN] Enable/disable lips smoothing - bool
- bTongueEnable [IN] Enable/disable tongue smoothing - bool
1 # Set smooth enable
2 viseme_smooth_option = RLPy.RVisemeSmoothOption()
3 jaw_enable = False
4 lips_enble = True
5 tongue_enble = False
6 viseme_smooth_option.SetSmoothEnable(jaw_enable, lips_enble, tongue_enble)
SetSmoothValue ( self, fJaw, fLips, fTongue )
Set the viseme smoothing values for parts of the mouth.
See Also: SetSmoothEnable
Parameters
- fJaw [IN] Smooth value for the jaw - float [0.0,1.0]
- fLips [IN] Smooth value for the lips - float [0.0,1.0]
- fTongue [IN] Smooth value for the tongue - float [0.0,1.0]
1 # Set strength value
2 viseme_smooth_option = RLPy.RVisemeSmoothOption()
3 jaw_value = 0.4
4 lips_value = 0.2
5 tongue_value = 0.7
6 viseme_smooth_option.SetSmoothValue(jaw_value, lips_value, tongue_value)
GetStrengthEnableSetting ( self )
Get all the viseme strengthening states for the mouth parts.
See Also: GetStrengthValueSetting
Returns
Viseme trengthening states for the jaw, lips and tongue - bool list
1 # Get strength enable state
2 viseme_smooth_option = RLPy.RVisemeSmoothOption()
3 enable_list = viseme_smooth_option.GetStrengthEnableSetting()
4 print(enable_list[0]) # Jaw strength enable status
5 print(enable_list[1]) # Lips strength enable status
6 print(enable_list[2]) # Tongue strength enable status
GetSmoothEnableSetting ( self )
Get all the viseme smoothing states for the mouth parts.
See Also: GetSmoothValueSetting
Returns
Viseme smoothing states for the jaw, lips and tongue - bool list
1 # Get smooth enable state
2 viseme_smooth_option = RLPy.RVisemeSmoothOption()
3 enable_list = viseme_smooth_option.GetSmoothEnableSetting()
4 print(enable_list[0]) # Jaw smooth enable status
5 print(enable_list[1]) # Lips smooth enable status
6 print(enable_list[2]) # Tongue smooth enable status
GetStrengthValueSetting ( self )
Get all the viseme strength values for the mouth parts.
See Also: GetStrengthEnableSetting
Returns
Strength values for the jaw, lips and tongue - float list
1 # Get strength values
2 viseme_smooth_option = RLPy.RVisemeSmoothOption()
3 value_list = viseme_smooth_option.GetStrengthValueSetting()
4 print(value_list[0]) # Jaw strength value
5 print(value_list[1]) # Lips strength value
6 print(value_list[2]) # Tongue strength value
GetSmoothValueSetting ( self )
Get all the viseme smoothing values for the mouth parts.
See Also: GetSmoothEnableSetting
Returns
Smoothing values for the jaw, lips and tongue - float list
1 # Get smooth values
2 viseme_smooth_option = RLPy.RVisemeSmoothOption()
3 value_list = viseme_smooth_option.GetSmoothValueSetting()
4 print(value_list[0]) # Jaw smooth value
5 print(value_list[1]) # Lips smooth value
6 print(value_list[2]) # Tongue smooth value