Possible to script adding of folders to daz studio

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

  • fixmypcmikefixmypcmike Posts: 19,583

    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?

  • 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.

     

  • dquill1dquill1 Posts: 11

    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.

     

  • Richard HaseltineRichard Haseltine Posts: 100,729
    edited March 2021

    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.

    Post edited by Richard Haseltine on
  • Figured it out since i need something similar. 

    (function() {
    var folder= "F:/2d";
    var contentManager = App.getContentMgr();
    //contentManager.removeAllContentDirectories();
    contentManager.addContentDirectory(folder);
    })(); 
  • dquill1dquill1 Posts: 11
    edited April 2021

    thenoobducky said:

    Figured it out since i need something similar. 

    (function() {
    var folder= "F:/2d";
    var contentManager = App.getContentMgr();
    //contentManager.removeAllContentDirectories();
    contentManager.addContentDirectory(folder);
    })(); 

    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. 

    Post edited by Richard Haseltine on
Sign In or Register to comment.