Is it possibe to put certain folders as separate tabs?

handel_035c4ce6handel_035c4ce6 Posts: 457
edited October 2018 in New Users

Fro example I would like to be able to quickly access the folder where I put export/import stuff and the folder where I save the imported assets.

Post edited by handel_035c4ce6 on

Comments

  • Tabs in what?

  • Tabs like Content Library etc but just certain folders like Shaders Presets (just an example).

  • handel_035c4ce6handel_035c4ce6 Posts: 457
    edited October 2018

    Oops - sorry, double post.

    Post edited by handel_035c4ce6 on
  • Ah, no, you can't create new content-ype panes (it's something a developer cold do with a plug-in, though, if there was enough demand or self-interest).

  • handel_035c4ce6handel_035c4ce6 Posts: 457
    edited October 2018
    Chohole said:

    Thanks although it looks like chinese to me:-)

     

    If I cut and paste a folder with DUF files, created by me  (not a default folder with installed standard stuff) will the DUFs still work as intended? What I mean is can I create new MyLibrary folder, add it to the paths in the Daz settings, and cut and paste my folder with DUF files into it?

    Post edited by handel_035c4ce6 on
  • Yes, if you move the files using the OS (rather than in DS) then you will break the link to the CMS database, but the files will still show and work in the file based views.

  • So if I want my folder to be easy to fin and to be on the top of the Library then it will be better just to rename then in something like 1_Pose_Presets, 2_Exports and as they start with numbers they will always be on the before the standard folders, right?

  • Yes, if you move the files using the OS (rather than in DS) then you will break the link to the CMS database, but the files will still show and work in the file based views.

    I never got used to the smart content but I think because my database is a mess. I use the Content Library the most and know where my folders are. I try to organize my stuff with three main Content Directories for Daz Studio and eight other Content Directories that mainly have freebie collections or poser content.

    What bothers me the most is if I have to jump from one conent library to the other by navigating the folders. The Content Library pane offers a folder history to jump back and fourth a few steps but this dosn't always get you back where you was before. Also I would like to use the mouse buttons 4 and 5 for going through the folder history but these buttons don't work in DazStudio.

    Is there any way to have a script or something that can control the Content Library and let it jump to a given folder? I know the other option would be to organize everything in Categories but then you have to have everything categorized before you start browsing the content.

    What I do lately if I saved something in the wrong folder for example is I select the items in the Content Library, right-click and Cut, then I go to the other folder or create one and paste the items there. By doing this the content type overlays on the preview icons got lost, it seems it dosn't matter if you cut-paste user facing content stuff around with the Content Library or the OS File Browser Daz Studio dosn't uptate the database if you do so.

    After I've pasted the items that could be of mixed content type like scene subsets, poses, shapes I still like to have the overlay visible again. Before I found how to bring the overlays back I tend to write the content type behind the filename like _WearAble _Pose _SubSet and so on. The overlays gets showen again if you righ-click the folder with the unknowen content type files, select Edit Metadata and manualy choose the content type there. I wonder if there is an easy folder scan function inside the Daz Studio content manager to update the metadata automaticly?

  • ChoholeChohole Posts: 33,604

    So if I want my folder to be easy to fin and to be on the top of the Library then it will be better just to rename then in something like 1_Pose_Presets, 2_Exports and as they start with numbers they will always be on the before the standard folders, right?

    The linked sample scripts can be used (via "Custom Action") as a means of creating shortcuts to specific containers (e.g., folders, products, categories, etc) within the Content Library pane... the last line of each sample on the page should be the only thing you need to change. Said "Custom Action" can be placed in a menu or toolbar so that clicking one causes the Content Library pane to quickly navigate to the specified location.

     

     

  • If I cut and paste a folder with DUF files, created by me  (not a default folder with installed standard stuff) will the DUFs still work as intended? What I mean is can I create new MyLibrary folder, add it to the paths in the Daz settings, and cut and paste my folder with DUF files into it?

    If the folder structure remains the same I mean if you cut and paste a whole People/Pose folder for example the releative path remains the same in both libraries and the database dosn't get consfused. However if you are using a different folder to paste it into the new Library the metadata gets lost. Those content types like poses, scenese, subsets ect. can get saved anywhere and don't need any other content saved in the right place, as long as the original assets are accessible.

    The paths in the Content Libraries are relative paths so it dosn't matter for example if the textures are saved in library one or two. Example C:\User\UserName\Documents\Default_MyLibrary\Runtime\Textures\... and D:\MyNewLibrary\Runtime\Textures. This works as long as the textures remain in the Runtimes\Textures folder and dosn't get saved somwhere else.

    Even if you save Morph Assets or Figure/Prop Assets you can always choose the library in which you want the assets to be saved to. Those morphs and assets end up in a folder called data. With this I try to keep the original products and my additional assets for it in seperate Libraries its even easier to find the stuff you just have saved.

     

    Chohole said:

    I'm not exactly shure if I understand this script example.

    If I run the Set_Content_Library_DAZ_Studio_Formats_Container.dsa

    as I read in the description it will "set the active path" what does this mean? And is this the line in the script where you can choose to set another ContentDirectoryPath than the "first mapped" directory?

    I want to set it to People/Genesis 3 Female/Poses for example if thats possible to have the Content Library pick up the "active path".

    // Set the base to the first mapped native formats directoryvar sBase = oContentMgr.getContentDirectoryPath( 0 );

    Set Content Library Container

    Below are examples demonstrating how to set the active DAZ Studio Formats path...

  • Syrus_DanteSyrus_Dante Posts: 983
    edited October 2018

    Sorry my question had already been answered by Chohole before I've posted. I should update the page more often before posting.

    Nice to know thanks. I didn't read the script to the bottom line where the function to set the directory gets its argument passed. How this works is interesting. I just ask myself why we need all the script lines as overhead, its just a few kilobyte you say?

    I think of to save this Set_Content_Library_DAZ_Studio_Formats_Container.dsa into the Scripts/Utilities folder in the library and then write a second script Set_Path_G3F_Pose.dsa that just calls the Set_Content_Libary...dsa, passes the argument (the path) with something like this Set_Content_Library_function("People/Genesis 3 Female/Pose"); and thats all you should have to write in your script. Would be great if this could work this way I just don't understand how to modify the script to do this.

    Post edited by Syrus_Dante on
  • ChoholeChohole Posts: 33,604

    Sorry my question had already been answered by Chohole before I've posted. I should update the page more often before posting.

    Nice to know thanks. I didn't read the script to the bottom line where the function to set the directory gets its argument passed. How this works is interesting. I just ask myself why we need all the script lines as overhead, its just a few kilobyte you say?

    I think of to save this Set_Content_Library_DAZ_Studio_Formats_Container.dsa into the Scripts/Utilities folder in the library and then write a second script Set_Path_G3F_Pose.dsa that just calls the Set_Content_Libary...dsa, passes the argument (the path) with something like this Set_Content_Library_function("People/Genesis 3 Female/Pose"); and thats all you should have to write in your script. Would be great if this could work this way I just don't understand how to modify the script to do this.

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

  • LindseyLindsey Posts: 1,984

    If you can access content from the Smart Content tab, you can create custom folders in your DAZ Studio format library and drag icons from the Smart Content tab to your custom folder(s) creating shortcuts.  Since they are shortcuts, metadata doesn't "break" and you can use your Computer's OS to rearrange/reorganize the shortcuts.  If your Smart Content/Content Library are on the same tab group, you'd need to temporarly move the Content Library tab do a different tab group.  See picture attached for an example.

    Shortcut Drag and Drop.jpg
    1920 x 1080 - 337K
  • Understood, thanks. Will figure something easy to implement:-)

  • Syrus_DanteSyrus_Dante Posts: 983
    edited October 2018

    Thanks Chohole.

    I know this example I've used some of this in my own script but never understood how to write the "remote" execution. See here Convert to SubD script.

    By reading over the script a second time now I see the lines that "calls" the other script and passes arguments. My future scripts will support this remote execution there is a great potential in it.

    Caller_Script.dsa

    // If a script is foundif( !sScriptPath.isEmpty() ){	// If the script loads	if( oScript.loadFromFile( sScriptPath ) ){		// Execute the script; pass in an array of arguments;		// passing in arguments requires 2.2.2.17 or newer		oScript.execute( [ App.version, sScriptPath, true ] );        }}

    Now modified to call the Set_Content_Library...dsa

    var sScriptPath = "Scripts/Utilities/Set_Content_Library_DAZ_Studio_Formats_Container";// If a script is found (in the given path/filename)if( !sScriptPath.isEmpty() ){	// If the script loads	if( oScript.loadFromFile( sScriptPath ) ){		// Execute the script; passes in the "Content Path" as argument;		// passing in arguments requires 2.2.2.17 or newer		oScript.execute( "People/Genesis 3 Female/Pose" ); //the directory the Content Library should jump to        }} else {        MessageBox.critical( qsTr("Can't find the script!\n" + sScriptPath)	        , qsTr("Critical Error!"), qsTr("&OK") );}

    Now I think I need to modify the last line in Set_Content_Library_DAZ_Studio_Formats_Container.dsa to something like this:

    // Original example})( "People/Genesis 3 Female" );//should I write this in here?})( sArg );//or I don't know maybe:})( sPath );

     

    Post edited by Syrus_Dante on
  • ChoholeChohole Posts: 33,604

    I am given some more advice to pass on to you

    The Global::getArguments() function used in the Callee sample returns the *Array* of arguments passed in from the Caller sample. The DzScript::execute() function used in the Caller sample takes an (optional) *Array* of arguments (even if that Array consists of a single String), not a String as you have here; to fix, wrap "People/Genesis 3 Female/Pose" in square braces like so ["People/Genesis 3 Female/Pose"]. The Callee sample shows how to forward the passed-in arguments through the anonymous function and how to inspect the value/type of each argument. For your purposes, declare/define a variable in the Callee script with the passed-in value if the length of the arguments array is (at least) the expected length and its type is as expected. Like so...
    ---
    var sPath = (aArgs.length > 0 && typeof( aArgs[0] ) == "string" ? aArgs[0] : "");
    if( sPath.isEmpty() ){ print( "The first argument passed-in is not a valid string." ); return; }
     
  • Syrus_DanteSyrus_Dante Posts: 983
    edited October 2018

    Thanks alot, so all arguments to pass even if its just one string have to be stored and transmitted in an Array I understand that.

    Almost a year has passed since I had a look into Daz Scripting and my lastest Convert to SubD script, I forgot that the arguments get passed in an array. On the reciever side (Callee_Script.dsa) I know how to handle that.

    But thank you for this great example how to convert the single string Array argument, do a few checks if its the right datatype and put it into sPath. And all this in one script line, this is clever I propably would have written a few nested if conditions to check this, you see I'm not an scripting expert.

    var sPath = (aArgs.length > 0 && typeof( aArgs[0] ) == "string" ? aArgs[0] : "");if( sPath.isEmpty() ){ print( "The first argument passed-in is not a valid string." ); return; }

     

    Just for reference this is the top part of my latest script modification at Convert to SubD script ApplyOrZero_SubD_SubDivLevel_MeshResLevel_v8.dsa 22K

    It will only accept passed arguments that are in the right order and datatype 1. Bool 2.3.4. Integer. You should be able to pass it just one to a maximum of four arguments. If not you will get a notification what went wrong. Now that I know how to deal with passing the arguments in an Array there are some things to rewrite. This script is meant as a module and should run in "silent" mode with var bDebugConsole = true; no messagebox will pop up at the end and all infromations get written into the Script IDE console. Critical Erros will still pop up as a messagebox. I think this will make it easy to use and foolproof for others and they can acces the function inside the script with their own scripts and just a few lines of code.

    See Begin: Callee_Script.dsa MODIFICATION!

    // DAZ Studio version 4.10.0.107 filetype DAZ Script/********************************************************************** 	Copyright (C) 2002-2017 Daz 3D, Inc. All Rights Reserved.	Script code: MODIFIED! No warranty of any kind. 	This script is provided as part of the >> Daz Script Developer Discussion >> Convert to SubD script		Creative Commons Attribution 3.0 Unported (CC BY 3.0)	- http://creativecommons.org/licenses/by/3.0 	To contact Daz 3D or for more information about Daz Script visit the	Daz 3D website: 	- http://www.daz3d.com		Items : [node, figure, object]	Nodes : [bone, null / group / camera / light / dformer / instance / shell / push / other exotic custom types...]	**********************************************************************	Daz 3D Forums > Software > Daz Studio Discussion > Daz Script Developer Discussion > Convert to SubD script	Modification of the original Script Example / code snippet:	Thread opener [OP]:  Hellboy @ September 15 - 2017	- Idea by: algovincian @ September 18	- Mod by: jag11 @ November 27	- Mod v7 by: Syrus_Dante @ 2017-12-21	- now with extended error detection!	- now with using UNDO-Stack - Script Action is called "Change SubD Values on Selection" and can be undone	- includes parts of Example Script: Sub Script [Callee_Script.dsa] to show passed Arguments with their datatypes in the MessageBox	Source: http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/remote_operation/sub_script/start**********************************************************************		FileName: ApplyOrZero_SubD_SubDivLevel_MeshResLevel_v7.dsa	Function: pass arguments to Apply - Or - Zero values with no or just some Arguments passed	- will apply SubD (Convert to SubD), View SubD Level, Render SubD Level and Resolution Level values	- to the SubD related Properties of the current Selection of Items in the Daz Studio Scene		Run_this_Script_with_Arguments.dsa Example(unfortunately not possible yet!):	**********************************************************************	include ("ApplyOrZero_SubD_SubDivLevel_MeshResLevel_v7.dsa");	Apply_SubD_SubDivLevel_MeshResLevel(true, 2, 1, 1);	- Apply SubD to Selection	- Change Property: View SubD Level to 2	- Change Property: Render SubD Level to 1 (View SubD: ERC[Add] to Render SubD ??? Render SubD should never be less than View SubD)	- Change Property: Resolution Level to: HighRes	[or try this - also possible]:	Apply_SubD_SubDivLevel_MeshResLevel(true);	- Apply SubD to Selection	- All other values get set to Zero	some side note ;) https://en.wikipedia.org/wiki/Abstraction_(computer_science)**********************************************************************/// Source: https://www.daz3d.com/forums/discussion/197936/convert-to-subd-script// Define an anonymous function;// serves as our main loop,// limits the scope of variables(function ( aArgs ) {	/**********************************************************************	Declared Variables Value Meaning:	**********************************************************************	Apply_SubD : to Selection (Convert To SubD)	false = dont apply	true = apply SubD	My_VSubDLevel : Set Property: View SubD Level	- 1 = Don't Change	0 = OFF	1 to 5 = ON	My_RSubDLevel : Set Property: Render SubD Level	- 1 = Don't Change	0 = OFF	1 to 7 = ON	My_ResLevel : Set Property: Resolution Level	- 1 = Don't Change	0 = Base	1 = High Resolution		**********************************************************************/	var Apply_SubD = false;		// <<< don't apply by default value for Apply: SubD (Convert To SubD) 	var My_VSubDLevel = 0;		// <<< Zero by default value for Property: View SubD Level (Render SubD Level will also be set) 	var My_RSubDLevel = 0;		// <<< Zero by default value for Property: Render SubD Level	var My_ResLevel = 0;		// <<< Zero by default value for Property: Resolution Level		/*================================================================================	Begin: Callee_Script.dsa MODIFICATION!	================================================================================*/	// String : A function for retrieving a translation if one exists	// unnecessary? how about to ask for DS version number here ???	/*********************************************************************/	function text( sText )	{		// If the version of the application supports qsTr()		if( typeof( qsTr ) != "undefined" ){			// Return the translated (if any) text			return qsTr( sText );		}		// Return the original text		return sText;		};		// Declare working variables	/*********************************************************************/	var vArg;			//value of the passed Argument	var sType;			//String: Type of 'current' Argument / later Type of 'current' Object see: sType = typeof( oObject )	var nArgs = 0;			//Number: of Arguments - by default no Arguments get passed if you run this stript	var bDebug = true;		//Boolean: Switch - true: you get a MessageBox to see the passed Arguments with datatypes	var bDebugConsole = false;	//Boolean: Switch - true: instead of the final messagebox the final message gets written to the Script IDE console with the use of print("") - critical erros will still be showen with a messagebox	// Define text variables for the message	var sButton = text( "&OK" );			//String: just the MessageBox OK button - gets translated to other languages? if any translation exists ;) see "function text"	var sTitle = text( "Passed Arguments:" );	//String: MessageBox Title	var sMessage = "\n";				//String: MessageBox Text - gets filled later in the last step	var aMessage = [];				//Array: to collect all messages from "passed Argument loop" and final results	var aMessageSucces = [];			//Array: to collect all messages from the function: InfoMsg	var aMessageError = [];				//Array: to collect all messages from the function: ErrorMsg	// Iterate over the arguments passed to the script	/*********************************************************************/	for( var i = 0, nArgs = aArgs.length; i < nArgs; i += 1 ) {				// if we got more than 4 arguments passed cancel this for-loop		if ( nArgs > 4) {			break;		}				// Get the 'current' argument		vArg = aArgs[ i ];		// Get the 'current' type		sType = typeof( vArg );		// Check given Arguments for typeof: object		/*********************************************************************/		if( sType == "object" ) {			MessageBox.critical( text ("We are done... dont pass me Objects!")			, text ("Critical Error!"), sButton );						return null;	//We are done... with no succes			//...otherwise why not pass this script the object or an array of objects to set the SubD values on them ;)			//how is this called: overloaded? Side-Info https://en.wikipedia.org/wiki/Function_overloading			//This would be the right place to define what should happen with the given object(s)		}					//here we set the values of the variables to the given Arguments		/********************************************************************************		- Apply 4 Arguments that can be passed to this script		- with the values in the array vArg = aArgs[ i ]		- aArgs[ 1 ] = Apply_SubD 	 : TypeOf: Bool		- aArgs[ 2 ] = My_VSubDLevel : TypeOf: Int		- aArgs[ 3 ] = My_RSubDLevel : TypeOf: Int		- aArgs[ 4 ] = My_ResLevel 	 : TypeOf: Int		********************************************************************************/		if( i == 1 ) {			aMessage[aMessage.length + 1] = text (				"1. passed Argument: Apply SubD (Convert To SubD) = %1 TypeOf: %2"				.arg( vArg )				.arg( sType ));			if (sType == "bool" ) {				Apply_SubD = vArg;	//set 1st passed Argument			} else {				aMessage[aMessage.length + 1] = text ( "    > Error#: %1 should be TypeOf: bool"				.arg( nError += 1 ));			}		}		if ( i == 2 ) {			aMessage[aMessage.length + 1] = text (				"2. passed Argument: Set Property: View SubD Level = %1 TypeOf: %2"				.arg( vArg )				.arg( sType ));			if (sType == "int" ) {				My_VSubDLevel = vArg;	//set 2nd passed Argument			} else {				aMessage[aMessage.length + 1] = text ( "    > Error#: %1 should be TypeOf: int"				.arg( nError += 1 ));			}		}		if ( i == 3 ) {			aMessage[aMessage.length + 1] = text (				"3. passed Argument: Set Property: Resolution Level = %1 TypeOf: %2"				.arg( vArg )				.arg( sType ));			if (sType == "int" ) {				My_ResLevel = vArg;	//set 3rd passed Argument			} else {				aMessage[aMessage.length + 1] = text ( "    > Error#: %1 should be TypeOf: int"				.arg( nError += 1 ));			}		}		if ( i == 4 ) {			aMessage[aMessage.length + 1] = text (				"4. passed Argument: Set Property: Render SubD Level = %1 TypeOf: %2"				.arg( vArg )				.arg( sType ));			if (sType == "int" ) {				My_ResLevel = vArg;		//set 4rd passed Argument			} else {				aMessage[aMessage.length + 1] = text ( "   > Error#: %1 should be TypeOf: int"				.arg( nError += 1 ));			}		}	}// EndOf: for( var i = 0, nArgs = aArgs.length; i < nArgs; i += 1 )	/*================================================================================	EndOf: Callee_Script.dsa MODIFICATION!	================================================================================*/		// if in Debug Mode AND if this script got Arguments passed = display the messagebox	// if errors occured OR the amount of arguments is more than 4 = Critical Error!	// no problem with less than 4 passed arguments as long as it is the right datatype	//********************************************************************************	if (( bDebug == true ) && (nArgs != 0)) {		if ((nError != 0) || (nArgs > 4)) {			MessageBox.critical( text (			+ "Error reading passed Arguments!\n"			+ "Pass me Arguments like this:\n"			+ "1. Apply: SubD (Convert To SubD) TypeOf: bool\n"			+ "2. Change Property: View SubD Level TypeOf: int\n"			+ "3. Change Property: Render SubD Level TypeOf: int\n"			+ "4. Change Property: Resolution Level TypeOf: int\n" )			, text("Critical Error!"), sButton );			return null;	//We are done... with no succes		}		MessageBox.information( sMessage, sTitle, sButton );	}//...just the top PART of the whole script....................//get the Arguments if this script gets called to run from elsewhere})( getArguments() );		// Finalize the function and invoke

     

     

     

    Post edited by Syrus_Dante on
  • bool and int are not types in DS script, you need Boolean and Number. Unfortunately the Intrinsic Types page is currently down, though it is in the old DS3 scripting docs http://docs.daz3d.com/doku.php/public/software/dazstudio/3/start . Rob has supplied a script that will show, and show you how to get, the name of a data type (and also shows handling arrays and objects)

    var sString = "";print( "typeof sString =", "\"" + typeof sString + "\"" );var nNumber = 5;print( "typeof nNumber =", "\"" + typeof nNumber + "\"" );var bBoolean = false;print( "typeof bBoolean =", "\"" + typeof bBoolean + "\"" );var oObject = {};print( "typeof oObject =", "\"" + typeof oObject + "\"" );print( "Array.isArray( oObject ) =", Array.isArray( oObject ) );var aArray = [];print( "typeof aArray =", "\"" + typeof aArray + "\"" );print( "Array.isArray( aArray ) =", Array.isArray( aArray ) );

     

  • OK thanks Richard.

    So it is called Boolean and Number (that can hold integer or floating point values). I just started to write this script without reading much documantation and thought I could adapt some of my C++ programming knowledge.

    Understanding the datatypes is an important part of this scripting and programming in general. It seems I need a bit more pratice.

    Thanks also for the link I just downloaded the DAZ Script API (ZIP - 2.96 MB) and found what I was searching for.

    [Quote]: DAZ Script API ds3_daz_script_development_kit_3.0.1.144_docs/standards.html

    DAZ Script Coding Standards

    Below you'll find coding standards that DAZ uses internally. We've provided them here in hopes that you will find them useful in your own endeavors. We find that by using these standards, our code is easier to read and maintain. We hope that they might offer you the same.

    Variable Naming:

    Variable names names should be descriptive, rather than brief. Use the following rules when naming variables:

    Notation:
    Since DAZ Script variables are type-less, use a Hungarian Notation style naming convention to help avoid confusion about what types variables and parameters are expected to be. The following is a list of prefixes for the different basic types:

    Prefix Type
    o Object – any variable that is intended to hold an instance of a QObject or
    DAZ Script custom class besides those listed below.
    a Array type variables
    b Boolean type variables
    n Number (integer) type variables
    f Number (float) type variables
    s String type variables
    clr Color type variables
    cg ColorGroup type variables
    pal Palette type variables
    pix Pixmap type variables
    date Date type variables
    pnt Point type variables
    rect Rect type variables
    regx RegExp type variables
    size Size type variables
    bytes ByteArray type variables
    font Font type variables
    w DzWidget type variables
    box DzBox3 type variables
    mtx DzMatrix3 and DzMatrix4 type variables
    vec DzVec3 type varaibles
    quat DzQuat type variables
    rng DzTimeRange type variables
    edge DzHalfEdge type variables
    tri DzTriangle type variables
    quad DzQuad type variables
    poly DzPolygon type varaibles

    Variable Name Case:
    Variable names always start with a lowercase letter, with each subsequent word in the variable name starting with an uppercase letter (no underscores separating words).

    Be Descriptive:
    Always use descriptive variable names. Avoid making variable names from single letter abbreviations that can be difficult to read. One letter variable names should NOT be used, except in the following cases:

    • i, j, k, n : Should only be used to iterate over a for/while loop where the variables i, j, and k are iterators, and n is the total number of iterations.
    • x, y, z, w : Should only be used to represent coordinates in 2D or 3D space.

    Global Variables:
    Global variable names always start with 'g_'. Global variables should be used sparingly, but when they are used they should reside at the top of the file.

Sign In or Register to comment.