CGTalk > Software > Autodesk Maya > Maya Dynamics
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 11-09-2005, 01:12 PM   #1
nikiatanasov
Frequenter
 
nikiatanasov's Avatar
portfolio
Nikolai Atanasov
3D Generalist
Freelancer
Sofia, Bulgaria
 
Join Date: Aug 2002
Posts: 103
Send a message via ICQ to nikiatanasov Send a message via Yahoo to nikiatanasov
active rigids controled with animated sceleton?

Hi, I have to do a character witch is made out of stone to break-down to parts (rigid bodies), the problem is that tha character have to move while some parts of it begin to fall.
I know that rigid bodies can't be parented.. How to connect them tho have the transformation from the rig and to start falling dynamicly at given time. after a while the whole character have to breakdown at once.
I know its a hard thing to do but I'll appreciate any ideas how to do such a thing.
10x

With Regards
Nikolai Atanasov
 
Old 11-10-2005, 10:20 AM   #2
nikiatanasov
Frequenter
 
nikiatanasov's Avatar
portfolio
Nikolai Atanasov
3D Generalist
Freelancer
Sofia, Bulgaria
 
Join Date: Aug 2002
Posts: 103
Send a message via ICQ to nikiatanasov Send a message via Yahoo to nikiatanasov
now after some research I've found that I can parent Passive Rigids to my rig, also I'm creating a particle in the center of each rigid body witch is parented to the sceleton too. I'm using the particles only for "listening" for a volume fields and to switch passive to active.
if (inputforce[0] > 0.1){
setAttr "rigidbody1.active" 1;
}

The idea is working on few objects, now I have to write mel that will automate the creation of the particles an putting expression to each particle object to control representing rigid body attribute for .active, but I'm not shure how can I add expression to the particles with mel.

If someone have a better idea please share it whith us
10x
 
Old 11-12-2005, 09:11 AM   #3
nikiatanasov
Frequenter
 
nikiatanasov's Avatar
portfolio
Nikolai Atanasov
3D Generalist
Freelancer
Sofia, Bulgaria
 
Join Date: Aug 2002
Posts: 103
Send a message via ICQ to nikiatanasov Send a message via Yahoo to nikiatanasov
hmm some kind of East Europe monologue happens here

anyway, I have solved my problem and will post the solution. I think it's not the best way but its working.

I don't have strong expirence with mel and thats because the script I made have to be edited for each kind of set you have in the scene. It works with selected geometry and two previously created fields "worldGravity" and "gravityField", but it can be extended for more complex situations.
so how to use it:

1. place all objects (parts) to be in the pose similar to the curent character pose(because you have to parent them later to the coresponding bones)
2. create one gravity field and rename it to "worldGravity" (this is the gravity for the rigids)
3. create second gravity with volume shape and give it a name "gravityField1" (this is for the particles, that will listen for this gravity and when particle gets into the region of this gravity, the particle have to execute a command that will set coresponding rigid body to Active)
after seting these things the script comes here:

/////////////////////////////////////////////////////////////////////////////////////////
string $sel[] = `ls -sl`;
$mysize=size($sel);
$i = 0;
while($i< $mysize)
{
select -r $sel[$i];
float $myCenter[] = `xform -q -t`;
rigidBody -passive -n ("rigid_body"+$i);
particle -p $myCenter[0] $myCenter[1] $myCenter[2] -n ("particle_center"+$i);
string $inputforce = "particle_center"+$i+"Shape.inputForce[10]";
string $outputforce = "gravityField1.outputForce["+$i+"]";
string $particleName = "particle_center"+$i;
connectAttr -f $outputforce $inputforce;
connectDynamic -f gravityField1 $particleName;
connectDynamic -f worldGravity $sel[$i];
string $expr1 = "\"if(mag(particle_center" +$i+ "Shape.inputForce[10])>.1)\n{\nsetAttr \"rigid_body" +$i+ ".active\" 1;\n}else{\nsetAttr \"rigid_body" +$i+ ".active\" 0;\n};\"";
dynExpression -rbd -s $expr1 ("particle_center"+$i+"Shape");
$i = $i+1;

}

/////////////////////////////////////////////////////////////////////

now all selected objects are passive rigids and there is a particle object in the center of every one peace of geometry, the particle contains dynamic expression that will affect coresponding rigid body.
All you need now is to parent the particles and the rigids to coresponding joint and to change the mass of the particles to "0" (this will prevent particle from fly away when its in the volumeshape of the gravityField)
now you can animate this volume where to go and to make the rigids from passive to active.
I'm not finished with my project, so there will be update on this stuff.

I hope that this is helpfull

With Regards,
Nikolai Atanasov
 
Old 11-25-2005, 04:37 PM   #4
coccosoids
Expert
 
coccosoids's Avatar
portfolio
R L
Romania
 
Join Date: Aug 2002
Posts: 925
very cool info
 
Old 11-25-2005, 04:37 PM   #5
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 04:34 PM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.