Friday 22 April 2016

Scripting and Dynamics - VII


This is my last post before the submission, I have been working on the tool and polishing my script.

Here’s a screenshot of the final tool:


It is divided by separators in three sections:

·         General Settings: this section allows you to configure the size of the grid and the cell.

·         Make Fire Collider: this section allows you to make an object an active fire collider, whenever the object touched grid cells it will apply X intensity per tick on them until they burn out.

·         Apply Material Properties: this section allows you to mark an environment mesh with fire properties, all the cell that lie beneath this one will inherit the properties specified in the tool.


At the end of the project, I have to say I am quite satisfied with how it behaves; the project could still be improved both in terms of performance and look. 
The particles used at the moment are hardcoded but a better way to manage their look could have been exposed.
Performance proves to be an issue with bigger grids, I didn’t have time to experiment with it but I believe that alternative ways of detecting collisions could have improved the end result in that regard.

Wednesday 13 April 2016

Scripting and Dynamics - VI

This week has been very exciting as finally everything is finally coming together! As previously mentioned I’ve been working on detecting collision events in order to create fire events. 

My test scene consisted of a sphere affected by gravity that falls into the grid; my goal was to have the sphere trigger a fire event on each cell touched by it and then let the simulation handle all the details about fire spreading around.

In order to implement this I had to research how to create passive rigid bodies procedurally for each grid cell.Once I had this setup working I tagged the sphere with some custom attributes and then added some logic on the collision handling routine to check for the attributes to know the intensity of the fire event.

As of this week I finally have a working version of the whole simulation, but I still feel it is not user friendly enough so before wrapping the project up I’m going to add a small UI tool to manipulate parameters rather than forcing the user to fiddle with custom attributes hidden somewhere in the hierarchy of objects.


Stay tuned!

Wednesday 6 April 2016

Scripting and Dynamics - V

Last week I managed to create a fire grid and did some tests with hard coded fire sources, the result was satisfying already but there are still improvements to be made.

So for this week I decided to take a deeper look into raycasting: the idea is that the user will build the environment and then add fire simulation on top of it, so I wanted to create something that allows the user to click on environment meshes like rocks or grass and let those meshes specify the behaviour and parameters of the cells below them.

After looking extensively at the documentation I found a way to implement raycasting with Python in Maya: that is achieved through the use of the OpenMaya. 
This module provides a function called closestIntersection which performs raycasting on a specified mesh and also returns the intersection point.


By using this function I managed to implement custom parameters based on the mesh lies on top of the grid: the only missing building block to enable a fully procedural simulation is now the fire collision events so stay tuned for more progress on that!