www.sidefx.com/forum/topic/85494/
“For anybody interested I’ve created a simple procedural by kinda reverse engineering the hair one. I’ve attached a minimal example of render time point scatter with number of points controlled by primvar.”
www.sidefx.com/forum/topic/85494/
“For anybody interested I’ve created a simple procedural by kinda reverse engineering the hair one. I’ve attached a minimal example of render time point scatter with number of points controlled by primvar.”
I don’t think @lewis.taylor. has shared this here yet, he rerecorded the talk he did for SHUG, lots of great tips here on volumes and general best practices for fx: https://vimeo.com/894363970
Yep, precisely:
PythonModule (or external module to be reused). It’s quite simple, really. Most of the below is just the docstring 😛 “` def fix_inputs(node): “””Shifts inputs of node to remove gaps This function is to be called from an onInputChanged Event Handler inside of the Operator Type Properties’ Script section. To avoid triggering further onInputChanged callbacks while running, a temporary cachedUserData gets added that exits this function early until it is complete. Args: node (:class:`hou.Node`): node to remove empty inputs from. “”” if node.cachedUserData(“skip_onInputChanged”): return if not all(node.inputs()): node.setCachedUserData(“skip_onInputChanged”, True) for i, input_connection in enumerate(node.inputConnections()): node.setInput(input_connection.inputIndex(), None) node.setInput(i, input_connection.inputItem()) node.destroyCachedUserData(“skip_onInputChanged”) “`
onInputChanged: “` node = kwargs[“node”] node.hdaModule().fix_inputs(node) “`
Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20233812/14/23/custom_merge_vs_naive_01.gif
yeah heh
Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20233912/08/23/fakeinflate.hip
ok friends i have ported this to ocl, one last step is missing, someone smarter than me needs to solve this…
only updating normals within Ocl is missing, then we could run it on the gpu without the sop loop but with the iterations on the ocl node..
Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20234012/07/23/intersectionPeak_v9_ocl.hipnc
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20234012/07/23/c93002ec7958c654252d3a8743583938.mp4
Just tested in a for loop (nodes) rather then the vex foor loop. It’s much more stable as it samples the updated P,N each step
Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20233012/06/23/image.png
Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20232112/06/23/intersectionPeak_v1.hip
well, i do, but it’s part of MOPs Plus so there’s a bit of proprietary stuff in there that isn’t exposed
if you have specific questions i’m happy to answer them
the code above is run in a sop solver after fetching impacts data, it’s used to generate new constraint prims. you’d have to create the polyline and get the `name` attributes of the two objects based on the impact points
oh! actually @districtnein i have an older test scene i built before i asset-ified everything. it doesn’t have nearly the same feature set but it shows how to build dynamic glue constraints (outside of a few edge cases this won’t cover)
Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20231312/05/23/rbd_dynamic_constraint_toadstorm.hip
there’s some local space fuckery involved with where you put constraint points and what orientation they’re in. they have to be generated in the rest space of the rbd objects, even if the rbd objects aren’t in rest space when the constraint is made
i built a tool for this in MOPs+, it generates constraints on the fly from collisions. it works roughly like this: “` // get position, orientation, and rest xform of impact prims vector P1 = point(1, “P”, i@impactprimnum); vector P2 = point(1, “P”, i@parentprimnum); vector rest1 = point(1, “rest”, i@impactprimnum); vector rest2 = point(1, “rest”, i@parentprimnum); vector4 orient1 = point(1, “orient”, i@impactprimnum); vector4 orient2 = point(1, “orient”, i@parentprimnum);
vector deltaP1 = @P – P1; vector deltaP2 = @P – P2;
// rotate these vectors into the local space of the impacting objects. deltaP1 = qrotate(qinvert(orient1), deltaP1); deltaP2 = qrotate(qinvert(orient2), deltaP2);
// shift by rest position. these are the local space constraint points. P1 = rest1 + deltaP1; P2 = rest2 + deltaP2;
// generate a polyline from P1 and P2 and set name attributes to match the two RBD objects being constrained… “`
the attributes will be different if you’re not generating stuff from collision points, but the math should be similar
Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20231312/05/23/rbd_runtime_constraints.gif
sometimes xyzdist() is not really what you want when you want to get distance from the edge of a font and so on because you get all these rounded corners. i wrote a quick wrangle that gives you the same type of sharp distance that an inset would give you:
“` int numprims=nprimitives(1);
float dist=10000000000000000000; for (int i=0; i
}
@dist=dist; “`
(the second input is a “convertline” of the font)
Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20233912/04/23/houdinifx_CuEDfyQLMW.gif