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 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 mattiasmalmer

here goes…

it creates a subdirectory named backup. saves a copy of your scene there named currentscenename_backup_timestamp.hip

then it does that every ten minutes.

and after it has written ten files it deletes the first one. so you have rolling loop of ten backup files. (to ensure your server is not full of files over night haha)

you can change update interval and number of stored backups really easily by just modifying the py file.

this in my opinion is how auto backup SHOULD work.

now it would be neat if it did not save files if the scene is unmodified. so that it does not make a lot of unneccessary saves. but I can live with that for now.

now this code is written by an idiot and chatGPT so do not blame me if it paperclips your machine

no more stupid overwriting of the original scene file. no broken links to caches from changes in filenames. just a straight backup if shit hits the fan.

Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20230112/24/23/456.py

Archived post by bonsain

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

Archived post by technically_artist

Posting this for future reference and so others won’t walk my foolish path “`c // Vertex Wrangle vector quad[] = {{0,0,0}, {0,1,0}, {1,1,0}, {1,0,0}}; vector tri[] = {{0,0,0}, {1,0,0}, {0,1,0}};
int vtx = vertexprimindex(0, i@vtxnum); int vtxcount = primvertexcount(0, i@primnum);
if(vtxcount == 3) v@__intrinsic_uv = tri[vtx]; else if(vtxcount == 4) v@__intrinsic_uv = quad[vtx]; else // Probably should do NGons at some point v@__intrinsic_uv = -1.0; “`

Archived post by mattiasmalmer

Did you guys see this neat SHARD Noise function that @ENDESGA posted on twitter? x.com/ENDESGA/status/1725827957061759092?s=20
I did a quick houdini variant. Also extended it to 4D so that we can phase it.

Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20233711/21/23/SHARDNOISE.hiplc
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20233711/21/23/image.png