Basics

flashmoyoflashmoyo Posts: 12

Hi all,

I'm an experienced developer, but I'm kinda lost with Daz. Documentation seems all over the place with no obvious way how to begin or where to find resources. Anyway, I'd like to do the following:

1. Add a figure on the scene. eg: Genesis 2

2. Add a cloth (from the content library) on the said figure 

3. Load a material for the cloth added in step 2

Finally I'd like to know if it is possible to run a script automatically when opening Daz or make it execute a script from command line or another way with no UI interaction.

 

If someone can provide a sample for the above actions or point me to the right direction would be much appreciated.

 

Thanks a lot!

Post edited by flashmoyo on

Comments

  • ChoholeChohole Posts: 33,604
    edited August 2015
  • You can run a script on start up or on File>New by entering its location in the Startup or Scene tabs of the Preferences dialogue.

  • djigneodjigneo Posts: 283
    edited September 2015

    1) Loading Genesis:

    var oContentMgr = App.getContentMgr();oContentMgr.openFile("C:/DAZ 3D/Studio/My Library/People/Genesis/Genesis.duf", true);

    You should probably use the App variable to search your content directory appropriately instead of hard-coding a path such as in my example.

    2) Loading cloth:

    var oNode = Scene.getNode(1); // assuming the first node is Genesis now, you actually will want to search for it, most likelyScene.setPrimarySelection(oNode); // select Genesis

    Then nearly the exact same code as #1, instead pointing to your cloth content instead of Genesis. Perhaps iterate Scene.getNodeList() and look for the node that way.

    3) Applying material preset to cloth:

    var oNode = Scene.getNode(2); // find the cloth object (you'll probably need to actually search for it again, it may be under Genesis)Scene.setPrimarySelection(oNode); // select the cloth object

    Then nearly the same code as in #1 and #2, assuming your material preset already sets the materials you want when you have the node selected.

     

    If you haven't already, I suggest downloading the old API to your computer and referencing it heavily. I certainly feel the same way as you (experienced developer, struggled to get started), although I think I've fought though quite a bit of it by now, so I should hopefully be able to help you further if you get stuck.

    I suggest breaking the code up into bite-sized chunks and verifying the pieces work independently. I find I make a lot of silly little mistakes when I don't double-check all of my assumptions.

    Post edited by djigneo on
  • Thank you for your help. The old API has been really helpful.I'll make sure to contribute to the forum with answers/tutorials when I feel a bit more comfortable with the language/environment as the current documenation is really not good.

     

    Thanks again.

  • LindseyLindsey Posts: 1,985

    On the lower right of Daz Studio screen, click on "Select a Lesson..." for a listing of self-guided tutorials.

    Screen Shot 01-01-16 at 12.51 PM.PNG
    497 x 218 - 13K
Sign In or Register to comment.