Git Product home page Git Product logo

abmatt's Introduction

ANoobs Brres Material Tool (ABMatt)

This tool is used to convert and edit Brres files in Mario Kart Wii.

Installation

Compiled releases are available for Linux and Windows.

Or, install as python package:

pip install git+https://github.com/Robert-N7/abmatt.git

Dependencies

ABMatt uses Wiimm's Image Tool which must be installed on your system path.

Modes

ABMatt has Gui and command-line capabilities.

  • The Gui interface provides easy drag and drop interfacing.
  • Text-based commands can be issued from the command line, interactive shell, or from file.

Converting Capabilities

ABMatt supports converting to and from:

  • Wavefront OBJ
  • Collada DAE

When replacing an existing model, materials with matching names will take on the properties of the previous material.

GUI Features

Materials can be dragged to replace existing materials. The material is copied and pasted, which includes shader and animation data. Main Window

Command Line Usage

ABMatt supports a command line (see FileFormat) followed by options.

abmatt [command_line][flags]
Flag Expanded Description
-a --auto-fix Set the autofix level (0 to turn off fixes).
-b --brres Brres file selection.
-d --destination The file path to be written to. Multiple destinations are not supported.
-f --file File with ABMatt commands to be processed as specified in file format.
-h --help Displays a help message about program usage.
-i --interactive Interactive shell mode.
-l --loudness Sets the verbosity level. (0-5)
-o --overwrite Overwrite existing files.
--moonview Treat the Brres as Moonview course, adjusting material names.

Command Line Examples

This command would open course_model.brres in overwrite mode and run the commands stored in my_commands.txt

abmatt -b course_model.brres -o -f my_commands.txt

This next command would enable xlu for all materials starting with the prefix xlu.

abmatt -b course_model.brres -o -n xlu.* -k xlu -v true

Examples

Example command_line:

convert course_model.obj                    # Converts obj to brres 
set xlu:true for xlu.* in model course      # Sets all materials in course starting with xlu to transparent
set scale:(1,1) for *                       # Sets the scale for all layers to 1,1
info layer:ef_arrowGradS                    # Prints information about the layer 'ef_arrowGradS'
add tex0:ef_arrowGradS.png format:ia8       # Adds the image 'ef_arrowGradS.png' as a tex0 in ia8 format

Copy/Paste

  • Group copying matches selected items on their names.
  • Single copying pastes over all selected without matching names.
  • Names are not changed when pasting.
  • Copying a material will copy all settings related to the material, including layers, shaders, and animations.

An example of pasting material data using a wildcard:

copy material for * in course_model.brres
paste material for * in new_model.brres

An example of pasting a single material:

copy material for ef_dushBoard in course_model.brres
paste material for my_ramp in my_course.brres

File Format

ABMatt supports reading in commands from files or in interactive mode which have a specified extended BNF format. Parameters are delimited by spaces except where a ':' or ',' is specified. Case is insensitive for commands, keys, and values.

line = begin_preset | command_line;
begin_preset = '[' <preset_name> ']' EOL; 

command_line =  cmd-prefix ['for' selection] EOL;
cmd-prefix = set | info | add | remove | select | preset | save | copy | paste | convert | load;
set   = 'set' type setting;
info  = 'info' type [key | 'keys'];
add   = 'add' type;
remove = 'remove' type;
select = 'select' selection;
preset = 'preset' preset_name;
save = 'save' [filename] ['as' destination] ['overwrite']
copy = 'copy' type;
paste = 'paste' type;
convert = 'convert' filename ['to' destination] ['include' poly-list] ['exclude' poly-list] [convert-flags]
load = 'load' command-file

convert-flags = ['patch'] ['no-colors'] ['no-normals'] ['single-bone'] ['no-uvs']
poly-list = [polygon-name[,polygon-name]*]
selection = name ['in' container]
container = ['brres' filename] ['model' name];
type = 'material' | 'layer' [':' id] | 'shader' | 'stage' [':' id]
    | 'srt0' | 'srt0layer' [':' id] | 'pat0'
    | 'mdl0' [':' id] | 'tex0' [':' id] | 'brres';

setting =  key ':' value; NOTE: No spaces allowed in key:value pairs
key = material-key | layer-key | shader-key | stage-key
    | srt0-key | srt0-layer-key | pat0-key | tex0-key; 
value = material-value | layer-value | shader-value | stage-value
    |  srt0-value | srt0-layer-value | pat0-value | tex0-value; 

Selection Explanation

In the selection process,

  • Selection narrows the search to the file(s) and model(s) if specified.
  • Next, the <name> parameter matches against material names using direct and regex matching creating the current selection.
  • Commands operate on the selection until specifying a new selection.

Material Keys

material-key = 'layercount' | 'xlu' | 'ref0' | 'ref1' |
 'comp0' | 'comp1' | 'comparebeforetexture' | 'blend' |
 'blendsrc' | 'blendlogic' | 'blenddest' | 'constantalpha' |
 'cullmode' | 'shadercolor' | 'lightchannel' |
 'lightset' | 'fogset' | 'matrixmode' | 'enabledepthtest' |
 'enabledepthupdate' | 'depthfunction' | 'drawpriority';

blend-factor  = 'zero' | 'one' | 'sourcecolor' | 'inversesourcecolor'
    | 'sourcealpha' | 'inversesourcealpha' | 'destinationalpha' | 'inversedestinationalpha';
blend-logic   = 'clear' | 'and' | 'reverseand' | 'copy' | 'inverseand' | 'nooperation' | 'exclusiveor' 
    | 'or' | 'notor' | 'equivalent' | 'inverse' | 'reverseor' | 'inversecopy' | 'inverseor' | 'notand' | 'set';
cull-mode     = 'all' | 'inside' | 'outside' | 'none';
const-alpha   = 'enable' | 'disable' | number;
matrix-mode   = 'maya' | 'xsi' | '3dsmax';
comparison    = 'never' | 'less' | 'equal' | 'lessorequal' |  
    'greater' | 'notequal' | 'greaterorequal' | 'always';
shader-color = ['constant'] n ':' color;
light-channel = lc-flag | lc-color | lc-control;
lc-flag = ('material' | 'ambient' | 'raster')('color' | 'alpha') 'enable:' ('true' | 'false');
lc-color = ('material' | 'ambient') ['color'] ':' color;
lc-control = ('color' | 'alpha') 'control' 
    ('material' | 'ambient' | 'enable' | 'attenuation' | 'diffuse') ':' value
color = red ',' green ',' blue ',' alpha

Layer Keys

layer-key = 'scale' | 'rotation' | 'translation' | 'scn0cameraref' |
  'scn0lightref' | 'mapmode' | 'uwrap' | 'vwrap' |    
  'minfilter' | 'magfilter' | 'lodbias' | 'anisotrophy' |
  'clampbias' | 'texelinterpolate' | 'projection' | 'inputform' |
  'type' | 'coordinates' | 'embosssource' | 'embosslight' |
  'normalize' | 'indirectmatrix';

wrap-mode     = 'clamp' | 'repeat' | 'mirror';
minFilter     = 'nearest' | 'linear' | 'nearest_mipmap_nearest' |
'linear_mipmap_nearest' | 'nearest_mipmap_linear' | 'linear_mipmap_linear';
map-mode      = 'texcoord' | 'envcamera' | 'projection' | 'envlight'  
| 'envspec';
projection    = 'st' | 'stq';
inputform     = 'ab11' | 'abc1';
type          = 'regular' | 'embossmap' | 'color0' | 'color1';
coordinates   = 'geometry' | 'normals' | 'colors' | 'binfileormalst' |    
'binfileormalsb' | 'texcoord0' | 'texcoord1' | 'texcoord2' | 'texcoord3'  | 'texcoord4' | 'texcoord5' | 'texcoord6' | 'texcoord7';

Shader Keys

shader-key = 'stagecount' | 'indirectmap' [<n>] | 'indirectcoord' [<n>] | 'indirectmap' [<n>];

Stage Keys

stage-key = 'enabled' | 'mapid' | 'coordinateid' | 'textureswapselection' |
   'rastercolor' | 'rasterswapselection' | 'colorconstantselection' |
   'colora' | 'colorb' | 'colorc' | 'colord' | 'colorbias' |
   'coloroperation' | 'colorclamp' | 'colorscale' | 'colordestination' |
   'alphaconstantselection' | 'alphaa' | 'alphab' | 'alphac' | 'alphad' |
   'alphabias' | 'alphaoperation' | 'alphaclamp' | 'alphascale' | 'alphadestination' | 
   'indirectstage' | 'indirectformat' | 'indirectalpha' | 'indirectbias' | 
   'indirectmatrixselection' | 'indirectswrap' | 'indirecttwrap' | 'indirectuseprevstage' | 'indirectunmodifiedlod';

RASTER_COLORS = 'lightchannel0' | 'lightchannel1' | 'bumpalpha' | 'normalizedbumpalpha' | 'zero';
COLOR_CONSTANTS = '1_1' | '7_8' | '3_4' | '5_8' | '1_2' | '3_8' | '1_4' | '1_8' |
                   'color0_rgb' | 'color1_rgb' | 'color2_rgb' | 'color3_rgb' |
                   'color0_rrr' | 'color1_rrr' | 'color2_rrr' | 'color3_rrr' |
                   'color0_ggg' | 'color1_ggg' | 'color2_ggg' | 'color3_ggg' |
                   'color0_bbb' | 'color1_bbb' | 'color2_bbb' | 'color3_bbb' |
                   'color0_aaa' | 'color1_aaa' | 'color2_aaa' | 'color3_aaa';
COLOR_SELS = 'outputcolor' | 'outputalpha' | 'color0' | 'alpha0' | 'color1' |
              'alpha1' | 'color2' | 'alpha2' | 'texturecolor' | 'texturealpha' |
              'rastercolor' | 'rasteralpha' | 'one' | 'half' |
              'colorselection' | 'zero';
BIAS = 'zero' | 'addhalf' | 'subhalf';
OPER = 'add' | 'subtract';
SCALE = 'multiplyby1' | 'multiplyby2' | 'multiplyby4' | 'divideby2' | number;
COLOR_DEST = 'outputcolor' | 'color0' | 'color1' | 'color2';

ALPHA_CONSTANTS = '1_1' | '7_8' | '3_4' | '5_8' | '1_2' | '3_8' | '1_4' | '1_8' |
                   'color0_red' | 'color1_red' | 'color2_red' | 'color3_red' |
                   'color0_green' | 'color1_green' | 'color2_green' | 'color3_green' |
                   'color0_blue' | 'color1_blue' | 'color2_blue' | 'color3_blue' |
                   'color0_alpha' | 'color1_alpha' | 'color2_alpha' | 'color3_alpha';
ALPHA_SELS = 'outputalpha' | 'alpha0' | 'alpha1' | 'alpha2' | 'texturealpha' |
              'rasteralpha' | 'alphaselection' | 'zero';
ALPHA_DEST = 'outputalpha' | 'alpha0' | 'alpha1' | 'alpha2';

TEX_FORMAT = 'f_8_bit_offsets' | 'f_5_bit_offsets' | 'f_4_bit_offsets' | 'f_3_bit_offsets';
IND_BIAS = 'none' | 's' | 't' | 'st' | 'u' | 'su' | 'tu' | 'stu';
IND_ALPHA = 'off' | 's' | 't' | 'u';
IND_MATRIX = 'nomatrix' | 'matrix0' | 'matrix1' | 'matrix2' | 'matrixs0' |
              'matrixs1' | 'matrixs2' | 'matrixt0' | 'matrixt1' | 'matrixt2';
WRAP = 'nowrap' | 'wrap256' | 'wrap128' | 'wrap64' | 'wrap16' | 'wrap0'; 

SRT0 Keys

srt0-keys = 'framecount' | 'loop' | 'layerenable'
srt0-layer-enable = id ':' ('true' | 'false') 

SRT0 Layer Keys

srt0-layer-keys = 'xscale' | 'yscale' | 'rot' | 'xtranslation' | 'ytranslation';
srt0-layer-values = 'disabled' | key-frame-list;
key-frame-list = key-frame-index ':' value {',' key-frame ':' value};

PAT0 Keys

pat0-keys = 'framecount' | 'loop' | 'keyframe';
pat0-keyframe = key-frame-list;

TEX0 Keys

tex0-keys = 'dimensions' | 'format' | 'mipmamcount' | 'name';
tex0-dimension = width ',' height;
tex0-format = 'cmpr' | 'c14x2' | 'c8' | 'c4' | 'rgba32' | 'rgb5a3' | 'rgb565' 
            | 'ia8' | 'ia4' | 'i8' | 'i4';

Convert Examples

Convert course_model.brres to a Dae file

convert course_model.brres to course_model.dae

Convert course_model.dae to a Brres file, excluding polygons road and boost, and renaming materials to satisfy Moonview Highway conditions:

convert course_model.dae to course_model.brres exclude road,boost --moonview

Convert course_model.dae patching over only the road and boost polygons while keeping the existing model intact.

convert course_model.dae to course_model.brres include road,boost --patch

Presets and Command Files

Presets are a way of grouping commands together. They can be defined in presets.txt or in command files. Presets begin with [<preset_name>] and include all commands until another preset is encountered or end of file. An empty preset [] can be used to stop preset parsing (and begin command parsing).

[my_preset]
set material xlu:True
set layer scale:(1,1)
set layer mapmode:linear_mipmap_linear

To call the preset: preset my_preset for my_material_name

The load command can be used to load additional commands and presets. As with all recursive things, be careful not to create an infinite loop!

Additional Configuration

An example configuration

Contributing

Contributions are welcome! Feel free to submit a pull request.

Known Limitations and Bugs

  • Windows installer sometimes hangs in the background until the process is terminated.
  • Non-standard files in Brres are not supported.

abmatt's People

Contributors

heath123 avatar mardy avatar robert-n7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

abmatt's Issues

AttributeError: 'str' object has no attribute 'Material'

Traceback (most recent call last):
  File "/home/heath/Downloads/abmatt/abmatt/__main__.py", line 29, in <module>
    main()
  File "/home/heath/Downloads/abmatt/abmatt/__main__.py", line 22, in main
    files = load_config.parse_args(argv, base_path)
  File "/home/heath/Downloads/abmatt/abmatt/load_config.py", line 358, in parse_args
    if not Command.run_commands(cmds):
  File "/home/heath/Downloads/abmatt/abmatt/command.py", line 705, in run_commands
    cmd.run_cmd()
  File "/home/heath/Downloads/abmatt/abmatt/command.py", line 769, in run_cmd
    return self.run_convert()
  File "/home/heath/Downloads/abmatt/abmatt/command.py", line 837, in run_convert
    mdl = converter.load_model(model)
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_dae.py", line 43, in load_model
    self._before_encoding()
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_lib.py", line 123, in _before_encoding
    self.encode_materials()
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_dae.py", line 57, in encode_materials
    self._encode_material(material.Material(material))
AttributeError: 'str' object has no attribute 'Material'

model.zip

ValueError: Unsupported draw cmd 0

When converting the Halogen Highway BRRES file (the Discord download) to DAE:

Exporting to /home/heath/mk-plugin/halogen-dae/course.dae...
Traceback (most recent call last):
  File "/home/heath/Downloads/abmatt/abmatt/gui/converter.py", line 68, in run
    self.item.convert()
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_lib.py", line 199, in convert
    self.save_model()
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_dae.py", line 52, in save_model
    mesh.add_node(self.__decode_geometry(polygon))
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_dae.py", line 77, in __decode_geometry
    geo = decode_polygon(polygon, self.influences)
  File "/home/heath/Downloads/abmatt/abmatt/converters/geometry.py", line 417, in decode_polygon
    face_point_indices, weights = decode_indices(polygon, polygon.encode_str)
  File "/home/heath/Downloads/abmatt/abmatt/converters/geometry.py", line 355, in decode_indices
    raise ValueError('Unsupported draw cmd {}'.format(cmd))
ValueError: Unsupported draw cmd 0

KeyError: 'beginner_course'

Using the same file as in #25, I get this:

Converting /home/heath/luigi/dae/edit/course.dae... 
Traceback (most recent call last):
  File "/home/heath/Downloads/abmatt/abmatt/gui/converter.py", line 67, in run
    self.item.convert()
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_lib.py", line 195, in convert
    self.load_model()
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_dae.py", line 33, in load_model
    self.__parse_controllers(material_geometry_map)
KeyError: 'beginner_course'

ValueError: cannot reshape array of size 15264 into shape (3,5)

File (not including textures)

Converting /home/heath/luigi/dae/edit/course.dae... 
Traceback (most recent call last):
  File "/home/heath/Downloads/abmatt/abmatt/gui/converter.py", line 67, in run
    self.item.convert()
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_lib.py", line 203, in convert
    self.load_model()
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_dae.py", line 32, in load_model
    self.__parse_nodes(dae.get_scene(), material_geometry_map, matrix)
ValueError: cannot reshape array of size 15264 into shape (3,5)

Black screen when using CLI?

Doing abmatt "convert [DAE FILE HERE]" -d course_model.brres --overwrite seems to result in a black screen and

image

but the GUI works

Textures not URL decoded?

WARN: Failed to find image smk%20(copy).png
The image is called smk (copy).png so it seems like it needs to URL decode?

OSError: [Errno 38] Function not implemented

On Linux (Ubuntu 20.04):

Exporting to /run/user/1000/doc/6662a94c/luigi.dae...
Traceback (most recent call last):
  File "/home/heath/Downloads/abmatt/abmatt/gui/converter.py", line 67, in run
    self.item.convert()
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_lib.py", line 199, in convert
    self.save_model()
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_dae.py", line 53, in save_model
    self._end_saving(mesh)
OSError: [Errno 38] Function not implemented: 'luigi_maps'

luigi changes to whatever filename you saved as. I'll try to investigate to see what causes this

Textures broken?

This model looks like this in Blender:
image
but like this in-game (using Free Look for a clearer view):
image
It changes as you get closer/further away so it might be to do with mipmaps or something

Poligon view is empty

Hi Robert!
I opened Luigi from New Super Mario Bros. abmatt can load the model and export the polygons as Collada, with all textures and armatures. However, if in the GUI I right-click on the polygon and choose "View", the 3D window that opens shows only the floor grid, and no model. Is it a feature not yet implemented, or could it be because of some incompatibilities with the brres format from NSMB?

Feature Request: Shader Export

Can you make a feature where you can export the shader to blender and/or make a plugin where you can Import the shader to blender?

AttributeError: 'InfluenceCollection' object has no attribute 'combine'

Converting /home/heath/luigi/dae2/edit/course.dae... 
Traceback (most recent call last):
  File "/home/heath/Downloads/abmatt/abmatt/gui/converter.py", line 68, in run
    self.item.convert()
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_lib.py", line 197, in convert
    self.load_model()
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_dae.py", line 35, in load_model
    self.__parse_controllers(material_geometry_map)
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_dae.py", line 105, in __parse_controllers
    self.__parse_controller(controller, matrix, material_geometry_map)
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_dae.py", line 109, in __parse_controller
    self.__add_geometry(geometry, material_geometry_map)
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_dae.py", line 137, in __add_geometry
    if not geo[0].combine(geometry):
  File "/home/heath/Downloads/abmatt/abmatt/converters/geometry.py", line 49, in combine
    self.influences.combine(geometry.influences)
AttributeError: 'InfluenceCollection' object has no attribute 'combine'

Only one material in an object shows

When importing this model (this is different to the one in #43 as there I split by material):
model.zip
it should show up as:
image
But in a BRRES viewer and in game it shows as:
image
(the dog texture is missing)

SIGSEGV (Address boundary error)

When replacing a model, I get SIGSEGV (Address boundary error)
I'm on Linux, and as the latest releases have no Linux version I'm doing PYTHONPATH=./ python3 ./abmatt/gui/main_window.py from the command line in the git repo
Steps to reproduce:

  1. Open the course_model.brres file of Luigi Circuit
  2. Expand it, right-click on course and select Replace, and open the linked DAE file

DAE file and textures: https://drive.google.com/file/d/1fPR8lll5iK-dEPh6m27LuG9NGL2Gxm-O/view?usp=sharing
This doesn't happen with the same model as an OBJ but the file is still unusable due to #28

Model looks wrong after being reimported

After exporting a DAE file from Luigi Circuit and reimporting it to the same file using the Replace function, it looks like this:
image
As far I can tell everything is partially transparent so the sky shows through
Also shadows look too dark

Documentation / tutorial

Hi Robert, I just found your project yesterday and it's fantastic! It's an impressive work, and I'm especially glad that you made both a GUI and a CLI version :-)

I'm not new to programming, but I'm definitely new to modding, so I might be asking some silly questions here. :-) But I think that in any case it would be nice to have some documentation or a short tutorial to cover this questions:

  1. The readme says that this tool is for Mario Kart. Yet I tried to open Luigi from the New Super Mario Bros game, and it seems to load well (I also exported one polygon as Collada and could see it in Blender, with textures and armature). If this tool is indeed a generic tool for brres, maybe we could add a link to https://wiki.vg-resource.com/BRRES in the readme, since in that page there's a list of games using the format?
  2. It not clear to me what are the possible ways of modifing a model and reimporting it back into the game. Specifically:
    1. Can one export the model as Collada and then edit it in blender, then re-export as Collada and import it back into abmatt, or will something get lost/broken in the process?
    2. If one only wants to modify a texture, what's the simplest way to do that?
    3. If one exports a model from a second game (which also uses brres) and renames the polygons and the armatures to match those of an existing model in the first game, is it reasonable to expect that one can replace a model from the first game using the model from the second game? Would be super cool to have a tutorial showing this.

AttributeError: 'NoneType' object has no attribute 'iter'

In this model, doing a replacement on the original Luigi Circuit BRRES:

Converting /home/heath/luigi/dae2/edit-basic/course.dae... 
Traceback (most recent call last):
  File "/home/heath/Downloads/abmatt/abmatt/__main__.py", line 35, in <module>
    main()
  File "/home/heath/Downloads/abmatt/abmatt/__main__.py", line 24, in main
    files = load_config.parse_args(argv, base_path)
  File "/home/heath/Downloads/abmatt/abmatt/load_config.py", line 291, in parse_args
    if not Command.run_commands(cmds):
  File "/home/heath/Downloads/abmatt/abmatt/command.py", line 690, in run_commands
    cmd.run_cmd()
  File "/home/heath/Downloads/abmatt/abmatt/command.py", line 750, in run_cmd
    return self.run_convert()
  File "/home/heath/Downloads/abmatt/abmatt/command.py", line 822, in run_convert
    mdl = converter.load_model(model)
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_dae.py", line 34, in load_model
    self.__parse_nodes(dae.get_scene(), material_geometry_map, matrix)
  File "/home/heath/Downloads/abmatt/abmatt/converters/dae.py", line 88, in get_scene
    node = self.decode_node(x)
  File "/home/heath/Downloads/abmatt/abmatt/converters/dae.py", line 140, in decode_node
    target = self.__get_bound_material(child)
  File "/home/heath/Downloads/abmatt/abmatt/converters/dae.py", line 659, in __get_bound_material
    bound_material = first(first(first(node, 'bind_material'), 'technique_common'), 'instance_material')
  File "/home/heath/Downloads/abmatt/abmatt/converters/dae.py", line 30, in first
    for x in element.iter(item):
AttributeError: 'NoneType' object has no attribute 'iter'

struct.error: 'H' format requires 0 <= number <= 65535

Converting /tmp/course.dae... 
Traceback (most recent call last):
  File "/home/heath/Downloads/abmatt/abmatt/__main__.py", line 29, in <module>
    main()
  File "/home/heath/Downloads/abmatt/abmatt/__main__.py", line 22, in main
    files = load_config.parse_args(argv, base_path)
  File "/home/heath/Downloads/abmatt/abmatt/load_config.py", line 358, in parse_args
    if not Command.run_commands(cmds):
  File "/home/heath/Downloads/abmatt/abmatt/command.py", line 705, in run_commands
    cmd.run_cmd()
  File "/home/heath/Downloads/abmatt/abmatt/command.py", line 769, in run_cmd
    return self.run_convert()
  File "/home/heath/Downloads/abmatt/abmatt/command.py", line 837, in run_convert
    mdl = converter.load_model(model)
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_dae.py", line 48, in load_model
    self.__encode_geometry(x)
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_dae.py", line 145, in __encode_geometry
    super()._encode_geometry(geometry)
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_lib.py", line 328, in _encode_geometry
    return geometry.encode(self.mdl0, encoder=encoder,
  File "/home/heath/Downloads/abmatt/abmatt/converters/geometry.py", line 118, in encode
    data, p.face_count, p.facepoint_count = self.__encode_tris(tris, p.has_weights())
  File "/home/heath/Downloads/abmatt/abmatt/converters/geometry.py", line 207, in __encode_tris
    tristrips, face_count, facepoint_count, tris = triset.get_tri_strips(fmt_str)
  File "/home/heath/Downloads/abmatt/abmatt/converters/triangle.py", line 128, in get_tri_strips
    face_point_count += encode_triangles(disconnected, fmt_str, tristrips)
  File "/home/heath/Downloads/abmatt/abmatt/converters/triangle.py", line 59, in encode_triangles
    byte_array.extend(pack('>BH', 0x90, face_point_len))
struct.error: 'H' format requires 0 <= number <= 65535

model.zip

Incorrect UV mapping of some polygons

I'm trying to convert the course model of snes mario circuit 3 to obj/dae but in both cases some textures seem to be stretched (and perhaps misaligned).
The command I use is abmatt convert course_model.brres to course.dae. course_model.brres being the brres file extracted from old_mario_sfc.szs.

Below are some examples comparing blender to what it is supposed to be (taken from noclip.website):

rmc3_2
rmc3_1

The red/white stripes blender seem be stretched.

rmc3_4
rmcs3_3

Here the posts are red instead of white and the finish line is also stretched.

Error "Failed to execute script main_window"

when launching the abmatt-gui.exe, a window pops up with the following error: "Failed to execute script main_window".
(maybe related to the fact i have a newer python version already installed and the tool didn't get updated for quite some time now?)

AttributeError: 'NoneType' object has no attribute 'split'

model.zip

Traceback (most recent call last):
  File "/home/heath/Downloads/abmatt/abmatt/__main__.py", line 35, in <module>
    main()
  File "/home/heath/Downloads/abmatt/abmatt/__main__.py", line 24, in main
    files = load_config.parse_args(argv, base_path)
  File "/home/heath/Downloads/abmatt/abmatt/load_config.py", line 291, in parse_args
    if not Command.run_commands(cmds):
  File "/home/heath/Downloads/abmatt/abmatt/command.py", line 690, in run_commands
    cmd.run_cmd()
  File "/home/heath/Downloads/abmatt/abmatt/command.py", line 750, in run_cmd
    return self.run_convert()
  File "/home/heath/Downloads/abmatt/abmatt/command.py", line 822, in run_convert
    mdl = converter.load_model(model)
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_dae.py", line 35, in load_model
    self.__parse_nodes(dae.get_scene(), material_geometry_map, matrix)
  File "/home/heath/Downloads/abmatt/abmatt/converters/dae.py", line 88, in get_scene
    node = self.decode_node(x)
  File "/home/heath/Downloads/abmatt/abmatt/converters/dae.py", line 147, in decode_node
    n = self.decode_node(child)
  File "/home/heath/Downloads/abmatt/abmatt/converters/dae.py", line 138, in decode_node
    node.controller = self.decode_controller(geom, self.__get_bound_material(child))
  File "/home/heath/Downloads/abmatt/abmatt/converters/dae.py", line 206, in decode_controller
    vertex_weight_indices = np.array([int(x) for x in first(vertex_weights, 'v').text.split()], int)
AttributeError: 'NoneType' object has no attribute 'split'

kart models

This software does work when converting mkwii maps to obj, but when converting the standard kart, which is the only one I have done so far, the mapping for the texture is not applied correctly. This seems to be happening for every standard kart model, and it might be the case for other karts with further testing. For example here is what mii_standard_kart_m.brres was once exported as obj: https://drive.google.com/drive/folders/1yZUt4Jr6IMZj88vIO96x3GX-cKbJ8ZFQ?usp=sharing

Now maybe I have to convert it to a different file format, or its something messed up on my end, but either way still wanted to report this.

TypeError: on_model_rename() takes 3 positional arguments but 4 were given

Traceback (most recent call last):
  File "/home/heath/Downloads/abmatt/abmatt/gui/brres_treeview.py", line 122, in rename
    node.rename(text)
  File "/home/heath/Downloads/abmatt/abmatt/brres/mdl0/mdl0.py", line 376, in rename
    self.parent.on_model_rename(self, old_name, name)
TypeError: on_model_rename() takes 3 positional arguments but 4 were given

AttributeError: 'ObjGeometry' object has no attribute 'linked_bone'

When I import an OBJ using the GUI:

Converting /media/heath/Windows/Users/User/Desktop/mkwii-obj/portway.obj... 
No geometry found for Plane
Traceback (most recent call last):
  File "gui/converter.py", line 67, in run
  File "converters/convert_lib.py", line 188, in convert
  File "converters/convert_obj.py", line 35, in load_model
AttributeError: 'ObjGeometry' object has no attribute 'linked_bone'

No .configure file

I'm trying to install the linux version on my ubuntu machine, but every time I try, it says it needs a .configure file, which is absent. I'm trying to use Make, but it's not going to work without a .configure file. Any help?

'bool' object has no attribute 'all'

Exception has occurred: AttributeError
'bool' object has no attribute 'all'
  File "/home/heath/Downloads/abmatt/abmatt/converters/colors.py", line 143, in combine
    if (self.rgba_colors != color.rgba_colors).all():
  File "/home/heath/Downloads/abmatt/abmatt/converters/geometry.py", line 59, in combine
    self.colors.combine(geometry.colors, True)
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_dae.py", line 173, in __add_geometry
    if not geo[0].combine(geometry):
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_dae.py", line 198, in __parse_nodes
    self.__add_geometry(x, material_geometry_map)
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_dae.py", line 37, in load_model
    self.__parse_nodes(dae.get_scene(), material_geometry_map, matrix)
  File "/home/heath/Downloads/abmatt/abmatt/command.py", line 837, in run_convert
    mdl = converter.load_model(model)
  File "/home/heath/Downloads/abmatt/abmatt/command.py", line 769, in run_cmd
    return self.run_convert()
  File "/home/heath/Downloads/abmatt/abmatt/command.py", line 705, in run_commands
    cmd.run_cmd()
  File "/home/heath/Downloads/abmatt/abmatt/load_config.py", line 358, in parse_args
    if not Command.run_commands(cmds):
  File "/home/heath/Downloads/abmatt/abmatt/__main__.py", line 22, in main
    files = load_config.parse_args(argv, base_path)
  File "/home/heath/Downloads/abmatt/abmatt/__main__.py", line 29, in <module>
    main()

(this is using VS Code so the stacktrace is backwards from usual)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.