Cannot set parms via callback in Maya, works in Houdini

   3275   3   2
User Avatar
Member
3 posts
Joined:
Offline
Hey guys. Im having trouble using python in an HDA that I'm sending over to Maya. I've attached a simple example HDA to set parameters using a callback script (button). Works like a charm in Houdini, but on the Maya side I need to hit my ‘Execute’ button, reset simulation, reload asset, sync asset until eventually the field updates to the correct value. Sometimes it works, other times it bugs out, and other times still it seems like it works but has a refresh issue. Any thoughts?

Maya 2014
Houdini Engine 14.0.430


Callback Script:

hou.pwd().hdaModule().setInitFrame()

Script:
import hou

def setInitFrame():

me = hou.pwd()
me.setParms({“initFrame”: 736})

Attachments:
mrhoneSetparmExample.hda (3.7 KB)

User Avatar
Member
818 posts
Joined: Sept. 2013
Offline
The value should actually be updated. If you click the AE's “Load Attributes” button to refresh the AE, you should see the updated value. Or, if you use getAttr, you should see the correct value. And you should be able to use the updated value inside the asset.

There's just some refresh issue with Maya's AE. This issue has been there since the beginning, but I haven't found a way to fix/workaround it unfortunately.

If you take a look at our spaceship asset [orbolt.com], it uses callback to do something similar too. The values are indeed updated, just not refreshed in the UI properly.
Andrew / アンドリュー
User Avatar
Member
3 posts
Joined:
Offline
Sadly refreshing the AE has no effect and getAttr is saying the value hasnt changed. After a bit more testing it doesnt appear to be a refresh issue to me. It looks like the most replicable way to get the script to work is to hit the button then reload/refresh the asset.

Ill take a look at the spaceship HDA and see if the issues are similar


The button, when pressed, should show a value of 736
(In maya)
Test 1
set initFrame to 0 via the slider
Hit “Execute”. GUI shows zero, getAttr shows 0
Hit “sync asset”. GUI shows 736, gettattr shows 736

Test 2
set initFrame to 0 via the slider
Hit sync Asset. GUI shows 0, gettattr shows 0
Hit execute. GUI shows 0, gettattr shows 0
Hit “sync asset”. GUI shows 736, gettattr shows 736

Test 3
set initFrame to 0 via the slider
hit reload asset. GUI shows 0, gettattr shows 0
Hit execute. GUI shows 0, gettattr shows 0
hit reload asset. GUI shows 736, gettattr shows 736


Test 4
set initFrame to 0 via the slider
Hit execute. GUI shows 0, gettattr shows 0
toggle auto sync outputs. GUI shows 736, gettattr shows 736
User Avatar
Member
818 posts
Joined: Sept. 2013
Offline
You might also be having an issue with DG evaluation. Your asset isn't outputting anything, so Maya might not be triggering a compute on the asset. Try outputting some geometry.

The AE refresh issue would still be there, so you still need to hit “Load Attributes” to see the updated value.
Andrew / アンドリュー
  • Quick Links