Possible to script adding of folders to daz studio
dquill1
Posts: 11
I'd like to add folders via script to the Daz Studio Formats. I'm constantly adding and removing folders for various configs I run. My setups are fairly complex but consistent and was wondering if it's possible to script adding of folders to Daz studio.
Comments
You can use the Content Directory Manager to create different sets of content folders and switch them easily
is DzContentFolder or DzContentMgr what you looking for?
http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/contentmgr_dz#a_1ab6c514656b9bc1761e96b26a3c03f205
Not a code monkey, but it does appear possible.
Just tried replacing the ContentDirectoryManager.dsx file with DS open, and the different file was recognized when i opened CDM.
Only thing was, i'd have to manually change the directory set.
As an option to a script, might try setting up different content sets in CDM, and then a short cut to the manager so you could swap to different sets.
Content Directory manager is a script. You can see examples of what you need here http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/start#directory_mapping
This definitely looks possible, but the documentation is...well lacking in specifics. I'm going to play with this but struggling with syntax big time. don't really script daz much, but it's a fun thing to tackle.
DzContentFolder.getContentDirectory(f:\2d, saveSetting=true); should do it, but doesn't (if the directory is f:\2d). This was good help, hope to get it done, this would be massively hlepful if I figure it out. I switch directories constnatly, and having scripts could save a ton of time. have literally hundreds of directories and would make managing it so much easier.
getContentDirectory() takes a number, telling it which one to get, and returns a DzContentFolder. Also, you either need to escape the backslash (\\) or use a forward slash (/) as the folder separator, and you just want true not saveSettings = true which is assigning a value to the saveSettings variable and then passing the value of the command to the function - which doesn't want it anyway.
There are soem general introductory setions in the scipting docuemntation on codign standards, you should read those and also try to read a bit about coding with ECMA script (Javascript is quite close and widely documented) to get the basics down; the object definitions will then make much more sense.
Figured it out since i need something similar.
You are so the person here!!!! this is perfect. I was mucking with the fuction, but never really got it working. I don't really know the language well enough and was fumbling with the base knowledge (or lack thereof). I'm scriping my entire library now. Thank you so much!!! This is a massive help.