Friday, 5 April 2019

Wednesday, 3 April 2019

match, finding a string in a wrangle. Wildcards.

in Blast nodes you can use wildcards * all over the place
eg. @name=*something
will kill anything with "something" in it's name attribute. It's a little different when you want to select things in this manner in a wrangle. We use the "match" function to do this-


if(match("*stick*",@name)){

s@value="yeah!";


}

Here we look for the string "stick" in the attribute "name". On success, we make "value" equal to "yeah!".

Tuesday, 2 April 2019

separating objects for booleans/other things

Case example - you have a 


To separate out an object, maybe for booleaning, or to avoid intersections when doing some other sort of calculation, make a point class attribute (connectivity)
then in a point wrangle do something like this-

@P.x+=@class;
@P.y+=@class;

This should separate the pieces enough. If not, use a multiplier.
Then promote the class to a primitive attribute - for some reason Boolean Fracture doesn't carry across the class attr to any newly generated points when it is left as a point attr.


Do your booleans...you might want to scatter some points on the surfaces or copy some turbulent grids onto the object points.

Bring the class attribute back to point level and then do the reverse transformation

@P.x-=@class;
@P.y-=@class

 link any multipliers you might have to save time changing values in multiple boxes!



Saturday, 30 March 2019

constraints between two different objects refresh redux ultra

I've probably made a post about this before. Or I thought I did. .. anyway. I only make notes about things as I actually do them :) Repetition is the key to learning !

If you're trying to create constraints between two different objects, say a bunch of bricks and a big big of plaster wall you have to approach your primitive constraints generation a little differently than usual.
Normally you would put a Connect Adjacent Pieces node down and this would draw lines between your closest points. However if you were to merge the bricks and plaster together and do this, you still end up with lines being generated between brick bits and plaster bits..when all you actually want are the lines exclusively between brick & plaster. Whew.

To achieve this you have to hijack the name attribute of your brick and plaster geometry so that Houdini thinks there are only two names to connect between. Instead of having "brick01,brick02,brick03,plaster01,plaster02,plaster03" you will have "brick,plaster". that's it.
In a Point Wrangle(for packed geo) or a Primitive Wrangle(if you are working with unpacked geo) for each of your objects do something like this -

s@original_name=@name;
s@name="objectA";

where objectA might be "brick", object B might be "plaster". Now merge these two mono-named objects together , promote the name  attribute to point level (if it isn't already) and apply the Connect Adjacent Pieces node to them. Now you should only see lines being generated between the two seperate groups of objects. Brick to Plaster. Plaster to Brick.
Finally you must bring back your original name, so use an attribute rename node for this..


Plug your nice sparkly constraints into the rest of your network!


Friday, 29 March 2019

2d zoom pan

ctrl alt rmb drag..
if there's an image plane, lock the camera movement

RBD Hard Constraints/Glue Constraints & Sanity check

hard constraints will read Force, Angle, Torque and Distance
Glue constraints will read Strength and Impact

Sometimes you will glue things together and they will still seem to come apart (when attached to something animated for example). Try solving the RBD Packed Object on creation frame - this MIGHT fix it...

Check your Constraint Network's "Overwrite with SOP" field if constraints are not being deleted correctly. It should only be active (value of 1) for the first frame of the simulation. Then it should go back to 0. Otherwise, it will constantly read in the constraints from the SOP level (ie. replacing it with vanilla untouched constraints)

Wednesday, 20 March 2019

RBD Clustering, an "update"

Instead of using the cluster attribute found in Sam's notes...

Add a primitve VOP to your constraint primitives.
Create a voronoi noise and promote the frequency to the top level.
Plug the output (dist1 is good) into a ramp float node and then mess around with the curve to create some interesting patterns (try adding noise to this), which will essentially operate as clusters.. Export this to Strength, or multiply it by a pre-existing value.