I have an asset that takes some inputs and runs a bullet simulation to generate contact data. This point data needs to then be exported to a plain text file for other purposes. Currently I have a python sop with a button that, when pressed, runs a callback function to read the input geo and format it to a file. This works fine within houdini but upon trying to run my export callback from engine in maya it appears to output nothing, as in theres nothing being returned from ‘pts = hou.pwd().geometry().points()’
I'm not sure how something like this is evaluated in the Engine context, could someone explain what the best way to do this is?
Python Callbacks inside an asset in Engine
3926 4 1- icarus551
- Member
- 22 posts
- Joined: 12月 2009
- Offline
- awong
- Member
- 818 posts
- Joined: 9月 2013
- Offline
I did a few tests, and they seem to work. hou.pwd().geometry().points() seems to return the correct values.
Maybe I'm not recreating your scenario exactly. Could you attach an example asset of what your setup is? You could also email me the asset if that's more comfortable (awong@sidefx.com).
Maybe I'm not recreating your scenario exactly. Could you attach an example asset of what your setup is? You could also email me the asset if that's more comfortable (awong@sidefx.com).
Andrew / アンドリュー
- icarus551
- Member
- 22 posts
- Joined: 12月 2009
- Offline
Upon further investigation my python exporter did in fact work. I tested the script on a set of static points and it worked fine. There appears to be an issue with directly reading points from non-file-cached dop sim. For some reason, writing the points to disk (geo rop) and reading them back in before running the export script made it work.
It's particularly bizarre since the sim scrubs properly in maya no problem from memory. This only happens on cooking a branched node chain.
I can try to isolate and reproduce the issue, if it's indeed a bug ill make an RFE
cheers 8)
It's particularly bizarre since the sim scrubs properly in maya no problem from memory. This only happens on cooking a branched node chain.
I can try to isolate and reproduce the issue, if it's indeed a bug ill make an RFE
cheers 8)
- awong
- Member
- 818 posts
- Joined: 9月 2013
- Offline
Hm, I might be able to produce your problem after all. It could be a time-related issue. The callback script might always be executed at frame 1, rather than the “current” frame. So the geometry that's returned by hou.pwd().geometry() is actually the geometry at frame 1, which probably has no points.
I'll need to look further into this. It might get a bit hairy. :?
I'll need to look further into this. It might get a bit hairy. :?
Andrew / アンドリュー
- awong
- Member
- 818 posts
- Joined: 9月 2013
- Offline
-
- Quick Links