Skip to content
quag edited this page May 15, 2011 · 4 revisions

mcobj: Minecraft to OBJ (and PRT) converter

For example renders see http://quag.imgur.com/minecraft__blender.

If you'd like to show me renders, report problems, suggest improvements, would like builds for other platforms or to ask for help, please email me.

The http://reddit.com/r/mcobj sub-reddit been setup for showing off renders, discussing how to achieve nice effects and news about updates. Feel free to contribute and if it is quiet or empty to stir it up with some posts.

As I'd love to see renders, please email me copies of images you create.

Downloads

Change Log
2011-04-17 0.11 mcobj-0.11-windows.7z 547K
  • Add -solid flag for putting sides on the area
  • Add -rx 2 -rz 8 for selecting a rectangular area
  • Slight improvement to glass color (less likely to be black)
  • Read block data from blocks.json instead of being hard coded
  • Remove -hs (hide stone) flag. Now add "empty":true to stone in blocks.json
mcobj-0.11-linux-x86.7z 353K
mcobj-0.11-linux-x64.7z 364K
mcobj-0.11-osx.7z 366K
2011-03-17 0.10.2    
  • Add beds and redstone repeaters
  • Update colors from WormSlayer
  • Only invert x-axis for PRT (not both x and z)
2011-03-14 0.10.1    
  • Bug fix: colors missing from blocks with extra data (except for wool) in OBJ
2011-03-13 0.10    
  • Flip both x and z axis for PRT output
  • Write out blocks around transparent blocks. For example, the block under a torch or the blocks around glass
2011-03-06 0.9.2    
  • Rename PRT channel from MtlIndex to BlockId
2011-03-06 0.9.1    
  • Fix bug (when PRT support was added) that made OBJ files empty
2011-03-05 0.9    
  • Fix PRT export bug where all blocks appeared in a 16x16x128 space
2011-03-05 0.8    
  • Add alternative output format: PRT (use -prt flag to enable)
2011-03-05 0.7    
  • Add support for the beta world format
2011-02-19 0.6    
  • Further tweaks to colors
  • Add color wool blocks
2011-02-17 0.5    
  • Switch to WormSlayer's block colors
  • Reverting to relative vertex numbers as abs numbers didn't help with the 3dsmax loading
2011-02-17 0.4    
  • Use absolute vertex numbers instead of relative (to support 3dsmax)
  • No longer leak file handles and gzip streams
2011-02-14 0.3      

Usage

On windows:

mcobj -cpu 4 -s 20 -o world1.obj %AppData%\.minecraft\saves\World1

Flags:

-cpu 4 How many cores to use while processing. Defaults to 1. Set to the number of cpu's in the machine.
-o a.obj Name for the obj file to write to. Defaults to a.obj
-h Help
-prt Output a PRT file instead of OBJ

Chunk Selection:

-cx 10 -cz -23 Center the output to chunk x=10 and z=23. Defaults to chunk 0,0. To calculate the chunk coords, divide the values given in Minecraft's F3 screen by 16
-s 20 Output a sized square of chunks centered on -cx -cz. -s 20 will output 20x20 area around 0,0
-rx 2 -rx 8 Output a sized rectangle of chunks centered on -cx -cz. -rx 2 -rx 8 will output a 2x8 area around 0,0

Limit the output:

-fk 300 Limit the face count (in thousands of faces)
-y 63 Omit all blocks below this height. Use 63 for sea level
-hb Hide the bottom of the world
-g Gray; omit materials
-bf Don't combine adjacent faces of the same block within a column
-sides Output sides of chunks at the edges of selection. Sides are usually omitted

Limitations

Lots!

Only understands cube blocks (no torch meashes, door meshes and so on) No textures. Just solid colors per block Torches and lava don't emit light ... The no-mesh and no-texture limitations are delibarate. They keep the obj file size and face counts down allowing dumps of large parts of the world without blowing out Blender's memory.

Blender

Requires Blender 2.5.

Steps:

  1. Start Blender
  2. Delete the standard cube (right-click and press delete)
  3. Start the obj importer: (hit space, and type, "import obj" and hit return)
  4. Select the generated obj file and wait for it to import
  5. Enable Ambient Occlusion (switch to Blender's 'World' planel and click the 'Ambient Occlusion' checkbox)
  6. Start a render (hit F12)

Example Run

C:\>mcobj -cpu 4 -s 4 -o world1.obj %AppData%\.minecraft\saves\World1
mcobj dev-7-g1591dec (cpu: 4)
   1/5590 (  0,  0) Faces:  889 Size:  0.0MB
   2/5590 (  0, -1) Faces:  880 Size:  0.1MB
   3/5590 ( -1,  0) Faces:  850 Size:  0.1MB
   4/5590 ( -1, -1) Faces:  849 Size:  0.1MB
   5/5590 (  0,  1) Faces: 1042 Size:  0.2MB
   6/5590 ( -1,  1) Faces:  888 Size:  0.2MB
   7/5590 (  1,  0) Faces:  918 Size:  0.3MB
   8/5590 (  1, -1) Faces:  860 Size:  0.3MB
   9/5590 (  1,  1) Faces: 1678 Size:  0.4MB
  10/5590 (  0, -2) Faces:  906 Size:  0.4MB
  11/5590 ( -1, -2) Faces:  850 Size:  0.4MB
  12/5590 (  1, -2) Faces:  836 Size:  0.5MB
  13/5590 ( -2,  0) Faces:  863 Size:  0.5MB
  14/5590 ( -2, -1) Faces:  851 Size:  0.5MB
  15/5590 ( -2,  1) Faces:  909 Size:  0.6MB
  16/5590 ( -2, -2) Faces:  869 Size:  0.6MB

Clone this wiki locally