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()) “`

Archived post by bonsain

I wasn’t aware of those functions, that’s cool! This seems to work quite nicely from a quick test… granted this is a curve with 4/5 points ๐Ÿ™‚ Would be keen to see if this does what you need, @mattiasmalmer, and any performance issues you run into!
prim wrangle: “` function void insertvertex(int geohandle; int prim_num; int insertion_index; int point_num) { int points[] = primpoints(0, prim_num); insert(points, insertion_index, point_num); foreach (int i; int point; points) { setvertexpoint(0, prim_num, i, point); } }
vector new_pos = point(1, “P”, 0); int new_pt = addpoint(0, new_pos);
int insertion_index = chi(“insertion_index”); insertvertex(0, i@primnum, insertion_index, new_pt); “`
I made it into a `insertvertex` function if you feel like reusing this via a custom vex library ๐Ÿ™‚ The last few lines is just me querying a point position from the wrangle’s second input and choosing which index to insert it on~

Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20241402/09/24/insert_vertex.gif

Archived post by petercubic

hey there, I meant to post this earlier but got caught up in a long meeting; I think another Peter gave you the tip you needed though ๐Ÿ˜ ๐Ÿ™Œ
One other way of doing this is creating a sort of “Uber-Shader” using Parameter Nodes when building shaders. This creates an “Input” within USD, and allows for you to use the Edit Material Property LOP to make as many Specializes (a type of Reference) from one shader as you want. I learned this from @goldleaf, and hopefully I’m explaining it decently.
Here’s a quick example HIP I whipped up. Might not be the best example, but hopefully it makes it clear enough. One of the shaders should be offsetting more quickly than the other.
Let me know if I can try to help clarify anything more. ๐Ÿ™‚

Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20243401/31/24/Animated_Shader_Properties.hip

Archived post by mattiasmalmer

finally got around to dealing with a resampling issue that often gets in the way. those pesky corners being rounded. so i find them by angle. then remove duplicates and finally harden them.

good companion to the trace SOP

corner hardificator

Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20242701/30/24/houdinifx_LpgbhlJjho.gif
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20242701/30/24/harden_corners.hiplc
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20242701/30/24/image.png

Archived post by kiran_irugalbandara

Before buying this I went through the free pdf sample he released. It was really nice and even though I rarely use game engines or do shader work the theory in it was very nice.

Essential math for game devs by the same author is also great

This is the free sample I was talking about

Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20243401/28/24/ENG-VE-VOL2-FREE-SAMPLE.pdf