Page 1 of 6 123 ... LastLast
Results 1 to 15 of 77

Thread: Import Blender Fluids

  1. #1

    Import Blender Fluids

    Click image for larger version. 

Name:	blenderFluids_sampleFrame.jpg 
Views:	361 
Size:	51.7 KB 
ID:	115291
    I created a script for importing the files generated from a Blender Fluids simulation and creating a sequence of lwo files. It's still in a rough state and thought I would ask for some advice/feedback.

    The script reads the Blender .bobj.gz files to read the mesh and .bvel.gz file velocity data. Creates weightmaps and a morph target. I figure to animate the morph over 1 frame to enable motion blur.
    It reads the particle files for type, position, velocity and size creating a particle cloud for the position. It creates a weightmap for the size, but I don't see any way to use it in layout with the hypervoxels. I chose to only import one type of particle and in fact I don't even know what the blender fluid particle types are. The velocity is ignored at this time. Maybe a morph target for the points can be created.

    Does anyone have some Blender Fluids knowledge or some ideas as to how the whole process should work with respect to Lightwave?

    The code can be found here:
    http://www.clintons3d.com/plugins/lightwave/index.html

  2. #2
    Super Member JohnMarchant's Avatar
    Join Date
    Mar 2003
    Location
    Murcia, Spain
    Posts
    2,915
    Thanks mate
    Dell XPS 15
    15.6-inch (3840 x 2160) 4K 282ppi IPS LCD
    Intel i7 7700HQ 2.8GHz
    Windows 10 64Bit
    NVidia GeForce GTX 1050 Ti
    1TB SDD
    32Gb Ram

    LightWave 2019.03

    Very nice Laptop

  3. #3
    Eat your peas. Greenlaw's Avatar
    Join Date
    Jul 2003
    Location
    Los Angeles
    Posts
    7,125
    Thanks for creating this script! I really want to check this out soon. Let you know how it goes here.

    G.

  4. #4
    I updated the script and got the motion blur working for the fluid mesh and the particle mesh. The trick was to animate a null moving up in Y from frame 0 to 1, set post behavior to repeat and then use channel follower to make the morphs follow the null. Just a few more things to figure out then I'll make a more user friendly version of the script.

  5. #5
    Click image for larger version. 

Name:	blenderFluidsToLW_025.png 
Views:	258 
Size:	147.4 KB 
ID:	115615
    It's done! As done as it's going to get anyway.
    It's easier to use and I found out that the particle files aren't really needed. Their information is already used to add detail to the mesh files.
    The script just has one major flaw in the form of a memory leak. The way around it is to set modelers undo levels all the way down to 1. The leak is still there but it's not as extreme as when the undo was set to 40 steps.

  6. #6
    Super Member
    Join Date
    Feb 2003
    Location
    Hamburg
    Posts
    1,571
    Can't get it to work in Modeler 11.5.1 x32. I've created the bin/Lib directory, extracted everything from python27.zip and renamed the zip. In Modeler I create a cube and assign a surface. Then I run the script, load a .gz file from the sim, let it run and get error code 2904. It creates two lwo's (fluidsurface_final_0000 and fluidsurface_particles_0000) and stops. The Console says:
    import final mesh
    import particle mesh
    first frame = 0
    last frame = 250

    I've attached the first 5 frames from the sim.
    Attached Files Attached Files

  7. #7
    It's fixed(I hope...). There was a leftover command I was using when trying to fix the memory leak. I noticed that your sequence looked inside out so I added a flip normals checkbox.

  8. #8
    Super Member
    Join Date
    Feb 2003
    Location
    Hamburg
    Posts
    1,571
    Works fine now, thanks for this nice script.

    If you don't mind I'd like to make some feature requeste that came into my mind while testing this:
    - would be nice to have a indicator that Modeler is still working, maybe a small window that shows the number of the processed object
    - is there a way to cancel the execution?
    - a scale function to bring the lwo's into the right size

  9. #9
    Banned OnlineRender's Avatar
    Join Date
    Dec 2008
    Location
    Glasgow , Scotland , UK
    Posts
    6,359
    thanks

  10. #10
    Quote Originally Posted by dee View Post
    Works fine now, thanks for this nice script.

    If you don't mind I'd like to make some feature requeste that came into my mind while testing this:
    - would be nice to have a indicator that Modeler is still working, maybe a small window that shows the number of the processed object
    - is there a way to cancel the execution?
    - a scale function to bring the lwo's into the right size
    You must be a mind reader, because I'd also like to have the first 2 items you mentioned. It won't happen any time soon though. I have no idea how to make it work yet. Can you explain the scale request?

  11. #11
    Super Member
    Join Date
    Feb 2003
    Location
    Hamburg
    Posts
    1,571
    I made a simulation in Blender and it came in 100 times bigger than I wanted and the dielectric material properties didn't fit. So I thought it would be nice to have a scale factor so the lwo's are created the right scale. I could scale the null in Layout but having correct scaled lwo's is somewhat nicer.

    I'm having some spikes in meshes which don't show up in Blender but in the lwo's. If you want to have a look at the particular frames just let me know and I'll PM you a link.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	spike.jpg 
Views:	205 
Size:	27.1 KB 
ID:	115748  

  12. #12
    Quote Originally Posted by dee View Post
    I made a simulation in Blender and it came in 100 times bigger than I wanted and the dielectric material properties didn't fit. So I thought it would be nice to have a scale factor so the lwo's are created the right scale. I could scale the null in Layout but having correct scaled lwo's is somewhat nicer.

    I'm having some spikes in meshes which don't show up in Blender but in the lwo's. If you want to have a look at the particular frames just let me know and I'll PM you a link.
    Scale will be easy to add. The spikes will take some work. I did some tests and the mesh imports properly without the spike but when saving the spike ends up in the lwo file. It happened for me in 4 frames out of 26. I think LW might be in an unstable state after the import.
    You can fix it manually by using the Polygon Statistics panel to select the non-planar polygons and delete them and re-save the file.

    Edit: I found a clue. Some of the triangles are classified as degenerate/non-planar when importing. If I delete them the file saved will load back in properly.
    Last edited by clintonman; 07-23-2013 at 12:05 AM.

  13. #13
    Super Member
    Join Date
    Feb 2003
    Location
    Hamburg
    Posts
    1,571
    Cool! BTW, this "The material for the sequence can be changed in Layout by loading/creating an object in the scene with the same surface name and setting the surface editor to "edit by scene" instead of object. The object sequencer fluid will adopt the new surface settings." doesn't work for me, if I advance a frame the surface goes back to the saved stated. But there's this little helper: https://www.lightwave3d.com/assets/p...ntry/surf-rep/

  14. #14
    New update is done. It fixes the spikes, adds a scale factor and the default scale has been reduced by a factor of 100. Blender cm was importing as meters in LW. I also added progress indicators. I haven't tried the surface plugin yet, but it sounds useful.

  15. #15
    Newbie Member cgb777's Avatar
    Join Date
    Mar 2004
    Location
    St Louis, MO
    Posts
    88
    Quote Originally Posted by dee View Post
    Cool! BTW, this "The material for the sequence can be changed in Layout by loading/creating an object in the scene with the same surface name and setting the surface editor to "edit by scene" instead of object. The object sequencer fluid will adopt the new surface settings." doesn't work for me, if I advance a frame the surface goes back to the saved stated. But there's this little helper: https://www.lightwave3d.com/assets/p...ntry/surf-rep/
    Same thing happens to me. When I advance a frame, the surface goes back to the saved stated. Any fixes or am I missing something?

Page 1 of 6 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •