Atom Posted August 17, 2016 Share Posted August 17, 2016 Hi All, I have several python scripts inside of a FBX Import subnet. The scripts needs to run in a certain order. One script controls the bones via sliders. Another script sets values on those sliders in the other script to produce an auto walking character. This works fine when I click playback on the timeline. However, when I try to export a MDD file of this animation I only get a static result. Also the export goes by very fast and the progress bar never pops up. My conclusion is that the python scripts are not running every frame thus the exporter sees the same object on every frame. I did try setting the frame directly in the Pre-Render script by setting the script type to python and using the following code. hou.setFrame(hou.frame()) Is there any way to make my python script run every time the frame changes? Quote Link to comment Share on other sites More sharing options...
holycause Posted August 17, 2016 Share Posted August 17, 2016 you can set it as a pre-frame script Quote Link to comment Share on other sites More sharing options...
Atom Posted August 17, 2016 Author Share Posted August 17, 2016 How do I do that? What is the syntax for calling the external Python node from the MDD Pre-Frame single line text field? My Python node has over 100 lines of code and references 30-40 custom parameters on itself. To migrate all those custom parameters into the MDD node would take a while and there is still no guarantee that would work. As I mentioned above the Pre-Render field seems to have no effect when I place code in it. Quote Link to comment Share on other sites More sharing options...
bonsak Posted August 17, 2016 Share Posted August 17, 2016 (edited) Can't you just point the pre-frame field to your python script on disk? EDIT: Oops sorry. Didn't read the first post. -b Edited August 17, 2016 by bonsak Quote Link to comment Share on other sites More sharing options...
Atom Posted August 17, 2016 Author Share Posted August 17, 2016 (edited) Thanks, I do have a work around at this time. I put a File Cache node in write mode and export an OBJ file. Then I press Play on the timeline and it does kick out a mesh for every frame because the Python scripts run when the timeline changes. After that I bring that mesh sequence into it's own geo via the File node. This scrubs just fine and I point the MDD exporter to this temporary geo playback node. I can then kick out a MDD file from that temporary file. Kind of a long winded way to achieve the goal but it does work. Edited August 17, 2016 by Atom 1 Quote Link to comment Share on other sites More sharing options...
Atom Posted August 22, 2016 Author Share Posted August 22, 2016 (edited) I did find a better way to solve this problem. Simply force cook your python node in the Pre-Frame or Post-Frame Script fields. hou.node('/obj/my_python_node').cook(force=True) You can force cook multiple python nodes as well. The order that you force the cook is the order that the nodes will run in. Edited August 22, 2016 by Atom Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.