Command-line script for exporting STK objects

Command-line script for exporting STK objects

Postby Worldblender » 20 Dec 2020, 20:49

Source: https://github.com/RQWorldblender/stk-b ... ect_cmd.py
I just came up with a script that is basically a command-line frontend to the Blender exporter scripts. They are still required to be enabled in the input Blender files, since this script calls them. It's useful for exporting multiple objects at once, without being slowed down by GUI elements. However, this advantage comes at a cost: It is not possible to select individual objects to be exported; all objects that are not marked as 'ignore' or having 'hide_render' are exported.

I hope this script proves to be useful to some, as automation can save a considerable amount of time. ;)
{l Code}: {l Select All Code}
usage: blender [-h] [-k] [-t] [-m] [-s] [-o FILE] file

Export a SuperTuxKart (STK) object in background mode with this script. Supported
objects include karts, tracks, library nodes, and standalone SPM models: blender
--background --python /home/richard/stk-blender/extras/export_stk_object_cmd.py --
[options]

positional arguments:
  file                  The file to export data from

optional arguments:
  -h, --help            show this help message and exit
  -k, --kart            Force exporting a kart
  -t, --track           Force exporting a track or library node
  -m, --materials       Force exporting materials.xml
  -s, --spm             Force exporting the whole scene as an SPM model
  -o FILE, --output FILE
                        Export to the specified path
User avatar
Worldblender
 
Posts: 96
Joined: 15 Aug 2014, 18:46
Location: Houston, Texas, United States

Who is online

Users browsing this forum: No registered users and 1 guest

cron