|
| 1 | +# +--------------------------- |
| 2 | +# | |
| 3 | +# | D e n i z en M o d e l s |
| 4 | +# | AKA DModels - dynamically animated models in minecraft |
| 5 | +# | |
| 6 | +# +--------------------------- |
| 7 | +# |
| 8 | +# @author mcmonkey |
| 9 | +# @date 2022/06/01 |
| 10 | +# @updated 2022/06/13 |
| 11 | +# @denizen-build REL-1772 |
| 12 | +# @script-version 1.3 |
| 13 | +# |
| 14 | +# This takes BlockBench "BBModel" files, converts them (via external program) to resource pack + Denizen-compatible file, |
| 15 | +# then is able to display them in minecraft and even animate them, by spawning and moving invisible armor stands with resource pack items on their heads. |
| 16 | +# |
| 17 | +# Installation: |
| 18 | +# 1: Add "models.dsc" to your "plugins/Denizen/scripts" and "/ex reload" |
| 19 | +# 2: Make sure you have DenizenModelsConverter.exe on hand, either downloaded or compiled yourself from https://github.com/mcmonkeyprojects/DenizenModels |
| 20 | +# 3: Note that you must know the basics of operating resource packs - the pack content will be generated for you, but you must know how to configure the "mcmeta" pack file and how to install a pack on your client |
| 21 | +# 4: Take a look at the config settings in the bottom of this file in case you want to change any of them. |
| 22 | +# |
| 23 | +# Usage: |
| 24 | +# 1: Create a model using blockbench - https://www.blockbench.net/ |
| 25 | +# 1.1 Create as a 'Generic Model' |
| 26 | +# 1.2 Make basically anything you want |
| 27 | +# 1.3 Note that there is a scale limit, of roughly 73 blockbench units (about 4 minecraft block-widths), |
| 28 | +# meaning you cannot have a section of block more than 36 blockbench units from its pivot point. |
| 29 | +# If you need a larger object, add more Outliner groups with pivots moved over. |
| 30 | +# 1.4 Make sure pivot points are as correct as possible to minimize glitchiness from animations |
| 31 | +# (for example, if you have a bone pivot point in the center of a block, but the block's own pivot point is left at default 0,0,0, this can lead to the armor stand having to move and rotate at the same time, and lose sync when doing so) |
| 32 | +# 1.5 Animate freely, make sure the animation names are clear |
| 33 | +# 2: Save the ".bbmodel" file |
| 34 | +# 3: Use the DenizenModelsConverter program to convert the bbmodel to a ".dmodel.yml" and a resource pack |
| 35 | +# 4: Save the ".dmodel.yml" file into "plugins/Denizen/data/models" |
| 36 | +# 5: Load the resource pack on your client (or include it in your server's automatic resource pack) |
| 37 | +# 6: Spawn your model and control it using the Denizen scripting API documented below |
| 38 | +# |
| 39 | +# ######### |
| 40 | +# |
| 41 | +# API usage examples: |
| 42 | +# # First load a model |
| 43 | +# - ~run dmodels_load_model def.model_name:goat |
| 44 | +# # Then you can spawn it |
| 45 | +# - run dmodels_spawn_model def.model_name:goat def.location:<player.location> save:spawned |
| 46 | +# - define root <entry[spawned].created_queue.determination.first> |
| 47 | +# # To move the whole model |
| 48 | +# - teleport <[root]> <player.location> |
| 49 | +# - run dmodels_reset_model_position def.root_entity:<[root]> |
| 50 | +# # To start an automatic animation |
| 51 | +# - run dmodels_animate def.root_entity:<[root]> def.animation:idle |
| 52 | +# # To end an automatic animation |
| 53 | +# - run dmodels_end_animation def.root_entity:<[root]> |
| 54 | +# # To move the entity to a single frame of an animation (timespot is a decimal number of seconds from the start of the animation) |
| 55 | +# - run dmodels_move_to_frame def.root_entity:<[root]> def.animation:idle def.timespot:0.5 |
| 56 | +# # To remove a model |
| 57 | +# - run dmodels_delete def.root_entity:<[root]> |
| 58 | +# |
| 59 | +# ######### |
| 60 | +# |
| 61 | +# API details: |
| 62 | +# Runnable Tasks: |
| 63 | +# dmodels_load_model |
| 64 | +# Usage: Loads a model from source data by name into server memory (flags). |
| 65 | +# Input definitions: |
| 66 | +# model_name: The name of the model to load, must correspond to the relevant ".dmodel.yml" file. |
| 67 | +# dmodels_spawn_model |
| 68 | +# Usage: Spawns a single instance of a model using real armor stand entities at a location. |
| 69 | +# Input definitions: |
| 70 | +# model_name: The name of the model to spawn, must already be loaded via 'dmodels_load_model'. |
| 71 | +# location: The location to spawn the model at. |
| 72 | +# Supplies determination: EntityTag of the model root entity. |
| 73 | +# dmodels_delete |
| 74 | +# Usage: Deletes a spawned model. |
| 75 | +# Input definitions: |
| 76 | +# root_entity: The root entity gotten from 'dmodels_spawn_model'. |
| 77 | +# dmodels_reset_model_position |
| 78 | +# Usage: Resets any animation data on a model, moving the model back to its default positioning. |
| 79 | +# Input definitions: |
| 80 | +# root_entity: The root entity gotten from 'dmodels_spawn_model'. |
| 81 | +# dmodels_end_animation |
| 82 | +# Usage: Stops any animation currently playing on a model, and resets its position. |
| 83 | +# Input definitions: |
| 84 | +# root_entity: The root entity gotten from 'dmodels_spawn_model'. |
| 85 | +# dmodels_animate |
| 86 | +# Usage: Starts a model animating the given animation, until the animation ends (if it does at all) or until the animation is changed or ended. |
| 87 | +# Input definitions: |
| 88 | +# root_entity: The root entity gotten from 'dmodels_spawn_model'. |
| 89 | +# animation: The name of the animation to play (as set in BlockBench). |
| 90 | +# dmodels_move_to_frame |
| 91 | +# Usage: Moves a model's position to a single frame of an animation. Not intended for external use except for debugging animation issues. |
| 92 | +# Input definitions: |
| 93 | +# root_entity: The root entity gotten from 'dmodels_spawn_model'. |
| 94 | +# animation: The name of the animation to play (as set in BlockBench). |
| 95 | +# timespot: The time (in seconds) from the start of the animation to select as the frame. |
| 96 | +# delay_pose: 'true' if playing fluidly to offset the pose application over time, 'false' to snap exactly to frame position. |
| 97 | +# |
| 98 | +################################################ |
| 99 | + |
0 commit comments