Archived post by tackyflea

K found out how to make a basic signal, hours of finding the right function leading to only few lines of code woo(?)
How to do a basic Signal in python compatible with Houdini: “`python from PySide2.QtCore import QObject, Signal class ECoolEventSignal(QObject): string_event = Signal(str)
cool_event_instance = ECoolEventSignal()
# sender cool_event_instance.string_event.emit(“Passing da string”) # reciever cool_event_instance.string_event.connect(self.listeningFunction) “` (You can also hook to the event functions via doc.qt.io/qt-5/qcoreapplication.html#sendEvent but it was overkill in my need)

now time for a drink and do something with this tommorow 😂

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