Scripting: Modifying Daz Script to prompt for file name?

I'm trying to use this daz script sample: The Save a Pose Preset

http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/file_io/save_duf_pose/start

It saves without opening the dialog window...like the checkboxs and asking for the file name.

I would like it to promt for a file name, but continue to do everything else automaticaly. (currently, it over writes its previous use when used)

 

I've looked thru the code but I don't know the langauge...I'm experience with some scripting langauges, but not this...but from what I think I've figured is to do what I want will take a bit more coding than just changing a flag from false to true.

BUT, maybe I'm wrong, and there is flag I haven't id'd that will do it.

So, I'll ask the assembled brains here if this is an easy fix, or if it's something I'll need to table to after I've learned the language more.

Comments

  • Moved to scripting forum.

    The lien that sets the name is currently

    	// Construct the name of the file to save to; omit file extension	var sFile = String("%1/%2 Test").arg( sBasePath ).arg( sClassName );

    so you want to get a file name (with the global FileDialog object - FileDialog.doFileDialog( false , "Save Pose Preset" , sBasePath, ".DUF file (*.duf)" ) http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/filedialog_dz#a_1ad1cc8e478a4b0ee1906ea50336eb8c78 , then check that it's valid, and carry on. Something like (untested)

    	// Construct the name of the file to save to; omit file extension	var sFile = FileDialog.doFileDialog( false , "Save Pose Preset" , sBasePath, ".DUF file (*.duf)" )	// Check for a valid path - "" is Cancel	if ( sFile == "" ) {		// we're done		return;	}	// Now get rid of the extension by discarding the rightmost 4 characters	sFile = sFile.left( sFile.length - 4 );

     

Sign In or Register to comment.