[Addon] Minecraft Block Creator

Hey guys,

I was a bit hesitant to post this here as it’s such a specific, non-general addon, but I figured someone here might find it useful. =) Here’s the original post I made on the Minecraft forums:

As I’m thinking of creating a minecraft animation in Blender soon I wanted a way to quickly be able to place blocks. I therefore created a Blender add-on that allows you to do just that.
After you select the block category you can choose what kind of block you want it to be. In the case of wood or leaves it will also display an optional setting for the type (birch, spruce, oak or jungle). Also, for leaves and grass it will show two sliders (humidity and temperature) for determining the correct color based on the foliagecolor image. For Jack-O-Lanterns and glowstone lamps there’s an on/off toggle and finally, it also offers a slider for the amount of cracks you get from breaking a block.
All of these values are fully animatable.

http://i.imgur.com/Q3OFn.png

Some restrictions however include not being able to see cracks and tint layers (i.e. grass tufts on top of dirt) without being in the slower ‘shaded’ mode in GLSL shading (alt+z), as well as not all blocks being added yet. Some notable absentees are [since added] and anything not on terrain.png (chests, etc). I plan to add these ASAP as well. One other very nasty, and seemingly unovercomable bug due to how Blender stencil textures work, grass blocks can only be cracked on the top side of the block.

That said, while it’s not 100% complete I’d love for some people to try it out and give me some feedback. =)
For those of you willing to give it a whirl, here’s a quick “getting started”:

  • Download the latest Blender version, 2.64.
  • Install the add-on by copying the entire folder into your add-ons folder[1].
  • Open Blender.
  • Go to your User Preferences (file -> user preferences or cmd+, on Mac).
  • Go to the Add-ons tab.
  • Search for “minecraft” or locate “Minecraft Block Creator” under the “Mesh” tab on the left.
  • Enable the add-on.
  • Delete the default cube (this is a Blender bug; the default cube has weird polygon indices).
  • Add a new one by pressing shift+a and selecting Mesh -> Cube.
  • With your mouse in the 3D viewport, press ‘N’ to open the Properties panel.
  • At the bottom press “Make Minecraft block!”.

Congratulations, you now have a dirt block!
You are now free to change it’s type, destruction level, etc. to your heart’s content.

Due to some limitations in Blenders viewport, here are a few other how-tos:

  • To view the cracks and tint layers, press alt+z to change the shading mode to textured (or do so at the footer of the 3D viewport). Warning: This mode is slower than the regular one, especially when changing the block type or tinting colors.

  • When tinting leaves or grass the color will unfortunately -not- display in the viewport. To see the current color, go to the Textures tab and select the tint layer [2]. You can see the color in the Preview screen there.

  • To animate properties, hover over the property and press ‘i’. It behaves just like any other property in Blender. Just be aware block category and type don’t automatically get synced, so this may lead to some unexpected jumps in block type.

Another thing to keep in mind is for the blocks to diplay properly you need to have Mipmaps off in the User Preferences and the shading mode set to GLSL, Textured Solid. Currently the add-on does this on activation (even though I really shouldn’t do this…), so if you’re wondering why any of those settings changed, now you know. http://static.minecraftforum.net//public/style_emoticons/default/wink.png

Alright, that’s about it! Looking forward to your feedback! =)

Cheers,
Patrick

Download link: https://dl.dropbox.c…raft_blocks.zip

[1] Windows 7: C:\Users%username%\AppData\Roaming\Blender Foundation\Blender\2.64\scripts\addons
Windows XP: C:\Documents and Settings%username%\Application Data\Blender Foundation\Blender\2.64\scripts\addons
OSX: blender.app/Contents/MacOS/2.64scripts/addons
Linux: /home/$user/.config/blender/$version/scripts/addons

[2]
http://i.imgur.com/hUowD.png

Update Version 0.2:
Added slabs, water and lava blocks. For water I added “Size X, Size Y and Size Z” parameters to control it’s size similar to how an array modifier does. The reason for this is it solves inner-faces, and actually optimizes a bunch as it doesn’t process or create the “inner” cubes. Be warned though, it’s still quite slow at high amounts.


So there you have it! Please don’t pay too much attention to the actual code; it’s made to “just work” and I haven’t spent much time cleaning it all up. =P

Hope somebody else will find this useful.

Cheers,
Patrick

Wow, you’ve obviously done a lot of work, and judging from the different minecraft style works and animations that have shown up here, I expect there will be a lot of people very excited.

Looking forward to your feedback! =)

It worked for me, but I was a little disappointed it did not make a Cycles material. That would be more useful than a Blender Internal version.

Oh, good call! I actually thought about it before, but never did anything with it. I’ll throw it in there as well. =)

And done! It will switch to the appropriate material automatically based on a “scene_update_post” handler, thought I find this approach just a -tad- overkill, checking to see if the render engine’s changed every frame. =P Would you happen to have any ideas on a more efficient approach?

Version 0.4 is now up. This adds the following:

  • Water received a “Flow Speed” option. This automatically animates it to produces a streaming water effect (0 = off)
  • Added an additional “Small Foliage” category for the more complicated blocks such as Nether Wards, Flowers and Cobwebs

I also fixed some pretty critical bugs, amongst which:

  • No more errors on frame change
  • Optimized and bug-fixed creation of water “patches” (rows x columns x beams)
  • Water and partly transparent blocks (leaves) now render correctly in Cycles
  • Top and bottom faces have UV isands turned 180º to match original blocks
  • Re-enabling the add-on no longer clears internal list of minecraft blocks (used for updates and render engine switching)
  • Scrubbing through frames now updates all blocks that need to be, not just the active selection

Again, feedback would be much appreciated! Enjoy!

(PS: Are these kinds of update posts appreciated or would it be best to just keep this on the Minecraft forum only?)

I don’t think anyone will mind, Its a great addon and a lot of people here play minecraft.

I don’t see why not, Minecraft itself is basically a super friendly modeling program.

Well done on the addon!

Senshi I must say this is one of the best addons I have used, simple to use, and easy to set up scenes.

Some info you might find helpful.

  1. grass and fern always turns out gray no matter what I do to the humidity etc. (This could be me but all others work well when changing controls).

  2. Could you or will you add a change all to dup blocks instead of manually changing each blocks.

  3. Would it be pos to have an options to use dif terrain PNG files or a combination of terrain files in a drop down box like the select block type. I know you can change the file in the folder, but being able to have a few dif textures files to choose from would be useful.
    Not too sure if this would work as not 100% how the UV mapping works or if it could work with higher res terrain files.

Any way thanks for making this, a very useful program.

Alright, I’ll keep crossposting the updates then. =) Thanks. (For inquiring minds: Bromber’s post was answered and discussed a bit on the Minecraft Forums.)

Update:
And we’re at version 0.5! Fern and grass now tint correctly and support for additional texture maps has been added. I also added flow for the lava blocks and did some miscellaneous bug fixes.

There are two requisites for using other texture maps:

  • The relative position of the block on the map must match that of the original (i.e. block 3 needs to be dirt. Whether it’s a 16x16 or 256x256 tile doesn’t matter).
  • The name must be unique and something other than “terrain.png”. Meaningful names are encouraged, as this also determines the display name in the panels. “blocky.png” would become “Blocky” for instance.

You can add and remove additional texture maps in the new, designated “Minecraft Texture Maps” panel (below the “Minecraft Block Type” panel by default). You can then set the correct texture map per block at the bottom of the old panel.

As always, please let me know what you think and if you have any problems or suggestions I’d love to hear them.

Cheers!

(In case anyone notices, the “Vines” block is kaput, I still have to figure out it’s tinting color.)

Quickie update: vines and lilypads now work correctly. Also moved vines to the “Small Foliage” category.

Wow, I have played around with this for a while now and I am thoroughly impressed!

Will play with it some more and report and bugs I find. REALLY great job so far though :slight_smile:

This add-on is amazing! I just finished a short video testing it out: http://youtu.be/8baOpFkTFbA and i love it!

Thanks for the positive feedback guys! =) Glad to hear people are finding it useful.
And great video JumPROper; looked great! Thanks for sharing!

Another quickie fix just got uploaded which fixes the following:

  • Water block no longer has two “Flow Speed” properties
  • Tint color is maintained between texture map switches
  • Texture map switching now happens on all selected objects

How did you make the leaves, grass, and vegetation tintable?