Animation textures


(blendedHKU) #1

hi, was wondering if there was a way to use animated textures (they killed it from 2.10)…

think by using the bitmap text and write script for switching between letters…but is a different solution would be nicer…

casH


(Pooba) #2

I know Doc Holiday had a working script that he showed everyone, maybe you should ask him! You can also find that file somewhere in these posts, go back a bit and you should find it.

Pooba


(3djones) #3

animated textures work again in 2.25 - same as in the old days - you can even set framerate now - check the image window :smiley:


(Pooba) #4

Some of us don’t have publisher…


(wiseman303) #5

I’m not real good with python yet, so this might not work. It should give you an idea of how it should work though.

Import GameLogic

contr = GameLogic.getCurrentController()
own = contr.getOwner()
mesh = own.getMesh()
vertexTotal = mesh.getVertexArrayLength()
#The object running the script needs an int propert called vert.
vertex = own.vert

#Here’s the good bit.
while vertex < vertexTotal:
vert = getVertex(0, vertex)
uv = vert.getUV
#requires a float property called move on the object.
uv.setUV(uv[0] + own.move, uv[1])

I haven’t tested this code, you might have to adjust the last line.

Hope this helps.


(saluk) #6

Alright, I whipped this up real fast for you all.
The file should be pretty much self explanitory, here’s a run down of how to use it though:

Make sure the frames in your texture image are set up horizontally in the image, don’t try and put frames on multiple lines because it wont read that. As long as all the frames are the same size, it should work.

The frames prop is how many frames are in the image. Make sure this is correct, becuase the script uses this in order to figure out how to space out the frames.

The speed prop is how many seconds it takes to go to the next frame. Adjust it as needed.

Have fun, and good luck!

http://www.angelfire.com/ego/spinhead/animtex.zip


(IngieBee) #7

Thank you, nice and simple.

Ingie


(blendedHKU) #8

thank yoU… thank you

i had made a lot of textures for 2.12, and really wanted to use them…

casimir


(gargola) #9

Saluk: i tried your example on one of my games an it came up with this error:

http://www8.gratisweb.com/blendergargola/error.jpg

what i did wrong? please help me. :slight_smile:


(saluk) #10

You must have accidentally removed the indentation. Just make sure all the lines under the line with “for” are indented.

like this:


for vert in range(0,length):
   vertes = mesh.getVertex  ...

not like this:


for vert in range(0,length):
vertex = mesh.getVertex  ...

Make sure you use the indent key, and not just put a couple spaces. Python’s weird that way.


(gargola) #11

thanx Saluk.i’ll see if i can fix it. :slight_smile: