Problem with obj export via script (DAZ 4.14).

mundotwomundotwo Posts: 3

Hello. I am trying to export an object in some non-default poses into obj files. When I try to do it via script ( using this example: http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/file_io/export_obj_silent/start ) the resulting geometry, for some reason, doesn't have those nice shape "improvements" (morphs) that DAZ does automatically (like stretch compensations for bending, etc.). On the other hand, when I export manually (via File > Export...) - everything works just fine.

Even this "minimal" code does not work as it should:

function exportOBJ( sPath, sName){	var oExportMgr  = App.getExportMgr();		var sClassName = "DzObjExporter";		var oExporter = oExportMgr.findExporterByClassName( sClassName );			var aPath = sPath + "/" + sName+ ".obj";	oExporter.writeFile( aPath );				oExporter.deleteLater();	};

What am I doing wrong?

Post edited by mundotwo on

Comments

  • mundotwomundotwo Posts: 3
    edited August 2021

    I found this solution:

     function exportOBJ( sPath, sName){	var oExportMgr  = App.getExportMgr();		var sClassName = "DzObjExporter";		//var oExporter = oExportMgr.findExporterByClassName( sClassName );			var aPath = sPath + "/" + sName+ ".obj";	//oExporter.writeFile( aPath );				//oExporter.deleteLater();        oExportMgr.exportFile (aPath, -1);	};

     

    Still not sure why the first variant doesn't work as it should.

     

    Post edited by mundotwo on
Sign In or Register to comment.