Our Houdini asset has a button to save the paint data related to the terrain height to disk. Currently we've got our project set up so that when the artist who is designing the level presses ctrl + s triggers a save of the Unity scene and also triggers a button press on the ‘Save Paint data’ button on the Houdini asset.
The problem we have is that to trigger the button press you have to recook the asset, and because our asset can become extremely large - it can take anywhere from 30 - 60 seconds to recook the asset. If we were to click the button ‘Save Paint data’, the time taken to save the data is a fraction of that time.
Is there a way to trigger the functions inside of the Houdini asset to run without recooking the entire asset?
When you call RequestCook with bUploadParameters set to true, it uploads the parm values, which triggers the button script. I wonder if it will trigger directly just by uploading the parm value, instead of calling RequestCook. You can test this by following code:
HEU_Parametersparameters=houdiniAsset.Parameters;HEU_ParameterDatasaveGridButtonParam=parameters.GetParameter("execute");saveGridButtonParam._intValues=saveGridButtonParam._intValues==0?1:0;// Set parm directlyHEU_SessionBasesession=houdiniAsset.GetAssetSession(true);session.SetParamIntValue(houdiniAsset.AssetID,saveGridButtonParam._name,0,saveGridButtonParam._intValues);
You might still have to cook later to use the HDA, but if you are just doing this through code, it might be okay.
You'll have to cook the asset if you want to see the update on the UI. That's how its designed as otherwise we can get into pretty bad state between the asset in Houdini and its representation in Unity.