Vertex Memory [after GameEngine Closes]

Hello,

Ive written a program which alters a mesh’s vertex’s (verties :slight_smile: ) according to audio data coming in over OSC. I’d like end the GameEngine but retain my altered mesh so i can export it and make it on a lathe. I think ive read this cant be done as the gameengine wont remember anything once it closes- is this correct.
If im right are their other ways of going about this. Ive tried alt+P on the script but the game runs on 4 scripts and blender doesnt recognise the GameLogic module anyway.

So:

  1. Does OSC work when not in GameEngine i.e. not pressed P
  2. How much of a re-write am i gonna have to do. I took a look at the Blender API[not GameEngine API] and everything looks different differnet ways of getting hold of vertexes etc…
  3. Or is there a way for Blender to remember the shape after it was deformed.

Thanks for reading all that, its abit of a ramble :smiley:
Will

there isn’t a way for blender to remember the same shape

if you create the mesh using the nmesh api it will not show up in the game engine, but will show up in blender

[your file will become unusuable in the player because the blender module doesn’t exist there]

so you will have to do both, hopefully you can get it to work as you like… I’ve found the mesh editing api in the game engine pretty much useless

Thanks for the quick reply zero_d,

is the player which you talk about a .exe file? cheers

oh and also is there a way of linking scripts i.e. i have 4 scripts but to run in blender you press alt-a so can i reference them from one script or do i have to recode 4 scripts into 1.

Thanks

Will

Foreword:
Excuse-me please if I didn’t fully understand your problem, I’m not a native English speaker…

glitchCORD~

PostPosted: Mon Oct 17, 2005 4:30 pm Post subject: Vertex Memory [after GameEngine Closes]
Hello,

Ive written a program which alters a mesh’s vertex’s (verties ) according to audio data coming in over OSC. I’d like end the GameEngine but retain my altered mesh so i can export it and make it on a lathe.

You could store in a text file the coords/index/materialID of each vertex, using Class KX_MeshProxy & Class KX_VertexProxy which you must have used in your program (script?), and use this data to modify your mesh with the blender api.

Hope this helps.
That’s just my two cents! :wink:

Hi glitchCORD~, if I understand what you are trying to do, cant you simply take a screen shot of your object to use as a profile to follow on the lathe. I dont think there is a build with orthographic cameras in the game engine but you can mimic this the way blender used to do it, by setting the camera at a long distance from the object and the using a high value on the lens setting. Its not true orthographic, but it should be close.

Bogey.

Or you could set the camera to ortho in the editing (F9) buttons. If taking a screeny isnt what your after then you could make a script that stores the positions of each vertex into a text file. You would then use a partner script outside of the game engine to apply these positions to a mesh. Lot’s of work.

phew, that a lot there…

Bogey, no idont think so im new to this lathe thing but from what i understand i need to export my mesh as .dxf or .stl, stl being the better format. But im gonna ask my tutor and see if that’ll work, it’ll be a lot less hassle.

Mol Flesh and Drewu, ive just done a search for saving text files-looks complicated even more complicated when ive got to learn Blender API anyway to load this back up off a txt file… arrgh :smiley:

So im going to go with my original idea recoding my scripts from KX_VertexProxy and KX_MeshProxy into NMesh and whatever, i guess ill have to learn how to do the txt file saving for the future when things get more complicated- live latheing!!!

Just to ask again is it possible to run more than 1 script when i hit alt-A ie reference other scripts from inside one, this would aave a little work.

Cheers everyone

Will

If you are going to recode your scripts for non-game engine use, you are going to have to learn the blender api anyway. Mabe you should tell us about your situation some more. What user input are you using? What exactly is the mesh representing? And so on…

Yeh thats what i was thinking Drewu, just started looking at ePickle and open/write, eval and str.

OK so this is what im aiming at:

max/msp analyses audio using fft and sends out 8 or 16 numbers [corresponding from bass to high range ie 1 is uber low bass 16 is high pitched screaming] using udp and osc.

blender analyses these numbers and uses them to set the height of vertices on a grid[8/16wide by 250] it sets them on the first row, waits one beat[max also sends bpm] sets them on the next row etc until you have a visual slice of audio time.

This is then exported via dxf/stl into a program i dont know the name of which sorts stuff out to be lathed.

OK so this is where im at now: :smiley:

max/msp repeatedly sends out 5 random numbers between 1 and 3 via udp and osc.

blender analyses these and and sets the vertices height on a 5 by 5 grid. it sets the first row, waits a set time, does the second etc, when it gets to the 5th it returns to the first.

----now i want to be able to load up how the mesh looked when i hit escape into “normal” blender and export it to the lathe program.

So after looking at ePickle/ str eval (which is best please) i figure:

i write a txt file when i hit a key which saves the dictionaries which contain each rows vertex data. then i learn the blenderAPI and figure out how i load up a script which opens the text file and assigns the numbers in those dictionaries to the vertices in the grid…

its gonna be fun :frowning:

any ideas on how i should go about this???

Cheers

glitchCORD~, sorry for confusing the issue, after checking, ive seen ortho cameras do work in the game engine, so I cant see why you cant do a screen grab, then trace around the shape with a bezier curve, and export that as a dxf. Its cause I cant program that I allways try to avoid python whenever I can.

Bogey.

ps, I’ll shut up now.

What? No ortho in game engige? That is not true! What are you talking about?

ha ha no need to shut up bogey, but i think were coming from different angles(???) here. a screen grab in ortho mode would hide some of whats going on with the mesh, im thinking that a screen grab from a plan view front/back and orto might be enough but heres a [stupidly large] bmp if you want to see. there are small troughs and peaks obscured from view behind the “mountain” closest to you…

So im gonna learn cPickle or the other thing, will see what works best… expect lots of confused posts in the days to come :slight_smile:

heres the bmp

http://www.thefilehut.com/userfiles/glitchcord/for%20tom.bmp