There are 2 ways to open your models in the 3D viewer:
MCModelViewer: Open model in viewer
will open the model currently selected in the editor in the viewerAutomatically detects if a texture is animated and plays the animation with 1 tick per frame.
Models reference textures and sometimes a parent model. The extension automatically searches for these assets in all assets roots contained in your workspace.
E.g. a model references the texture block/cake_bottom
:
"textures": {
"bottom": "block/cake_bottom"
}
The extension might resolve this reference to the texture assets_root/minecraft/textures/minecraft/block/cake_bottom.png
.
Some models use assets outside of your workspace, e.g. if they use Vanilla Minecraft textures or depend on another resourcepack.
In this case you can add external assets roots, that the extension will include when trying to resolve a referenced asset:
MCModelViewer: Add assets root
mcmodel-viewer.assetsRoots
settingE.g. this model references the Vanilla Minecraft texture for arrow entities:
"textures": {
"particle": "entity/projectiles/arrow",
"arrow": "entity/projectiles/arrow"
}
We could extracted all Vanilla Minecraft assets from the version JAR into the folder %APPDATA%/.minecraft/versions/1.16.5/assets/
and then add it as an assets root. The texture will then be resolved to %APPDATA%/.minecraft/versions/1.16.5/assets/minecraft/textures/entity/projectiles/arrow.png
If any ancestor of the currently opened model changes, the model will be automatically reloaded.
Asset roots are directories that contain assets for minecraft. Resourcepacks use them to overwrite or add custom assets. They containing a .mcassetsroot
file and follow a certain directory structure:
assets_root
├╴.mcassetsroot
└╴<namespace>
├╴models
│ ├╴block
│ └╴item
├╴textures
│ ├╴block
│ └╴item
⠇