So recently, I found myself rewatching these old Minecraft videos from the channel “Jake Eyes” showcasing ridiculous ways to day in Minecraft. Apart from the fact that this 6 years old content still manages to entertain me, one special thing about them is that they usually Contain these really impressive block animations that look like they were built frame by frame. I didn’t think too much about them until I stumbled across a video where the guy complained about YouTube falsely demonetizing his channel, and where he said this: That got me thinking, how hard could it be to do something similar without too much effort? Was he really the only one doing this? I very quickly looked on YouTube, and apart from a few videos using commands to create relatively simple animations, I didn’t find much, so I decided to try it out myself. The obvious approach for creating these massive in-game animations would be to literally build them frame by frame and take a screenshot from the same spot after every build, But I’m really terrible at building, and I would never have the patience to do it this way. I therefore had to automate the process as much as I could so that the computer would do all the tedious work for me. I immediately thought about a way to use 3D modeling software to create the animation, as they come with some very helpful tools to make your job easier when animating. I just had to find a way to convert an animation I made in blender into a list of block structures Which I could then somehow load into the game and play them back one after the other. Jake Eyes mentioned using MCEdit for his videos a while back, which is a piece of software that can be used to place 3d models into Minecraft worlds as blocks, But that software hasn’t received an update since 2016 and doesn’t support the newest minecraft versions, and can also not modify a world while you’re playing it, so I would have to leave the world before loading the next frame which would be very time consuming. I decided to first write a blender extension to convert a 3d model into blocks frame by frame and save the result to a file, and create a Minecraft mod to place these blocks into the game automatically. Let’s see how it works. So let’s start with the blender extension. If you don’t know, Blender is a free and open-source 3D software used for modeling, rendering, animation and more. While the software is mainly written in C, it can be interacted with using Python through the scripting tab. As a programmer, I had already messed around with this tab a bit, but I still had to do a lot of research to familiarize myself with the API. As you already know, a 3D model is made out of Individual points in 3D space connected together to form faces. And quick sidenote: in the world of 3D rendering we like to restrict ourselves to only dealing with triangles as it makes the math easier, but in the world of 3D modeling you can also use quads or any other type of polygon. Anyway, we need a script to convert this vertex based model into a voxel based model. For those who don’t know, a voxel is like a pixel but in 3D, so like a pixel based image, a voxel based model is made out of a grid of equally sized tiles which Are usually represented as cubes. This is why minecraft can be called a “voxel based game”, because all blocks can be thought of as voxels in a giant 3 dimensional raster. The voxelized model can then be treated as a block structure that can directly be placed into the world. Well, actually we still need to assign colors to the individual voxels so that whatever we use to place the model into the world knows what block type to use. So while converting, the script also Has to figure out what color a voxel should be based on the color of the model at that position. I also want to mention that I couldn’t use the remesh modifier available in blender to voxelize the model, as it disregards the original color and also behaves weirdly on animated models. At first, I wanted to generate a grid around the model and only fill in the cells that are inside the geometry, but I couldn’t find a fast enough way to perform this check. I ended up just using the vertices of the mesh to fill in the grid, Which worked as long as the model was subdivided enough so that the distance between two surface vertices would never be lower than the distance between two cells. A better way to do this would Be to move along the faces of the mesh to fill in the grid, but I had no idea how to do this in 3D. Also, I could then just use the vertex colors as colors for the voxels, or use the UV coordinates To extract the right color from the model’s texture. I then just let the script do that for every frame of the animation while saving the generated voxels to a file. Now to the second part, which is importing the generated voxels into the game. I started off By making a plugin, which is similar to a mod but only runs on the server side of the game. The advantage of a plugin is that setup and development are much easier thanks to APIs like Bukkit and Spigot, but I quickly realised that I would need a mod, since I wanted to automatically Take screenshots during playback to create a smooth image sequence, but that is only possible if you have access to the client side. I decided to use the fabric API to develop the mod, as it is becoming increasingly popular and I wanted to try it out. The mod itself then added a few commands To the game to load the voxel files into memory, specify a position and play back the animation. Here the most interesting part was figuring out which block to use based on a voxel’s color. I created a very simple python script to extract the average color of every texture in the game, and I Could then use this information to find the block which’s average color was closest to the desired color. It is possible that using something called the “dominant color” instead would have yielded better results, but I don’t really care. I then thought it would be funny to generate a texture Pack where every texture is replaced by only its average color, here’s how that turned out. I might leave a link to this pack in the description, but let’s get back to the point of this video. Once I had loaded the voxel data, specified the playback location and started The sequence, the mod would automatically place the blocks into the world frame by frame with a specified interval, and would automatically take screenshots before placing the next frame. That way, I would have an image sequence ready to be imported into any editing software and Played back at any speed, regardless of how laggy the game was during the recording. It was now time to try it all out. While I did a lot of testing, I’m only going to show my favorite results. First off, here’s a simple bouncing ball animation. If it doesn’t look so well, That’s because I’m actually not that good at animating, but anyway here it is in minecraft. If you think it’s boring, you’re right. Let’s make an explosion. I started off by importing an OpenVDB explosion from the internet, and used the volume to mesh Modifier to convert it into a 3D model. Sadly, that got rid of the temperature information, so I had to modify the script to create a simple color gradient. Here’s how it looks in minecraft. And now with only a single color. Sadly, the game seems to be struggling a bit with all these chunk updates, but it still looks cool. I also don’t know why the animation stops so abruptly, something probably went wrong while exporting the voxels. I then created a simple fluid simulation using Mantaflow, here it is in Minecraft. Now it’s time for something really interesting: I shared some of the animations I made on discord, and someone suggested I should use this to play a minecraft animation inside minecraft. I thought that would be a great idea, so I downloaded a Minecraft rig, And created a basic animation as a test. Here’s how it looks in minecraft. I then tried to make something a little more interesting, but sadly, my animation skills really aren’t that great. In the end I must admit that the automation I programmed isn’t enough to create truly amazing Stop motion animations like Jake Eyes did, you still need some solid animation skills which I lack, but I still think what I came up with looks kinda cool. Anyway, I think I’m gonna leave it there. If you want to try this out yourself, you can find everything you’ll need in the description. Let me know if you managed to create something interesting with it. Also, I wanna point out that this video was more of a bonus video while I work on more elaborate projects. I had asked you a while ago if I should make a video out of this small project, And most of you said yes, so that was it. I really hope you’ve enjoyed this video. Don’t forget to leave a like if you did, and consider subscribing to support the channel. As I’m writing this we’re getting closer and closer to 2,000 subscribers which is truly incredible, thank you all so much. Have a great day, and I’ll see you in the next one. Video Information
This video, titled ‘How I played a Minecraft Animation inside Minecraft’, was uploaded by NamePointer on 2021-07-31 19:49:02. It has garnered 603071 views and 25781 likes. The duration of the video is 00:10:33 or 633 seconds.
A showcase and explanation of an interesting side project of mine: a program that converts 3D animations into Minecraft stop-motion sequences
► Discord server: https://discord.gg/FJqqvqHaZS ► Leave a like to help the channel grow 👍 ► Every subscription counts! 🎈
► Source code and usage: https://github.com/carl-vbn/minecraft-voxel-loader ► The “averaged” texture pack: Not released yet, but you can probably find something similar online. ► Tweet me your creations: https://twitter.com/NameP01NTER ► Inspired by @jayRiott and his series “50 Ways to…”
🎵 Music from Epidemic Sound, register with my link to support the channel: https://www.epidemicsound.com/referral/tgmxaf/
Detailed description: In this video, I explain how I programmed a Minecraft Mod long with several Python scripts that allow me to convert a 3D animation from Blender into a sequence of block structures or voxel structures that can then be imported and played back inside Minecraft to easily create Stop-motion animations like Jake Eyes does on his channel. This is just my solution, and might not be the best.
Chapters 0:00 – The challenge 1:26 – My idea 2:22 – Epic intro 2:26 – The Blender extension 5:15 – The Minecraft Mod 7:16 – The results 9:22 – Conclusion