-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ceb10cf
commit e842bc3
Showing
1 changed file
with
32 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,62 @@ | ||
# Minecraft Model Viewer | ||
|
||
- Features | ||
- [Features](#Features) | ||
- [Open model in 3D viewer](#Open-model-in-3D-viewer) | ||
- [Animated textures](#Animated-textures) | ||
- [Automatically resolves assets](#Automatically-resolves-assets) | ||
- [External assets](#External-assets) | ||
- [Changelog](https://github.com/Oran9eUtan/vscode-mcmodel-viewer/blob/main/CHANGELOG.md) | ||
- [Assets roots](#Assets-roots) | ||
- [Changelog](https://github.com/OrangeUtan/vscode-mcmodel-viewer/blob/main/CHANGELOG.md) | ||
|
||
# Features | ||
## Open model in 3D viewer | ||
There are 2 ways to open your models in the 3D viewer: | ||
1. Json files that are recognized as model files (must be located in an assets root folder) will have a menu item that opens them in the viewer | ||
1. Json files that are recognized as model files (must be located in an [assets root](#Assets-roots)) will have a menu item that opens them in the viewer | ||
2. Executing the command `MCModelViewer: Open model in viewer` will open the model currently selected in the editor in the viewer | ||
|
||
 | ||
|
||
## Animated textures | ||
Detects and plays animated textures | ||
Automatically detects if a texture is animated and plays the animation with 1 tick per frame. | ||
 | ||
|
||
## Automatically resolves assets | ||
Models reference textures and sometimes a parent model. The extension automatically searches for these assets in all asset roots contained in your workspace. <br> | ||
Asset roots are directories containing a `.mcassetsroot` file and follow the minecraft directory structure: | ||
``` | ||
assets_root | ||
├╴minecraft | ||
│ ├╴models | ||
│ │ ├╴block | ||
│ │ └╴item | ||
│ └╴textures | ||
│ ├╴block | ||
│ └╴item | ||
└╴.mcassetsroot | ||
``` | ||
Models reference textures and sometimes a parent model. The extension automatically searches for these assets in all [assets roots](#Assets-roots) contained in your workspace. <br> | ||
|
||
E.g. a model references the texture `block/cake_bottom`: | ||
```json | ||
"textures": { | ||
"bottom": "block/cake_bottom" | ||
}, ... | ||
} | ||
``` | ||
The extension will resolve this reference to the texture `assets_root/minecraft/textures/minecraft/block/cake_bottom.png`. | ||
The extension might resolve this reference to the texture `assets_root/minecraft/textures/minecraft/block/cake_bottom.png`. | ||
|
||
## External assets | ||
If your models use assets outside of your workspace, you can add the paths of asset roots on your system to the setting `mcmodel-viewer.assetsRoots`. The extension will then include these directories when resolving assets. You can also add assets roots with the `Add assets root` command.<br> | ||
Some models use assets outside of your workspace, e.g. if they use Vanilla Minecraft textures or depend on another resourcepack.<br> | ||
In this case you can add external [assets roots](#Assets-roots), that the extension will include when trying to resolve a referenced asset: | ||
- Execute the command `MCModelViewer: Add assets root` | ||
- Manually add entry to `mcmodel-viewer.assetsRoots` setting | ||
|
||
E.g. this model references a arrow texture that does not exist in the workspace: | ||
E.g. this model references the Vanilla Minecraft texture for arrow entities: | ||
```json | ||
"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` | ||
|
||
# Assets roots | ||
Asset roots are directories that contain assets for minecraft. Resoourcepacks use them to overwrite or add custom assets. They containing a `.mcassetsroot` file and follow a certain directory structure: | ||
``` | ||
We can add the path to an external assets root `%APPDATA%/.minecraft/versions/1.16.5/assets/`. The texture will then be resolved to `%APPDATA%/.minecraft/versions/1.16.5/assets/entity/projectiles/arrow.png`. | ||
assets_root | ||
├╴.mcassetsroot | ||
└╴<namespace2> | ||
├╴models | ||
│ ├╴block | ||
│ └╴item | ||
├╴textures | ||
│ ├╴block | ||
│ └╴item | ||
⠇ | ||
``` |