silent saving doesnt save
cernyviktor
Posts: 0
Hi everyone,
I started a little scripting project and ran into a problem. The endgoal is to loop over the frames of the timeline in a scene and save each frame as a posePresetFile in a defined folder.
For this goal the first step would be to save a file without user interaction. I know this is a pretty old hat and i looked at the given example and found an older thread with close to this code:
// DAZ Studio version 4.12.0.86 filetype DAZ Scriptvar oAssetIOMgr = App.getAssetIOMgr();var nAssetIOFilter = oAssetIOMgr.findFilter( "DzPoseAssetFilter" );var oAssetIOFilter = oAssetIOMgr.getFilter( nAssetIOFilter );if( oAssetIOFilter ){ var oSettings = new DzFileIOSettings(); oAssetIOFilter.getDefaultOptions( oSettings ); //save only the current frame oSettings.setBoolValue("SaveCurFrame",true); oSettings.setBoolValue("CompressOutput",true); oSettings.setBoolValue("RunSilent",true); oAssetIOMgr.doSaveWithOptions(oAssetIOFilter,oSettings,true,"g:/frame000.duf");}
The problem is that the file flat out isnt saved. The output only says "Running silent. No "NodeNames" defined. (in case this show an obvious error that i dont get).
Have i gotten the path wrong? or am i on the completly wrong track in the first place. Thanks for any pointers ^^
Comments
Hi,
The problem is that you forgot to select nodes to save.
You should look to this complete example : http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/file_io/save_duf_pose/start
A simple copy/paste of that code should give you exactly what you want (silent pose saving, selecting frame to export etc...). You'll just have to change the path of the saved file, line 467 :
Hope that helps!
Here's a short version to begin with :
That one saves only the "hip" bone's rotations. Adapt it to your needs!