Esempio n. 1
0
__author__ = "soopercool101"
__version__ = "1.0.0"

from BrawlCrate.API import BrawlAPI
from System.IO import Path

BrawlAPI.OpenTemplate(
    Path.Combine(BrawlAPI.PluginPath, "Project M 3.6 Stage Templates",
                 "STGVILLAGE_nv.pac"))
__author__ = "BillyNoodles"
__version__ = "2.0.0"

from BrawlCrate.API import BrawlAPI
from System.IO import Path
from System.IO import Directory

preset_name = "MKW Boost"
preset_path = Path.Combine(BrawlAPI.PluginPath, "MKWii Animations",
                           preset_name)

if BrawlAPI.ShowYesNoWarning("Are you sure you want to delete this preset?",
                             "Delete Preset"):
    Directory.Delete(preset_path, True)
    BrawlAPI.RootNode._mainForm.reloadPluginsToolStripMenuItem_Click(
        None, None)
Esempio n. 3
0
__author__ = "soopercool101"
__version__ = "1.0.0"

from BrawlCrate.API import BrawlAPI
from System.IO import Path

BrawlAPI.OpenTemplate(Path.Combine(BrawlAPI.PluginPath, "Project M 3.6 Stage Templates", "STGGREENHILL.pac"))
Esempio n. 4
0
from BrawlCrate.NodeWrappers import *


def tex_search():  # Function to scan for all image nodes in the file
    wrappers = BrawlAPI.NodeWrapperList  # Get the wrapper of every node in the file (export filters are contained in wrappers)
    tex_list = []
    for wrapper in wrappers:
        if ".png" in wrapper.ExportFilter:  # If the node is exportable to png, add it to the list
            tex_list += [wrapper.Resource]
    return tex_list


# Main function
if BrawlAPI.RootNode != None:  # If there is a valid open file
    root = BrawlAPI.RootNode
    folder = BrawlAPI.OpenFolderDialog()
    if folder:
        count = 0  # Set the count
        for item in tex_search():  # Gather the texture list to export
            item.Export(
                folder + "/" + item.Name + ".png"
            )  # We already know everything in this list is exportable to a .png
            count += 1  # Increment the count
        if count:  # If any textures are found, show the user a success message
            BrawlAPI.ShowMessage(
                str(count) + " textures were successfully exported to " +
                folder, "Success")
        else:  # If no textures are found, show an error message
            BrawlAPI.ShowError('No textures were found in the open file',
                               'Error')
else:  # Show an error message if there is no valid file open
__author__ = "soopercool101"
__version__ = "1.0.0"

from BrawlCrate.API import BrawlAPI
from System.IO import Path

BrawlAPI.OpenTemplate(Path.Combine(BrawlAPI.PluginPath, "Project M 3.6 Stage Templates", "STGDOLPIC.pac"))
from BrawlCrate.API import BrawlAPI
from BrawlLib.SSBB.ResourceNodes import *
from System.IO import Directory

not_found = []


def replace_node(node, folder_path):
    new_node_path = Directory.GetFiles(folder_path, node.Name + ".*")
    if new_node_path:
        node.Replace(new_node_path[0])
    else:
        not_found.append(node.Name)


if BrawlAPI.RootNode != None:
    children = BrawlAPI.RootNode.GetChildrenRecursive()
    models = filter(lambda c: isinstance(c, MDL0Node), children)
    folder_path = BrawlAPI.OpenFolderDialog("Open materials/shaders folder")
    for model in models:
        for shader in model.ShaderList:
            replace_node(shader, folder_path)
        for mat in model.MaterialList:
            replace_node(mat, folder_path)
        model.Rebuild(True)  # force rebuild because brawlcrate is shit
    if not_found:
        BrawlAPI.ShowMessage("File not found for: " + ", ".join(not_found), "")
                    texture.Export(Path.Combine(path, texture.Name + ".tex0"))

                # export animation
                for srt in BrawlAPI.NodeListOfType[SRT0Node]():
                    for srt_subnode in srt.Children:
                        if srt_subnode.Name == material.Name:
                            srt.Export(Path.Combine(path, srt.Name + ".srt0"))
                            break
                
                # only once
                break

if BrawlAPI.RootNode != None:

    # prompt for preset name
    preset = BrawlAPI.UserStringInput("New Preset Name", "")
    if preset != None:

        # check if preset already exists
        path = Path.Combine(BrawlAPI.PluginPath, "MKWii Animations", preset)
        if not Directory.Exists(path):

            # prompt for target material
            target = BrawlAPI.UserStringInput("Target Material", "")
            if target != None:

                textures = []
                export_animations()

                # edit and include import and delete script to preset folder
                import_script = File.ReadAllText(Path.Combine(BrawlAPI.PluginPath, "MKWii Animations", "Import Preset.txt"))
from BrawlCrate.API import BrawlAPI
from BrawlLib.SSBB.ResourceNodes import *
from System.IO import Path


def export_node(node, folder_path):
    node.Export(Path.Combine(folder_path, node.Name))


if BrawlAPI.RootNode != None:
    children = BrawlAPI.RootNode.GetChildrenRecursive()
    models = filter(lambda c: isinstance(c, MDL0Node), children)
    folder_path = BrawlAPI.OpenFolderDialog("Open materials/shaders folder")
    for model in models:
        for shader in model.ShaderList:
            export_node(shader, folder_path)
        for mat in model.MaterialList:
            export_node(mat, folder_path)
Esempio n. 9
0
__author__ = "soopercool101"
__version__ = "1.0.0"

from BrawlCrate.API import BrawlAPI
from System.IO import Path

BrawlAPI.OpenTemplate(
    Path.Combine(BrawlAPI.PluginPath, "Project M 3.6 Stage Templates",
                 "STGBATTLEFIELD.pac"))