Houdini Engine: Houdini Engine: Asset busy (cook status: COOKING). Unable to start cooking!

   2534   6   0
User Avatar
Member
29 posts
Joined: Sept. 2017
Offline
Hi,

i control a HDA by script. In some loops i set parameters and do a recook followed by a rebuild (See https://www.sidefx.com/forum/topic/67971/). But the rebuild doesn't reset the AssetCookStatus. After the rebuild it's set to COOKING (Set in StartHoudiniCookNode), but should be NONE for recook to work.

It works if i add

SetCookStatus(AssetCookStatus.NONE, AssetCookResult.NONE);

at the end of RequestReload.

@seelan: Should i submit a bug report for this?
User Avatar
Member
571 posts
Joined: May 2017
Offline
Hmm, that sounds like a bug. You shouldn't force set the cook status because it is there to make the Recook and Rebuild properly finish (otherwise you can end up doing a Rebuild before a Recook is finished which guarantees a bad state). Do you have a reproducible HDA that you can submit with a bug report?

Thanks.
User Avatar
Member
29 posts
Joined: Sept. 2017
Offline
seelan
Hmm, that sounds like a bug. You shouldn't force set the cook status because it is there to make the Recook and Rebuild properly finish (otherwise you can end up doing a Rebuild before a Recook is finished which guarantees a bad state). Do you have a reproducible HDA that you can submit with a bug report?

Thanks.

The HDA doesn't matter in this case, could be anything, e.g. just a simple heightfield. In unity you can reproduce this problem with:

HEU_HoudiniAsset houdiniAsset;
...
houdiniAsset.RequestReload(false);
// -> Now we have AssetCookStatus.COOKING
houdiniAsset.RequestCook(true, false, true, true);
// Fails because it required AssetCookStatus.NONE

I submit a bug report with this.
User Avatar
Member
29 posts
Joined: Sept. 2017
Offline
I debugged this a bit more. It seems the problem is inherent to the current implementation of the unity plugin. Both methods “RequestCook” and “RequestReload” in “HEU_HoudiniAsset” have the flag “bool bAsync” in their signature. But if you look closer at the possible code paths you find some hardcoded “bAsync = true”. As a result if you want to make the calls blocking they simple aren't in all cases.

The steps i tried in code:

* Rebuild the asset
* Loop over all tiles (have a exposed parameter for tilesplit node)
* Cook the current tile

This lead to:

* Rebuild returned, but some parts were still running (due to bAsync = true in some code paths)
* Cook can't start because AssetCookStatus says it is still not finished


I sent this update to the opened bug report.

My next step is to try the new EditorCoroutines unity package and to wait for the status to be NONE to be able to proceed.
User Avatar
Member
571 posts
Joined: May 2017
Offline
If you replace the last line in HEU_HoudiniAsset::LoadAssetPresetAndCook with the following, it should fix your problem:
//RecookAsync(bCheckParamsChanged: false, bSkipCookCheck: true, bUploadParameters: false, bUploadParameterPreset: true, bForceUploadInputs: false);
RecookBlocking(bCheckParamsChanged: false, bSkipCookCheck: true, bUploadParameters: false, bUploadParameterPreset: true, bForceUploadInputs: false);

So this is the Recook step in the Rebuild cook where it applies the parm presets, then cooks again. It should be the blocking Recook, not the async version. If you make this change, does it solve your issue?

Also I believe this is the only spot where a blocking cook becomes async. Let me know if there are other spots.
User Avatar
Member
571 posts
Joined: May 2017
Offline
Fixed in 17.5.322
User Avatar
Member
29 posts
Joined: Sept. 2017
Offline
seelan
Fixed in 17.5.322
Works for me! Thanks @seelan for the quick fix :-)
  • Quick Links