Go to file
Lars Mueller e503b04040 Redirect all animations through character_anim
Clean implementation by hooking PlayerRef methods
2022-05-11 19:25:42 +02:00
models Add skinsdb support 2020-10-13 11:57:12 +02:00
Readme.md Add an API for setting bone overrides 2021-10-10 13:18:09 +02:00
importer.lua Fix global warnings if strictness is enabled 2021-01-17 18:16:37 +01:00
init.lua Switch to modlib quaternions 2021-04-01 01:12:38 +02:00
main.lua Redirect all animations through character_anim 2022-05-11 19:25:42 +02:00
mod.conf Redirect all animations through character_anim 2022-05-11 19:25:42 +02:00
modeldata.lua Add skinsdb support 2020-10-13 11:57:12 +02:00
schema.lua Switch to newer modlib.mod.configuration() 2021-04-01 00:56:32 +02:00
screenshot.png Add screenshot 2020-09-20 17:22:26 +02:00
settingtypes.txt Switch to newer modlib.mod.configuration() 2021-04-01 00:56:32 +02:00

Readme.md

Character Animations (character_anim)

Animates the character. Resembles playeranim and headanim.

About

Depends on modlib. Code written by Lars Mueller aka LMD or appguru(eu) and licensed under the MIT license. Media (player model) was created by MTG contributors (MirceaKitsune, stujones11 and An0n3m0us) and is licensed under the CC BY-SA 3.0 license, as must be its derivatives (skinsdb and 3d_armor variants).

Screenshot

Image

  • GitHub - sources, issue tracking, contributing
  • Discord - discussion, chatting
  • Minetest Forum - (more organized) discussion
  • ContentDB - releases (cloning from GitHub is recommended)

Features

  • Animates head, right arm & body
  • Advantages over playeranim:
    • Extracts exact animations and bone positions from glTF models
    • Also animates attached players (with restrictions on angles)
  • Advantages over headanim:
    • Provides compatibility for Minetest 5.2.0 and lower
    • Head angles are clamped, head can tilt sideways
    • Animates right arm & body as well

Instructions

  1. If you want to use a custom model, install binarystream from LuaRocks:
    1. sudo luarocks install binarystream on many UNIX-systems
    2. sudo luarocks install luabitop if you're not using LuaJIT
    3. Disable mod security. Make sure you trust all your mods! Ideally import models with all other mods disabled.
    4. Export the model as glTF and save it under models/modelname.extension.gltf
    5. Do /ca_import modelname.extension
  2. Install and use character_anim like any other mod

Configuration

default

arm_right

radius

Right arm spin radius

  • Type: number
  • Default: 10
  • >= -180
  • <= 180
speed

Right arm spin speed

  • Type: number
  • Default: 1000
  • > 0
  • <= 10000
yaw
max

Right arm yaw (max)

  • Type: number
  • Default: 160
  • >= -180
  • <= 180
min

Right arm yaw (min)

  • Type: number
  • Default: -30
  • >= -180
  • <= 180

body

turn_speed

Body turn speed

  • Type: number
  • Default: 0.2
  • > 0
  • <= 1000

head

pitch
max

Head pitch (max)

  • Type: number
  • Default: 80
  • >= -180
  • <= 180
min

Head pitch (min)

  • Type: number
  • Default: -60
  • >= -180
  • <= 180
yaw
max

Head yaw (max)

  • Type: number
  • Default: 90
  • >= -180
  • <= 180
min

Head yaw (min)

  • Type: number
  • Default: -90
  • >= -180
  • <= 180
yaw_restricted
max

Head yaw restricted (max)

  • Type: number
  • Default: 45
  • >= -180
  • <= 180
min

Head yaw restricted (min)

  • Type: number
  • Default: 0
  • >= -180
  • <= 180
yaw_restriction

Head yaw restriction

  • Type: number
  • Default: 60
  • >= -180
  • <= 180

models

Other models, same format as default model

API

Minetest's player:set_bone_position is overridden so that it still works as expected.

character_anim.set_bone_override(player, bonename, position, rotation)

The signature resembles that of set_bone_position. bonename must be a string. The following additional features are provided:

  • Using it like set_bone_position by setting rotation and position to non-nil values and using "" to set the root bone
  • Setting only the bone position by setting rotation to nil - bone rotation will then be model-animation-determined
  • Setting only the bone rotation by setting position to nil - bone position will then be model-animation-determined
  • Clearing the override by setting both rotation and position to nil ("unset_bone_position")