Monday 24 June 2019

FETCH inverting transforms at object level

Recently I transformed a camera (scaled and rotated) to make things easier to work with in Houdini.
I did this with nulls at object level, rather than within the SOP themselves.
However, when transferring my assets back to Maya there was no clear way to invert the transformation (like in the SOP level Transform nodes).

The answer to this, is to use a FETCH node (thanks Matt Evans), which I pointed toward my rotation null and I told it to invert.. This Fetch node was then plugged into the geometry I was trying to return to the original camera orientation/scale (as you would with a null).

basically!
SCALE NULL--->ROTATE NULL--->CAMERA

FETCH(points to ROTATE NULL,with invert ticked on)--->GEO


Wednesday 19 June 2019

rotate packed primitives/ WALTER ROTATE

how to rotate a/bunch of packed primitive/s -
Use a WALTER ROTATE.

in a primitive wrangle:


float randomFactor=rand(@primnum+2323)*chf("randomMult");
matrix3 rot = primintrinsic(0, "transform", @primnum);
vector4 orient = quaternion(rot);
vector x = normalize(qrotate(orient, {1,0,0}));
vector y = normalize(qrotate(orient, {0,1,0}));
rotate(rot, radians(chf("angle") * randomFactor), x);
rotate(rot, radians(chf("angley")), y);
setprimintrinsic(0, "transform", @primnum, rot);

//////////////////
what we are doing is:
  • making a random factor to multiply the rotations, using primnum as a seed
  • creating a matrix called "rot", and initialising it to the transform of the primitive
  • create a vector called "orient", using the quarternion of the rot matrix
  • create vectors x and y
  • rotate the rot matrix using input angles for x and y
  • then finally set the primitive intrinsic using the rot matrix

Friday 31 May 2019

vellum hair thickness

To randomise vellum hair thickness, you use pscale values. To get Vellum to recognise these values, UNTICK the Thickness box in the Vellum Constraints node.

polywire radius

To vary the thickness of your polywires, simply type in the @variable you've made into the "wire radius" field of  the polywire node.. A rather simple thing that I should have figured out *facepalm*.

Tuesday 28 May 2019

spinning particles/points/rbds

I made a previous post about spinning particles with "w" and Pop Torque.... Walter uses this & it seems much simpler (?). In your DOP network, create a Pop Spin node & in the VEXpression space type:

spinspeed = 100*(fit01(rand(@id),chf("min"),chf("max")));
axis = sample_direction_uniform(rand(@id));


Spinspeed is measured in degrees per second
Axis specifies the axis of each point you're spinning. The sample_direction_uniform() function returns a normalised vector. So here, we have a completely randomised rotation axis. Not bad.

Tuesday 30 April 2019

recalculating velocity

Nicked from Walter..

Velocity is a vector..
Velocity=speed x direction.
I was using this because some of my POPs had too much speed and were going through my collision objects.

If you store the normalised version of your velocity, this is the direction. Then you can multiply it by a new speed.. Perhaps you want to make it 85% of it's velocity until it reaches your max target?

So...in VEX:


vector direction=normalize(@v);

float speed=length(@v);

if(speed>chf("maxSpeed")){

speed*=chf("dampMultiplier");
}


Friday 19 April 2019

Group selection expand.

If you need to expand your group's point selection, make ANOTHER group node straight after it.
Specify the same name and change it to Point type (this only works with points I think).
Set the Initial Merge to Union with Existing.

Untick Base Group.
Tick "Include by Edges" and also "Edge Depth".
Specify the group name in the Point Group box and drag the slider to see your point selection increase.

If you want to put the expanded selection into a new group, give it a different name at the top.