Notifications
Clear all

[Closed] Loading/unloading of objects per frame?

Hi,
I’m not a Max user myself, so please bear with me.
I’m trying to transfer a simulated mesh from XSI to Max so that our Max user here can render the simulation on his side.

My first instinct was to export an OBJ sequence and import that into Max. Our Max guy found a nice script to do this and it works well. Unfortunately, the script loads the entire sequence into the scene and from what I gather it simply animates the visibility of each object. With the size of our final simulation approaching 75 Mb per OBJ, loading any decent length of animation will cause memory issues…
I was hoping there might be a straightforward or already existing solution (perhaps a script) to load objects into the scene on demand and delete them after the frame has progressed.

I’m totally unfamiliar with Max’s SDK, but know this would be possible to script in XSI.

Any ideas how I might proceed with this, or recommendations that I can make for our Max guy?

Thanks!

P.S. point caches are not an option, since the mesh is not consistent between frames.

7 Replies

you could use a callback (which basically means detecting any desired event and then executing a function when the event occurs. )
In this case you could use a preRender callback. Infact, if you look into the “How To” section in maxscript reference, you’d find a [b][color=white][b]How To … Change Objects At Render Time

[/b][/color][/b]

Well thanks for the effort. :wise:
Not quite what I was after, but it should give a lead to the Max guy here.

Is the vertex count / order of all the objects the same?

Perhaps you could import the first mesh, and with the subsequent meshes, animate their vertices to match the first using a simple looping expression.

EDIT: Just seen your note about point cache, so disregard. better to follow the callback route

Unfortunately not. If so, I could even use a point cache. There is new geometry being created every frame, kind of like a fluid-sim.
I told our guy to see if he can have a look at frame-change callbacks or events and hopefully come up with something.

Thanks!

Ha! Posted at the same time

hi ciaran,

i havent used it myself but there is an obj importer for blender fluid sims on http://www.scriptattack.com/

this apears to update per frame after it caches the obj data to text file so perhaps this could be used for what you have described.

Excellent! We’re trying it now…

Thanks!