Exporting selected object

DzExporter will export all the objects avaiable in the scene except the hidden ones. If I'd like to export only the primary selection, I could loop all the nodes and hide everything except the currently selected one. But I'd like to know if there is already an option or a way to do it in the SDK...

Comments

  • rbtwhizrbtwhiz Posts: 2,162
    edited December 1969

    DAZ Studio > v4.x > Reference Guide > Scripting > API Reference > Samples > File Input/Output > Silent OBJ Export provides a sample script that will show you the logic and available settings for the Wavefront Object (OBJ) exporter. The same code could be translated to a C++ function, fairly easily.

    Each exporter is responsible for providing its own settings. DAZ Studio > v4.x > Reference Guide > Scripting > API Reference > Samples > File Input/Output > Exporter Settings will allow you see what settings are available for a given exporter, if any.

    -Rob

  • Alessandro MastronardiAlessandro Mastronardi Posts: 2,593
    edited December 1969

    Hi Rob, I indeed had that sample already converted to C++, and after studying the options (which are the same "offered" buy the Studio interface export command), I realized that indeed there was not a way to export only the selected object.
    That's why I decided to ask.

  • Alessandro MastronardiAlessandro Mastronardi Posts: 2,593
    edited December 1969

    Darn me... I just took a closer look at the code and there is a:

    // Do not limit export to selection - only available in 4.1.x
    oSettings->setBoolValue( "SelectedOnly", false );

    Sorry...

  • TugpsxTugpsx Posts: 732
    edited December 1969

    yes, since these were added you should also add a version check to your script to ensure that older versions dont have conflict with unsupported terms.

  • Alessandro MastronardiAlessandro Mastronardi Posts: 2,593
    edited December 1969

    Tugpsx said:
    yes, since these were added you should also add a version check to your script to ensure that older versions dont have conflict with unsupported terms.

    Thanks, will do that!

Sign In or Register to comment.