Saturday, February 11, 2017

Why you should care about the data formats CraftMaster supports…

Introduction


One way of thinking about CraftMaster is as a data exchange portal between Minecraft and the broader 3D technology ecosystem, as shown below in Figure 1.

Figure 1: CraftMaster as a data exchange portal between Minecraft and the 3D technology ecosystem.

In this context, CraftMaster provides Minecraft users access to the exciting capabilities enabled by the broader 3D industry - for example VR/AR, 3D printing, 3D scanning, etc. At the same time, CraftMaster also enables the 3D industry to engage with the Minecraft community in new and unique ways. CraftMaster is able to play the role of connective tissue between these two domains due to its ability to import, export, and translate between many different 3D - and even 2D - data formats.

This fundamental feature – 3D/2D data exchange and conversion - is what allows CraftMaster users to download 3D models from 3D Warehouse, convert them into Minecraft schematics and place them into Minecraft worlds (see the Download and Place tutorial). It’s also what allows CraftMaster users to share their Minecraft creations as 3D models on Sketchfab, and from Sketchfab on social media sites (see Extract and Share tutorial). These workflows are only two simple examples of what’s possible with CraftMaster. In fact, there’s an unlimited range of possibilities - once you understand all of the data formats and data flows that CraftMaster supports.

CraftMaster Data Formats


To set the stage, let's first review the relevant data formats, and provide a little context for each. Table 1 below provides a high-level summary of all the data formats that CraftMaster supports.

Table 1: CraftMaster data formats.

  • .NBT: The .NBT file format was introduced into Minecraft along with Structure Blocks. When you Save a structure that you built in Minecraft using a Structure Block, Minecraft creates an .NBT file in the structures folder for that particular World. We use the word “structure” to indicate the content defined by an .NBT file. By the way, individual .NBT files are normally limited to 32x32x32 blocks - which means that users are normally constrained to saving structures that fit within a 32x32x32 block volume (although CraftMaster can help with that…read on).
  • .schematic: As the file suffix indicates, this type of file is called a “schematic". Schematics were introduced with MCEdit as a way for users to “extract” - or, in other words, copy out of a Minecraft world - discreet volumes of the world, and exchange them between worlds and with other users. Schematics can also be used by other Minecraft editors, such as WorldEdit. 
  • .OBJ, .STL, .KMZ, COLLADA (.DAE): These are all 3D data formats that are commonly supported by different applications and workflows within the broader 3D industry. Each specifies the surface geometry of the 3D objects they represent. In addition, .OBJ, .KMZ, and Collada (.DAE) also specify the surface color, or “texture”, of the 3D object. .STL files, on the other hand, are monochrome - no color/texture is captured. Collectively, we refer to this group of file types as “3D models".
  • .PNG, .JPEG: These are industry standard 2D image data formats, which can be imported into CraftMaster and extruded to create 3D models. As you would expect, we refer to .PNG and .JPEG files “2D images”.
  • .CMO: CraftMaster defines a new, canonical 3D data format -"CraftMaster object", or .CMO file. This is the native file format for CraftMaster and all objects are internally stored as this data type.  A .CMO file is actually a compressed ZIP package that contains a CraftMaster 3D data representation of the object, as well as industry standard .OBJ, .NBT, and .schematic renditions of the object.
With this understanding of the relevant data formats, let's now walk through the data flows that CraftMaster enables.

CraftMaster Data Flows


The diagram in Figure 2 below illustrates a holistic view of all of the different data formats supported by CraftMaster, and how CraftMaster enables different data flows.

Figure 2: CraftMaster data formats and data flows.

When content flows through CraftMaster, it is stored and managed as a CraftMaster object, or .CMO file. Depending on what feature of CraftMaster you’re using, CraftMaster will automatically convert between the canonical .CMO format and one or more of the other data formats described above.

Now, let's work our way through the diagram in Figure 2 in detail, starting with the upper left hand corner.

Get Content


One of the three main panels of CraftMaster is the Get Content Panel. From here, you can browse content on 3D Warehouse - probably the most expansive source of free 3D content on the Internet. You can learn more about 3D Warehouse here. 3D Warehouse is exciting for Minecraft users because it hosts a plethora of 3D models that are particularly relevant to Minecraft - including buildings, statues, monuments and much, much more. Watch our Small World Tour video to get a taste of how you can amp-up your building capabilities using 3D Warehouse and CraftMaster.

The 3D models hosted on 3D Warehouse are typically available as Collada/.DAE or .KMZ files. When downloading from 3D Warehouse (see Figure 3), CraftMaster automatically converts these 3D Models into .CMO so they can be used within Craftmaster and easily placed within a Minecraft World.

Figure 3: Downloading a .KMZ file from 3D Warehouse using CraftMaster

Also from the Get Content Panel, CraftMaster users can access a couple different Schematic sharing sites - MinecraftStuff.net and Minecraft-Schematics.com. These sites allow Minecraft users to share (upload and download) schematics that have been created in Minecraft and extracted using MCEdit or WorldEdit, or built from scratch in MCEdit or WorldEdit. When you download a schematic from one of these sites into CraftMaster, a .CMO file is created and stored in the CraftMaster library so, using CraftMaster, schematics can then be easily placed again and again in one or more Minecraft worlds, as well as exported and shared.

Share on Sketchfab


Let’s now move to the top right of the diagram in Figure 2…From CraftMaster’s 3D Panel, users can share any object stored in CraftMaster via Sketchfab by simply invoking the Upload to Sketchfab command (see Figure 4).

Figure 4: Uploading a 3D object to Sketchfab using CraftMaster.

When this command is invoked, CraftMaster uploads an .OBJ for the currently selected 3D Object, and the .OBJ file is processed and stored on Sketchfab’s site. Once on Sketchfab, users can customize the view of their 3D models using a variety of tools provided by Sketchfab, and also share them on Facebook, Twitter, and Tumblr. When 3D Models are shared from Sketchfab, the Sketchfab 3D viewer is embedded into the appropriate social media feed, allowing users to experience the full benefit of viewing the model in 3D. You can learn more about Sketchfab here.

Placing Structures in and Extracting Structures from Minecraft


As you can see on the right side of the diagram in Figure 2, CraftMaster can also be used to place structures within and extract structures from Minecraft worlds. CraftMaster uses Structure Blocks and .NBT files to exchange content with Minecraft. For example, if you place a structure into a world using the CraftMaster map (see Figure 5)...

Figure 5: Placing a Structure using CraftMaster Maps.

...CraftMaster automatically generates Structure Blocks, or .NBT files, in the structures folder for the currently selected World. At the same time, CraftMaster generates a Minecraft command for placing the Structure Block in the specified location, and saves it into the OS Clipboard. Now, all a user needs to do is invoke the command line within Minecraft, paste in the automatically generated command, and hit Return. This places the Structure Block and, when Loaded, the structure is built exactly where the user specified on the CraftMaster map.

Within CraftMaster's 3D Panel, users can also create Structure Blocks for the currently selected 3D object by selecting the Save Structure to Current World command.

Figure 6: Saving a Structure to the Structure folder using CraftMaster.

Invoking this command places the .NBT file(s) that represent the currently selected 3D object into the structures folder of the active world. Subsequently, the user can build that structure from within Minecraft by placing and loading a Structure Block with the same name as the 3D object.

One nice feature of CraftMaster objects is they are not constrained to be only 32x32x32 blocks big. For larger 3D objects, CraftMaster generates and saves multiple Structure Blocks/.NBT files so the complete structure can be automatically built in Minecraft. And, whether the structure is placed using CraftMaster map, or saved from the 3D Panel, it can be built again and again within the target world by simply Loading a Structure Block of that name.

CraftMaster can also extract – or copy out of Minecraft Worlds – volumes defined by two Signs of the same name on opposite corners of the volume. You can learn more about Extracting volumes using Signs by watching the Extract and Share tutorial.  CraftMaster can also extract structures using Structure Blocks – either by defining a new volume within a World or extracting a structure already placed in a world (see Figure 7 below)...

Figure 7: Extracting structures using placed structure blocks in CraftMaster.

...or copying the structure out of the Stored Structures folder (see Figure 8 below).


Figure 8: Extracting a structure from a stored Structure Block in CraftMaster.


Importing and Exporting Content Using CraftMaster


Let’s now move to the bottom left of the diagram. While in CraftMaster’s 3D Panel, users can import any of the data formats shown on the diagram by invoking the Import Model command (see Figure 9):

Figure 9: Importing models using CraftMaster.

CraftMaster can import files stored on the local hard drive in any of the 3D data formats listed. CraftMaster can also import 2D images - either .JPEG or .PNG files - that are imported as 3D objects with an initial thickness of 1 block. Once imported, users can extrude the 2D image to make it as thick as they want.

The import command can also be used to read 3D models captured with a 3D scanner – for example, the bust of my son, shown in Figure 10, was captured using the Structure Sensor 3D scanner and imported into Minecraft using CraftMaster.


Figure 10: 3D scan imported into Minecraft using CraftMaster.

Finally, let's look at the lower right of the diagram. CraftMaster allows users to export objects to a variety of 3D data formats. CraftMaster can export any of the 3D file formats shown in Figure 2 using the Export 3D command (see Figure 11).

Figure 11: Exporting 3D objects using CraftMaster.

For example, CraftMaster can export an .STL file or .OBJ file of something built in Minecraft so that it can be 3D printed.

Finally, CraftMaster allows users to import and export .NBT files and .schematics. This means that CraftMaster can be used to conveniently exchange structures and schematics between Minecraft users, and that CraftMaster is fully compatible with MCEdit and WorldEdit.


Have Fun Exploring CraftMaster!


Wow, I know that’s a lot to internalize…but, I hope it will help you better understand the richness of CraftMaster and the data formats that it supports. More importantly, I hope that you’ll discover new and exciting ways of using CraftMaster to enhance and extend your Minecraft experience.

Amplify your creativity! And, please be sure to share you favorite use cases with us on the CraftMaster user forum.