PDA

View Full Version : Birthing rigid body's from particles


Bernard397
04-21-2007, 08:55 PM
Hello ,



is it possible to birth rigid body's from a particle stream ?



thanks,


bern

mandark1011
04-23-2007, 02:23 PM
I also would like to know the answer to this question. In Paul Jewells demo there is a rigid instancer. Ive been playing around with this idea and im wondering if it truly is a rigid body or just fakes it using the rigid attributes.. Any Help!?!

Sphere♥
04-23-2007, 03:08 PM
Yeah sure, with an animation expression on the particleShape. For example: set emitter type, rate and speed, set a short lifespan for actual particles, check the Particle: Creation radio button in the animation expression.

Sphere♥
04-24-2007, 02:03 PM
For fun I tried a quick simple test this morning using a Maya emitter to spawn Nima PhysX (http://forums.cgsociety.org/showthread.php?f=86&t=297327) rigid body cubes, I posted a quick playblast of it on google video (http://video.google.ca/videoplay?docid=3826842011904978810), a cube cannon I guess. But ouch, google video really made a mess of it when compressing, you can't really see the cubes.

Animation expression goes in the particleShape (press cursor down on particle to select). The very simple animation expression I used for this (note: rigidBody solver is Nima PhysX (http://forums.cgsociety.org/showthread.php?f=86&t=297327) in this case; would need actual geometry for rendering):vector $p = position;
vector $v = velocity;
select -cl;
NxCreatePhysicsShapeBox;
nxRigidBody -p ($p.x) ($p.y) ($p.z) -active -m 1 -den 1 -omd 1 -adp 0 -dp 0 -sf 0.2 -df 0.2 -b 0.6 -l 0 -tf 200 -iv ($v.x) ($v.y) ($v.z) -iav 0 0 0 -c 0 -pc 0 -i 0 0 0 -imp 0 0 0 -si 0 0 0 -sio none;
//

mandark1011
04-24-2007, 02:43 PM
Amazing! always fun to see your physx tests sphere.. Thanks so much for the expression too ill definately play around with this one. Again thank you

apoc519
04-24-2007, 03:56 PM
Sphere's got the right idea. That's basically what my script does.

I find the starting position and velocity of a particle, replace it with a Nima rigid body and then kill the particle

mandark1011
04-25-2007, 03:07 PM
Question#1
I was wondering how often you actually found a use for this script in production environments? Im thinking about attempting to build one myself, but with a recent addition to my family, time has become a precious commodity, so im questioning if my "spare" computer time couldnt be better spent on other ideas.
Question#2
By using Nima PhysX rigids arent you limited to having the actual plugin installed on every machine you use it on? Has the film and tv version eluded to in the big physX post on CGTalk manifested yet or is everyone still useing the beta version?"

Thanks for the reply!

apoc519
04-25-2007, 04:26 PM
the script can be as simple as what Sphere wrote or with an interface like mine which only took me maybe a day and a half to write with all the extra options. I havn't really used it in production because I've been stuck doing cloth sim for the last few months so I havn't needed it. I think it's a really useful alternative to instances for things like debris when its close up and you need to see that interaction.

Theres a couple of major problems to overcome though. The biggest problem is I have no idea how to cache something like this. I have just been rendering it on the fly so far. Because you have geometry being created on the fly you need a caching system that can handle that. The built in Nima system is no good.

Sphere♥
04-26-2007, 05:21 PM
Perhaps a clever full script could be able to take care of managing a scene filled with spawned rigid bodies, including deleting them on rewind and even possibly baking them (using an external data file?), but it might take a significant time investment to write such a management system and it might be slow. But yes, since it's not native Maya functionality you're looking at implementing it programmatically. I've managed to "bake" with MEL the geometry alone (existing, not spawned) from Nima rigid bodies, which allowed to not require Nima down the line on other machines.

Nima is no longer beta! I think it's really geared to PC game developpers (makes sense). But there is a serious issue which has pretty well made me stop playing with it. There is a memory leak happening when you use it, it's a small leak but becomes a major problem when thousands of rigid bodies are simulated. Feeling Software is looking into it (http://www.feelingsoftware.com/bugzilla/show_bug.cgi?id=271), I'm waiting for that fix to get going with Nima again.

p.s.: thanks mandark1011 for encouraging my mediocrity, it helps me learn to do very quick and dirty tests, so we share. It's quick and easy if I don't have a high bar to strive for, and it's the fun part rather than the work part.

westiemad
04-27-2007, 08:19 AM
is there a mel command reference for the plugin?

Sphere♥
04-27-2007, 03:01 PM
is there a mel command reference for the plugin?Not that I'm aware of. But most of their syntax follows Maya's rigid body syntax, for example: for nxrigidbody you can look up Maya's rigidbody command for syntax. Other than that I just look at the commands issued by the menus and in the Script Editor.

CGTalk Moderation
04-27-2007, 03:01 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.