Set Content Library Container help
maclean
Posts: 2,438
I tried this script a year ago and gave up in frustration. But in my current project, I have to continually drill down into a Poser folder to get stuff.
Here's what baffles me. I *think* this is the section I need to change, but have no idea how.
// Set the base to the first mapped Poser formats directory var sBase = String("%1/Runtime/Libraries").arg( oContentMgr.getPoserDirectoryPath( 0 ) ); // 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( "/" ) ) );
var aIdPath = [ oAssetMgr.getPoserDirID(), sBase to what?
and
var aRelativeParts = sPath.split( "/" ); to what?
Can anyone help out here? I'd certainly appreciate it.
I'd appreciate it even more if we could just right-click a folder and choose 'Add to Favorites' but my feature request for that went nowhere.
Comments
sBase would be the relative path to the folder you want to start with - then the rest of the path, to get an absolute path is prepended to that by the oAssetMgr call.
the split command is breaking the string sPath into an array of folder names - it breaks the string apart at the directory separators ("/").
Remember that feature requests are assesed by product management and set a priority, based on their prceived need and on the resourced needed to implement. Rob may choose to pick soem up in his own tiem, but that obviously depends on how they are presented (and woudl still be dependent on factors like the tiem needed and the risk of breaking something else).
I don't really understand any of that, Richard.The path I want is "F:\6 poser\Runtime\libraries\Props\Maclean\Everyday"
I tried this and get an error.
I know I'm thick, but a commented path example in these scripts would avoid idiots like me asking stupid questions.
Is that a mapped content directory?
Yes, it is. These are the only 2 dirs I have. (Btw, I use Tree view, not categories)
Actually I misread the code, the
Not sure what that means either. I tried this, but nothing happens.
Then at the end of the script, I see this, but why is it there?
Should I be changing that too?
No - the split( substring ) breaks the main string into pieces, at the location(s) of the substring - you didn't want to change that.
That last bit is the relative path to be used. Sorry, I should have gone to the full script rather than just looking at the bits you were querying.
Courtesy of Rob:
Well, I copied/pasted the entire script but it does nothing - and gives no errors either. Tried changing the last line to "Props" - nothing.
The windows explorer path is "F:\6 poser\Runtime\libraries\Props\Maclean\Everyday" and it's the only mapped Poser directory. Am I doing something wrong? Back/forward slashes? Quotes?
There seems to be an issue, as written, with the simple call for later versins of DS - if I sabotage that by making the line fter getting the Content LIbrary pane
if( ! App.version64 >= 0x0004000800010033 ){
(adding a negation) then the script works, using the long method in the later section. I don't know if the method requires a slightly different format, or if the version number is too low and it's a feature added in a later build than 4.12.0.86 - which is what I was trying.
I tried this (not sure if I put your addition in the right place), but it gives me an error on line 109 - ie the path - })( "Props/Maclean/Everyday" );
Then I tried it with Rob's default path - })( "Character/DAZ People" ); - but that doesn't work, so I'm not sure what's happening.
You've deleted the stuff that would be run with the later app version, and in the process lost a } so the brackets no longer match. But I wasn't offering this as a fix, if you ran the script with the ! in an older DS it would try using the new one-step method (since the version number would not be greater than) and would error out, I was just saying that it seems to be an issue there in the latest DS (unfortyunately I never remember to keep the older versions to see if the last general release would work).
Oh well, it doesn't seem it'll work for now, so I give up. I can't believe that after 3-4 days and all these posts a fairly basic concept (like bookmarks in a browser) is such an issue. I understand the reasons and glitches, but the whole scripting thing in DS just doesn't happen for me. I'm no code monkey, so I can only rely on the dev team or people like yourself, Richard. Unfortunately, these little things in DS can make my working life easier or more awkward. But hey, I get there in the end.
Thanks for taking the time to help out.
Well, the script with the adapted input came from Rob. This issue, whether it's an error in the script or in DS or us, affects the plain vanilla version too - I'm guessing it's showing up a bug, or a change (remember thatb these pane methods are not documented and are use at your own risk), or possibly a slip as to which version number is required for it to work.
Well, if Rob knows about it, I'm sure he'll get round to dealing with it at some point. It's a pretty minor issue, so I don't expect him to go right at it. No doubt it'll go on his list somewhere.
Rob has in fact updated the sample, and I can confirm it is now working in 4.12.0.86, so download that and change just the parameter passed on the last line (as above).
Wowwww!!!! Got it working now. I downloaded the DS one too, just in case of changes, and it works too.
THANK YOU, ROB!!! And you too, Richard!
Happy Bunny!