Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customizable wielditem animations for items with on_use functions #2811

Open
MirceaKitsune opened this issue Jun 21, 2015 · 11 comments
Open
Labels
@ Client / Audiovisuals Feature request Issues that request the addition or enhancement of a feature

Comments

@MirceaKitsune
Copy link
Contributor

Whenever you left-click, your empty hand or the item you are wielding swings forward. While this is the sane and normal behavior for most items, it would be extremely useful if the animation of the wielded item could be disabled or overridden by the items. This is an obvious and problematic limitation, as it's impossible to have a matching animation for items with special uses.

The most common example are items you eat: When you left-click to eat an apple, you swing that apple forth as if punching, instead of bringing it closer to the camera where your mouth should be, or not doing any movement at worst. Weapons are even more affected: You cannot make a bow or pistol that shoots upon left-clicking, because it looks like you're punching with it... Kaeza's firearms mod is an example of how ridiculous that looks.

I believe we seriously need a way to disable or customize the wielditem animation for items that have an on_use function. The easy solution would be a flag to disable the punch animation altogether, which would make weapons being fired not look so weird. The harder but better fix would be mechanics to customize the animation... perhaps a Lua table containing a set of positions that the wielded item goes through? Whichever implementation is best, I think a solution for this is highly needed, and that someone with knowledge in this area should look into an option for this.

@C1ffisme
Copy link

Idea:
Like Blender, we could define 3D keyframes, and points on the 16x16 image to go to these keyframes.

@rubenwardy
Copy link
Contributor

@C1ffisme yes, that's what we're talking about: you'd need keyframes to do this. It would be simpler to do position/rotations though.

I'd like to see this feature.

@Jordach
Copy link
Contributor

Jordach commented Jun 22, 2015

Why not just use a model format with a skeleton and animate the skeleton in
Blender? .x, .b3d and .obj are able to animate to a custom skeleton with
keyframes. Have both a right mouse and left mouse set of animations.

On 22 June 2015 at 10:17, rubenwardy [email protected] wrote:

@C1ffisme https://github.com/C1ffisme yes, that's what we're talking
about: you'd need keyframes to do this.

I'd like to see this feature.


Reply to this email directly or view it on GitHub
#2811 (comment).

@MirceaKitsune
Copy link
Contributor Author

@Jordach That might not be the best solution, since we probably don't want Minetest to depend on models for basic features (like the wield item). They're meant for players, entities, and mesh nodes.

What I think might be an easy solution is implementing a customizable animation in a single vector (direction). So you can specify something like (x = 0, y = 0, z = -1) which would make the wielditem move by amount -1 when you left-click (toward the center of the screen). Rotation on the way can be automatically determined based on velocity, or we could customize it as another vector.

Or perhaps we should have two vectors, where the first is the normal position of the wielded visual of that item? After all, we don't have a way to reposition it per item either, it always appears in the right hand... we might want special items to appear in the center of the screen for example, so why not?

-- example: re-simulating the existing punch animation using the new function
minetest.register_item({
-- wielditem_animation: (pos, direction, animation_speed)
wielditem_animation = ({x = 0, y = 1, z = 2.5}, {x = 5, y = -2.5, z = 0}, 1)
}}

@Jordach
Copy link
Contributor

Jordach commented Jun 23, 2015

No, no - you mis-interpreted - you should TREAT the wielditem much like an
entity - the original extruded object can be PARENTED to a bone, which can
then be edited via Blender's dope sheet or create some new keyframes.

On 22 June 2015 at 13:20, Mircea Kitsune [email protected] wrote:

@Jordach https://github.com/Jordach That might not be the best solution
here, since we probably don't want Minetest to depend on models for basic
features (like the wield item). They're only meant for players, entities,
and mesh nodes.

What I think might be an easy solution is implementing a customizable
animation in a single vector (direction). So you can specify something like
(x = 0, y = 0, z = -1) which would make the wielditem move by amount -1
when you left-click (toward the center of the screen). Rotation on the way
can be automatically determined based on movement, or we could customize it
as another vector.

Or perhaps we should have two vectors, where the first is the normal
position of the wielded visual of that item? After all, we don't have a way
to reposition it per item either, it always appears in the right hand... we
might want special items to appear in the center of the screen for example,
so why not?

-- example: re-simulating the existing punch animation using the new
function
minetest.register_item({
-- wielditem_animation: (pos, direction, animation_speed)
wielditem_animation = ({x = 0, y = 1, z = 2.5}, {x = 5, y = -2.5, z = 0},
1)
}}


Reply to this email directly or view it on GitHub
#2811 (comment).

@4aiman
Copy link
Contributor

4aiman commented Jun 24, 2015

+1 Animations for eating, shooting, launching an arrow - just you wait!

@paramat paramat added the Feature request Issues that request the addition or enhancement of a feature label Apr 2, 2016
@Wuzzy2
Copy link
Contributor

Wuzzy2 commented Feb 11, 2017

Yes, this would be a good addition.
I would also suggest to define some common default animations (like eating) directly in the engine so subgames don't have to recreate the eating animation (and other important animations) 1,000,000 times. ;-)

@Ferk
Copy link
Contributor

Ferk commented Apr 29, 2017

For reference: PR #4297 is an implementation (WIP) in this direction

@FreeLikeGNU
Copy link
Contributor

I have not played with wield animation but:
I too, would like the animation for wielding created from an armature in a tool like Blender as suggested. We could have all kinds of complex actions possible. That said:

I would love to see wield, player and entity animations as modable (without replacing the existing model). It would be nice if the flow for creating the animation were something like, if I may be vebose:

  • Open the model to be affected in blender,
  • Perform desired transforms, rots, etc on armature for some number of frames, save animated model.
  • Define frames and bone names of the new model animation frames to perform on existing model for the action in lua.
  • MT would then transform bones on existing model for the action defined in the mod.

The reasoning is that we don't want to have to replace the entire animated model for each mod, we just want to add some animation to that model for a specific action. (Lets take advantage of manipulating bones!) While defining animation with vectors and quarts is OK, its not very intuitive for one making the art and we already have a well established tool (Blender) to make animating models relatively easy.

@sfan5
Copy link
Collaborator

sfan5 commented Apr 26, 2020

#9562 is recent PR by Jordach that allows disabling the default animation at least

@rubenwardy
Copy link
Contributor

Here's a PR I made in 2016 that allows linear keyframing of wielditem animations: #4297

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@ Client / Audiovisuals Feature request Issues that request the addition or enhancement of a feature
Projects
None yet
Development

No branches or pull requests

10 participants