For any feature requests to either the Skyline Engine or the websites and forums please leave your suggestion here.

Animation API [Done]

Animation API [Done]

Postby ant0N » 18 Nov 2012, 14:51

here is how I see these commands. :)
over time the list of commands will be added.

Code: Select all
1 entity.loadAnimation(entity, animation) -- adds the animation of the object.
2 entity.animation(entity, frame, flag)
   flag:
      1 = lose once.
      2 = fixated
      3 = play in reverse order
3 entity.getAnimation(entity) -- get the current animation.
4 entity.setAnimation(entity, animation) --change your current animation
5 entity.stateAnimation(entity) -- returns the state of the animation
   return:
      0 = the animation does not play
      1 = the animation is playing
6 entity.extractAnimation(animation, frameStart, frameEnd) -- extract animation


==================================================================================
exemple:
Code: Select all
      function onInit()
         obj = objID
         idle = entity.extractAnimation("C:/zombi.mesh", 0, 20)
         run  = entity.extractAnimation("C:/zombi.mesh", 21, 40)
         die  = entity.extractAnimation("C:/zombi.mesh", 41, 60)
         entity.animation(obj, idle, 2)
      end
      
      function onUpdate()
         if( input.keyDown( "up" ) == 1) then
            entity.move(obj,0,0,0.1)
            if entity.stateAnimation(run) == 0 then
               entity.animation(obj, run, 2)
            end
         else
            if entity.stateAnimation(run) == 0 then
               entity.animation(obj, idle, 2)
            end
      end   
User avatar
ant0N
Skyline Moderator
Skyline Moderator
 
Posts: 415
Joined: 02 Nov 2012, 12:49
Location: Россия, Москва
Skill: Programmer
Skill: 3D Modeller

Re: Animation API

Postby StarFire » 18 Nov 2012, 15:58

Keep them coming ;)
User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1678
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer

Re: Animation API

Postby SolarPortal » 29 Nov 2012, 19:08

lua controlled animations is now possible by simple and easy to use controls stored in a lua library called anim
Animations allow blending between animations with an adjustable blend time value.
A new demo has been made displaying the animation control system.

Here are the new controls.
  • anim.loadAnimation
  • anim.playAnimation
  • anim.stopAnimation
  • anim.setEnabled
  • anim.setLooped
  • anim.setLength
  • anim.setTime
  • anim.setWeight
  • anim.setSpeed
  • anim.getEnabled
  • anim.getLooped
  • anim.getLength
  • anim.getTime
  • anim.getWeight
  • anim.getSpeed

The Online lua reference will be updated with the new commands upon release and provide much more information and examples.

:D
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: Анимация API

Postby ant0N » 30 Nov 2012, 06:39

Great news! Waiting for a new demo.... :D
User avatar
ant0N
Skyline Moderator
Skyline Moderator
 
Posts: 415
Joined: 02 Nov 2012, 12:49
Location: Россия, Москва
Skill: Programmer
Skill: 3D Modeller


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 0 guests