Accidentally Cooking with the Houdini Object Module

   2769   5   2
User Avatar
Member
9 posts
Joined: Dec. 2011
Offline
Hi

I'm trying to perform a relatively simple operation:

01 - Load a scene without cooking it.

But I'm not sure I'm doing it right. So far I'm up to two steps:

01 - hou.hipFile.load(binary, suppress_save_prompt=False)
02 - hou.hscript(“viewupdate -u never”)

It works, sort of, but before adding more steps to this procedure I want to make sure I'm not doing something completely backwards. The procedure above sounds to me like it would load up the entire .hip file and cook it according to the settings there within, and then afterwards set the viewupdate flag to never.

The odd part is that doing it this way indeed stops a scene from fully cooking, so it is indeed having some sort of an effect…

Any tips on a better method to stop a file from cooking on load are well appriciated.

p.s. does the HOUDINI_COOK_MODE_THRESHOLD environment variable hold anything relative to this? Thinking something along the lines of:

while hou.hipFile.isLoadingHipFile():
{set HOUDINI_COOK_MODE_THRESHOLD 1}

Which could potentially throw Houdini into locking the cook mode as never during load and release it afterwards.
User Avatar
Member
7717 posts
Joined: July 2005
Offline
Shouldn't you reverse the order of the commands? ie.


01 - hou.hscript(“viewupdate -u never”)
02 - hou.hipFile.load(binary, suppress_save_prompt=False)


I don't think HOUDINI_COOK_MODE_THRESHOLD is needed.
User Avatar
Member
9 posts
Joined: Dec. 2011
Offline
edward
Shouldn't you reverse the order of the commands?

Indeed, that was my initial assumption.

What happens however, is first the viewupdate setting gets set to manual, and then the .hip file loads and cooks.

For some bizarre reason, loading the scene and then setting the viewupdate immidiately afterwards appears to stop it cooking. Don't actually see the logic in it, since it makes sense to do it the other way around, but as I said, it works, in a way, but feels backwards so I am under the impression it's not the order of commands that is backwards, but my methodology rather.
User Avatar
Member
7717 posts
Joined: July 2005
Offline
So you want it to cook once to see something and then not cook it again? That's not what you said originally.
User Avatar
Member
9 posts
Joined: Dec. 2011
Offline
hehe, it gets confusing even trying to describe it

I don't want to cook the scene at all, just want to open it for quick debugging.

Both methods described above result in some cooking in one form or another, and it's using a combination of hou.hipFile and hou.hscript.

It's dirty coding, but it appears to be the only way to not cook…….
User Avatar
Member
509 posts
Joined: July 2005
Offline
what I do is having a bash (or which ever shell you use, assuming you're under Linux/Osx) script/alias that runs houdini with the “-n” flag.
that will always load a Houdini session in Manual update mode without any cooking.
JcN
VisualCortexLab Ltd :: www.visualcortexlab.com
  • Quick Links