Archived post by paqwak

Yup looks the version I did (based on @mestela initial work) is slightly faster, but you have to extend the voxel banding at lot on the vdb from polygon itself … after that it’s a single volume vop … it’s probably less clever but faster to execute. Otherwise yes Dom toolset is a way better approach, especially if you can only use SDF primitives.

Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20241103/11/24/sop_vdbsoftboolean.1.0.hda

Archived post by jefflmnt

@David Torno

with a bit of help about binary string lookup from a good friend of mine

it’ll spit out a CSV file with this

took a tad longer than I thought – but I think there might be a better way to do this lol

Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20245503/10/24/get_versions.hiplc
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20245503/10/24/image.png

Archived post by aswaab

Some code for the volume wrangle. Volume goes in input 1. Seed points in input 2. And then you need to construct the control interface.
`//controls int mirror = chi(“mirror”); int distanceMetric = chi(“distanceMetric”);
//init variables float currentdist = 1000000; //pick a super high starting value. In theory, it should be infinite… int closestpt = 0; //placeholder for seed point float dist = 0; //placeholder for distance to seed vector pos = v@P; //current voxel position
//mirror if(mirror == 1) pos.x = abs(pos.x); if(mirror == 2) pos.y = abs(pos.y); if(mirror == 3) pos.z = abs(pos.z);
//calculate distances int pts = npoints(1); for(int pt = 0; pt < pts; pt++){ vector ptpos = point(1, "P", pt); vector vdist = abs(pos - ptpos); //vector distances if(distanceMetric == 0) dist = length(vdist); //euclidian/voronoi distance if(distanceMetric == 1) dist = sum(vdist); //manhattan distance if(distanceMetric == 2) dist = max(vdist); //chebyshev distance if(dist <= currentdist){ closestpt = pt; currentdist = dist; } }`

Above code will give you a density field that stores the seed values. From there, you can parse it how you need.

(gemming my own code for posterity)

Archived post by _white_dog_

I have just published a new Cloud Solver 😀 drive.google.com/file/d/18RnoiX-Hvn4kM3_L09wT0INXRdRYFjxh/view?usp=drive_link
It is based on the SIGGRAPH Asia 2020 paper “Stormscapes: Simulating Cloud Dynamics in the Now”. It can simulate fog, stratus, stratocumulus, cumulus, cumulonimbus, Kelvin-Helmholtz instability, and more. computationalsciences.org/publications/haedrich-2020-stormscapes.html

Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20240502/23/24/cloud2.mp4

Archived post by waffleboytom

this works but I feel like it’s a hack

“`py node = hou.pwd() stage = node.editableStage()
prim = stage.GetPrimAtPath(‘/geo/points_0’)
ptsattrib = prim.GetAttribute(‘points’)
ptsarray = prim.GetAttribute(‘points’).Get()
ptsattrib.Set(ptsarray[::10]) “` weirdly enough the python version doesn’t seem to affect the HoudiniDataId while the vex version sets it to -1 which makes me go hmmmmm

“`py node = hou.pwd() stage = node.editableStage()
prim = stage.GetPrimAtPath(‘/geo/points_0’)
attribs = prim.GetAttributes()
for attrib in attribs:
interp = attrib.GetMetadata(“interpolation”)
if interp == “vertex”:
valarray = attrib.Get() attrib.Set(valarray[::10]) “` this makes more sense as if you have more primvars on your points you would wanna slice those arrays as well

the 10 here drives the percentage of points you want, setting it to 10 gives me 10 percent of my original pointcount

to get 5% you would do 20 because 100/20

“`py node = hou.pwd() stage = node.editableStage()
for prim in stage.Traverse():
if not prim.GetTypeName() == ‘Points’:
continue
attribs = prim.GetAttributes()
for attrib in attribs:
interp = attrib.GetMetadata(“interpolation”)
if interp == “vertex”:
valarray = attrib.Get() attrib.Set(valarray[::10]) “` here’s a version that will cull all your point clouds to keep only 10%. Might be slow if you have a large stage as I’m doing a stage traversal here

this won’t work for an animated pointcloud though

hold on

right, here’s a file with a static point cloud, animated(time dependent), animated(time samples)

Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20245502/17/24/image.png
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20245502/17/24/waffles_cull_points_solaris.hip

Archived post by waffleboytom

I’ll post the code in a bit

“`py from pxr import UsdSkel
node = hou.pwd() stage = node.editableStage()
skeleton_prim = None anim_prim = None
for prim in stage.Traverse() :
if prim.GetTypeName() == “Skeleton”:
skeleton_prim = prim
elif prim.GetTypeName() == “SkelAnimation”:
anim_prim = prim
anim_binding = UsdSkel.BindingAPI.Apply(skeleton_prim.GetPrim())
anim_rel = anim_binding.CreateAnimationSourceRel()
anim_rel.AddTarget(anim_prim.GetPrim().GetPath())
vis = skeleton_prim.GetAttribute(“visibility”)
vis.Set(“invisible”)“`

Here’s my file featuring all methods we discussed (you need the dragon and the shark models )

(that snippet also hides the skeleton so it doesn’t show on the dragon)

Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20240002/13/24/waffles_usd_apply_anim.hip

Archived post by mattiasmalmer

I just inject a little extra height on each frame where the sand is supposed to fall. A simple distance to point.
Then the erosion solver tries to erase and spread it around. So thats nice.
I use the heightfield to scatter one layer of just dumb particles to get the general terrain.
Next i made a simple solver that just generates a few thousand points per frame and sctters them using the difference between two frames of heightfield as a density map. This way i get particles where there is movement. I then perturb them per frame using the heightfield gradient. These points die off after a while so that they stay roughly constant as new ones are spawned.
It works surprisingly well for what I need it for.
The system updates at ”Interactive rates” 🙂

A nice bonus is that it is just a shell of points so rendering is not insane.

Archived post by waffleboytom

the classic “I found code on the forum” haha “`py
node = hou.pwd() stage = node.editableStage()
from pxr import UsdSkel
skeleton_prim = stage.GetPrimAtPath(“/Object_10/skin0/skeleton”)
anim_binding = UsdSkel.BindingAPI.Apply(skeleton_prim.GetPrim())
anim_rel = anim_binding.CreateAnimationSourceRel()
anim_prim = stage.GetPrimAtPath(“/Object_10/skin0/Scene”) anim_rel.AddTarget(anim_prim.GetPrim().GetPath()) “`