Export scene property values to DUF

Is there any native support in the scripting environment to generate DUF files from a scene in DAZ?    I need to export a specific set of properties values to a DUF file.   I can certainly do this using the built-in support asset saving tools, but I need to programatically specify what goes into the DUF file.    I don't see this anywhere in the API docs, and I'd certainly like to avoid writing my own DUF file writer if possible.  

Also, unrelated -- is it possible for a DUF file to trigger a script execution when it is applied to a scene?   And vice versa -- from a Daz Script, can I apply a DUF file to a scene node?

 

Thanks

 

 

Comments

  • algovincianalgovincian Posts: 2,610

    Not sure I completely understand the first part of your post, but you can certainly set property values via script. If you want control over exactly what properties get saved/set, I think a script may be the only way to go, but maybe I'm missing something.

    As far as your second question goes, you may want to look into setting up some signals/slots and connecting them so they trigger user defined functions, but it's hard to say given the info you provide. Might be worth having a look at the signals for DzScene. I don't know exactly what it is you want to do, or exactly which DUFs you want to do it for when they are loaded into a scene.

    As far as the last part of your post goes, something like this may be helpful:

    var oContentMgr = App.getContentMgr();  

    // clear any selections in the scene
    var nodes = Scene.getNodeList();
    var n = nodes.length;
    for( var i = 0; i < n; i++ )
    {
        nodes[i].select(false);
    }

    // select a node by label and merge a .duf to it
    var oNode = Scene.findNodeByLabel( "yourNodeLabel" );
    if( oNode ){
        oNode.select(true);
        oContentMgr.openFile( "yourFile.duf", true ); // the boolean specifies merging
    }

    Hope this helps.

    - Greg

     

  • shoei321shoei321 Posts: 113

    Thanks Fixmypcmike, that is exactly what I was looking for.

     

     

Sign In or Register to comment.