polyevaluate with the shell flag…
shatter help
Heh, I see… I was creating an emiter, selecting the particle child of the emitter and then trying to run the script without letting the particles actually emit.
I’m still not able to get a decent shatter with this code - I’m always getting 1 decent cut (on the right) and a load of random planes (on the left)

I don’t think I’m doing anything particularly wrong… Creating an emitter - letting it spit out some particles, selecting the particles, then the mesh and running the code…
could it be some weird preference settings I have?
thomwickes, looks like you are letting the particles get too far away from the cube. Try to emit it so all the particles are inside of the cube then run the script.
Ah, so we were both right…
When I was running the script before, the particles were contained within the mesh, but for some reason on this machine maya is treating particles funny. I emitted them again so the particles barely left the emitter (and were no where near the edge of the box) and now it cuts perfectly. It’s like my version of maya is treating particles like they’re much further away from the origin than they actually are.
I’m not sure what’s causing this on my machine, but I also get the same problem with scripts that replace broken geometry with instanced particles, the area that the particles are born at are a super scaled down version of the position they’re supposed to be born at.
Have you tried resetting the create emitter tool? Also whats your units set to? You should always leave it at centimeters. Hmmm not sure what else could be causing it . . . :-\
gah!!
my units were set to metres. nothing i did myself!
Problem fixed though. I read through the code and I understood it all. it’s nice. Are you adding the particle emission to the script? is that why you wanted to delete locators that are outside the mesh?
I love how it’s all particle based - so the distribution of the particles completely effects your shatter. You can draw the particles in for total customisation, or script it all for adding all that nifty bomb locator stuff.
I have a question. Could you tell me the pros and cons of Maya Shatter function? I didn’t try any script in this thread but I tried Maya shatter and it gave a good result. I’m new to dynamic in Maya so I’m not sure why people don’t use that function?
Giap, the Maya Shatter function is horrible. It works fine on a cube, but if you try to use it in a real project, you will be pulling your hair out constantly. Also they haven’t updated it since like Maya 2.
Maybe my test is too simple so I didn’t find any issue. But it takes sort of long to shatter my sphere into 100 pieces. But for some reasons. When I apply rigid body to these pieces and the gravity as well, the dynamic seems not to work.
Further to this, I would guess you could almost get a texture fracture, if you emit particles from a texture file with 0 speed. Hmm, I’m not quite sure it would work as expected currently, but maybe in conjunction with voxel idea it could work.
I am not sure any of the effects under the effects menu were ever really meant for serious production, they are just a bunch of mel scripts. Seems like they are more there to show what can be done, kind of like the examples in the visor. There are some quite nice expressions in them that i found useful when learning.
Do you guys have any workflow tips for handling maya rigid body dynamics? The calculation times are pretty steep.
I have one:
don’t use it! 
seriously
use dynamica, nima, novodex (which is the same) and if you have maya 2009x64 you are f**** 
so you can try use particle instancer to do the job quick but not too accure
or you can/ must use this “rigid body dynamics” and pull most of your hair out 
or use realflow to do the rigidbody dynamic
PhysX is the best I have seen, but its buggy. Good for a lot of stuff though. From what I hear the guys at NVidia are working on a new plugin, so hopefully all those bugs go away.
There’s also no PhysX for those of us on Macs. I really wish there was an OpenCL version of Bullet Physics. That way every platform and card would be covered.
Always use proxy geometry and seperate collision layers wherever possible - also triangulate your geometry. The maya RBs are very dated now but aren’t completely useless… Physx and bullet are much faster and more stable though.
I guess a nice this to do with this would be to add a random distribution across the object’s bounding box, then convert those to locators, then delete the locators outside the mesh and use those for the cut procedure. I guess you couldn’t specify the number of shards created? because as particles are added the number of shards increases exponentially
