]> git.rm.cloudns.org Git - xonotic/mediasource.git/commitdiff
Fix print exception and refactor array variable in the action remover script
authorLegendaryGuard <rootuser999@gmail.com>
Wed, 7 Dec 2022 13:16:58 +0000 (14:16 +0100)
committerLegendaryGuard <rootuser999@gmail.com>
Wed, 7 Dec 2022 13:16:58 +0000 (14:16 +0100)
models/player/blender_scripts/xon_player_model_action_remover.py

index 21e162ae77e80b7c097e239bdbe3ca1d184a79c6..561cdbe23db2a76dcbee95587db153c89587ff6d 100644 (file)
@@ -10,11 +10,27 @@ def removeAction(name):
     try:
         bpy.data.actions.remove(bpy.data.actions[name])
     except:
-        print(f"WARNING: This action called <{name}> does not exist!")
+        print("WARNING: This action called", name, "does not exist!")
 
-nameActions = ["backleft", "backright", "deadone", "deadtwo", "dieone", "dietwo", "draw", "duck", "duckbackwardleft", "duckbackwardright", "duckwalkforwardleft", "duckforwardleft", "duckforwardright", "duckidle", "duckjump", "duckstrafeleft", "duckstraferight", "duckwalk", "duckwalkbackwards", "fly", "forwardleft", "forwardright", "idle", "jump", "melee", "painone", "paintwo", "run", "runbackwards", "shoot", "strafeleft", "straferight", "taunt"]
+actionNames = [
+    "backleft", "backright", 
+    "deadone", "deadtwo", 
+    "dieone", "dietwo", 
+    "draw", 
+    "duck", "duckbackwardleft", "duckbackwardright", "duckwalkforwardleft", "duckforwardleft", "duckforwardright", "duckidle", "duckjump", "duckstrafeleft", "duckstraferight", "duckwalk", "duckwalkbackwards", 
+    "fly", 
+    "forwardleft", "forwardright", 
+    "idle", 
+    "jump", 
+    "melee", 
+    "painone", "paintwo", 
+    "run", "runbackwards", 
+    "shoot", 
+    "strafeleft", "straferight", 
+    "taunt"
+]
 
-for i in range(len(nameActions)):
-    removeAction(nameActions[i])
+for i in range(len(actionNames)):
+    removeAction(actionNames[i])
 
 print("ALL XONOTIC PLAYER ANIMATION ACTIONS REMOVED!")
\ No newline at end of file