I actually started with super hard nCloth sim, but at some point, no matter how high i put everything, it still would compress and break. I thought I would then just find center and replace the CLoth with my real objects, but once the sim would break., it just went down hill and I ended up with flat pancakes everywhere.
the second step was rigidBodies. amazingly filling the bottle and tossing them around worked to a point, but that damn "intersection warning" would stop the whole thing. besides it was running at about 15 to 10 min a frame , so , i gave up on that
next I tried DMM , which would have been great, except I only have access to the freebie one, and its too limited poly count made it useless
next I tried Bullet/ dynamica but It fell apart as well, mostly due to my lack of knowledge. and limited time to get this shot done, I only had about a day and a 1/2 to do it. I got super close with bullet, but some basic things were killing me. for one Stepping. apparently you can only change the step size of the bullet solver, if you are using dynamica, hence I switch to dynamica. which got me closer, but i ran into issues where the bottle would move too fast and the pills would just fall out, so i slowed the whole animation down, with the intent of speeding up the baked animation, but then the pills just fell out before the bottle even moved. Things that drive me crazy about bullet.. ( and this is probably mostly due to my noob trying to learn bullet in one hour issues)
Couldn't find how to reverse a surface. so I had to start with an open bottle, or the pills would spring out on frame one, and then go crazy.
for some reason, bullet would move the pivot of my object to 0 0 0 when making a dynamic object . So if i had a bunch of pills in a set position in the bottle, ( simmed using rigid bodies) I couldn't seem to turn them into bullet objects without the pivots all being at zero.
along those same lines. using "box" instead of mesh would be faster, but the box seemed always way off compared the object. if i did the aforementioned pre filled bottle, the box surrounding the pills would go from 0 0 0 to wherever my objects were.
so in the end? and I'm really not happy with it. i filled the bottle with nParticles ( balls ) that were roughly the size of the pills, emailed the group to see if there was a way to change the shape, then simmed a bunch of different nParticle dynamics. chose a sim, baked out the instances ( no thanks to un-instancer no longer working) , but I found a mel un-instancer that takes rotations into account on H3D. and then hand key fixed all the pills for about 3 hours.
on that note. I found that animation layers were super helpful. Since I just wanted to offset the pills a little bit, I found the under and over grouping them baked animation, didn't really work, but the animation layers I was able to key the pills offset animation and get the desired result. The only sticky bit on that, is that I wanted to bake the animation offset layer down to the base layer. You can merge, but then you still have to keep that layer, you can't delete it. What I wanted my end result to be, was to have NO animation layers, and the merged animation layer, actually a part of the base anm layer. I was about to just bake new geo to world space, when I said, F- it its late, I'm leaving the merged layer in there. and that seemed to work.
in the back of my mind I kept thinking I should look up ODE, I think that allowed you to make capsule like rigid bodies. next down time I get, I'm looking it up, as well as investigate more into DMM and Bullet.
when the job ships, I'll see if I can post a vimeo.. ( its not all that exciting however ) :)
-=s