[Mod] Character Animations [character_anim]

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

[Mod] Character Animations [character_anim]

by LMD » Post

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


Links
  • 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. Disable mod security. Make sure you trust all your mods! Ideally import models with all other mods disabled.
    3. Export the model as glTF and save it under models/modelname.extension.gltf
    4. Do /ca_import modelname.extension
  2. Install and use character_anim like any other mod
Last edited by LMD on Mon Dec 28, 2020 17:35, edited 5 times in total.
My stuff: Projects - Mods - Website

User avatar
daret
Member
Posts: 136
Joined: Tue Nov 12, 2019 20:36
GitHub: daretmavi
In-game: Daretmavi

Re: [Mod] Character Animations [character_anim]

by daret » Post

Greate job, thanx.

User avatar
daret
Member
Posts: 136
Joined: Tue Nov 12, 2019 20:36
GitHub: daretmavi
In-game: Daretmavi

Re: [Mod] Character Animations [character_anim]

by daret » Post

Is it possible to add skindb support? It is not working with this mod.
https://github.com/minetest-mods/skinsdb.git

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [Mod] Character Animations [character_anim]

by LMD » Post

daret wrote:
Wed Oct 07, 2020 20:07
Is it possible to add skindb support? It is not working with this mod.
https://github.com/minetest-mods/skinsdb.git
Yes it is, but I ultimately see this as a skinsdb issue. Skinsdb should use the 3d armor model instead of registering it's own.
My stuff: Projects - Mods - Website

User avatar
daret
Member
Posts: 136
Joined: Tue Nov 12, 2019 20:36
GitHub: daretmavi
In-game: Daretmavi

Re: [Mod] Character Animations [character_anim]

by daret » Post

Maybe it is because 3d armor is not mandatory dependency, so it uses it's own model.

User avatar
daret
Member
Posts: 136
Joined: Tue Nov 12, 2019 20:36
GitHub: daretmavi
In-game: Daretmavi

Re: [Mod] Character Animations [character_anim]

by daret » Post

Hi,
I tested it wit emote mod viewtopic.php?t=16374 and most of the emotes works, but /freeze and /point are shutting game down.

Code: Select all

AsyncErr: environment_Step: Runtime error from mod 'character_anim' in callback environment_Step(): ...t/games/Planet_alive/mods/player/character_anim/main.lua:9: nan
stack traceback:
	[C]: in function 'assert'
	...t/games/Planet_alive/mods/player/character_anim/main.lua:9: in function 'get_animation_value'
	...t/games/Planet_alive/mods/player/character_anim/main.lua:119: in function 'handle_player_animations'
	...t/games/Planet_alive/mods/player/character_anim/main.lua:203: in function <...t/games/Planet_alive/mods/player/character_anim/main.lua:201>
	/usr/share/minetest/builtin/game/register.lua:429: in function </usr/share/minetest/builtin/game/register.lua:413>
stack traceback:

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [Mod] Character Animations [character_anim]

by LMD » Post

daret wrote:
Thu Oct 08, 2020 19:14
Hi,
I tested it wit emote mod viewtopic.php?t=16374 and most of the emotes works, but /freeze and /point are shutting game down.

Code: Select all

AsyncErr: environment_Step: Runtime error from mod 'character_anim' in callback environment_Step(): ...t/games/Planet_alive/mods/player/character_anim/main.lua:9: nan
stack traceback:
	[C]: in function 'assert'
	...t/games/Planet_alive/mods/player/character_anim/main.lua:9: in function 'get_animation_value'
	...t/games/Planet_alive/mods/player/character_anim/main.lua:119: in function 'handle_player_animations'
	...t/games/Planet_alive/mods/player/character_anim/main.lua:203: in function <...t/games/Planet_alive/mods/player/character_anim/main.lua:201>
	/usr/share/minetest/builtin/game/register.lua:429: in function </usr/share/minetest/builtin/game/register.lua:413>
stack traceback:
Thanks for your bug report! Very useful, especially with the attached error log. This allowed me to quickly find and fix the bug for the newest version (rolling-11).
My stuff: Projects - Mods - Website

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [Mod] Character Animations [character_anim]

by LMD » Post

daret wrote:
Wed Oct 07, 2020 20:07
Is it possible to add skindb support? It is not working with this mod.
https://github.com/minetest-mods/skinsdb.git
Added skinsdb support. Get the latest release and it will work fine.
My stuff: Projects - Mods - Website

User avatar
daret
Member
Posts: 136
Joined: Tue Nov 12, 2019 20:36
GitHub: daretmavi
In-game: Daretmavi

Re: [Mod] Character Animations [character_anim]

by daret » Post

Wow, thanks. You are quick.

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [Mod] Character Animations [character_anim]

by LMD » Post

daret wrote:
Tue Oct 13, 2020 15:10
Wow, thanks. You are quick.
You're welcome! By the way, it actually didn't take long. What I did was quite simple:

1. Grab the model
2. Convert to glTF using Blender
3. Use /ca_import <modelname>
4. Commit
5. Push
6. Release on CDB
My stuff: Projects - Mods - Website

User avatar
daret
Member
Posts: 136
Joined: Tue Nov 12, 2019 20:36
GitHub: daretmavi
In-game: Daretmavi

Re: [Mod] Character Animations [character_anim]

by daret » Post

Thanx for info.

When I try to use /ca_import I always get an error:

Code: Select all

AsyncErr: ServerThread::run Lua: Runtime error from mod 'character_anim' in callback on_chat_message(): /home/user/.minetest/mods/character_anim/importer.lua:19: attempt to index global 'buffer' (a nil value)
stack traceback:
	/home/user/.minetest/mods/character_anim/importer.lua:19: in function 'read_accessor'
	/home/user/.minetest/mods/character_anim/importer.lua:80: in function 'read_bonedata'
	/home/user/.minetest/mods/character_anim/importer.lua:146: in function 'import_model'
	/home/user/.minetest/mods/character_anim/importer.lua:156: in function 'func'
	/usr/share/minetest/builtin/game/chat.lua:69: in function </usr/share/minetest/builtin/game/chat.lua:48>
	/usr/share/minetest/builtin/game/register.lua:429: in function </usr/share/minetest/builtin/game/register.lua:413>
I tried to use existing character.b3d.gltf as test.gltf and run /ca_import test

I'm probably missing something.

I installed binarystreams from luarocks

Code: Select all

luarocks list

Installed rocks:
----------------

binarystream
   1.0-2 (installed) - /usr/local/lib/luarocks/rocks
I use Linux KDE Neon (based on Ubuntu 20.04 LTS) - LuaRocks 2.4.2

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [Mod] Character Animations [character_anim]

by LMD » Post

Fixed it. Seems to be a Minetest bug. Will release tomorrow.

Edit: Released. Get the newest version from GitHub or ContentDB.
My stuff: Projects - Mods - Website

SFENCE
Member
Posts: 280
Joined: Sun Sep 29, 2019 07:13
GitHub: SFENCE
In-game: SFENCE

Re: [Mod] Character Animations [character_anim]

by SFENCE » Post

Hi.
There is a problem with tape when the character_anim mod is used at the same time as the clothing mod.

With character_anim enabled, the tape is shown on the bad side of the player. Details here: issue.

I have checked the code of character_anim and I think that the problem is models included in character_anim.

Can you look at it, please?
cdb_3P0AYqjEIn68

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [Mod] Character Animations [character_anim]

by LMD » Post

SFENCE wrote:
Wed May 26, 2021 12:09
Hi.
There is a problem with tape when the character_anim mod is used at the same time as the clothing mod.

With character_anim enabled, the tape is shown on the bad side of the player. Details here: issue.

I have checked the code of character_anim and I think that the problem is models included in character_anim.

Can you look at it, please?
Character_anim includes the models to ensure the right bone data is used. Clothing does not change the models.

I see two possibilities: (1) clothing relies on one of it's optional dependencies to override a model, which character_anim (wrongly) overrides again or (2) character_anim messes up a bone I haven't tested
My stuff: Projects - Mods - Website

SFENCE
Member
Posts: 280
Joined: Sun Sep 29, 2019 07:13
GitHub: SFENCE
In-game: SFENCE

Re: [Mod] Character Animations [character_anim]

by SFENCE » Post

LMD wrote:
Wed May 26, 2021 21:23
SFENCE wrote:
Wed May 26, 2021 12:09
Hi.
There is a problem with tape when the character_anim mod is used at the same time as the clothing mod.

With character_anim enabled, the tape is shown on the bad side of the player. Details here: issue.

I have checked the code of character_anim and I think that the problem is models included in character_anim.

Can you look at it, please?
Character_anim includes the models to ensure the right bone data is used. Clothing does not change the models.

I see two possibilities: (1) clothing relies on one of it's optional dependencies to override a model, which character_anim (wrongly) overrides again or (2) character_anim messes up a bone I haven't tested
In this case, clothing uses the character model from mod skinsdb. It looks like character_anim override this model from skinsdb.

Here is screenshots from testing:
Spoiler
Image
Attachments
cloth_cape.png
cloth_cape.png (334.9 KiB) Viewed 4522 times
cdb_3P0AYqjEIn68

sangeet
Member
Posts: 49
Joined: Sat Feb 13, 2021 12:15

Re: [Mod] Character Animations [character_anim]

by sangeet » Post

I ran into an issue when i tried to use this mod. If i connect to the server using minetest client, everything works fine. However, if I connect using multicraft, my characters flies in the air one block above the ground:

Image

To verify that this bug is caused by this mod, or most likely modlib, i tested it on server with just two mods installed.

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [Mod] Character Animations [character_anim]

by LMD » Post

sangeet wrote:
Fri May 28, 2021 18:00
I ran into an issue when i tried to use this mod. If i connect to the server using minetest client, everything works fine. However, if I connect using multicraft, my characters flies in the air one block above the ground:

Image

To verify that this bug is caused by this mod, or most likely modlib, i tested it on server with just two mods installed.
I can't properly support MultiCraft. They are most likely offsetting the model in a buggy way.
My stuff: Projects - Mods - Website

sangeet
Member
Posts: 49
Joined: Sat Feb 13, 2021 12:15

Re: [Mod] Character Animations [character_anim]

by sangeet » Post

LMD wrote:
Sun Jun 20, 2021 09:50
I can't properly support MultiCraft. They are most likely offsetting the model in a buggy way.
ok, thank you for your answer.

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

Re: [Mod] Character Animations [character_anim]

by runs » Post

A Petz user send me on ContentDB:

Code: Select all

2021-12-25 23:21:28: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'petz' in callback luaentity_Step(): /home/ulla/.minetest/mods/character_anim/main.lua:41: attempt to index a nil value
2021-12-25 23:21:28: ERROR[Main]: stack traceback:
2021-12-25 23:21:28: ERROR[Main]:   /home/ulla/.minetest/mods/character_anim/main.lua:41: in function 'set_bone_override'
2021-12-25 23:21:28: ERROR[Main]:   /home/ulla/.minetest/mods/character_anim/main.lua:60: in function 'set_bone_position'
2021-12-25 23:21:28: ERROR[Main]:   /home/ulla/.minetest/mods/petz/petz/mobkit/bh_head.lua:56: in function 'move_head'
2021-12-25 23:21:28: ERROR[Main]:   /home/ulla/.minetest/mods/petz/petz/mobkit/bh_head.lua:16: in function 'func'
2021-12-25 23:21:28: ERROR[Main]:   /home/ulla/.minetest/mods/mobkit/init.lua:621: in function 'execute_queues'
2021-12-25 23:21:28: ERROR[Main]:   /home/ulla/.minetest/mods/mobkit/init.lua:848: in function 'stepfunc'
2021-12-25 23:21:28: ERROR[Main]:   /home/ulla/.minetest/mods/petz/petz/petz/lamb_mobkit.lua:114: in function 'old_on_step'
2021-12-25 23:21:28: ERROR[Main]:   /home/ulla/.minetest/mods/monitoring/builtin/on_step.lua:17: in function </home/ulla/.minetest/mods/monitoring/builtin/on_step.lua:15>
It seems your mod conflicts hardly with Petz. I check your code and a line is:

Code: Select all

players = {}
And the offending line is #41:

Code: Select all

players[name].bone_positions[bonename] = value
This means a global variable. Please check this faults with luacheck to ensure 100% not global variables jumping across another mods...

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [Mod] Character Animations [character_anim]

by LMD » Post

runs wrote:
Wed Dec 29, 2021 16:43
A Petz user send me on ContentDB [...]
I received the same report from the same user. At the time of your post, I have already identified and resolved the issue in this commit. It stems from me overriding the :set_bone_position function for both entities and players but not handling it properly for entities. This unfortunately is a required workaround for compatibility with bone-override setting mods.
It seems your mod conflicts hardly with Petz.
"Hardly" usually means "scarcely (used to qualify a statement by saying that it is true to an insignificant degree)" according to a dictionary. You probably meant to use it in the archaic way, "harshly", or "critically".
This means a global variable. Please check this faults with luacheck to ensure 100% not global variables jumping across another mods...
I don't use luacheck, but you're wrong; the players variable is not global, it is environmental. I use modlib to change the environment of loaded files; you can almost always expect main.lua to run in a modified mod environment. players = {} then equals character_anim.players = {}.
My stuff: Projects - Mods - Website

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

Re: [Mod] Character Animations [character_anim]

by runs » Post

LMD wrote:
Wed Dec 29, 2021 17:59
runs wrote:
Wed Dec 29, 2021 16:43
A Petz user send me on ContentDB [...]
I received the same report from the same user. At the time of your post, I have already identified and resolved the issue in this commit. It stems from me overriding the :set_bone_position function for both entities and players but not handling it properly for entities. This unfortunately is a required workaround for compatibility with bone-override setting mods.
It seems your mod conflicts hardly with Petz.
"Hardly" usually means "scarcely (used to qualify a statement by saying that it is true to an insignificant degree)" according to a dictionary. You probably meant to use it in the archaic way, "harshly", or "critically".
This means a global variable. Please check this faults with luacheck to ensure 100% not global variables jumping across another mods...
I don't use luacheck, but you're wrong; the players variable is not global, it is environmental. I use modlib to change the environment of loaded files; you can almost always expect main.lua to run in a modified mod environment. players = {} then equals character_anim.players = {}.
Thanz you. Yes 'harshly' was the right word to use in this case.

Sometimes language barriers make it difficult for me to communicate. I know I sound rude sometimes, because Spanish is a very direct language, I would never say in Spanish: "I would like this, please", but rather I would say: "I want this".

User avatar
ulla
Member
Posts: 142
Joined: Wed Feb 04, 2015 09:22
GitHub: IIIullaIII
IRC: ulla
In-game: ulla

Re: [Mod] Character Animations [character_anim]

by ulla » Post

HI i have update server 5.5,I found that if you go into third person mode, the player is rotated badly while moving, but this is visible only for themselves other players do not see the error
X4cna2d4UqsiawIzUumDgPoYNx3JLGII

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [Mod] Character Animations [character_anim]

by LMD » Post

ulla wrote:
Sun Feb 20, 2022 15:49
HI i have update server 5.5,I found that if you go into third person mode, the player is rotated badly while moving, but this is visible only for themselves other players do not see the error
Can confirm, thanks for the report.
My stuff: Projects - Mods - Website

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [Mod] Character Animations [character_anim]

by LMD » Post

SFENCE wrote:
Wed May 26, 2021 12:09
Hi.
There is a problem with tape when the character_anim mod is used at the same time as the clothing mod.

With character_anim enabled, the tape is shown on the bad side of the player. Details here: issue.
Should be fixed on the latest master (rolling-25 on CDB) paired with the latest master of modlib (rolling-88 on CDB)
My stuff: Projects - Mods - Website

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [Mod] Character Animations [character_anim]

by LMD » Post

ulla wrote:
Sun Feb 20, 2022 15:49
HI i have update server 5.5,I found that if you go into third person mode, the player is rotated badly while moving, but this is visible only for themselves other players do not see the error
Fixed. Please update to rolling-25 (latest master) and update modlib to rolling-88 (latest master as well).
My stuff: Projects - Mods - Website

Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests