MaterialAnimation

ThereWiki | RecentChanges | Preferences

Material Animation

Basic Material Animation can be applied to designer objects in world. These animations consist of material textures instructed to move along the face of the object. Programming for these instructions can be done inside TsFiles.

Material Animation constants

DrawmodeDrawing mode of texture ( not detailed )
drawmode=valuedescription
0Defaultdefault
1Opaqueoverrides opacitymap
2Blendedalpha overlay (requires an opacity map)
3Filterfilter the light ( like glass )
4Chromakeycut-out (requires a cut-out map )
5Additiveadds light ( like fire and lights )

Note: When using drawmode , for the best effect, 
you must draw different colors than what you intend to end up with in the end.
For filter, you usually want to make sure all the colors are bright and pastel.
For additive, you want to make sure all the colors are dark and earthy.

AnimtypeAnimation type of texture
animtype=valuedescription
0NoneNone
1Scrollingtexture scrolls in direction of Animloop [ arg1="direction in degrees (0-360)" ]
2OneStrip?use a single Framestrip
3AllStrips?use a multi Framestrip
4RandomStrips?use a random Framestrip
5BrownianMotion?stochastic process* [ arg1="speed multiplier",animspeed="limiter"]
6RandomFrame?random frame order from Framestrip
7SwayingSways forward and back
8FrameLoop?loop between 2 frames [ arg1="start frame",arg2="end frame" ]
9SingleFrame?undocumented , Manually scale texture ( extract frame or tile )[ arg1="scale height integer",arg2="scale width integer",animspeed=inset (useage unknown)]

brownian motion = 
stochastic process 
[ steps (in both x and y directions) are independent normal random variables ]

AnimloopDirection of animation and frame counting
animloop=valuedescription
0Forwardtextures/frames loop forward
1Reversetextures/frames loop backward
2Alternatingtextures/frames see saw back and forth

numframesnumber of frames per Framestrip
numframes=int

numstripsnumber of Framestrip's in texture
numstrips=int

animspeedanimation speed , frames/scrolls per second
animspeed=int

animargargument1 to pass to animtype
animarg=int

animarg2argument2 to pass to animtype
animarg2=int

Some values are clamped (limited) if you enter invalid values, or they aren't yet configured.
For example, angles of scrolling/swaying are clamped between 180 degrees and 180 degrees.
The minimum resolution/increment for values is usually 0.01.

image format

Example of an image using framestrips.

frames
framestrip-0101020304050607080910111213141516
framestrip-0217181920212223242526272829303132

Framestrip example:

Syntax:

I beleive all Constants are Global, therefore you can use the name or the number in TsFiles. Numeric values are preferred

modelSettings = {
        materialname = {
          colormap = "dir/colormap.jpg",
          opacitymap = "dir/colormap.jpg",
          cutoutmap = "dir/colormap.jpg",
          filtermode = "int",
          lit = "bool",
          twosided = "bool",
          drawmode = "int",
          animtype = "int",
          animloop = "int",
          numframes = "int",
          numstrips = "int",
          animspeed = "float",
          animarg = "float",
          animarg2 = "float",
        },
      },


Sample TS file structure ( for in-world rendering )

Frame Animation

PIECE
{
  name = "objectname",
  id = "devxxxxxxxxx",
  model = "test/animation/tester.model",

  modelSettings = {
  [ "test" ] = {
    colormap = "test/animation/numtest.jpg",
    opacitymap = "test/animation/numtestopacity.jpg",
    lit = 0,
    twosided = 0,
    animtype = 3,
    numstrips = 2,
    numframes = 16,
    animspeed = 1,
    animloop = 0,
  },
},
  sinkToGround = dropOnTop,
  layoutClass = "Structures",
}

CONTENTS
{
  { "devxxxxxxxx", 1 },
}

Scrolling Animation

PIECE
{
  name = "objectname",
  id = "devxxxxxxxxx",
  model = "test/animation/tester.model",

  modelSettings = {
  [ "test" ] = {
    colormap = "test/animation/numtest.jpg",
    opacitymap = "test/animation/numtestopacity.jpg",
    lit = 0,
    twosided = 0,
    animtype = 1,
    animspeed = 1,
    animloop = 0,
  },
},
  sinkToGround = dropOnTop,
  layoutClass = "Structures",
}

CONTENTS
{
  { "devxxxxxxxx", 1 },
}

Sample Preview file ( for testing in There Previewer )

If you test a model in the There Previewer and then click file save,
you can save a preview file that stores all the settings of your test instance.

These files are named with the file extension .preview and are basic text files 
composed of basic xml structured data.

If you edit these preview files with a text editor ( such as notepad )
and add the necessary paramaters then you can test animation in the peviewer by opening the preview file.

The zoetrope application by There_developer now automates this proces.

xml uses nested tags to designate heirarcy and dependancy.
A typical "tag" looks like this <tagname>value</tagname>

The format for the animation paramaters is as follows.

<drawmode>int</drawmode>
<animtype>int</animtype>
<animloop>int</animloop>
<numframes>int</numframes>
<numstrips>int</numstrips>
<animspeed>float</animspeed>
<animarg>float</animarg>
<animarg2>float</animarg2>

and should be located inside the <material> tag for the material you are animating.

Sample preview file


<Preview>
  <Model>C:\Program Files\There\ThereClient\Resources\drink\m004dr_mugclear01.model</Model>
  <Material>
    <Name>liquid</Name>
    <colormap>Program Files\There\ThereClient\Resources\drink\t002dr1b_hotblues.jpg.dds</colormap>
    <lit>1</lit>
    <twosided>0</twosided>
        <drawmode></drawmode>
        <animtype>1</animtype>
        <animloop>1</animloop>
    	<animspeed>10</animspeed>
    	<animarg>90</animarg>
    	<animarg2></animarg2>
	<numframes></numframes>
	<numstrips></numstrips>
  </Material>
  <Material>
    <Name>glass</Name>
    <colormap>Program Files\There\ThereClient\Resources/drink/t002dr_glassmug.jpg</colormap>
    <opacitymap>Program Files\There\ThereClient\Resources/drink/t002drxx_glassmugalpha.jpg</opacitymap>
    <lit>1</lit>
    <twosided>0</twosided>
  </Material>
</Preview>

Downloadable version of this file
you may have to right-click save as if your browser shows it as text
link: upload:drink.preview

Files

Test files for frame animation ( unzip to c:\ for preview file to work )
link: upload:test.zip

WORKING EXAMPLES

This is a working example of [Georgieanna's] Outdoor Swimming Pool
It makes the water move slowly.
All parameters are included for you to play with.

Replace the file C:\Program Files\There\ThereClient\Resources\fu\80268641.ts with this text.
Restarting the There client is necessary for your changes to take affect.

PIECE
{
  name = "Outdoor Swimming Pool",
  id = "dev80268641",
  model = "fu/80268641.model",
  modelSettings = {
  [ "Mtl #1" ] = {
    colormap = "fu/80268641_1.jpg",
  },
  [ "Mtl #2" ] = {
    colormap = "fu/80268641_2.jpg",
  },
  [ "Mtl #4" ] = {
    colormap = "fu/80268641_3.jpg",
    opacitymap = "fu/80268641_4.jpg",
    drawmode = 0,
    animtype = 1,
    animloop = 0,
    numframes = 0,
    numstrips = 0,
    animspeed = .3,
    animarg = 0,
    animarg2 = 0,
  },
},
  sinkToGround = dropOnTop,
  layoutClass = "Structures",
}

CONTENTS
{
  { "dev80268641", 1 },
}

Additional Resources

[There Animation Resources] - Official there information on creating and submitting animated objects through the Animated Builders Club

[TheChaz's Unofficial Animation Pack ] - further development has ceased due to preferred official animation submission procedures


ThereWiki | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited July 4, 2007 6:29 am by YuujoAkebono (diff)
Search: