Difference between revisions of "Animation Streamlined"

From Second Life Wiki
Jump to navigation Jump to search
(A start)
 
(Adding links)
Line 6: Line 6:
What? Now you want their wings flapping and their legs moving?  
What? Now you want their wings flapping and their legs moving?  


====Give me the How-To!====
===Give me the How-To!===


You've got some choices to make. All the methods described here involve tradeoffs, and no one method is best in all situations. They all work for non-pathfinding creations as well.
You've got some choices to make. All the methods described here involve tradeoffs, and no one method is best in all situations.  
 
They work with pathfinding-enabled and non-pathfinding creations.


====Method: Animated Textures====  
====Method: Animated Textures====  


Use llAnimateTexture() with a texture to simulate movement.  
Use [[llAnimateTexture|llAnimateTexture]] and [[llSetLinkTextureAnim|llSetLinkTextureAnim]] with a texture to simulate movement.  


Most of the time a framed texture is what you'd want, but for something like a millipede's legs you might want to use a tiling texture instead. (flat texture pics, and maybe a pair of animated gifs of those textures) Eyes blinking. Bug wings.
Most of the time a framed texture is what you'd want, but for something like a millipede's legs you might want to use a tiling texture instead. (flat texture pics, and maybe a pair of animated gifs of those textures) Eyes blinking. Bug wings.
Line 25: Line 27:
====Method: Flexible Prims====
====Method: Flexible Prims====


Flexi can be used to simulate smooth movement. Guinea pigs hair, wings, shark
Flexi can be used to simulate smooth movement. (pic:those hairy Wilderness critters, flexi wings, library shark)


* A large number of flexi prims in a scene can lag the viewer. Viewer graphic settings can impact how flexi prims are displayed.
* A large number of flexi prims in a scene can lag the viewer. Viewer graphic settings can impact how flexi prims are displayed.
* A flexi prim's values can be changed via script using llSetLinkPrimitiveParamsFast() and the PRIM_FLEXIBLE flag.
* A flexi prim's values can be set in the edit window or changed via script using [[LlSetLinkPrimitiveParamsFast|llSetLinkPrimitiveParamsFast]] and the [[PRIM_FLEXIBLE]] flag.


====Method: Alpha Animation====
====Method: Alpha Animation====


Use llSetAlpha() to change which pieces are visible at any one time to simulate movement. (pic: river ray)
Use [[llSetLinkAlpha|llSetLinkAlpha]] to change which pieces are visible at any one time to simulate movement. (pic: river ray)


Make several models of your creature in different poses. Link them together, usually at the torso. Alternate which model of the linkset is visible.
Make several models of your creature in different poses. Link them together, usually at the torso. Alternate which model of the linkset is visible.


* Higher LI/prim count than other methods.  
* Higher LI/prim count than other methods.  
* It induces less sim lag than moving the prims, but the viewer receives a message for every alpha change.
* It induces less server lag than moving the prims, but the viewer receives a message for every alpha change.


====Method: Prim Movement====
====Method: Prim Movement====


This repositions and resizes pieces to simulate movement. (Pic: capybura? mopbeast with eyes that go big when it spots an avatar)
This method repositions and resizes pieces to simulate movement. (Pic: capybura? mopbeast with eyes that go big when it spots an avatar)


* Lower LI/prim count than alpha animation.
* Lower LI/prim count than alpha animation.
* Use the Physics Type None setting on the child prims. It does great things for the sim's script time.
* It causes a fair bit of server lag. Use the Physics Type None setting on the child prims to reduce the server's script time. You can set this when building in the edit window or via script using [[LlSetLinkPrimitiveParamsFast|llSetLinkPrimitiveParamsFast]] with [[PRIM_PHYSICS_SHAPE_TYPE]] set to [[PRIM_PHYSICS_SHAPE_NONE]].
* The viewer receives a message for each prim change.
* The viewer receives a message for each prim change.
* Using the edit window to resize a creature that uses prim movement can break the creature.
* Using the edit window to resize a creature that uses prim movement can break the creature.
* Use [[LlSetLinkPrimitiveParamsFast|llSetLinkPrimitiveParamsFast]] with the prim position, rotation, and size flags.


====Method: Sculpt Map Swap====
====Method: Sculpt Map Swap====
Line 54: Line 57:
* Lower LI/prim count than alpha animation. Beware of LI when using sculpts!
* Lower LI/prim count than alpha animation. Beware of LI when using sculpts!
* It generates a LOT of viewer lag. The viewer receives a message for each prim change. The viewer recalculates the sculpt mesh with each change. The impact of the recalculating can be softened by having prims within loading range showing the same sculpt shapes.
* It generates a LOT of viewer lag. The viewer receives a message for each prim change. The viewer recalculates the sculpt mesh with each change. The impact of the recalculating can be softened by having prims within loading range showing the same sculpt shapes.
* Use [[LlSetLinkPrimitiveParamsFast|llSetLinkPrimitiveParamsFast]] with the [[PRIM_TYPE_SCULPT]] flag to set a prim's sculpt map.

Revision as of 12:54, 12 June 2012

Animating Streamlined

Your creations are on the move. Congratulations!

What? Now you want their wings flapping and their legs moving?

Give me the How-To!

You've got some choices to make. All the methods described here involve tradeoffs, and no one method is best in all situations.

They work with pathfinding-enabled and non-pathfinding creations.

Method: Animated Textures

Use llAnimateTexture and llSetLinkTextureAnim with a texture to simulate movement.

Most of the time a framed texture is what you'd want, but for something like a millipede's legs you might want to use a tiling texture instead. (flat texture pics, and maybe a pair of animated gifs of those textures) Eyes blinking. Bug wings.

  • This is very low server and viewer lag.
  • This is 2D, so it's best for small or flat things.
  • SL won't allow you to upload a texture larger than 1024x1024 pixels so resolution may be an issue for textures with a lot of frames.
  • Animated textures on a prim can be on one face, or all faces with one direction, so sometimes you have to break a moving section up. (point out Sylvan's flipped UV wheel trick here)

(pic: hippoflies, solid and live) These hippoflies are an example of using model design and animated textures together. The model has several sets of wings. The different frames of the texture each have one pair of wings visible, so when animated the hippoflies resemble bumblebees.

Method: Flexible Prims

Flexi can be used to simulate smooth movement. (pic:those hairy Wilderness critters, flexi wings, library shark)

  • A large number of flexi prims in a scene can lag the viewer. Viewer graphic settings can impact how flexi prims are displayed.
  • A flexi prim's values can be set in the edit window or changed via script using llSetLinkPrimitiveParamsFast and the PRIM_FLEXIBLE flag.

Method: Alpha Animation

Use llSetLinkAlpha to change which pieces are visible at any one time to simulate movement. (pic: river ray)

Make several models of your creature in different poses. Link them together, usually at the torso. Alternate which model of the linkset is visible.

  • Higher LI/prim count than other methods.
  • It induces less server lag than moving the prims, but the viewer receives a message for every alpha change.

Method: Prim Movement

This method repositions and resizes pieces to simulate movement. (Pic: capybura? mopbeast with eyes that go big when it spots an avatar)

  • Lower LI/prim count than alpha animation.
  • It causes a fair bit of server lag. Use the Physics Type None setting on the child prims to reduce the server's script time. You can set this when building in the edit window or via script using llSetLinkPrimitiveParamsFast with PRIM_PHYSICS_SHAPE_TYPE set to PRIM_PHYSICS_SHAPE_NONE.
  • The viewer receives a message for each prim change.
  • Using the edit window to resize a creature that uses prim movement can break the creature.
  • Use llSetLinkPrimitiveParamsFast with the prim position, rotation, and size flags.

Method: Sculpt Map Swap

Swap the prim's sculpt map to simulate movement. (pic:flamingos)

  • Lower LI/prim count than alpha animation. Beware of LI when using sculpts!
  • It generates a LOT of viewer lag. The viewer receives a message for each prim change. The viewer recalculates the sculpt mesh with each change. The impact of the recalculating can be softened by having prims within loading range showing the same sculpt shapes.
  • Use llSetLinkPrimitiveParamsFast with the PRIM_TYPE_SCULPT flag to set a prim's sculpt map.