Archived post by cdordelly

`# Force Houdini’s style sheet self.setProperty(“houdiniStyle”, True) sh = hou.ui.qtStyleSheet() self.setStyleSheet(sh)`

also when you call the dialog, make sure to set the houdini qt window as parent too:

`# Create and show the dialog dialog = OSLManagerDlg(parent=hou.ui.mainQtWindow()) dialog.exec_()`

in this case, this dlg looks like this

I guess it will be similar for a python panel, have no idea <:kill_me:419295639348838400>

Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20241207/06/24/image.png

Archived post by kiran_irugalbandara

@David Torno I got fed-up of writing that code to the shell . you can make your own MainMenuCommon.xml file which will give you a section on the top menu bar. Then you can add a custom button to that which runs a script which handles this reload. so much easier. atleast imo.

this is what my code , looks like. It just reloads all my modules in my scripts folder

“`xml
help_menu
“`

Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20245806/05/24/image.png

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