summaryrefslogtreecommitdiffstats
path: root/Scripts/libunity.py
diff options
context:
space:
mode:
Diffstat (limited to 'Scripts/libunity.py')
-rw-r--r--Scripts/libunity.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Scripts/libunity.py b/Scripts/libunity.py
index 9168057..cd8174d 100644
--- a/Scripts/libunity.py
+++ b/Scripts/libunity.py
@@ -598,7 +598,7 @@ class UnityAnimator():
ctrl = param.addChildMapping('m_Controller')
ctrl.mapping['fileID'] = anim.anchor
- def addLayer(self, layer_name, add_to_head = False) -> UnityDocument:
+ def addLayer(self, layer_name, add_to_head = False, weight: float = 1.0) -> UnityDocument:
# Add layer to controller
anim = self.peekNodeOfClass('91')
layers = anim.mapping['AnimatorController'].mapping['m_AnimatorLayers']
@@ -612,7 +612,7 @@ class UnityAnimator():
layer.addChildSequence('m_Behaviours')
layer.mapping['m_BlendingMode'] = '0'
layer.mapping['m_SyncedLayerIndex'] = '-1'
- layer.mapping['m_DefaultWeight'] = '1'
+ layer.mapping['m_DefaultWeight'] = str(weight)
layer.mapping['m_IKPass'] = '0'
layer.mapping['m_SyncedLayerAffectsTiming'] = '0'
layer.addChildMapping('m_Controller').mapping['fileID'] = anim.anchor