Difference between revisions of "Houdini learning"
Jump to navigation
Jump to search
Line 80: | Line 80: | ||
vector uv = primuv(0, "uv", @primnum, set(0.5, 0.5, 0)); | vector uv = primuv(0, "uv", @primnum, set(0.5, 0.5, 0)); | ||
i@udim = 1001 + int(uv.x) + int(uv.y)*10; | i@udim = 1001 + int(uv.x) + int(uv.y)*10; | ||
+ | |||
+ | // Set pscale Min/Max | ||
+ | @pscale = fit01(pow(rand(@ptnum), ch("power")), ch("pscale_min"), ch("pscale_max")); | ||
</pre> | </pre> |
Revision as of 16:53, 5 October 2020
Contents
- 1 Houdini learning
- 1.1 Increase Volume Density
- 1.2 Substract any VDB by another VDB
- 1.3 Get bound & centroid
- 1.4 UVs
- 1.5 Attribwrangle - if...
- 1.6 Attribfrommap - Use UDIMs images
- 1.7 Attribwrangle - Udim number on primitives attributes
- 1.8 Place at World center, scale et re-transform for export
- 1.9 Misc Attr Wrangle expressions
Houdini learning
Increase Volume Density
// In a volumewrangle @density *= 10;
Substract any VDB by another VDB
// In a volumewrangle if (volumesample(1,"surface",@P)<0)@density=0; //inverse: if (volumesample(1,"surface",@P)>0)@density=0;
Get bound & centroid
// In a null object bbox(opinputpath('.',0),D_XSIZE) bbox(opinputpath('.',0),D_YSIZE) bbox(opinputpath('.',0),D_ZSIZE) centroid(opinputpath('.',0),D_X) centroid(opinputpath('.',0),D_Y) centroid(opinputpath('.',0),D_Z)
UVs
// In this order : uvautoseam - uvflatten - uvlayout In uvflatten : Seams = seams
Attribwrangle - if...
// Kill emission on a smoke source after frame 300 if (@Frame>300) @density = 0;
Attribfrommap - Use UDIMs images
// Replace 1001 by <UDIM> and check UDIM Filename Expansion
Attribwrangle - Udim number on primitives attributes
// In a wrangle set on Primitives vector uv = primuv(0, "uv", @primnum, set(0.5, 0.5, 0)); i@udim = 1001 + int(uv.x) + int(uv.y)*10;
Place at World center, scale et re-transform for export
// In a transform translates -centroid(0,0) -centroid(0,1) -centroid(0,2) // In a transform Uniform scale (bbox("/obj/neigeSol/timeshift1/", D_ZSIZE))/(bbox("/obj/neigeSol/transform_centerWorld/", D_ZSIZE)) // At end, in a transform Uniform scale 1/((bbox("/obj/neigeSol/timeshift1/", D_ZSIZE))/(bbox("/obj/neigeSol/transform_centerWorld/", D_ZSIZE)))
Misc Attr Wrangle expressions
// Delete by color if (@Cd.x<chf("seuilColor"))removepoint(0,@ptnum); // Set random pscale @pscale = fit01(pow(rand(@ptnum), ch("power")), ch("pscale_min"), ch("pscale_max")); // Udim attr for each Udim vector uv = primuv(0, "uv", @primnum, set(0.5, 0.5, 0)); i@udim = 1001 + int(uv.x) + int(uv.y)*10; // Set pscale Min/Max @pscale = fit01(pow(rand(@ptnum), ch("power")), ch("pscale_min"), ch("pscale_max"));