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

More attention to "MC animated textures" #9

Open
Fixer-007 opened this issue Apr 23, 2016 · 6 comments
Open

More attention to "MC animated textures" #9

Fixer-007 opened this issue Apr 23, 2016 · 6 comments

Comments

@Fixer-007
Copy link

Fixer-007 commented Apr 23, 2016

After texture fix #4016 you will need to improve your mcresconvert a bit for cases like were minetest is not using animation (like animated diamond ore/iron ore in John Smith modded pack), that means 32x1044 px file or so should be truncated to just 32x32. This issue appears only on rare packs, like on this popular one: http://mods.curse.com/texture-packs/minecraft/223328-john-smith-legacy-modded.
Example of animated iron ore texture, when #4016 is applied: https://i.imgur.com/5On8J7i.png

@Fixer-007 Fixer-007 changed the title More attention to "animated textures" More attention to "MC animated textures" Apr 23, 2016
@wilkgr76
Copy link

wilkgr76 commented Jun 6, 2016

I wanted to make an animated crosshair. Can you guess what happened?

Yeah, didn't work...

@sofar
Copy link
Member

sofar commented Jun 8, 2016

Right, the problem is that in MC almost any texture can be animated, but MT doesn't automatically animate anything as the code to detect animated tiles just isn't present in MT. Basically every texture needs to be de-tiled, except for ... the ones we know can be animated.

@ensonic
Copy link
Contributor

ensonic commented Jul 9, 2016

Is it so that the animation only work, where the corresponding block is build like this?
https://forum.minetest.net/viewtopic.php?id=6767

tiles = {{name="xxx_animated.png", animation={type="vertical_frames",  aspect_w=32, aspect_h=32, length=8}}},

@sofar
Copy link
Member

sofar commented Jul 11, 2016

@ensonic yes, that's correct.

@ensonic
Copy link
Contributor

ensonic commented Jul 11, 2016

So ideally minetest would need some mechanism to allow texture packs to enable the animation part dynamically. Can't think of a clean way to achieve this though :/

@ensonic
Copy link
Contributor

ensonic commented Aug 8, 2016

textures with animation can not only be detected because of their aspect ration, but also by the presence of a $texture.png.mcmeta file in json format, e.g.

{
  "animation": {
    "frametime":4,
    "frames": [
      0,
      1,
      2,
      3,
      4,
      5,
      6,
      7,
      8,
      9,
      10,
      11,
      12
    ]
  }
}

or

{
  "animation": {
    "frames": [
      {
        "index": 0,
        "time": 11
      },
      {
        "index": 1,
        "time": 7
      },
      ...
      {
        "index": 0,
        "time": 13
      }
    ]
  }
}

Unfortunately (as we can see) the format can vary. If we're okay to add a dependency to jq (which is commonly available), we can extract the number of frames like this:

# v1
cat items/bucket_water.png.mcmeta | jq '.animation.frames | max_by(.)'
# v2
cat blocks/tallgrass.png.mcmeta | jq '.animation.frames | max_by(.index) | .index'

Seems we can select the type by grepping for "index":.

That remaining main issue seems that we need a list of which textures in minetest support animations right now. Any idea?

ensonic added a commit to ensonic/mcresconvert that referenced this issue Aug 6, 2017
Item textures are not animated in minetest.
See minetest-tools#9
ensonic added a commit to ensonic/mcresconvert that referenced this issue Aug 6, 2017
Item textures are not animated in minetest.
See minetest-tools#9
ensonic added a commit to ensonic/mcresconvert that referenced this issue Aug 6, 2017
Item textures are not animated in minetest.
See minetest-tools#9
ensonic added a commit to ensonic/mcresconvert that referenced this issue Aug 6, 2017
For minetest blocks that are not animated crop to the first frame.
See minetest-tools#9
ensonic added a commit to ensonic/mcresconvert that referenced this issue Aug 6, 2017
For minetest blocks that are not animated crop to the first frame.
See minetest-tools#9
sofar pushed a commit that referenced this issue Nov 25, 2017
Item textures are not animated in minetest.
See #9
sofar pushed a commit that referenced this issue Nov 25, 2017
For minetest blocks that are not animated crop to the first frame.
See #9
ensonic added a commit to ensonic/mcresconvert that referenced this issue Nov 26, 2017
Minetest seems to name textures '_animated.png' if they are. If source
textures are animated, but the target isn't named accordingly, crop it.

See minetest-tools#9
sofar pushed a commit that referenced this issue Nov 27, 2017
Minetest seems to name textures '_animated.png' if they are. If source
textures are animated, but the target isn't named accordingly, crop it.

See #9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants