]> git.rm.cloudns.org Git - xonotic/mediasource.git/commitdiff
Add Blender script to remove all Xonotic player animation actions to be executed...
authorLegendaryGuard <rootuser999@gmail.com>
Tue, 6 Dec 2022 23:08:16 +0000 (00:08 +0100)
committerLegendaryGuard <rootuser999@gmail.com>
Tue, 6 Dec 2022 23:08:16 +0000 (00:08 +0100)
models/player/blender_scripts/xon_player_model_action_remover.py [new file with mode: 0644]

diff --git a/models/player/blender_scripts/xon_player_model_action_remover.py b/models/player/blender_scripts/xon_player_model_action_remover.py
new file mode 100644 (file)
index 0000000..21e162a
--- /dev/null
@@ -0,0 +1,20 @@
+# script by LegendGuard
+# used in Blender 2.79b
+# wipes all animation actions (made for Xonotic player models)
+import bpy
+
+# note: when executed, ignore warnings
+# these tell some of these actions weren't found, but it's ok, no problem, works and ends at the last line
+
+def removeAction(name):
+    try:
+        bpy.data.actions.remove(bpy.data.actions[name])
+    except:
+        print(f"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"]
+
+for i in range(len(nameActions)):
+    removeAction(nameActions[i])
+
+print("ALL XONOTIC PLAYER ANIMATION ACTIONS REMOVED!")
\ No newline at end of file