-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Draw node animation for items #15930
base: master
Are you sure you want to change the base?
Conversation
So glad to see this finally getting implemented (even if only in part) |
Disclaimer: I haven’t tested yet. I see it’ behind the animated inventory items setting. Which also has the rotating items. Could this be changed to perhaps a new property that can be set per block that allows it to have the animation or not ? |
This will most likely be doable using (animated) mesh inventory images in the future. I don't know about the rotating items. You should probably fill out a feature request issue in this regard. |
No i'm saying that you put it behind the same setting that has the item rotation. |
I think making this node-def-controlled is a good idea. Game developers should have fine-granular control over this; I don't see a priori why players should have much control here. I agree that "reusing" the |
(I assume by "this" you mean the texture animation and not the rotation.) Allowing players to disable animations is beneficial for accessibility. People with vestibular disorder, epilepsy and similar may suffer from animated images, if I'm not wrong. So I guess it is good to have a global setting for this
What do you suggest? Should it just ignore the I thought it could even be considered a bug that animated nodes are not drawn animated in inventories, but if there is so much to discuss I should have opened an issue first. Note that this PR is closely related to #4758, but it does not solve it. |
@@ -404,7 +411,7 @@ void WieldMeshSceneNode::setItem(const ItemStack &item, Client *client, bool che | |||
setExtruded(tsrc->getTextureName(l0.texture_id), | |||
"", wield_scale, tsrc, | |||
l0.animation_frame_count); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note that setExtruded
cuts the texture down to its first animation frame, so there's no point remembering animation info in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, setExtruded
is only used for the wield mesh anyway, where the animation does not take effect (yet).
So I made it only remember the color there, like it was before, but for other draw types, both inventory items and the wield mesh uses createGenericNodeMesh
which remembers the animation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed, animation for extruded meshes will be added in a follow up PR.
Thanks for the review. |
I finally solved the wield mesh flickering problem by updating the lighting and animation at the same time instead of doing it separately. |
I moved I suppose it would be too much for this PR if I change large parts of the code to make it work for drawtypes that use a flat inventory image that has no tile layer. I will probably fix this in a follow up PR which also adds an API to set the inventory image animation in the item definition table. |
@@ -763,6 +761,12 @@ bool MapBlockMesh::animate(bool faraway, float time, int crack, | |||
// Cracks | |||
if (crack != m_last_crack) { | |||
for (auto &crack_material : m_crack_materials) { | |||
|
|||
// TODO crack on animated tiles does not work |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it never worked, so I just removed it. (because of the AnimationInfo
change)
See #5317
I like this feature but would prefer to have it only apply to the hovered/selected ItemStack like the existing rotation animation. |
I can’t say I’m for that. To help with game aesthetics I believe it would be better to define this per item. |
I prefer that by default nodes placed in the world and in inventories look the same, including the animation. In my opinion, it would be better to turn the hovered/selected appearance into another feature, like |
Only active if theinventory_items_animations
setting is on.(It does not work for the wield mesh without flickering)solvedClick me (Videos)
mtg.mp4
dev_animated.mp4
To do
Ready for Review.
Maybe some refactoring.
How to test
Enable theinventory_items_animations
setting.Start devtest and get some Animated Test Nodes.