Showing posts with label primitive. Show all posts
Showing posts with label primitive. Show all posts

Tuesday, 14 April 2026

geometry and material variants, instancing in solaris

Variant workflow. Use the Component builder + Geo Variants to build some variants. You'll use the Component Material node to create the mat variants, then packaged them out with the component output. Bake this as a USD.

 


Load your cached out USD. Attach an "explore variants" node and set the mode to explore. Set spacing to zero so they're all at the origin.

Then plug it into an Instancer. Specify the primitives you want to prototype (use in instancer). Make sure you UNTICK "Only Copy Specified Prototype Primitives". The rest is as normal (eg make some points inside the instancer and give it an index attribute).

Now all of your variants are in play.


This seems a bit longwinded, but I guess it does work and fits within a pipeline a bit nicer? It also works nicely with the variant systems that exist in Houdini/Solaris.

BONUS - if instead of using the Instancer in "Point Instancer" mode, you use "Instanceable Reference", you gain access to each and every instance. If you do this, you can actually use the Set Variant nodes to change particular instances, eg. you switch one of them to be a pig and make it red instead of green. Performance does take quite a big hit if you do this though. 

Wednesday, 1 March 2023

primitive number as an attribute - enumerate

 use case - you have a bunch of curves and want to give them individual point colours - but you want the points to all use the same id.

an Enumerate sop node will let you store the number value in each point or primitive. Lets use the primitive option, then attribute promote it to points so that each curve's points all contain the same identifiable attribute.


It can also be used to name "pieces", which might be useful



Tuesday, 9 November 2021

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

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!