Very Nice! It looks like Nicola has fixed the rotation issue... Fantastic!
It's working well, but I'm having a little difficulty figuring something out. If I cut up an object, and turn the pieces into rigid bodies, they behave strangely, like the center of gravity is off? I've tried deleting the history, centering the pivots, freezing transformations and a few other things to the pieces, but it persists... I'm sure there is something I can do to the object pieces, I'll try to figure it out tommorow. But here is a little quick example script:
Code: Select all
{
string $pCyl[] = `polyCylinder -r 5 -h 20`;
move -y 10;
string $pObj = $pCyl[0];
float $bb[] = `polyEvaluate -boundingBox ($pObj)`;
int $i;
for ($i = 0; $i < 4; $i++) {
float $px = rand(($bb[0]*0.95),($bb[1]*0.95));
float $py = rand(($bb[2]*0.95),($bb[3]*0.95));
float $pz = rand(($bb[4]*0.95),($bb[5]*0.95));
float $rx = rand(0,180);
float $ry = rand(0,180);
float $rz = rand(0,180);
polyCut -pc ($px) ($py) ($pz) -ro ($rx) ($ry) ($rz) -ef 1 -eo 0 0 0 ($pObj);
polyCloseBorder ($pObj);
}
select -r ($pObj);
polySeparate ($pObj);
}
When I turn the resulting pieces into rigid bodies (script cuts up convex pieces, so they're hulls), with the rotation fixes, it appears to work. But when I play the simulation the pieces behave like their center of gravity is far away. Again, I'll try to figure it out tommorow.
Thanks Nicola!
EDIT: Ok, looks like I figured it out... center of gravity is at world space 0,0,0, so I need to center pivots to both object pieces and world space... ok, I can work with that. Some tests, scripts and more later...