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

From Reallusion Wiki!
Jump to: navigation, search
(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...")
 
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==
+
{{last_modified}}
The smooth options of the viseme clip.
+
 
The developer can set the smooth value to smooth the transition
+
== Description ==
between two viseme keys, and set the strength to stylize mouth movement.
+
 
==Member Functions==
+
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()]].
===GetSmoothEnableSetting===
+
 
<syntaxhighlight lang="Python">
+
<syntaxhighlight lang="python" line='line'>
RLPy.RVisemeSmoothOption.GetSmoothEnableSetting ( self )
+
# 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>
Get the smooth enable states for all parts of a mouth.
+
 
====Returns====
+
== Member Functions ==
<div style="margin-left: 2em;">A list of smooth enable states - list
+
 
</div>
+
=== SetStrengthEnable ( self, bJawEnable, bLipsEnable, bTongueEnable ) ===
-----
+
 
===GetSmoothValueSetting===
+
Enable/disable viseme strengthening for parts of the mouth.
<syntaxhighlight lang="Python">
+
 
RLPy.RVisemeSmoothOption.GetSmoothValueSetting ( self )
+
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>
Get the smooth values for all parts of a mouth.
+
 
====Returns====
+
=== SetStrengthValue ( self, fJaw, fLips, fTongue ) ===
<div style="margin-left: 2em;">A list of smooth values - float
+
 
</div>
+
Set the viseme strength values for parts of the mouth.
-----
+
 
===GetStrengthEnableSetting===
+
==== Parameters ====
<syntaxhighlight lang="Python">
+
:'''fJaw''' [IN] Strength value of jaw - float [0.0,1.0]
RLPy.RVisemeSmoothOption.GetStrengthEnableSetting ( self )
+
:'''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>
Get the strength enable states for all parts of a mouth.
+
 
====Returns====
+
=== SetSmoothEnable ( self, bJawEnable, bLipsEnable, bTongueEnable ) ===
<div style="margin-left: 2em;">A list of strength enable states - list
+
 
</div>
+
Enable/disable viseme smoothing for parts of the mouth.
-----
+
 
===GetStrengthValueSetting===
+
==== Parameters ====
<syntaxhighlight lang="Python">
+
:'''bJawEnable''' [IN] Enable/disable jaw smoothing - bool
RLPy.RVisemeSmoothOption.GetStrengthValueSetting ( self )
+
:'''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>
Get the strength values for all parts of a mouth.
+
 
====Returns====
+
=== SetSmoothValue ( self, fJaw, fLips, fTongue ) ===
<div style="margin-left: 2em;">A list of strength values - float
+
 
</div>
+
Set the viseme smoothing values for parts of the mouth.
-----
+
 
===SetSmoothEnable===
+
See Also: [[#SetSmoothEnable ( self, bJawEnable, bLipsEnable, bTongueEnable )|SetSmoothEnable]]
<syntaxhighlight lang="Python">
+
 
RLPy.RVisemeSmoothOption.SetSmoothEnable ( self, bJawEnable, bLipsEnable, bTongueEnable )
+
==== 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>
Enable the parts of mouth to be smoothed.
 
====Parameters====
 
<div style="margin-left: 2em;">
 
'''bJawEnable''' [IN] jaw is enabled or not - bool
 
  
'''bLipsEnable''' [IN] lips is enabled or not - bool
+
=== GetStrengthEnableSetting ( self ) ===
  
'''bTongueEnable''' [IN] tongue is enabled or not - bool
+
Get all the viseme strengthening states for the mouth parts.
</div>
+
 
-----
+
See Also: [[#GetStrengthValueSetting ( self )|GetStrengthValueSetting]]
===SetSmoothValue===
+
 
<syntaxhighlight lang="Python">
+
==== Returns ====
RLPy.RVisemeSmoothOption.SetSmoothValue ( self, fJaw, fLips, fTongue )
+
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>
Set the smooth value for each part of a mouth.
 
====Parameters====
 
<div style="margin-left: 2em;">
 
'''fJaw''' [IN] the smooth value of jaw, the range is from 0.0 to 1.0 - float
 
  
'''fLips''' [IN] the smooth value of lips, the range is from 0.0 to 1.0 - float
+
=== GetSmoothEnableSetting ( self ) ===
  
'''fTongue''' [IN] the smooth value of tongue, the range is from 0.0 to 1.0 - float
+
Get all the viseme smoothing states for the mouth parts.
</div>
+
 
-----
+
See Also: [[#GetSmoothValueSetting ( self )|GetSmoothValueSetting]]
===SetStrengthEnable===
+
 
<syntaxhighlight lang="Python">
+
==== Returns ====
RLPy.RVisemeSmoothOption.SetStrengthEnable ( self, bJawEnable, bLipsEnable, bTongueEnable )
+
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>
Enable the parts of mouth to be adjusted by its strength.
 
====Parameters====
 
<div style="margin-left: 2em;">
 
'''bJawEnable''' [IN] jaw is enabled or not - bool
 
  
'''bLipsEnable''' [IN] lips is enabled or not - bool
+
=== GetStrengthValueSetting ( self ) ===
  
'''bTongueEnable''' [IN] tongue is enabled or not - bool
+
Get all the viseme strength values for the mouth parts.
</div>
+
 
-----
+
See Also: [[#GetStrengthEnableSetting ( self )|GetStrengthEnableSetting]]
===SetStrengthValue===
+
 
<syntaxhighlight lang="Python">
+
==== Returns ====
RLPy.RVisemeSmoothOption.SetStrengthValue ( self, fJaw, fLips, fTongue )
+
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>
Set the strength for each part of a mouth.
 
====Parameters====
 
<div style="margin-left: 2em;">
 
'''fJaw''' [IN] the strength value of jaw, the range is from 0.0 to 1.0 - float
 
  
'''fLips''' [IN] the strength value of lips, the range is from 0.0 to 1.0 - float
+
=== GetSmoothValueSetting ( self ) ===
  
'''fTongue''' [IN] the strength value of tongue, the range is from 0.0 to 1.0 - float
+
Get all the viseme smoothing values for the mouth parts.
</div>
+
 
 +
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>

Revision as of 22:55, 20 April 2020

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

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