Okay it works with the Import Only, but it still references the same Solver Variable as before, so id doesnt work with the solver Operator..
How can I change / reset a global Variable inside a Module (HDA Module)?
At the moment i reference a solver variable in the code area (of the HDA) like this:
solver = hou.phm().iisolver
In the Module the iisolver is defined like this:
iisolver = SphSolver(fps)
How can I create a methode i can trigger by a button, that resets the iisolver or makes a new iisolver??
Thank you for your help!
Found 6 posts.
Search results Show results as topic list.
Technical Discussion » Reforce / Renew a script in Houdini and make nodes time dependent
- TobiasVanSautter
- 6 posts
- Offline
Technical Discussion » Reforce / Renew a script in Houdini and make nodes time dependent
- TobiasVanSautter
- 6 posts
- Offline
Okay guys I got it.. I made a new function in the Python Module:
and execute it via a Buttoncallback. It just cooks the frame at the moment, so it has to read the script again… It works with the import Operator, now i just need to try it with my Solver Operator
))
Edit Patar:
Thank you for the answers, the thing is it works at the moment, but that would be an enormous workload.
I have to finish in 2 Weeks, so no more testing ;(
force = True def forceRead(): hou.Node.cook(hou.pwd(), force, (hou.frame(),hou.frame()))
and execute it via a Buttoncallback. It just cooks the frame at the moment, so it has to read the script again… It works with the import Operator, now i just need to try it with my Solver Operator
))
Edit Patar:
Thank you for the answers, the thing is it works at the moment, but that would be an enormous workload.
I have to finish in 2 Weeks, so no more testing ;(
Edited by TobiasVanSautter - Sept. 1, 2016 12:06:09
Technical Discussion » Reforce / Renew a script in Houdini and make nodes time dependent
- TobiasVanSautter
- 6 posts
- Offline
Puh where to start.
I'm writing my Bachelor Thesis about Integrating and already working C++ SPH Fluid Solver in Houdini. The Solver itself works external and is written by one of the guys here.
So I “just” need to feed this solver the information he needs. That I'm doing via Python and HDA's in Houdini.
The solver itself works okay right now, I just need to fix some issues, that the HDA Plugin can work properly.
One of the problems is (like written 3 times before):
- I need to reset the scripts externally (best with some button or something that i can integrate in the Plug-In HDA GUI).
Because I define the Solver 1 Time at the start. If i want to reset the simulation, i have to “re-define” the Solver. That I'm doing at the moment with opening the HDA properties and accept them. (Like a force re-read of the script).
Thats shitty, i dont want people to open the HDA and have such a workflow. They just should plug in a geo (in Szene Level), change some parameters and let it simulate.
My english and writing style is pretty shitty too, i know. Best to read it slowly
I'm writing my Bachelor Thesis about Integrating and already working C++ SPH Fluid Solver in Houdini. The Solver itself works external and is written by one of the guys here.
So I “just” need to feed this solver the information he needs. That I'm doing via Python and HDA's in Houdini.
The solver itself works okay right now, I just need to fix some issues, that the HDA Plugin can work properly.
One of the problems is (like written 3 times before):
- I need to reset the scripts externally (best with some button or something that i can integrate in the Plug-In HDA GUI).
Because I define the Solver 1 Time at the start. If i want to reset the simulation, i have to “re-define” the Solver. That I'm doing at the moment with opening the HDA properties and accept them. (Like a force re-read of the script).
Thats shitty, i dont want people to open the HDA and have such a workflow. They just should plug in a geo (in Szene Level), change some parameters and let it simulate.
My english and writing style is pretty shitty too, i know. Best to read it slowly
Edited by TobiasVanSautter - Sept. 1, 2016 11:40:08
Technical Discussion » Reforce / Renew a script in Houdini and make nodes time dependent
- TobiasVanSautter
- 6 posts
- Offline
I cant upload a scene, because this is a custom solver from my university..
The Solver Stuff doesnt really matter at the moment. The things that matters are my two questions:
- How can I reset a script
( with python or without having to go in the properties and accept them to force reset the script)
- How can i set a Node time dependent
( with Python or whatever )
I work in a SOP Network (Geometry Level)
EDIT:
So I just made a HDA just for you guys:
My custom solver start ist like that, I plug in a geo i want to simulate. So the points of the input mesh get instanced.
But if they're instanced one time, you just cant change them anymore. Even if you plug in another geo.
So you have to fix it by messing up the script (kinda force reset it), and refix it.
I want to do that nicely, not like that. It should be a plugin, not some fucked up workflow thingy^^
One difference: I dont use a python sop, i use a Geometrie Operator for the import, so i can use the Python Module in there too.
Hope you understand it better now
The Solver Stuff doesnt really matter at the moment. The things that matters are my two questions:
- How can I reset a script
( with python or without having to go in the properties and accept them to force reset the script)
- How can i set a Node time dependent
( with Python or whatever )
I work in a SOP Network (Geometry Level)
EDIT:
So I just made a HDA just for you guys:
My custom solver start ist like that, I plug in a geo i want to simulate. So the points of the input mesh get instanced.
But if they're instanced one time, you just cant change them anymore. Even if you plug in another geo.
So you have to fix it by messing up the script (kinda force reset it), and refix it.
I want to do that nicely, not like that. It should be a plugin, not some fucked up workflow thingy^^
One difference: I dont use a python sop, i use a Geometrie Operator for the import, so i can use the Python Module in there too.
Hope you understand it better now
Edited by TobiasVanSautter - Sept. 1, 2016 10:56:12
Technical Discussion » Reforce / Renew a script in Houdini and make nodes time dependent
- TobiasVanSautter
- 6 posts
- Offline
Technical Discussion » Reforce / Renew a script in Houdini and make nodes time dependent
- TobiasVanSautter
- 6 posts
- Offline
Heyho Guys,
first topic in this community, i asked the same question in odforce but nobody gave me an answer in a week.
So I'm implementing a extern solver framework in Houdini via Python.
The solver itself is packed as a SOP HDA, all attirubtes set and the actual simulation happens inside the HDA in another SOP HDA. The solver gets a geometries points, instances them, resolves them and sets the points new, so thats what happens mainly inside the HDA.
So i got two problems:
1. How can I renew a Script? The actual solvers simulation happens in the code area of the HDA inside. For that the code area gets an instance solver from the python module from the hda.
That means if I want to change or renew the solver I have to dive inside the node and accept it in the properties window, so it resets the solver.
Same goes for my node which instances the points of the geometry i want to simulate (the node is the actual input for the solver). If I want to load another geometry, i have to plug in the new geometry, have to dive inside the import Node and accept it (like the solver node), so the script resets and gets the new points.
2. At the moment I set a node time dependent like that:
hou.setFrame(hou.frame())
but I have the feeling it slows the actual simulation and isnt nice to read.
I hope you have some answers and that my german english is understandable
Thank you!
first topic in this community, i asked the same question in odforce but nobody gave me an answer in a week.
So I'm implementing a extern solver framework in Houdini via Python.
The solver itself is packed as a SOP HDA, all attirubtes set and the actual simulation happens inside the HDA in another SOP HDA. The solver gets a geometries points, instances them, resolves them and sets the points new, so thats what happens mainly inside the HDA.
So i got two problems:
1. How can I renew a Script? The actual solvers simulation happens in the code area of the HDA inside. For that the code area gets an instance solver from the python module from the hda.
That means if I want to change or renew the solver I have to dive inside the node and accept it in the properties window, so it resets the solver.
Same goes for my node which instances the points of the geometry i want to simulate (the node is the actual input for the solver). If I want to load another geometry, i have to plug in the new geometry, have to dive inside the import Node and accept it (like the solver node), so the script resets and gets the new points.
2. At the moment I set a node time dependent like that:
hou.setFrame(hou.frame())
but I have the feeling it slows the actual simulation and isnt nice to read.
I hope you have some answers and that my german english is understandable
Thank you!
-
- Quick Links