Animating a ribosome reading an RNA strand
The project is to animate the behaviour of a ribosome reading an RNA strand. I would like to have multiple vellum wobblies going through pre-programmed behaviour, which at the same time should be free floating and reacting to each other. I want the ribosome to be gently chugging on the RNA strand, with the push of the RNA strand gracefully influencing the ribosome.
The easy route is to choose one element to be static, for example the ribosome would remain in place, and the RNA passes through it. The ribosome would feel unnatural though, it would be stuck on the spot, mainly to alleviate the headache of the animator. No gentle caressing.
Another option is to bake in the movement of the ribosome, to pre-animate it with keyframes or something procedural. You could give it some natural movement, and the ribosome turning would influence the RNA, wrap and fold it by colliding with it, but not vice versa. The chugging of the RNA through the ribosome would not give a gentle push to the ribosome.
It took a bit of tinkering, first went down a path of locally generating force and contra force (it’s too tedious to control, and not stable enough to guarantee the strand pushes through.)
What I found to work was animating glue constraints. During the sim you create a glue constraint between ribosome and RNA, and decrease it’s restlength over time, eventually deleting it and creating a new constraint, between the same anchor point on the ribosome, and a new anchor point slightly further along on the RNA chain. This pulls the RNA chain reliably through the ribosome, and leaves everything freefloating in space.
I modelled something organic looking in zbrush but it’s basically the shape of a torus. On the geo you define an anchor point, selected by hand. Push the geo into a Vellum strut setup.
Just a simple curve. Define starting anchor point (this will be updated during the sim) Push it into a Vellum hair setup.

Merge the Strut and Hair setup and push into a dopnet.

This is what the dopnet looks like. Pretty straight forward vellum setup with the addition of two SOP solvers, one for the Geometry, and one for ConstraintGeometry. If you’re not familiar with these SOP solvers, Tim van Helsdingen explains them nicely in this video. (opens in a new window)
Dive into the sop solver for the geometry.

The steps are as follow. Usually it just pushes through the existing geometry as is, unless it’s a framenumber where new constraints get created (I create attribute ‘pusher’, if 0 then nothing happens, if 1 then switch to the newly created constraint geometry).
The chain on the right is working on the ConstraintGeometry. It’s importing the existing constraints, checking if it’s time for a new constraint, and then exporting that to the ConstraintGeometry SOP solver.
This is also where the stretch of the glue constraints gets updated. I’m tracking the age of the constraint, then using this to modify the restlength and eventually delete the constraint.
// set_stitch_pointnumberint multi = chi("Multi"); // How many points to jump each timeint speed = chi("Speed"); // Length of 1 cycle.i@goal_pt = 13 + multi*floor(@Frame/speed);//set_glue_momenti@pusher = 0;int speed = chi("Speed"); // Link this one to the same Speed in set_stitch_pointnumberint go_time = (int)@Frame%speed;
if(go_time==8){i@pusher = 1;}// age_constraintsi@age_fr += 1;
### delete_constraintsint speed = chi("Speed"); // Link this one to the same Speed in set_stitch_pointnumber
if(@age_fr>speed){removeprim(0, @primnum, 1);}// decrease_restlengthint frame_min = chi("Min");int frame_max = chi("Max");float scale = fit(@age_fr, frame_min, frame_max, 0, 1);scale = fit01(chramp("Scale", scale), 0.0, 1);
f@restlength = f@restlengthorig * scale;In the ConstraintGeometry SOP Solver it’s importing the constraints from the other SOP Solver and pushing them through as is.

Both the ribosome and RNA chain are free floating in space, not pinned down.
Changing the weights of each drastically changes the animation. Making the chain heavy and the ribosome light means the ribosome pulls itself along the chain. Making the ribosome heavy and the chain light means the ribosome stays in place and pulls the chain through itself.
Going to render out the full version soon.
Download example file (opens in a new window)
BONUS: There’s also a protein being assembled! I didn’t feature it here but it follows the same principles. I couldn’t figure out how to dynamically add points to the chain during the simulation. You could gradually increase the restlength between a fixed amount of points but I don’t like how this looks. I fudged it by simulating the full protein, giving the geo before the glue constraint some i@disableexternal = 1 and i@disableself = 1 so that that bit doesn’t interact with anything. Post sim I blast the bits that shouldn’t be visible yet. This gives triple interactions! The RNA chain is pulling on the ribosome is pulling on the protein, and vice versa.