How can I get more specific Vector Field creation?

Hi, I’ve run through creating Vector Fields from Maya and exporting them/ importing them into UE4. Everything works great but, I’m trying to find a way to create more specific Vector Fields. If you follow the tutorial to create them inside of Maya using Fluid effects you can get some decent results but they are more random in design. I would like to create them to be much more specific. For instance if I wanted to create a vector field that has velocities pointing in a vortex like fashion. Is there another means of creating these Vector fields other than Maya? If not then does anyone know of a way to get more specific results? I thought maybe I could create shapes and use them as collision objects to help dictate the Velocities within the Vector Field but I’m not having much luck. I would love to be able to create a vector field using photoshop but I keep hearing the texture vector field stuff isn’t implemented yet. Is this true? For me the easiest way to have very specific vector fields would be to have a layered black and white texture in photoshop - and each layer upwards would be the next grid layer in the field itself. I suppose this is more of a broad topic but any ideas in getting detailed Vector Fields is welcome. Thanks…

You can use any of the Maya Fluids tools to create your Vector Fields. For instance, if you want a vortex, add a vortex field to your fluid, and tone down all of the turbulence/swirl settings in your fluid grid.

You can also add geo shapes etc. and set them to collide with your fluid. If you don’t know how to do this I suggest taking some time and digging through the Maya Fluids documentation it is very exhaustive.

I have experimented with quite a few ways of creating grids, including using them on a massive scale to create world size vortices etc. etc. and they work pretty well. Try experimenting with bringing in your level geometry and lofting/creating inexpensive collision hulls for your fluid sim to collide with them.

A uniform field, combined with collision geo can yield some pretty nice results.

To be more specific, you can use any of the Maya Fluids fields, collisions etc. to modify the velocity of your grid. The key here is understanding that the velocity in your container is what is being used in the vector field.

Fantastic! This is a big win, thanks.

You can also script the values of the fluid grid through either mel or python, you could create a vortex (or any other shape from this) using this.

You can also just use a vortex or volume axis fields and add them to the fluid, let them run for a few frames and grab the resultant vector field.

I find it easier to create vector fields through houdini though, and as the fga file format is just a text file, it’s easy to write a python script to write an fga from houdini, I’ve just got this working myself.

Cheers,

Could you specify the file format. What I find on the internet is only for 2D grids and not 3D volumes. If you could share the python script it would be greatly appreciated.

Ok, I’ve followed the tutorial on A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums to know the file format. I’ve made my own python script that can generate the Unreal Engine Fluid Grid ASCII file format. I believe this is a self-defined format, since I cannot find any other reference to it. The python code Part 1:

Can’t seem to post code. Use this link:

https://drive.google.com/file/d/0BxxTGFY3xm7gMFlvVC1DcEJ0VVk/edit?usp=sharing

Example FGA File:

        16,16,16,
        -64,-64,-64,
        64,64,64,
        0.03779058903,0.1344531476,0.069425188,
        0.03631260991,0.1385757327,0.08436908573,
        0.03267278895,0.1418330967,0.1002340168,
        0.02698912099,0.1451566666,0.1147548184,
        0.02024663612,0.1504015028,0.1290556192,
        0.01225084998,0.1528069377,0.1403729469,
        0.00285216514,0.1563862562,0.1494427025,
        
        # So
        # 1:    Resolution3D
        # 2:    MinVector3D
        # 3:    MaxVector3D
        # 4:    Vectors3D
        # ...
        # N:

Massive apologies for missing your replies, your format looks good.

I have evolved mine away from a python script now and re-written it as a custom houdini file format in c++, so now I can create what ever vector field I need and save it directly to an fga file using a standard houdini file node. If anyone is interested in trying it then give me a shout and I can sort a file for you.

Cheers,

Hi ,

Following to your proposal for giving a test to your Houdini script I answer yes. I would be interested in doing some vector fields in Houdini but I am missing time to implement a whole exporter.
Can you please let me know how to get the files and how to use it?

Thank you very much

werwack

isgoed, is this script intended for Maya for Houdini? thnx

Neither. It generates a vector field directly in the Unreal Engine Format. It runs in python.

In the main in the bottom of the file, the following FGA-files are created:

if __name__ == "__main__":

    print("Create VectorField_Source16.fga")
    # self, Resolution, Minimum, Maximum):
    Source16 = FGA([16, 16, 16], [-100, -100, -100], [100, 100, 100])
    Source16.saveToFile("VectorField_Source16.fga")
    
    print("Create VectorField_Cone16Normal.fga")
    # self, Resolution, Minimum, Maximum):
    Cone16 = FGA([16, 8, 8], [40, -35, -35], [190, 35, 35])
    Cone16.Normalize()
    Cone16.saveToFile("VectorField_Cone16Normal.fga")

    print("Create VectorField_Vortex8.fga")
    # self, Resolution, Minimum, Maximum):
    Vortex8 = FGA([8, 8, 8], [-100, -100, -100], [100, 100, 100])
    Vortex8.Cross([0,0,1])
    Vortex8.saveToFile("VectorField_Vortex8.fga")