-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clear Keyframes script now supports clearing all for a CHR0
- Loading branch information
1 parent
706f6a3
commit 14d4651
Showing
1 changed file
with
35 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,48 @@ | ||
from BrawlCrate.API import * | ||
from BrawlCrate.NodeWrappers import CHR0EntryWrapper | ||
from BrawlCrate.API import * | ||
from BrawlCrate.NodeWrappers import CHR0Wrapper, 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) | ||
if isinstance(BrawlAPI.SelectedNode, CHR0Node): | ||
for node in BrawlAPI.SelectedNode.Children: | ||
clear_node_translation(node) | ||
else: | ||
clear_node_translation(BrawlAPI.SelectedNode) | ||
BrawlAPI.RefreshPreview() | ||
|
||
def clear_node_translation(node): | ||
for x in range(0, node.FrameCount): | ||
node.RemoveKeyframeOnlyTrans(x) | ||
|
||
def clear_scale(sender, event_args): | ||
for x in range(0, BrawlAPI.SelectedNode.FrameCount): | ||
BrawlAPI.SelectedNode.RemoveKeyframeOnlyScale(x) | ||
if isinstance(BrawlAPI.SelectedNode, CHR0Node): | ||
for node in BrawlAPI.SelectedNode.Children: | ||
clear_node_scale(node) | ||
else: | ||
clear_node_scale(BrawlAPI.SelectedNode) | ||
BrawlAPI.RefreshPreview() | ||
|
||
def clear_node_scale(node): | ||
for x in range(0, node.FrameCount): | ||
node.RemoveKeyframeOnlyScale(x) | ||
|
||
def clear_rotation(sender, event_args): | ||
for x in range(0, BrawlAPI.SelectedNode.FrameCount): | ||
BrawlAPI.SelectedNode.RemoveKeyframeOnlyRot(x) | ||
if isinstance(BrawlAPI.SelectedNode, CHR0Node): | ||
for node in BrawlAPI.SelectedNode.Children: | ||
clear_node_rotation(node) | ||
else: | ||
clear_node_rotation(BrawlAPI.SelectedNode) | ||
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)) | ||
def clear_node_rotation(node): | ||
for x in range(0, node.FrameCount): | ||
node.RemoveKeyframeOnlyRot(x) | ||
|
||
BrawlAPI.AddContextMenuItem(CHR0Wrapper, None, 'Clears translation keyframes for all entries', None, ToolStripMenuItem('Clear Translation', None, clear_translation)) | ||
BrawlAPI.AddContextMenuItem(CHR0Wrapper, None, 'Clears rotation keyframes for all entries', None, ToolStripMenuItem('Clear Rotation', None, clear_rotation)) | ||
BrawlAPI.AddContextMenuItem(CHR0Wrapper, None, 'Clears scale keyframes for all entries', None, ToolStripMenuItem('Clear Scale', None, clear_scale)) | ||
BrawlAPI.AddContextMenuItem(CHR0EntryWrapper, None, 'Clears translation keyframes', None, ToolStripMenuItem('Clear Translation', None, clear_translation)) | ||
BrawlAPI.AddContextMenuItem(CHR0EntryWrapper, None, 'Clears rotation keyframes', None, ToolStripMenuItem('Clear Rotation', None, clear_rotation)) | ||
BrawlAPI.AddContextMenuItem(CHR0EntryWrapper, None, 'Clears scale keyframes', None, ToolStripMenuItem('Clear Scale', None, clear_scale)) |