MASH - handeling a complex mesh

MASH - handeling a complex mesh

Anonymous
Not applicable
1,396 Views
2 Replies
Message 1 of 3

MASH - handeling a complex mesh

Anonymous
Not applicable

I'm working on a project where i need to have a town plan rise from the ground in a wave motion. I would think that MASH is the perfect tool for that.

I have extracted my geometry from a .AI file of some town plans, ran the clean-up operation and triangulated the mesh.

I tried to use the "explode mesh" procedure but constantly strand on this error // Error: Invalid geometry, cleanup required: buildings3Shape // 

 

the final product will be a heavily populated area (a lot bigger than this example) and needs to be accurate and loyal to real world plans so there is no way for me to generate the buildings procedurally.


Any ideas on how to approach this task?

Ill leave a screenshot of the model here, i hope i'm clear enough on my problem.





 

0 Likes
Accepted solutions (1)
1,397 Views
2 Replies
Replies (2)
Message 2 of 3

dinofiguera
Collaborator
Collaborator
Accepted solution

Hello, there are several ways to do that in Mash.
An explode node might not be the best solution since it breaks every face of your geometry, and assigns a Mash point to each face, so you will end up with millions of faces.
You should prepare your geometry with all of your buildings separated and clean with centered pivots.
you can select them all and put them into a Mash setup.  (If the buildings are really a lot, you can think of layering your setup in areas, and build the effect one area at the time.)
once you have the Mash setup, go to the Distribute node and change to distribution type into "initial State"
This way the Mash point will snap to the initial state of your buildings. 
Now you need an id node to assign each point to your different buildings.
You should see now a reproduction of your city as a

Mash setup.
Now you can add an offset node for example and animate the scaleY.  
If you animate the random strength attribute of the offset node, your buildings should randomly grow from o to the actual size.
 If you want, as you said, some sort of wave as a growing motion, you have to solve a little problem:
This comes from the fact that your buildings do not have world transformations values.
Their transformations are frozen with default values and Mash will consider only the pivot point at the center of the world for all of them.
This means that if you create a texture or a falloff object for the weight of the offset node, it won´t work as you expect.
To work properly, Mash needs to know each world transformation of every building and this means that you need a trick to bake the world transformations to your buildings.
For this I wrote a simple script:

string $selection[] = `ls -sl`;
string $tempConst = "temp";

for ($obj in $selection)
{
string $loc[] = `spaceLocator`;
pointConstraint -offset 0 0 0 -n $tempConst -weight 1 $obj $loc[0];
delete $tempConst;
parent $obj $loc[0];
makeIdentity -apply true -t 1 -n 0 -pn 1 $obj;
parent -w $obj;
delete $loc[0];
}
}

 

If you select your buildings and run this script, every building will get world transformations values,
After that, you can redo the previous steps of the Mash setup and you will be free to map textures on Strength values and add falloff objects.
I attached two examples, one with the first simple method, the second after baking the global values.
Cheers,
D

Message 3 of 3

Anonymous
Not applicable

Wow, thank you!

that was a better reply than i could have ever hoped for and definitely solves my problem (and opens up new doors with this tools for me)

I'm going to dive into this now, i'll let you know how it goes!

0 Likes