Still trying to set a 2nd Poser Dir as a Favorite (Solved)
maclean
Posts: 2,438
A year later, and I'm back to this topic. Rob's script is great, but incomprehensible to me.I have 2 poser installs on the same SSD - P6 and P9. P6 Favorites are no problem, but the P9 script only ever finds the P6.folders.
The relevant section comments are kind of vague
// Set the base to the first mapped Poser formats directory
// Set the first value to the id of the top-level container, // set the second value to the base path within that container
The trouble is I don't know what line any of these refer to. And how would it change for a 2nd Poser install?
It's not anything life-threatening, but surely someone knows how it works?
// 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( "/" ) ) ); }
TIA
Post edited by maclean on
Comments
Those comments are telling you what the code immediately below is doing.
I looked at the example script you linked to (Set_Content_Library_Poser_Formats_Container.dsa), and if that is the script you are running without any modifications, and you are using a version of DS >= 4.8.1.51, then the code you are showing in this post should all be skipped and this part run instead
The last line of the script sets the folder to select
When I run the script, it searches my content directories in the order they are defined in the Content Directory Manager (see attached), so:
"contentlibrarypane_dz" appears to be undocumented, so I don't know how to specify a specific content directory with "browseToPoserFolder". To do this, we have to use the old method. The old method does not search through all content directories, you have to specify which one to search in.
Looking at getPoserDirectoryPath on my system:
So we end up with sBase = "D:/3D/Auto Adapted/Runtime/Libraries"
and next,
This gives us aIdPath = [ "Poser", "D:/3D/Auto Adapted/Runtime/Libraries" ]
and then
So now aIdPath = [ "Poser", "D:/3D/Auto Adapted/Runtime/Libraries", "D:/3D/Auto Adapted/Runtime/Libraries/Character", "D:/3D/Auto Adapted/Runtime/Libraries/Character/DAZ People" ]
and finally
this causes the pane to work it's way through aIdPath until it ends up where we want it.
So, to use the script to switch to a directory in the second Poser content directory you need to change
to
and
to
Well, I'm not sure what I did, but I finally got it working! I can now access all my DS stuff, plus both Poser installs from a toolbar. When you're trying to work, faffing about hunting for folders is an overrated pastime.
In the early days of DS, there was a free script called Favorites which created a new menu, and with a couple of clicks, added any folder to it. I've never understood why the Dev Team don't add something similar to DS. I suppose they want people to use Smart Content. Treee is good for me.
Omniflux - Yet again, you've come up with the goods. Thanks! Did you get my PM?