Executing in mayapy/batch

   3346   2   1
User Avatar
Member
4 posts
Joined: July 2013
Offline
I'm trying to submit a houdini engine job to our farm and trying to figure out the best way to do it.

One step in our asset is to mesh a particle simulation to an alembic file sequence. We would like to distribute this on our farm. I've managed to do it locally by the following mel command:

setAttr Sop_mesh_asset_test.houdiniAssetParm.houdiniAssetParm_execute__button 1;

Where “execute” is the name of the button excecuting the rop output driver.
When we do it in batch mode maya doesn't wait for the houdini engine to finnish and exits right after the mel command. Is there another way of doing this?

One solution would of course be to save the underlying houdini scene and execute it as we do with our normal houdini jobs.


Cheers,
Simon
User Avatar
Member
818 posts
Joined: Sept. 2013
Offline
Ah, the reason why setAttr returns immediately is because the asset wasn't actually evaluated, and so the callback wasn't actually executed. You can manually trigger an evaluation after the setAttr by:
getAttr Sop_mesh_asset_test.output

The reason is that the button callbacks are executed when the asset is evaluated. This is not necessarily when you call setAttr. Normally the asset is shown Maya's viewport, so after a parameter change (setAttr), Maya will evaluate the asset. However, when you're running in batch, nothing is pulling on the asset, so no evaluation happens. So you'd have to manually do something that'll trigger an evaluation. And the easiest way is to just do a getAttr on the output attribute.
Andrew / アンドリュー
User Avatar
Member
4 posts
Joined: July 2013
Offline
Perfect, thanks!
  • Quick Links