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

Archived post by captainhammy

One thing I’ve seen some peopel do lately for diffing is to make use of the Attribute From Parameters node to generate all the graph data as points/attribs and then compare things via that

In single mode pointed to a node it also essentialy functions as a “getParms()” thing.

Not that setParms() is anything special either… It just processes all the dict keys/values and sets them. Could easily write a getParms() function that does the same.

Archived post by Colemapt96

“`import hou
def lock_hda(node_path): “”” Lock the HDA at the given node path. And then Unlock it now that it has been matched “”” # Get the node node = hou.node(node_path)
# Check if node exists if node is None: print(“Node does not exist.”) return
# Lock the HDA node.matchCurrentDefinition() # Unlock the HDA node.allowEditingOfContents()
# Example usage def otherDefinitions(node_path): ”’Given an HDADefinition object, return the other loaded definitions for the same node type.”’ # Look through all the loaded hda files for definitions providing # the same node type. node = hou.node(node_path) definition = node.type().definition() node_version = definition.nodeTypeName().split(‘::’)[0] result = [] result.append(definition) for hda_file in hou.hda.loadedFiles(): # Skip the hda file containing the definition that was passed in. if hda_file == definition.libraryFilePath(): continue for other_definition in hou.hda.definitionsInFile(hda_file): # print(other_definition) if node_version in other_definition.nodeTypeName().split(‘::’)[0]: result.append(other_definition) else: pass return result def getHighestVersion(node): node_path = node.path() otherDef = otherDefinitions(node_path) highest_version_def = sorted(otherDef, key=lambda x: x.nodeTypeName().split(“::”)[1])[-1] highest_version_name = highest_version_def.nodeTypeName() node.changeNodeType(highest_version_def.nodeTypeName(), keep_parms=True) print(f”Updated HDA {node_path} to version {highest_version_name}”) nodeM = hou.node(‘/path/to/your_node’) # replace path with actual node path node_path = nodeM.path() # get the node path since after we replace the type the direct reference will no longer exist
getHighestVersion(nodeM) # update the HDAs version type
lock_hda(node_path) # lock and unlock the HDA to match internal contents “`

justt got this guy done thought id share since i had to do some digging on how to do it! takes an input node and gets the highest version of that HDA and then updates it to that version and locks and unlocks the HDA to match contents!