so if I have this right, you have a 'pre-baked' animation (essentially, a series of meshes) you want to export to dbp-usable files? Here's something I tried in 3ds Max:
- I created a pArray which produced a stream of mesh particles. (obviously, here you'll want your realflow animated object in its place)
- shift this to one side and place a compound object -> mesher at the origin.
- in the mesher's properties, pick the pArray. If you scrub the timeline it should look as though it were a copy of the pArray.
- it gets a little messy here: to the mesher, add an edit poly modifier, scrub to the first frame of the anim, collapse the mesher's stack (leaving just the editable poly) and export selected (I use kW x-port) as 'frame_
number.x'. (Or forego the modifier, scrub to the frame first then convert to an editable poly).
- now undo the collapse/convert, and repeat the process: scrub to next frame, collapse, export, undo.
Of course, this is something a script ought to automate.
Now you have an X file for each frame, you can load each in turn as objects, get meshes from them, and discard the object. Then, Make Object with the number of the mesh holding the first frame, and use the M1U command Change Mesh to switch meshes over time.
set display mode desktop width(), desktop height(), 32, 1
sync on : sync rate 30 : sync
backdrop off
scrW = screen width()
scrH = screen height()
// provide the path to your exported .x frames and the filename prefix ("frame_" -> "frame_1.x").
set dir "C:\Users\USERNAME\Documents\3dsMax\export" // example path
basefn$ = "frame_"
// anim length in ms
animLength# = 1000.0
// frames holds the mesh number at each frame.
numFrames = 100
dim frames(numFrames)
// extract meshes from objects.
for n = 0 to numFrames
fn$ = basefn$ + str$(n) + ".X"
if file exist(fn$)
exit prompt fn$, fn$ // if there is an error, will tell you what object caused it.
obj = find free object()
frames(n) = find free mesh()
load object fn$, obj // load in the object
make mesh from object frames(n), obj // extract the mesh
delete object obj // discard the object
print "got mesh: ", fn$ : sync
else
print "skipped missing mesh: ", fn$ : sync
endif
next n
exit prompt "", ""
backdrop on
// make object with starting frame. (the while-loop skips empty frames).
f = 0
while frames(f) = 0
f = wrap(f+1, 0, numFrames)
endwhile
make object 1, frames(f)
do
// cycle frames over time.
oldf = f
t = 1.0/(animLength#/numFrames) * (hitimer() %% animLength#)
f = int(t)
// if mouseclick, user can pick frame.
if mouseclick() = 1
f = clamp( numFrames*(1.0/(scrW*0.6)*(mousex()-scrW*0.2)), 0, numFrames )
line mousex(), scrH*0.95-4, mousex(), scrH*0.95+4
endif
// skip empty frames.
while frames(f) = 0
f = wrap(f+1, 0, numFrames)
endwhile
// only change mesh if need to.
if f <> oldf
change mesh 1, 0, frames(f)
endif
// set camera to spin slowly.
position camera 0,0,0
yrotate camera camera angle y() + 0.01
xrotate camera 20
move camera -160
// draw timeline.
line scrW*0.2, scrH*0.95, scrW*0.8, scrH*0.95
x = scrW*0.2 + scrW*0.6 * (1.0/numFrames*f)
line x, scrH*0.95-10, x, scrH*0.95+10
center text scrW/2, scrH*0.95-25, str$(f)
text 0, 0, str$(screen fps())
sync
nice wait 20
loop
I've not benchmarked this or anything, but it seems to run at a reasonable speed.
edit: recap: dbp can only deal with one mesh/set of meshes per .x file. They can animate and deform and such, so long as they're still made of the same points joining up in the same way. Baked systems of particles (particularly, anything metaball-y where particles repeatedly join up and detach and so forth over time, like in sea spray) don't follow these rules and are, as mentioned above, a string of completely seperate meshes (visually flowing, but a particular vertex id may be over here one frame/mesh, over there the next, etc.) dbp can't swallow that in one go, but if you feed it a bite at a time you can sort-of make it work.