Possible to read Morph Rules through DzFbxExporter?

Is it possible to parse the existing morph rules from DzFbxExporter or are they perhaps stored in a file somewhere that could be accessed?

Comments

  • You can get a representation of the morph rules if you start with this Silent FBX Export sample - http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/file_io/export_fbx_silent/start - and combine it with the DzSettings documentation, to give you something like this

        // Define an anonymous function;    // serves as our main loop,    // limits the scope of variables    (function(){         	// Get the primary selection to use for the file name    	var oNode = Scene.getPrimarySelection();    	// If something is selected    	if( oNode ){    		// Get the node's skeleton    		var oSkeleton = oNode.getSkeleton();    		// If it has a skeleton    		if( oSkeleton )	{    			// That is the node we want for the name    			oNode = oSkeleton;    		}    	}         	// Get the export manager    	var oExportMgr = App.getExportMgr();    	// Define the class name the for Autodesk Filmbox (*.fbx) exporter    	var sClassName = "DzFbxExporter";    	// Find the exporter    	var oExporter = oExportMgr.findExporterByClassName( sClassName );    	// If the exporter exists    	if( oExporter ){    		print("Exporter exists");    		// Create a settings object    		var oSettings = new DzFileIOSettings();    		         		// Fill the settings object with the default options from the exporter    		//oExporter.getDefaultOptions( oSettings );         		// Define whether or not to show options    		var bShowOptions = false;         		// Define whether or not to show options before prompting for a path;    		// requires 4.9.3.22 or later    		var bOptionsBeforeFile = false;    				    oExporter.getOptions( oSettings, bShowOptions && bOptionsBeforeFile, "" );		    print("oSettings: ", oSettings.toJsonString() );		    print("Rules: ", oSettings.getStringValue("rules"));    		// Clean up; don't leak memory    		oExporter.deleteLater();    	// We didn't find an exporter with the class name we wanted    	} else {    		// Inform the user    		MessageBox.critical( qsTr("An exporter with the class name \"%1\" " +    			"could not be found.").arg( sClassName ),    			qsTr("Critical Error"), qsTr("&OK") );    	}         // Finalize the function and invoke    })();

    You will first get the rules printed in one format as part of the Settings JSON string output, and then the rules on their own as a multi-line string.

  • perfect, thank you so much! 

Sign In or Register to comment.