Mineblend - Blender importer add-on for Minecraft worlds

I made a new addon http://sites.google.com/site/mineblend/ to directly import Minecraft saved game data into Blender.
I think it’s high time it’s available for anybody to play with, as I tried some Cycles renders yesterday and the results were incredible.

I hope this thread will act as a feedback thread for improving the script (also feel free to post renders!). For the moment, most of the details are on the google site rather than here in the forum, so please check it out if you’re interested.

Unzip the folder from the 7zip into your blender scripts/addons directory, and then enable in User Preferences (should appear as Minecraft 1.7+ under the Import-Export addons).

I’m receptive to all feedback, suggestions, whether anyone is actually interested in this at all, etc.

Disclaimer: Feature/content wise, the script isn’t yet complete, but I will be making a lot of additions soon and will prioritise these based on what’s most needed.

Anyway, I hope someone finds this useful.

All the best!

====== Update ======

If you have problems, please as a minimum level of info state your Operating System, and in the event of the script halting or crashing, please provide the last several lines of text in the Blender system console after the error (Help > Toggle System Console if not visible).

Cool Idea! You should make it possible to export stuff from blender to Minecraft as well! That would be really cool!

I installed it as instructed but when I enable it I get this error:

Traceback (most recent call last):
File “2.60\scripts\modules\addon_utils.py”, line 255, in enable
mod = import(module_name)
File “2.60\scripts\addons\io_import_minecraft_init_.py”, line 47, in <module>
from . import mineregion
ImportError: cannot import name mineregion

What do I do about this?

I installed it and played with it a little. It seems to only load one of each type of block and all centered in the middle. I’m using blender 2.6 and the final release of minecraft. Any ideas why this would be happening?

So…would I need a minecraft.jar for this? It keeps saying an error about no minecraft.jar…and I don’t have one because I only have…well…the PC Gamer Demo :o

Or should I just manually put in a Minecraft v1.3 jar?(Thats the version of the demo)

Hmmm…
I can’t seem to enable it. I’ve had similar problems with other scripts in the past. Can’t remember why it wouldn’t work.

Do I need specific build for it to work?

Aye, nvm, I just downloaded one of the pre-releases and it worked fine :stuck_out_tongue:

2.60 works, but it HAS to be in the io_import_minecraft folder, or esle it won’t. I think the 2.61 beta works as well…going to have to double check :wink:

Is there a python lib i might need to run this?
I’ve installed the scripts all over - ./blender and in the scripts directory of the extracted versions of blender that I am trying to use.

Does this import textures for all the recent blocks? Cause it said " textures for most common block types"

i haven’t posted enough so I’m getting ‘post denied’… what! OK, two at a time then-

@ShingWanTin
When I started I considered that - it would actually be reasonably straightforward to set up exporting, based on the level format structures already in there. So then Blender would effectively be a full Minecraft data editor. But I decided to focus on enabling import for the purpose of making nice renders as the core purpose of the script, for now.

@Maphrox - first thing to check would be if all files extracted from the zip file OK. Make sure your \scripts\addons\io_import_minecraft does contain mineregion.py. If it’s there, what OS are you on? it might be a path issue I’m not aware of, or other things. On Linux/Mac there may be a need for r-x permissions on the file for the user or group that Blender runs as, but I’m afraid that’s not something I’ve tested so far.

Your load-in worked fine, but (and this is normal…) the scale is vast - it’s 1 Minecraft metre (1 block) to 1 Blender Unit. Go into top view, and zoom out and up (orthographic helps). By default, it loads a square area centred on your last saved game location. The farther out you were from world start, the farther away it will be in the viewport.
The option “load at 3D cursor” loads a relative area to the 3D viewport (with Y+ as north), which will load around World position 0,0 (or wherever the 3d cursor is at).
Your starting position in a new Minecraft world is randomised some distance away from 0,0 and you may find uneven/ungenerated chunks when loading around 3D cursor.

@ A’nW - Aha, I saw your thread last month, and thought maybe I didn’t need to make the script because there was another way! But I share your pain… Cool pics, by the way, I like it!
I wondered, how did you get the crisp texture pixels? That’s something I haven’t resolved yet - with the current settings it seems to keep ending up with some antialiasing turned on, especially bad with alpha channels.

@Michael120 - MC Beta 1.3 is the first one to use this data format, so any Minecraft of that level or higher should work. But the script looks for your data in the ‘standard’ places, so if that demo version doesn’t use your application data folder and normal Minecraft paths then there’ll be trouble. It checks for minecraft.jar so it can get the blocks texture png. On Windows, that lives in C:\Users&lt;USERNAME>\AppData\Roaming.minecraft\bin
The PC Gamer demo isn’t something I knew about during testing, so any more you can tell me would be helpful to get the script to more robustly recognise save locations.

There shouldn’t be, it uses Py built-in stuff.
Things I can look into with you:

  • what OS are you on?
  • could you provide the last few lines of the error console (after “Traceback (most recent call last):”).
    This can be copy-pasted into a post and helps find the exact failure.

I’m on Windows 7 64bit, and mineregion.py is there, yes. I even tried re-extracting, no improvement.

I have found that I can’t enable the script without modifying the MCPATH. Setting it to find the correct folder (as I am on OSX (10.7.2)), so the current search for APPDATA doesn’t work), lets me enable it and even choose it from the import menu. But my list of worlds is empty :/. I do have worlds in the saves folder. Here is what my paths look like in the script (including my changes to the MCPATH line):

MCPATH = os.path.join(os.environ[‘HOME’], ‘/Library/Application\ Support/minecraft/’) # ‘C:/users/adam/AppData/Roaming/.minecraft/’
MCSAVEPATH = os.path.join(MCPATH, ‘saves/’)

Sciman, thank you for the Mac perspective, I’ve been meaning to work on that for a while. I think I might be able to get some access to a mac at work tomorrow, so I’ll take your note of those paths on board and prepare some fixes. As a quick suggestion (may be miles off with this) do you know what user/group permissions are set for your saved games, or who the owner is? It’s… not likely, but maybe there’s a ‘minecraft’ user… I’ll check what Linux does in that regard. I’ll update the script as soon as possible for this - sorry it hasn’t worked for you so far.

So, overall for now, I’m working on:

  • trying to reproduce/solve Maphrox’s “ImportError: cannot import name mineregion” (I am also on 64bit Windows 7!)
  • pathing and save game access on OSX
  • MC beta 1.8 - 1.0.0 blockdata additions (incomplete/missing block definitions)

You’re welcome :). I’m glad I could help some.

ls -l tells me this: drwxr-xr-x 8 Jacob staff 272 15 Oct 16:58 Jorel

So, it doesn’t look like it is owned by anybody other then myself. Would it be of any use to you to have a folder of save data from a mac? I’m not sure if there is any platform-specific differences in the save files.

If there are any other OSX questions I can try to help answer, let me know and I’ll see what I can do :slight_smile:

Looking forward to your updated script!
Sciman (Jacob)

Hi acro.
I’m using Ubuntu 11.10 64bit

When I clicked on the addon in preferences to enable it, this came up in the console -

Traceback (most recent call last):
File “/home/todd/Documents/blender-2.61beta-linux-glibc27-x86_64/2.60/scripts/modules/addon_utils.py”, line 255, in enable
mod = import(module_name)
File “/home/todd/Documents/blender-2.61beta-linux-glibc27-x86_64/2.60/scripts/addons/io_import_minecraft/init.py”, line 47, in <module>
from . import mineregion
File “/home/todd/Documents/blender-2.61beta-linux-glibc27-x86_64/2.60/scripts/addons/io_import_minecraft/mineregion.py”, line 21, in <module>
from . import blockbuild #import *?
File “/home/todd/Documents/blender-2.61beta-linux-glibc27-x86_64/2.60/scripts/addons/io_import_minecraft/blockbuild.py”, line 7, in <module>
MCPATH = os.path.join(os.environ[‘APPDATA’], ‘.minecraft’)
File “/home/todd/Documents/blender-2.61beta-linux-glibc27-x86_64/2.60/python/lib/python3.2/os.py”, line 450, in getitem
value = self._data[self.encodekey(key)]
KeyError: b’APPDATA’

Hope you can solve this for me. Would love to fool around with this.