How to play your video tutorials within Daz Studio

TugpsxTugpsx Posts: 732
edited January 2022 in The Commons

The question has come up time and again about how to play a tutorial or other product purchased through the Daz Store from within Daz studio.

How often have you bought a tutorial and cant find a product or content launcher and therefor forgot you even have the content?

Using the provided script you can launch your tutorials and other videos right from within the Daz Studio environment.

// DAZ Studio version 4.8.0.18 filetype DAZ Script// Create a file info object, using the path of the current scriptvar oFileInfo = new DzFileInfo( getScriptFileName() );// Prompt the operating system to do whatever it does with the given file type; same path/name as scriptApp.showURL( String("file:///%1/%2.mp4").arg( oFileInfo.path() ).arg( oFileInfo.baseName() ) ); 

 

 

 

 

https://vimeo.com/663877036

 

Post edited by Tugpsx on

Comments

  • That wil fail if the thing was isntalled through Connect (fairly unlikely, unless it already has a player script too). This is more robust if the target is in a mapped directory http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/general_ui/display_document_dynamic/start

  • TugpsxTugpsx Posts: 732

    Thanks Richard. We will have to modify your provided script to launch based on the scripts name. I don't think most users are going to venture into finding the relative path and the file name, hence why the previous script i presented only looked for the scripts name and sent it to the default OS application.

    The script you provided does have a few good error checking so modifying it to use the scripts name shold work for most users.

    It would be relatively easy for them to change the name of the launch script to the name of the file they would like to play/launch as in th previous version.

    Thanks for all your help.

  • Don't forget to include the encessary CC By Attribution elements if you are distributing the results.

  • TugpsxTugpsx Posts: 732
    edited January 2022

    Thanks Richard, based on the script you provided, users can add the file names as shown below

    // DAZ Studio version 4.16.0.3 filetype DAZ Script/********************************************************************** 	This script is a modified version of the script of  the Daz Script Documentation. 	The contents of this script, and\or any portion thereof, may only be used	in accordance with the following license: 	Creative Commons Attribution 3.0 Unported (CC BY 3.0)	- http://creativecommons.org/licenses/by/3.0 	Source: http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/general_ui/display_document_dynamic/start **********************************************************************/ (function( sRelativePath ){ function text( sText ) { if( typeof( qsTr ) != "undefined" ){ return qsTr( sText ); } return sText; };	var oContentMgr = App.getContentMgr(); 	if( !oContentMgr ){	return; }	var sPreferredBasePath, sAbsolutePath;	var sScriptPath = getScriptFileName();	if( App.version64 >= 0x0004000800010033 ){ var nDirType = DzContentMgr.AllDirs; if( App.version64 >= 0x0004000900000033 ){ nDirType = DzContentMgr.AllDirsAndCloud; }		sPreferredBasePath = oContentMgr.getMappedPath( nDirType, sScriptPath, false );		sAbsolutePath = oContentMgr.getAbsolutePath( nDirType, sRelativePath, sPreferredBasePath );	} else { sPreferredBasePath = oContentMgr.getMappedPath( sScriptPath, true, false ); sAbsolutePath = oContentMgr.getAbsolutePath( sRelativePath, true, sPreferredBasePath ); }	if( !sAbsolutePath.isEmpty() ){ App.showURL( String("file:///%1").arg( sAbsolutePath ) );} else { MessageBox.information( 	text("'%1' could not be found in a mapped content directory. " + "Check the installation and try again.").arg( sRelativePath ), text("File Not Found"), text("&Ok") );	}	})( 		/********* File to load ****************/	"/General/Digital Art Live/Daz Studio Postwork Clinic/PostworkClinicTutorial.mp4"	//"/data/asset folder location/file to load" supports .mp4 .pdf .txt"		/*******************************************/		);

    .

     

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