Difference between revisions of "Btk-conv"

From Pikmin Technical Knowledge Base
Jump to navigation Jump to search
(Translated readme.md from Github to Media Wiki style, added link to the tool.)
 
(There is absolutely no point in duplicating the information.)
 
Line 1: Line 1:
BTK-conv was created by Renol/Yoshi2 and can be found on his [https://github.com/RenolY2/btk-conv Github Repository].
+
BTK-conv was created by Renol/Yoshi2. It is a converter between the BTK format and JSON formatted text files. [[BTK file|BTK]] is used for texture animations (by transformation) in some Nintendo games on the GC, e.g. ''Super Mario Sunshine'' and ''Pikmin 2''.
  
__TOC__
+
== Download ==
 +
* [https://github.com/RenolY2/btk-conv GitHub Repository]
  
==BTK-conv==
+
[[Category:Tools]]
BTK-conv is a converter between the BTK format and JSON formatted text files. BTK is used for texture animations (by transformation) in some Nintendo games on the GC, e.g. Super Mario Sunshine and Pikmin 2.
+
[[Category:Pikmin 2]]
 
 
==Requirements==
 
* Newest version of Python 3
 
The newest version as of the making of this file is 3.6.4: https://www.python.org/downloads/
 
When installing it on Windows, make sure you check "Add Python to PATH" so that the included .bat files will work properly.
 
 
 
==Usage==
 
===Drag & Drop===
 
If you are on Windows, the provided btkconvert.bat file allows simply dropping a file on it to convert it. BTK files will be converted to JSON, and JSON will be converted to BTK. The bat file is set up so that floating point values are rounded to 6 digits after the decimal point and can be modified if more or less precision is wanted.
 
 
 
===Command line usage===
 
<pre>
 
python ./btk-conv.py [-h] [--ndigits NDIGITS] input [output]
 
 
 
positional arguments:
 
  input              Path to btk or json-formatted text file.
 
  output            Path to which the converted file should be written. If
 
                    input was a BTK, writes a json file. If input was a json
 
                    file, writes a BTK.If left out, output defaults to
 
                    <input>.json or <input>.btk.
 
 
 
optional arguments:
 
  -h, --help        show this help message and exit
 
  --ndigits NDIGITS  The amount of digits after the decimal point to which
 
                    values should be rounded when converting btk to json. -1
 
                    for no rounding.
 
</pre>
 
 
 
===About the JSON structure===
 
====Header:====
 
* <b>loop mode:</b> Effect unknown but might affect how the animation loops
 
* <b>angle scale:</b> Effect unknown
 
* <b>duration:</b> How long the animation plays, unit unknown
 
* <b>unknown:</b> Some sort of address? Often 0x801514a8, sometimes zero
 
 
 
====Animations:====
 
* <b>material name:</b> Name of the material to which the animation is applied. Name needs to match a material name from the BMD model to which the BTK belongs (when you make custom BMDs, material name in the BMD will be what the material name you are using in the 3d modelling program is)
 
* <b>material index:</b> Purpose unknown, but when there are two animations with the same material name, one animation has the index 0 and the other has the index 1 (Might apply to more than two too)
 
* <b>center:</b> Center coordinates in the UVW map?
 
* <b>scale uvw:</b> Coordinates are scaled by these values. 1.0 for all three for neutral scale.
 
* <b>rotation uvw:</b> Rotation of coordinates in degrees. Goes from -180 to 180. 0.0 for all three values for neutral.
 
* <b>translation u, v, w:</b> Moves coordinates (Allows for scrolling textures). 4 values per entry. First value is time at which the translation happens (compare with duration from above). Second is position to which the coordinates are moved. Third and fourth are unknown, but might affect interpolation or speed.
 
 
 
===Tips===
 
* Having trouble making animations? Take existing BTKs, change the material name of the animation to one from your model and experiment with it!
 

Latest revision as of 18:25, 12 January 2019

BTK-conv was created by Renol/Yoshi2. It is a converter between the BTK format and JSON formatted text files. BTK is used for texture animations (by transformation) in some Nintendo games on the GC, e.g. Super Mario Sunshine and Pikmin 2.

Download[edit]