Heya
I'm having some issues running the python SOP node as i would have thought it would.
I've managed to get a kinect to run inside of Houdini off a Python SOP node.
The process is multithreaded using QT and i'm trying to update the position of my points.
The hou.setPosition is running inside a while loop which is off the main thread so Houdinis UI doesnt freeze and is uneffected.
The issue i'm struggling to figure out is that inside this while loop the position of the points don't update in real time. I can click on a null node connected to the python node below it and the position updates and vise versa if i click onto the python node its self.
And after the setPosition function runs the timeline is increased as well. I've not tried keyframing yet as i would have already expected the setPosition to have worked already.
Does the python node only really update attributes after it's "finished" and in this instance by rendering the null under it the python node has technically "finished" cooking?
Just to add to this. I've continued to look more into the setting of the attributes and watching the geometry spreadsheet it looks like the values ARE changing and animating but the scene view doesnt seem to update. i've tried to have the attributes become a detail instead of setting the point positions and set the detail attrib to the point pos within a solver node. That didnt seem to work either :/
I've also tried putting 2 inputs into a switch node and have it switch values every frame with $F%2. Sadly it seems that physically clicking on a node is my current method to update the viewport. And i found theres a triggerUpdate() function but that doesnt give much luck either.
I had found this post talking about a hdefereval lib.
https://forums.odforce.net/topic/22570-execute-in-main-thread-with-results/ [forums.odforce.net]
I tried using the executeInMainThreadWithResult and it's able to print my debug prints and is also setting the point pos but not updating the ui. The main thing that differs from my code and the example code in the odfoce post is that mine is running QThread instead of threading. But i've not been able to find any info regarding the hdefereval lib online.
Python SOP node and updating ui whilst in while loops
1899 0 0-
- jm
- Member
- 40 posts
- Joined: Sept. 2014
- Offline
-
- Quick Links