View Full Version : Is it possible to make a script to surface an object sequence?

06-18-2011, 11:34 AM
Hello all,

I am working on a project where I may want to use an object sequence of a fluid simulation. Here is a quick test of a sequence of .obj files exported from blender and rendered in lightwave. http://www.youtube.com/watch?v=KOq9a-QCKU0. To surface the object sequence I need to open each .obj file in modeler, change the surface settings and then save the file. Could this be automated with a script? Is it possible to write a script that would sequentially load a file from a folder? If so it should be possible to automate this process. Thanks for any help.


06-18-2011, 03:26 PM
Yes, I think that is possible. I'm not sure how surface settings are stored in obj, but if it is limited to one section or file, you might just get by with a decent texteditor with macro-recording or text replacement.

06-18-2011, 03:49 PM
Did you try this:

edit: oh yeah, it doesn't have an LW 10 version yet (in progress).

06-18-2011, 06:55 PM
Assuming that all the objects are named the same. If you load all the objects into layout, and open the surface editor in the top left corner there is "Edit by" change that to Scene and all the surfaces that have the same name will be combined into one surface.

If the surfaces are all uniquely named create the surface for on of them then right click on the surface name, copy. Then select all the other surfaces (ctrl left click or shift left click) then right click paste.

06-19-2011, 04:04 AM
In the case of an object sequence it is unthinkable to load them into layout.
IL_Scrubreplace was one method: http://www.spinquad.com/forums/showthread.php?10042-blender-fluids-to-LightWave-workflow&p=225613&viewfull=1#post225613
..but I would go with the Splotch Dog system, if I did fluids now.

06-19-2011, 09:06 AM
Really, how do you render the sequence if you don't load them?

06-19-2011, 10:17 AM
Really, how do you render the sequence if you don't load them?

Object sequences works so that for each frame there is a new object loaded based on the framenumber...

Frame 0022 would load in Object_0022.lwo (or .obj). If you framestep to frame 0023, Object_0022.lwo would be replaced with Object_0023.lwo instead. This is why one need a way to apply a pre-defined surface to all these objects, either by a batch script in Modeler, or by a script/plugin in Layout that automates this whenever the object in a object sequence is replaced (by framestepping for example).

Splotchdogs BlenderFluids toolkit for LW makes use of the Library function to replace the surface at loadingtime/rendertime.

06-19-2011, 12:36 PM
Thanks for the info, I never knew that.

stiff paper
06-20-2011, 03:41 PM
The RealFlow plugin is an object sequence plugin that does just this. You save a "reference" mesh that has your surface applied to it, and then every time the plugin loads a new mesh for the current frame, it copies across the surface settings.

You used to be able to download the latest version from the RF site, but having just looked, I can't see it anywhere there now. They must have gotten hip and hidden it behind a registration. Ah well. If you can "find" a copy somewhere it might be worth trying it out. Having said that, it always seemed to break with every new version of LW, so who knows?