Mesh deformation

Can I use a Shape IPO with the IPO Actuator? It doesn’t seem to work.

How can I animate a mesh and shift that animation from the start to a certain point, and than us another key to shift it back in time? Do I have to write a script for that, or has somebody allready done such thing?

No, I dont think so. Read the actuator part of this:

http://download.blender.org/documentation/NaN_docs/BlenderGameReference/actuators.html

[quote][
Property Plays the Action for exactly the frame indicated in the property entered in the field “Prop:”.
/QUOTE]

use absolute shape keys and animate the curves (influences) how you want them. You can have many shapes influencing the result at any one time, from 0% to 1 (100%). For example, a cube wtih a shape key of a circle and a triangle, with 50% circle and 50% triangle makes this egg-like thing.

i tried to do the following script, which should work fine. but theres the problem, that curval of class keyblocks is read only. does anybody know, if there is a cvs, which allows to write curval, or is there any other option to change it?

from Blender import NMesh
import GameLogic as GL
import GameKeys as GK

Mesh=NMesh.GetRaw(‘animesh’)

def NMeshAnim(me,valD):

if me.key.blocks[1].curval >=1:
    print me.key.blocks[1].curval
elif me.key.blocks[1].curval<=0:
    print me.key.blocks[1].curval
else:
    me.key.blocks[1].curval+=valD
    print me.key.blocks[1].curval

return me

cont=GL.getCurrentController()

KeySens=cont.getSensor(‘Key’)

if KeySens.isPositive():

Key=KeySens.getPressedKeys()[0][0]

if Key==GK.RIGHTARROWKEY:
    Mesh=NMeshAnim(Mesh,0.02)
elif Key==GK.LEFTARROWKEY:
    Mesh=NMeshAnim(Mesh,-0.02)
else:
    pass

Mesh.update()

print ‘end’

oh and how can i post a script with indented lines?

Wrap the text in ‘code’ tags, then just use spaces.

well, your script will not working, you use “import Blender” !!!

As [a]drien said, the Blender module is not available at runtime from the Game Engine. To the best of my knowledge, all calls to the Blender module will be held in memory while the game runs, then applied to the Blender scene at game exit.

edit: Mesh deformations in the Game Engine is possible, I just haven’t been successful at it yet, so I can’t offer you more help. Sorry.

I believe there is a blurb about this on the physics forum. If I understand, the person working this left in February so no work is being done on it because he is working on the comercial side now?

However an interested body was asking him questions about how it could be done, or is being done at the vertex level.

If I understand it correctly it can be done in a script. Please dont flame me if I am full of it though…that just means I didnt understand.

You can deform mesh using armatures.
Just add unconnected bones. Parent the required vertices to required bones.
Then you can deform the mesh by animating these bones.
But if you are using too many bones then it will be trouble. But this is sufficient for simple mesh deformations.

I have attempted to do a mesh deformation in the game engine. I used python and modified a script from the GE Python API. It almost works. See the post here.

I’m going to do a bit of looking into this I think. I recently bought the Game Kit and noticed water with waves in the “Squish the Bunny” FPS demo. It ran much quicker than the Python solutions I’ve seen in the past, so I think it might be worth seeing how it was done.

Someone (I think it was Social) told me in the past that you can just use a Mesh IPO. The problem is, I can’t figure out how to set Mesh IPO’s. I know I used to be able to do it in Blender 1.72, but that’s the last time I tried it (it seems to me like the feature is currently broken). If anyone has any help to offer on that, it would be greatly appreciated.