Editing Btk-conv

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
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''.
+
BTK-conv was created by Renol/Yoshi2 and can be found on his [https://github.com/RenolY2/btk-conv Github Repository].
  
== Download ==
+
__TOC__
* [https://github.com/RenolY2/btk-conv GitHub Repository]
 
  
[[Category:Tools]]
+
==BTK-conv==
[[Category:Pikmin 2]]
+
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.
 +
 
 +
==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!

Please note that all contributions to Pikmin Technical Knowledge Base are considered to be released under the Creative Commons Attribution-ShareAlike (see Pikmin Technical Knowledge Base:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)