Skip to content

Commit

Permalink
Add Clear Keyframes script
Browse files Browse the repository at this point in the history
  • Loading branch information
soopercool101 committed Jul 30, 2020
1 parent 4201853 commit 0ba55e8
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Loaders/Utility/Clear Keyframes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from BrawlCrate.API import *
from BrawlCrate.NodeWrappers import CHR0EntryWrapper
from BrawlLib.SSBB.ResourceNodes import *
from BrawlLib.Wii.Animations import *
from System.Windows.Forms import ToolStripMenuItem

def clear_translation(sender, event_args):
for x in range(0, BrawlAPI.SelectedNode.FrameCount):
BrawlAPI.SelectedNode.RemoveKeyframeOnlyTrans(x)
BrawlAPI.RefreshPreview()

def clear_scale(sender, event_args):
for x in range(0, BrawlAPI.SelectedNode.FrameCount):
BrawlAPI.SelectedNode.RemoveKeyframeOnlyScale(x)
BrawlAPI.RefreshPreview()

def clear_rotation(sender, event_args):
for x in range(0, BrawlAPI.SelectedNode.FrameCount):
BrawlAPI.SelectedNode.RemoveKeyframeOnlyRot(x)
BrawlAPI.RefreshPreview()

BrawlAPI.AddContextMenuItem(CHR0EntryWrapper, None, 'Clears Translation', None, ToolStripMenuItem('Clear Translation', None, clear_translation))
BrawlAPI.AddContextMenuItem(CHR0EntryWrapper, None, 'Clears Rotation', None, ToolStripMenuItem('Clear Rotation', None, clear_rotation))
BrawlAPI.AddContextMenuItem(CHR0EntryWrapper, None, 'Clears Scale', None, ToolStripMenuItem('Clear Scale', None, clear_scale))

0 comments on commit 0ba55e8

Please sign in to comment.