This add-on imports pixel art images as colored cubes or squares. Pixels with 100% alpha are ignored.
NOTE: For best results the imported pixel art should actually have the apparent pixels be actual 1x1 pixels in the image. If not, there is an option to automatically down-scale such images, but it will not work for lossy images (JPEG) or if it was scaled to a non integer multiple of the original size and might be slow (see below for more details). Maybe you'd rather want to down-scale the image manually (using nearest neighbor option) in an image editor.
This add-on imports pixel art images as colored 1x1x1 separate cubes or 1x1 planes in a single mesh. Pixels with 100% alpha are ignored. All pixels of the same color will share one material. The material can use nodes. The names of the created cubes and materials can be controlled through format strings.
If you use the option 'Separate Cubes' then the imported pixels are all parented to an empty object so they can be easily transformed as a whole. The cubes have a size of 1x1x1 so they can be easily moved around pixel-by-pixel while holding ctrl.
If you use the option '2D Mesh' all the pixels will be planes in one single mesh. If you still want cubes then simply extrude the whole mesh by 1 unit in the Z direction. Alternatively you simply can use the solidify modifier.
This option imports much faster and it seems it is also faster to work with a single large mesh in blender than to work with many small objects.
When this option is checked the materials of the pixels will use nodes.
When this option is checked already existing materials that match the specified name will be used instead of creating new ones.
Often pixel art is posted on the internet in an upscaled form, meaning one apparent pixel is actually e.g. 8x8 or more pixels in the image. When this option is checked the image is analyzed and automatically down-scaled. This might be pretty slow for big images, since this is all done in Python.
NOTE: This only works if the image was up-scaled to an exact integer multiple of the original and no other filters where applied. If the image was saved as a lossy format like JPEG this will fail pretty much always, since lossy formats kinda smudge the pixels. The used image should best be PNG, BMP, or GIF.
The algorithm is quite primitive, but works for many pixel art images.
Pattern for the name of the empty object that will be the parent of all the pixels. This object is helpful when you want to transform the whole pixel art at once. You can safely delete it if you don't want it.
Pattern variables: {filename}
, {use_nodes}
Pattern for the names of the pixel objects.
Pattern variables: {filename}
, {use_nodes}
, {color}
, {x}
, {y}
Pattern of the names of the meshes of the pixels.
Pattern variables: {filename}
, {use_nodes}
, {color}
, {x}
, {y}
Pattern of the names of the materials of the pixels. Note that pixels of the same color will also share the same material. This way you can easily change the material properties of all pixels of the same color.
Pattern variables: {filename}
, {use_nodes}
, {color}
, {x}
, {y}
In name patterns certain variables will be replaced with their respective
values. Because these variables use a {name}
-syntax if you want to include
curly braces in your names you need to escape them as {{
and }}
.
{filename}
– The name of the file (not including the folder names).{use_nodes}
– The string nodes
if the use material nodes option is
selected, an empty string otherwise.{color}
– Hexa-decimal string of the color of the pixel (RRGGBBAA).{x}
– X-coordinate of the pixel.{y}
– Y-coordinate of the pixel.Added warning text in import dialog about too big image sizes.
This extension requests the following permission:
Import pixel art from disk