How to import gif texture ?

Discussion in 'Mapping Questions & Discussion' started by ggggass, Aug 25, 2016.

  1. ggggass

    ggggass L1: Registered

    Messages:
    28
    Positive Ratings:
    0
    how to import gif texture ?
     
  2. Crowbar

    aa Crowbar perfektoberfest

    Messages:
    1,419
    Positive Ratings:
    1,141
    You'll need to animate it through vmt, and probably have a vmf for each frame.
     
    • Agree Agree x 1
    • Respectfully Disagree Respectfully Disagree x 1
  3. ggggass

    ggggass L1: Registered

    Messages:
    28
    Positive Ratings:
    0
    Thanks :D and how i do change the texture's lenght?
     
  4. Nicky

    aa Nicky Rotten Tops

    Messages:
    907
    Positive Ratings:
    1,664
    You might want to check this out for creative sprite cards (Start at 26:00):

    View: https://youtu.be/70GhO6z5aKM?t=26m1s



    In order to do this, you will need to split your gif into separate frames as .tga's. You can do that by using an online tool like:
    http://ezgif.com/split

    I did this method for some of the meme particles in Meme Machine, like the rainbow frog and the duane. However I did have issues when gifs had too many frames, so after you split them up, you can delete a couple frames to try and keep it under something like 20.
     
    • Thanks Thanks x 1
  5. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,213
    Nope! Animated textures are just that, animated textures. They literally have multiple frames right in the VTF file, although you do still need to add a material proxy in your material file so the engine knows to actually animate them. Here's the relevant code:

    Code:
    "Proxies"
    {
        "AnimatedTexture"
        {
             "animatedtexturevar" "$basetexture"
             "animatedtextureframenumvar" "$frame"
             "animatedtextureframerate" 30 (or whatever you want it to be)
        }
    }
    Just slap that on the end of your VMT and you're golden.

    To make the actual texture, you'll need to actually have VTFEdit because the various export plugins (Photoshop, etc.) don't support animation. Save each frame as a separate file — don't forget to pad the dimensions out to a power of 2 first — differentiated by their frame number. Then launch VTFEdit, go to File > Import, and import all of your files at once. Make sure the texture type is set to "Animated Texture", which it should be by default. And that's all you really need to know.
     
    • Thanks Thanks x 2
    • Agree Agree x 2