Go to file
2022-02-19 22:52:54 +00:00
.github/workflows Update node.js.yml 2022-01-16 23:02:39 +00:00
.vscode Added VSCode debugging launch options 2021-11-06 20:32:50 +00:00
resources Updated atlas script, added palette script 2022-02-19 21:50:17 +00:00
shaders Major refactor to rendering, importing and util 2022-02-12 01:54:31 +00:00
src Added support for custom block palettes 2022-02-19 22:30:47 +00:00
tools Updated atlas script, added palette script 2022-02-19 21:50:17 +00:00
.eslintrc.json Updated atlas script, added palette script 2022-02-19 21:50:17 +00:00
.gitignore Action output message, more options to toggle 2022-01-16 02:25:28 +00:00
index.html Cleanup and fixed block mesh rendering 2022-02-12 17:18:04 +00:00
LICENSE Added LICENSE 2021-07-01 16:28:23 +01:00
package.json Updated atlas script, added palette script 2022-02-19 21:50:17 +00:00
README.md Updated README.md 2022-02-19 22:52:54 +00:00
styles.css Added warning messages 2022-02-12 20:54:31 +00:00
tsconfig.json Added VSCode debugging launch options 2021-11-06 20:32:50 +00:00

ObjToSchematic

A visual tool to convert .obj model files into Minecraft Schematics or Litematica.

Preview

Usage

You can either download the latest release or build it yourself by following the instructions below.

  • Download and install Node.js.
  • Run git clone https://github.com/LucasDower/ObjToSchematic.git in your command line.
  • Navigate to /ObjToSchematic-main.
  • Run npm install.
  • Run npm start.

Advanced

Block Palettes You can create your own block palettes to fit the build you desire. When you select this palette, the generated structure will only use the blocks defined in your palette. To create a palette, list every block you want to use in /tools/new-palette-blocks. A list of every supported block can be found in /tools/all-supported-blocks. When your list is complete, run npm run palette. If everything is successful, the next time you run the program you'll be able to select your new palette in the 'Block palette' dropdown.

Texture Atlases If you play Minecraft with a resource pack, you will probably want to build your own texture atlas. This way the program will use the same resource pack for its visualisation and more accurate colour-to-block conversions can be made. To do this, open your resource pack and copy all block textures from /assets/minecraft/textures/block into /tools/blocks/. Also, copy all block models from /assets/minecraft/models/block into /tools/models/. Now run npm run atlas, and make sure to say no to fetching textures and models. If everything is successful, the next time you run the program you'll be able to select your resource pack in the 'Texture atlas' dropdown.

Progress

0.1

  • 🟢 .json model loading
  • 🟢 Model voxelisation
  • 🟢 Optimised voxelisation & rendering overhaul
  • 🟢 Basic .obj file loader UI

0.2

  • 🟠 Greedy voxel meshing (Removed)
  • 🟢 Export to schematic

0.3

  • 🟠 Voxel splitting (Removed)
  • 🟢 Ambient occlusion
  • 🟢 Quality of life
    • Model PSR, height limit warnings
  • 🟢 .mtl support for block choice
    • PNG support, JPEG support
  • 🟢 Convert to TypeScript

0.4

  • 🟢 Block choice exported
    • Export to .litematic
  • 🟢 Support for non-uniform block models (i.e. not all sides have same texture e.g. Oak Log, Crafting Table)
  • 🟢 UI Redesign
  • 🟢 Optimised ambient occlusion
  • 🟢 Transition to ray-based voxelisation
  • 🟢 Dithering

0.5

  • Support for simplifying complex meshes
  • 🟡 Load custom block palettes and texture atlases
  • 🟢 Optimise construction of voxel mesh vertex buffers
  • 🟡 Web workers (see web-workers)
    • Progress bar
    • Prevent UI hanging
  • 🟢 Buffer refactor to support OES_element_index_uint WebGL extension (support for uint32 index buffers instead of uint16)
  • Alpha support
    • Alpha texture maps
    • Transparent blocks
  • Export to .nbt (structure blocks)
  • Import from .gltf

0.6

  • Node.js C++ addons
  • Block painting
  • Building guides
  • Slice viewer
  • .fbx import support
  • Support for non-block models (e.g. slabs, stairs, trapdoors, etc.)

Disclaimer

⚠️ This repo is in development and proper error handling is not currently my priority. Contributions are welcome.

This is an non-commercial unofficial tool that is neither approved, endorsed, associated, nor connected to Mojang Studios. Block textures used are from Minecraft and usage complies with the Mojang Studios Brand And Assets Guidelines.

MinecraftPreview

Debugging

To allow for your favourite debugging tools like breakpoints and call stacks, I've included launch options for debugging in VSCode. Use Ctrl+Shift+D, and run "Debug Main Process" and once the Electron window has initialised, run "Attach to Render Process".