shatter help


#321

posted a video of realtime playback with Bullet and the Voronoi shatter:

http://vimeo.com/5772020

Dave - you might want to get Erwin to submit the 2009 plug-in to the Google code site. That’s where most people will look. Is it easy to compile it for 2008? I think yours is much stabler than the one on there now for 2008.


#322

Just started playing with this script… Loving it!!!
(Iam new to scripting) I was trying to figure out how the number of cracks are determined in script -this seems to be it…looking at the particle count.

int $count = getAttr ($particles + ".count");

   if ($count > 0) {
       python("import dg_voroPy as v");
       python("reload(v)");
       python("v.doConstParToLoc(\""+ $mesh + "\", \"" + $particles + "\")");

If one were to add a field (into the interface of the script) that specify s the number of particles to be created and therefore the number of shattered pieces, what would that code look like? If it’s too much bother to explain I totally understand-but would this function be a helpful addition to what is already a really cool tool?


#323

Its posted a few pages back. Here is the link to the reply.

http://forums.cgsociety.org/showpost.php?p=5983546&postcount=293


#324

Not a bad idea. You could use the maxParticles attribute to lock the specified number of particles if you actually wanted a precise number of chunks. I’ll update the script when I have a moment to reflect this :slight_smile:


#325

Hey Guys,

its been a while since I been all this. Had to go thru pages and pages to download all of the updated scripts, and replace them.

Thank you everyone for everything. From the voronoi shatter to bullets plugin. This goes out to azshall and davegreenwood, and everyone else who contributed to this.

Hoping one day my skills in mel gets strong enough so I can contribute to this.


#326

anyone have any tips on getting consistent results with more complex meshes? I’m trying to do a figure and it’s failing (Boolean error) or if I simplify the mesh, it drops some bits. I’ve got all the locators inside the mesh, the history is deleted, frozen transforms, tried good quads and tris but still no luck.


#327

cgbeige, I’m not sure this will help you, but I’m almost certain you will have bad topology with your original mesh. There are perhaps one or two situations where the script might fail on good geo. If the boolean cube has exactly coincident vertices with your mesh, that could cause a problem. This is unlikely though. Try nudging the group of locators very slightly, and see if it still fails in the same spot, if so it’s in your mesh. Incidently, if you can go partway you might get a clue as to where the problem is…

Actually, in testing I've never had a mesh fail, so I don't quite know what might be the problem. If you can post the mesh I might take a look...

Dave.


#328

thanks dave - it was a mirrored cage mesh so it’s definitely possible there’s still something wrong with it. I’ll try and sort it out.


#329

ok - got it. had some overlapping faces. Any plans to multithread this – you don’t want to see how long it’s going to take to do 2500 particles :stuck_out_tongue:


#330

I had a good look through the docs to see if it was possible to take advantage of multi threading, as an operation like this would be ideal. I think it’s not possible, but I’d be glad to be pointed in the right direction if it is.

I am working on a C++ version, this is very fast and currently would calc your 2500 shards in under a second on my computer. It is not ready to release yet, and I don’t have much time to work on it.

If you have a lot of shards to make, the script is faster if the points are fairly uniformly distributed. And it’s a lot faster if they are close together.

One thing you could try:
just break a poly cube into a lot of pieces, your 2500, do this while you’re on a break;) You can save that broken cube as a seperate file for later use, when you can write a little script that dupes your mesh and makes a boolean intersection for each shard. You can get reasonable variety from your cube by rotating and scaling it…

Dave.


#331

well I was kidding since I know it’s not trivial to multithread but that would be great if there was a fast plug-in. It took about 6 hours to do the mesh - I just let it run and opened another instance of Maya (in the terminal, type “open -n /Applications/Autodesk/maya2009/Maya.app” for those on a Mac).

But anyway, it worked. thanks yet again for a great script.


#332

@ davegreenwood -

I have been wanting to compile this script to C++ for a long time, but unfortunately I lack the knowledge to do so. Would be really interested to see what you come up with, and good luck! :beer:


#333

or you can always create a duplicate of the maya.app


#334

my way’s cooler :scream:

when you do anything from the terminal, somewhere a black hole opens up and numbers fly out.


#335

HAHAHAHA! That one is going in my quote journal :beer:.


#336

hahaha touche


#337

Hey guys sorry for my ignorance but Im not 100% sure what is the difference between the Physics bullets plugin and the voronoi shatter or destructor? if are not the same what is the Physics bullets plugin does?

Thanks


#338

Voronoi shatter - is a script to shatter objects using the voronoi diagram. Basically it shatters
objects in a more random way. and its less blocky/square like (that comes with maya’s standard shatter plugin) and more random peices with different sizes and faces;

destructor - is a script what will take the shattered objects that you created using the voronoi shatter script, and it will instance those pieces to a nParticle Point, where by you can use fields and particle attributes to control those pieces.

Bullets - its a rigid body dynamics plugin. thats alot faster than the standard maya RBD solver.

there is a difference between destructor and bullets.

They can do the same thing, but with bullets, you get better collision detection where the whole object iself can collide while destructor is more faked collision.

its good to have all 3 in your computer. they all do different things.

There is alot more to this. but thats the basics.


#339

“Bullet Physics” refers to the Bullet Physics Library physics engine. The Maya plugin that enables us to use the rigid body dynamics part of the Bullet Physics engine in Maya is called “Dynamica” and was developped by Disney. Think of it simply as a very fast alternative to Maya’s own rigid body dynamics system. Here is the CGTalk thread about Dynamica: Disney’s Dynamica plugin for Bullet Physics


#340

I finally got the script to work! But why does it take so long to simulate the shatter?

Edit: That was because i had to many shattered pieces lol.