Favorites script for 2nd Poser install

I want to set some favorite folders using Rob's script

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

I already have them for my DS install and the 1st Poser install, but I can't get a 2nd Poser install path to work.

The relevant section seems to be

// Set the base to the first mapped Poser formats directory			var sBase = String("%1/%2")						.arg( oContentMgr.getPoserDirectoryPath( 0 ) )						.arg( sIntermediate ); 			// Set the first value to the id of the top-level container,			// set the second value to the base path within that container			var aIdPath = [ oAssetMgr.getPoserDirID(), sBase ];			// Split the relative path into its individual parts			var aRelativeParts = sPath.split( "/" );			// Iterate over each part in the relative path,			for( var i = 0; i < aRelativeParts.length; i += 1 ){				// Push the full path of the 'current' part onto the id path array				aIdPath.push( String("%1/%2")					.arg( sBase )					.arg( aRelativeParts.slice(0, i + 1).join( "/" ) ) );			}

and I've tried all sorts of changes, but it still won't work. I'm pretty sure

.arg( oContentMgr.getPoserDirectoryPath( 0 ) )

should be

.arg( oContentMgr.getPoserDirectoryPath( 1 ) )

but I've also tried

.arg( oContentMgr.getPoserDirectoryPath( 2 ) )

As for the rest, I'm not sure. This baffles me

// Set the first value to the id of the top-level container,			// set the second value to the base path within that container

because I don't know what values it refers to. No doubt the comments make sense to anyone who knows scripting, but not me.

In my Content Directory Manager, there are 2 entries under Poser Formats. The 1st one works with this script, but when I try to get the 2nd one, it just keeps opening a folder in the 1st install (Yes, there are 2 identically named folders, one in each install)

Any ideas?

Comments

  • maclean said:

    I want to set some favorite folders using Rob's script

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

    I already have them for my DS install and the 1st Poser install, but I can't get a 2nd Poser install path to work.

    The relevant section seems to be

    // Set the base to the first mapped Poser formats directory			var sBase = String("%1/%2")						.arg( oContentMgr.getPoserDirectoryPath( 0 ) )						.arg( sIntermediate ); 			// Set the first value to the id of the top-level container,			// set the second value to the base path within that container			var aIdPath = [ oAssetMgr.getPoserDirID(), sBase ];			// Split the relative path into its individual parts			var aRelativeParts = sPath.split( "/" );			// Iterate over each part in the relative path,			for( var i = 0; i < aRelativeParts.length; i += 1 ){				// Push the full path of the 'current' part onto the id path array				aIdPath.push( String("%1/%2")					.arg( sBase )					.arg( aRelativeParts.slice(0, i + 1).join( "/" ) ) );			}

    and I've tried all sorts of changes, but it still won't work. I'm pretty sure

    .arg( oContentMgr.getPoserDirectoryPath( 0 ) )

    should be

    .arg( oContentMgr.getPoserDirectoryPath( 1 ) )

    but I've also tried

    .arg( oContentMgr.getPoserDirectoryPath( 2 ) )

    As for the rest, I'm not sure. This baffles me

    // Set the first value to the id of the top-level container,			// set the second value to the base path within that container

    because I don't know what values it refers to. No doubt the comments make sense to anyone who knows scripting, but not me.

    It's an array of two values, the first is the id of the top level container (e.g. the content directory) and the second is the actual path (I think).

    maclean said:

    In my Content Directory Manager, there are 2 entries under Poser Formats. The 1st one works with this script, but when I try to get the 2nd one, it just keeps opening a folder in the 1st install (Yes, there are 2 identically named folders, one in each install)

    Any ideas?

    Have you tried in the curremnt Public Build? I wonder if it might be related to docs.daz3d.com/doku.php/public/software/dazstudio/4/change_log#4_12_1_35

  • macleanmaclean Posts: 2,438

    It's an array of two values, the first is the id of the top level container (e.g. the content directory) and the second is the actual path (I think).

    I'm not sure if that will help. What I meant was, I don't know which values I'm supposed to change. These two?

    var aIdPath = [ oAssetMgr.getPoserDirID(), sBase ]; - Would this become var aIdPath = [ oAssetMgr.getPoserDirID(1), sBase ];
    var aRelativeParts = sPath.split( "/" ); - And this var aRelativeParts = sPath.split( "Props/Folder" );

    The build I'm using is 4.12.0.86. I no longer use beta versions.

  • No - sorry, the top-level contain is Poser Formats, not the content directories underneath it - if you look at http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/assetmgr_dz#a_1a1510442406eb8b926bb09bbaa658a642 there are separate commands for each container type, and they don't take parameters so trying to pass one would just error out.

  • macleanmaclean Posts: 2,438

    Oh well, it's all Greek to me, as usual, and I'm no further on. Not to worry. I can live without it.

Sign In or Register to comment.