Author Topic: Animation codes [Presets]  (Read 2485 times)

Offline Drunken-Royalty

  • Experienced Traveler
  • **
  • Posts: 164
  • Country: gb
  • Floof-O-Meter: 10
  • DA - DrunkenRoyalty
    • DrunkenRoyalty
    • xX SashaLea Xx
    • View Profile
Animation codes [Presets]
« on: April 12, 2017, 07:02:34 pm »
Hey, has anyone got the full coding for animation presets? Fade in/out?
T.I.A.

I have the body part...
Quote
material preset_7_bodyMatL
{
 technique
 {
  pass
  {
  alpha_rejection greater_equal 128
   scene_blend alpha_blend
   texture_unit
   {
    anim_texture presetBodya.png  presetBodyb.png presetBodyc.png presetBodyd.png presetBodye.png presetBodyf.png presetBodyg.png presetBodyh.png presetBodyi.png presetBodyj.png presetBodyk.png presetBodyk.png presetBodyj.png presetBodyi.png presetBodyh.png presetBodyg.png presetBodyf.png presetBodye.png presetBodyd.png presetBodyc.png presetBodyb.png presetBodya.png 2.0
   }
  }
 }
}
material preset_7_bodyMatR
{
 technique
 {
  pass
  {
  alpha_rejection greater_equal 128
   scene_blend alpha_blend
   texture_unit
   {
    anim_texture presetBodya.png  presetBodyb.png presetBodyc.png presetBodyd.png presetBodye.png presetBodyf.png presetBodyg.png presetBodyh.png presetBodyi.png presetBodyj.png presetBodyk.png presetBodyk.png presetBodyj.png presetBodyi.png presetBodyh.png presetBodyg.png presetBodyf.png presetBodye.png presetBodyd.png presetBodyc.png presetBodyb.png presetBodya.png 2.0
   }
  }
 }
}
Loyalty is key. Don't talk behind other's back. Don't pick and choose people for your own benefit of work. Don't stir trouble and never, ever, lie.

Offline Morgra

  • I don't like sand...
  • Immortal Legend
  • *****
  • Posts: 5,718
  • Country: us
  • Floof-O-Meter: 347
  • Ever been killed by a spider? I was
    • DinksterDaily
    • View Profile
Re: Animation codes [Presets]
« Reply #1 on: April 12, 2017, 07:49:59 pm »
Hi there!

If you're looking for the coding for frame animation on presets, then look no further, you have it right there! Not sure what you mean by full coding, because it all depends on what parts the body want to be animated, how many frames the body parts have, and the file names of each of the frames. Allow me to break it down for you:

Format for Frame Animated Presets: anim_texture <frame1> <frame2> ... <duration in seconds>

Example: anim_texture presetBodya.png presetBodyb.png ... 2.0

--------------------

anim_texture is the keyword that makes it so the texture is animated frame by frame.

The second part is the frames in the order they need to appear. In your coding's case, it would be presetbodya.png presetBodyb.png presetBodyc.png .... and so forth. These are the file names of each frame. Make sure you include them all in order to get the effect you like. In the coding you provided, it fades in and out. Meaning, that the files go up to the frame file presetBodyk.png, then go back down to presetBodya.png

The final part of animated preset coding is the number at the end. This is pretty self explanatory. The number, in seconds, is the duration it takes to get to the first frame to the final frame. The shorter the number, the faster the animation. The longer the number, the slower the animation. I suggest messing with this until you get the speed and look you desire. It will take a few tries.

Note: Make sure you have all the frame files in your preset's folder under C:\FeralHeart\my_presets\preset_#

--------------------------------------------------

In the coding, like you said, you have the body. What you need to do if you want more animation on your preset (such as on the head, the eyes, the tail etc) is make brand new frame files with a brand new code for each part you want to animate. The placement of the anim_texture will be the same for each, but the difference will be in the names of the frames. As I don't know what format you are choosing to name your friends and what body parts you are wanting to animate, let me show you what it will look like under the left head part:

Code: [Select]
material preset_#_headMatL
{
 technique
 {
  pass
  {
   texture_unit
   {
    anim_texture presetHeada.png  presetHeadb.png presetHeadc.png presetHeadd.png presetHeade.png presetHeadf.png presetHeadg.png presetHeadh.png presetHeadi.png presetHeadj.png presetHeadk.png presetHeadk.png presetHeadj.png presetHeadi.png presetHeadh.png presetHeadg.png presetHeadf.png presetHeade.png presetHeadd.png presetHeadc.png presetHeadb.png presetHeada.png 2.0
   }
   }
  }
 }
}

Now, that is assuming you want the same effect for each body part, with the same number of frames, going at the same speed as everything else. They do not all have to be the same. Each body part can have a different animation to it with different numbers of frames to it than other body parts. In order for me to post your entire code, I would need to know what parts you needed animating, how many frames they each had, what the file names were for the different part's frames, and how fast you wanted it to go. This is not an easy task for someone not knowing what the preset needs to look like, so this is why I've given you this information ^^. All you need to do for your coding is place an anim_texture where there's just a texture only under the body parts that you need to be animated and follow the anim_texture format.

If you have questions, feel free to continue to ask! I hope I explained myself clearly.
Profile pic by Edolicious

People don't think the universe be like it is, but it do.


Offline Drunken-Royalty

  • Experienced Traveler
  • **
  • Posts: 164
  • Country: gb
  • Floof-O-Meter: 10
  • DA - DrunkenRoyalty
    • DrunkenRoyalty
    • xX SashaLea Xx
    • View Profile
Re: Animation codes [Presets]
« Reply #2 on: April 12, 2017, 07:58:34 pm »
Oh, yeah I understand all that! Thank you anyways, but all I need is the full coding like head/eyes/tail. I only have the body code currently.
Loyalty is key. Don't talk behind other's back. Don't pick and choose people for your own benefit of work. Don't stir trouble and never, ever, lie.

Offline Morgra

  • I don't like sand...
  • Immortal Legend
  • *****
  • Posts: 5,718
  • Country: us
  • Floof-O-Meter: 347
  • Ever been killed by a spider? I was
    • DinksterDaily
    • View Profile
Re: Animation codes [Presets]
« Reply #3 on: April 12, 2017, 08:03:34 pm »
Oh, yeah I understand all that! Thank you anyways, but all I need is the full coding like head/eyes/tail. I only have the body code currently.

All you need to do for your coding is place an anim_texture where there's just a texture only under the body parts that you need to be animated and follow the anim_texture format.

You in fact, as I explained before, already have the animated preset coding. You just need to place it accordingly in the material file under the body parts that require animation. Take a look at the code example I placed and notice how the frames are differently named and how it's under the left head material.
Profile pic by Edolicious

People don't think the universe be like it is, but it do.


Offline Drunken-Royalty

  • Experienced Traveler
  • **
  • Posts: 164
  • Country: gb
  • Floof-O-Meter: 10
  • DA - DrunkenRoyalty
    • DrunkenRoyalty
    • xX SashaLea Xx
    • View Profile
Re: Animation codes [Presets]
« Reply #4 on: April 12, 2017, 08:05:16 pm »
OOOhhh, right okay I get you now.

It's been a long day for my poor brain xD

Thanks again.
Loyalty is key. Don't talk behind other's back. Don't pick and choose people for your own benefit of work. Don't stir trouble and never, ever, lie.

Offline Kuri

  • Immortal Legend
  • *****
  • Posts: 8,168
  • Country: nz
  • Floof-O-Meter: 136
  • Foreboding evil harmless kitten.
    • dumbstuff4friends
    • channel/UCo42jgbLvEzkofpOin0_a4A
    • View Profile
Re: Animation codes [Presets]
« Reply #5 on: April 12, 2017, 08:06:50 pm »
If you are wanting to fade out transparency wise and are using a whole lot of .png with differing transparency i think you might find having the "alpha_rejection 128" code will make you blink in & out of existence.


The head code looks like
material preset_3_headMatL  (and same with an R instead of an L on the end for the right hand side)
Eyes like
material preset_3_eyeMatL
Tail
material preset_3_tailMat  (Tail has only one side)
The Japanese concept of wabisabi:
The closest concept in english would be 'rustic'
They might have an old thing, one example is a favourite bowl or dish, it's broken, pieces are missing, why fix it?  With gold and pieces from other dishes?
"Because it was my favourite & I like it"

Offline Morgra

  • I don't like sand...
  • Immortal Legend
  • *****
  • Posts: 5,718
  • Country: us
  • Floof-O-Meter: 347
  • Ever been killed by a spider? I was
    • DinksterDaily
    • View Profile
Re: Animation codes [Presets]
« Reply #6 on: April 12, 2017, 08:06:59 pm »
No problem! x3 I understand what that's like

Hope my instructions make enough sense. Let me know if you end up getting it to work or not.

Best of luck to ya.
Profile pic by Edolicious

People don't think the universe be like it is, but it do.


Offline Drunken-Royalty

  • Experienced Traveler
  • **
  • Posts: 164
  • Country: gb
  • Floof-O-Meter: 10
  • DA - DrunkenRoyalty
    • DrunkenRoyalty
    • xX SashaLea Xx
    • View Profile
Re: Animation codes [Presets]
« Reply #7 on: April 12, 2017, 09:04:41 pm »
It was just to play with, but I got there in the end! ^_^
https://www.youtube.com/watch?v=qeE_nXdqcLw&feature=youtu.be
Loyalty is key. Don't talk behind other's back. Don't pick and choose people for your own benefit of work. Don't stir trouble and never, ever, lie.

Offline Morgra

  • I don't like sand...
  • Immortal Legend
  • *****
  • Posts: 5,718
  • Country: us
  • Floof-O-Meter: 347
  • Ever been killed by a spider? I was
    • DinksterDaily
    • View Profile
Re: Animation codes [Presets]
« Reply #8 on: April 12, 2017, 09:42:17 pm »
Excellent job! Glad you figured it out. Animated presets are fun to work with.

I'll lock this since you got your coding worked out.
Profile pic by Edolicious

People don't think the universe be like it is, but it do.