Daz Script: Apply Duf to a model

edited January 2014 in Daz Studio Discussion

Hi! I'm struggling with dazscript for several hours, and decided to ask for simple example.
Lets say, I have Genesis model in the scene.
In some folder, I have mycloth.duf

How can I load and apply this cloth to the genesis model, completely via script? I know this should be simple, but docs are so lacking so far >__<</p>

THANKS!!!

EDIT: Phew, by digging inside forums, managed to resolve part1 of the question, it was actually easy:
var base = Scene.findNodeByLabel( "Genesis" );

EDIT2: Found this:

var sPathToFile:String = "E:\\My_PAth\\Outfit.duf"
App.getContentMgr().openFile( sPathToFile, true );

It executes without error, but nothing happens. HMMMMM;

Post edited by assignator_da12fd057f on

Comments

  • FistyFisty Posts: 3,416
    edited December 1969

    What type of file is "mycloth.duf"? If it's a shader preset just put it somewhere in your "my library" (Shader presets would be the most obvious place), select your genesis in the scene tab and its surfaces int he scene tab and double click your "mycloth" in your content library. If it's a material preset and it's made for genesis then it's as easy as selecting genesis in scene tab and double clicking the matpose in your library. (my library/people/genesis/characters/whatever you want would be a good place for a matpose for genesis)

    So unless I'm misunderstanding and you're trying to do something super advanced and super complicated you shouldn't have any need of scripting to get DS to read a duf file, it's kind of what it's made to do..

  • edited December 1969

    PHEW, actually my last code under EDIT2 works, just had a typo.
    It took awhile to research >____<, only after I founded SDK C++ docs, I managed to find all classes lists >______________<</p>

    It is just small example of a bigger picture, so actually yes, I'm trying to do something much more complicated.

    Anyway, I'm glad now that I have it working!

  • FistyFisty Posts: 3,416
    edited December 1969

    Good deal, carry on. =) Glad you got it working, DS scripting, unfortunately, makes my head hurt.

  • Richard HaseltineRichard Haseltine Posts: 102,252
    edited December 1969

    Developer Discussions http://www.daz3d.com/forums/categories/60/ is for DAZ Studio Scripting - if you post there and don't get an immediate answer there's a good chance Rob or one of the other developers will see your thread and reply.

  • edited December 1969

    Got it, thank you!

Sign In or Register to comment.