# Houdini - Controlled Destruction - SOP Solver in DOPs

We can modify constraints and geos *while a simulation runs* by plugging in SOP Solvers inside a DOP.

The wirings go like this:

[Above] The blue SOP Solver messes with the incoming RBD Packed Object (after the Bullet Solver is done with it), and the red SOP Solver messes with the constraint network.

The various solvers plugged into the Multi Solver (green) are evaluated left-to-right.

In this case, the Bullet Solver does its thing to the packed object, moves shit around, then passes it to the blue SOP Solver. The blue SOP Solver then does its thing, and the whole thing loops around.

Inside the SOP Solver, we are given 4 streams of information:

“DOP Geometry” is the *simmed* object, “impacts” is a table of points of who hit who and where *in the current loop* (so if no one hit nobody on the current loop, the table is empty), “feedbacks” just sorta hangs around, and “relationship geometry” is the constraint network.

### Modifying Geometry

Let’s start with this:

[Left] A packed Voronoi fractured object. [Right] The constraint network returned by the Voronoi Fracture.

We’ll ignore the constraint network and just sim her for now.

Pretty standard. But let’s say we want to break her up slowly, from top to bottom. Which means, we need to freeze all the pieces when the sim starts, and gradually, unfreeze them as the sim progresses.

### @active

RBD Solvers like Bullet read a *point attribute* called `i@active`

. When a point has `i@active = 0`

, it’s treated as static. So all we gotta do is set `i@active = 1`

to an ever increasing number of points as the sim plays.

Inside the blue SOP Solver:

We group points with a downward-animated bounding box. As the box travels down, more points become part of this group:

Next, we Wrangle over the points of this group and set `i@active = 1`

– making them suddenly “dynamic” and subjected to the forces of the sim e.g. gravity. Thus, giving us this result:

### Modifying Constraints

Now, we setup the usual constraint properties outside the DOP and wire up the Constraint Network. This gives us this rather grotesque thingee:

What’s happening is that, as the pieces become active, they are also Hard Constrained to each other, so they can’t break away from each other completely.

What we want is to **remove the constraints**, maybe on a slight delay after the pieces become active, so we get a little bit of this “sticking” behaviour, while also having them eventually fall apart and away.

So, inside the red SOP Solver:

This time, we want the “relationship geometry” – which is the Constraint Network. And just like we did with the bounding box, this time, we animate a Clip and rather crudely, just crop away the wireframe over time:

The final result is a mix of the two: pieces become active, hold together for just a bit then break away. Because we didn’t clip the constraints at the bottom, we get this cool big huge chunk breakaway thingee towards the end.