minetest / minetest

Minetest is an open source voxel game-creation platform with easy modding and game creation

Home Page:https://www.minetest.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add ability to unset bones (return to original animated state)

FatalError42O opened this issue · comments

When you use :set_bone_position() it is impossible to unset, reset, or otherwise return it to it's original state!
this means, (for example) if you want to make an arm face a certain direction (without permanently disabling animations in that bone) that you need to: change the player model to a model with BONES WITH SEPERATE NAMES and then set it back when you're done, there is no way around this, I've faced this problem time and time again, resetting the model does nothing, it is painful.

The clear solution is to add a equivalent objref:unset_bone_position() function, this way you can return the bone to its original state where it is animated according to the model.

There's also a few other ways to go about this;
have returning nil return it to its original state instead of adding a new function
OR
make an option to have it be an offset type thing like:
objref:set_bone_position([bone, position, rotation], offset)
where "offset" would be a bool indicating whether it removes the animation entirely, this would serve multiple purposes
it would
A: allow for more complex animations to be done with a bone (this is a massive improvement and would open up possibilities)
B: obviously allow it to be reverted back by objref:set_bone_position("arm_right", nil, nil, true) or something of the sort

While the addition to the set_bone_position by creating an option for it to be an offset is a great option, it is not exactly necessary at the moment, and may take more time to implement (though I'm not a core dev so I don't know) if minetest and its development was perfect, I'd choose that option, however for now- I think it can (hopefully) be a later addition to the API and can wait. What's more important is that there's actually a way to unset bone positions, as this is a absolutely frustrating issue, and needs to be improved desperately if the modding community is to continue innovating