Is it possible to force a cook of the Solaris stage before using a custom ROP to export the USD using HOM?
I have custom code querying the incoming stage to populate parameters as a pre-flight to the export.
I have tried calling lopnode.cook(force=True), but the stage is null when I query it after forcing the cook.
The Solaris USD Rop node seems to force the cook. Is this not a possible using LOPS and HOM? Do I have any options?
Cheers,
Aaron.
Solaris - Force cook stage and export - stage is null
2237 4 0- aaronauty
- Member
- 39 posts
- Joined: Jan. 2012
- Offline
- mtucker
- Staff
- 4438 posts
- Joined: July 2005
- Offline
- aaronauty
- Member
- 39 posts
- Joined: Jan. 2012
- Offline
Hey Mark.
I missed a crucial piece of information above! My query was when the Houdini session is in Manual mode.
I am checking the hou.updateModeSetting() for manual and then forcing the cook.
Auto and OnMouse are cooking and exporting as expected.
Would you expect a Houdini session in Manual mode to cook a lop node with lopNode.stage() in manual mode? Could it still be errors further up the network?
Aaron.
I missed a crucial piece of information above! My query was when the Houdini session is in Manual mode.
I am checking the hou.updateModeSetting() for manual and then forcing the cook.
Auto and OnMouse are cooking and exporting as expected.
Would you expect a Houdini session in Manual mode to cook a lop node with lopNode.stage() in manual mode? Could it still be errors further up the network?
Aaron.
Edited by aaronauty - Dec. 4, 2020 19:38:50
- mtucker
- Staff
- 4438 posts
- Joined: July 2005
- Offline
Ah! That is an important piece of information
You can write a function like this:
Since this whole function gets run on the main thread, the UI will have no reason to update between the two setUpdateMode calls, and this should have minimal impact on the Houdini session, other than to cook the specified LOP node.
This “issue” isn't specific to LOPs either. All node types will behave this same way in “Manual” mode, refusing to cook no matter how nicely or forcefully you ask. You must (at least temporarily) exit Manual mode to get anything to cook.
You can write a function like this:
def getstage(lop): hou.setUpdateMode(hou.updateMode.AutoUpdate) stage = lop.stage() hou.setUpdateMode(hou.updateMode.Manual) return stage
Since this whole function gets run on the main thread, the UI will have no reason to update between the two setUpdateMode calls, and this should have minimal impact on the Houdini session, other than to cook the specified LOP node.
This “issue” isn't specific to LOPs either. All node types will behave this same way in “Manual” mode, refusing to cook no matter how nicely or forcefully you ask. You must (at least temporarily) exit Manual mode to get anything to cook.
- aaronauty
- Member
- 39 posts
- Joined: Jan. 2012
- Offline
def getstage(lop): hou.setUpdateMode(hou.updateMode.AutoUpdate) stage = lop.stage() hou.setUpdateMode(hou.updateMode.Manual) return stage
Of course. Such a simple solution…. I didn't think it was a lops issue, I guess I have always relied on already compiled node for export, and they must be running similar code.
Brilliants cheers.
-
- Quick Links