diff options
| author | yum <yum.food.vr@gmail.com> | 2022-11-25 14:19:50 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2022-11-25 14:37:20 -0800 |
| commit | bf213509f7811e096b9d850999aaf54d18324eec (patch) | |
| tree | 05ecc0292900fe093a61043a6f34f061eed42e60 /libunity.py | |
| parent | a9e22d486432295c0185d317f5064cd1bc9c1738 (diff) | |
Add scaling capability
Text box may be scaled up and down now.
Diffstat (limited to 'libunity.py')
| -rw-r--r-- | libunity.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libunity.py b/libunity.py index 9380a6c..94e5ef2 100644 --- a/libunity.py +++ b/libunity.py @@ -674,7 +674,9 @@ class UnityAnimator(): # between anim_lo and anim_hi. Also creates the corresponding animation # state. def addAnimatorBlendTree(self, layer, state_name, param_name, - anim_guid_lo, anim_guid_hi, dx = 0, dy = 0) -> UnityDocument: + anim_guid_lo, anim_guid_hi, dx = 0, dy = 0, + lo_threshold = -1.0, hi_threshold = 1.0, + is_default_state = False) -> UnityDocument: # Create the blend tree. parser = UnityParser() parser.parse(BLEND_TREE_TEMPLATE) @@ -690,9 +692,11 @@ class UnityAnimator(): # Low animation tree.mapping['m_Childs'].sequence[0].mapping['m_Motion'].mapping['guid'] = anim_guid_lo tree.mapping['m_Childs'].sequence[0].mapping['m_DirectBlendParameter'] = param_name + tree.mapping['m_Childs'].sequence[0].mapping['m_Threshold'] = str(lo_threshold) # High animation tree.mapping['m_Childs'].sequence[1].mapping['m_Motion'].mapping['guid'] = anim_guid_hi tree.mapping['m_Childs'].sequence[1].mapping['m_DirectBlendParameter'] = param_name + tree.mapping['m_Childs'].sequence[1].mapping['m_Threshold'] = str(hi_threshold) tree.mapping['m_BlendParameter'] = param_name tree.mapping['m_BlendParameterY'] = param_name @@ -700,7 +704,7 @@ class UnityAnimator(): self.nodes.append(node) # Create the corresponding animation state. - anim_state = self.addAnimatorState(layer, state_name, False, dx = dx, dy = + anim_state = self.addAnimatorState(layer, state_name, is_default_state, dx = dx, dy = dy) anim_state.mapping['AnimatorState'].mapping['m_Motion'].mapping['fileID'] = node.anchor |
