Export Selected Object Only

I have a scene that is getting complex and I want to export certain items into Blender to make fitted props/attachments for them. I tried exporting an item but everything in the scene ended up in Blender. In most 3D programs we have an option to export only what is selected in the scene. Is this possible with Daz? How can this be achieved?

Comments

  • By default only visible items are exported, so seelct the stuff you want and invert the selection (I think there is, by default, a Select sub-menu with the Invert Selection command, if not it's in the Scene pane option menu reached by the lined button in the top corner) or directly select the items you don't want, whichever is simpler, then in the Parameters pane go to the Display group and click off the Visible button to hide the unwanted items. Do the export, then undo the hiding.

  • ToyenToyen Posts: 1,888

    I think that as of right now, the only way is to hide everything you do not want to export and leave what you want to export unhidden.

    Selexted only export would be a very nice feature to have in upcoming DS versions! : )

  • Thanks for the help everyone!

    @Chhole  Thanks, How do I use that script?

  • ChoholeChohole Posts: 33,604

    : In the script you will see several lines that start with "oSettings.setBoolValue(". Most of these lines set values for settings that correspond to options in the OBJ export dialog. There are additional settings that can be set, which are not exposed in the dialog. One such setting, the one you are interested in, is the "SelectedOnly" (and perhaps "SelectedRootsOnly") setting. Change the "false" value to "true" to enable the setting. The script has a comment above nearly every line. Read those to help you understand what each line does.
    ---
    Save the script to a file by clicking the linked title of the script.
    ---
    Running the script is the same as any other piece of content in Daz Studio. A custom action can be created to place it in menus and/or toolbars.
     

  • Chohole said:

    : In the script you will see several lines that start with "oSettings.setBoolValue(". Most of these lines set values for settings that correspond to options in the OBJ export dialog. There are additional settings that can be set, which are not exposed in the dialog. One such setting, the one you are interested in, is the "SelectedOnly" (and perhaps "SelectedRootsOnly") setting. Change the "false" value to "true" to enable the setting. The script has a comment above nearly every line. Read those to help you understand what each line does.
    ---
    Save the script to a file by clicking the linked title of the script.
    ---
    Running the script is the same as any other piece of content in Daz Studio. A custom action can be created to place it in menus and/or toolbars.
     

    Thank You! I will try it.

  • GeneralDeeGeneralDee Posts: 132
    edited October 2016

    Uodate: I changed those values to true and saved the dsa file. I ran the script but the whole scene is still exporting. What am I missing? Was there supposed to be a new option in the dialog?

    Post edited by GeneralDee on
  • Uodate: I changed those values to true and saved the dsa file. I ran the script but the whole scene is still exporting. What am I missing? Was there supposed to be a new option in the dialog?

    No, the script options will override the options from the dialogue (to set the Poser options) and then, if you make the edit Chohole advised, will limit the export to the selected items. You can make the script run entirely  silently, or with only a filename prompt, or you can comment out (put /* in fron and */ after) the sections setting the properties set by the dialogue and just have the script handle the selected item options (as described in the comments).

  • It works like a dream.  Thanks for the advice and discussion! ;)

  • Nana_fNana_f Posts: 18

    Hello...

    I have used this script, changed in TRUE like the image...

     

    but nothing...

    When I export in obj I can read the name of the object selected, but when amount in Max, I have all objects that I have visible in Daz3D :(

    2018-02-27.jpg
    764 x 234 - 217K
  • mCasualmCasual Posts: 4,607
    edited February 2019

    this is probably not available in DS1, DS2 and DS3 but under the current DS4 there's a setting called SelectedOnly

    <Settings>

     <Setting Type="String" Key="Preset">Bryce (1 unit = 8ft)</Setting>
     <Setting Type="Float" Key="Scale">1</Setting>
     <Setting Type="String" Key="LatAxis">X</Setting>
     <Setting Type="String" Key="VertAxis">Y</Setting>
     <Setting Type="String" Key="DepthAxis">Z</Setting>
     <Setting Type="Bool" Key="InvertLatAxis">no</Setting>
     <Setting Type="Bool" Key="InvertVertAxis">no</Setting>
     <Setting Type="Bool" Key="InvertDepthAxis">no</Setting>
     <Setting Type="Bool" Key="IgnoreInvisible">yes</Setting>
     <Setting Type="Bool" Key="WeldSeams">no</Setting>
     <Setting Type="Bool" Key="RemoveUnusedVerts">no</Setting>
     <Setting Type="Bool" Key="WriteVT">yes</Setting>
     <Setting Type="Bool" Key="WriteVN">no</Setting>
     <Setting Type="Bool" Key="WriteO">no</Setting>
     <Setting Type="Bool" Key="WriteG">yes</Setting>
     <Setting Type="Bool" Key="GroupGeom">yes</Setting>
     <Setting Type="Bool" Key="GroupNodes">no</Setting>
     <Setting Type="Bool" Key="GroupSurfaces">no</Setting>
     <Setting Type="Bool" Key="GroupSingle">no</Setting>
     <Setting Type="Bool" Key="WriteUsemtl">yes</Setting>
     <Setting Type="Bool" Key="WriteMtllib">yes</Setting>
     <Setting Type="Bool" Key="NoMaps">no</Setting>
     <Setting Type="Bool" Key="OriginalMaps">yes</Setting>
     <Setting Type="Bool" Key="CollectMaps">no</Setting>
     <Setting Type="Bool" Key="ConvertMaps">no</Setting>
     <Setting Type="Bool" Key="SelectedOnly">no</Setting>
     <Setting Type="Bool" Key="SelectedRootsOnly">yes</Setting>
     <Setting Type="Bool" Key="PrimaryRootOnly">no</Setting>
     <Setting Type="Bool" Key="IncludeParented">no</Setting>
     <Setting Type="Bool" Key="TriangulateNgons">no</Setting>
     <Setting Type="Bool" Key="CollapseUVTiles">no</Setting>
     <Setting Type="Int" Key="FloatPrecision">8</Setting>
     <Setting Type="Int" Key="RunSilent">0</Setting>
    </Settings>

     

    so updating code by Bob Whisenant for the 2000's

    this should work

    //===============================================
    // ExportObj Was written by Rob Whisenant.
    //===============================================
    function ExportObj( objFilename, scale, bWriteMtl, bCollectMaps )
    {
    var mgr = App.getExportMgr();
    var exporter = mgr.findExporterByClassName( 'DzObjExporter' );
    var settings = new DzFileIOSettings();
    exporter.getDefaultOptions( settings );
    settings.setStringValue( 'Preset', 'Custom (1 unit = 1cm)' );
    settings.setStringValue( 'Scale', scale );
    settings.setBoolValue( 'SwapYZ', false );
    settings.setBoolValue( 'IgnoreInvisible', true );
    settings.setBoolValue( 'WeldSeams', true ); //<========= figures welded
    settings.setBoolValue( 'WriteO', false );
    settings.setBoolValue( 'WriteG', true );
    settings.setBoolValue( 'GroupNodes', false );
    settings.setBoolValue( 'GroupSurfaces', false );
    settings.setBoolValue( 'GroupSingle', true ); //<========= figures welded
    settings.setBoolValue( 'GroupGeom', false );
    settings.setBoolValue( 'WriteVN', true );
    settings.setBoolValue( 'WriteVT', true );
    settings.setBoolValue( 'WriteUsemtl', true );
    settings.setBoolValue( 'WriteMtllib', bWriteMtl );
    settings.setBoolValue( 'CollectMaps', bCollectMaps );
    settings.setBoolValue( 'ConvertMaps', false );
    settings.setBoolValue( 'RemoveUnusedVerts', false );
    settings.setIntValue( 'RunSilent', 1 );
    settings.setBoolValue( 'SelectedOnly', true );
    exporter.writeFile( objFilename, settings );
    }

    and i'm adding an image because it's all about images !

    pinkish2.jpg
    999 x 999 - 396K
    Post edited by mCasual on
  • mCasualmCasual Posts: 4,607

    the script i used to obtain the list of settings

     

     var mgr = App.getExportMgr();var exporter = mgr.findExporterByClassName( 'DzObjExporter' );var settings = new DzFileIOSettings();exporter.getDefaultOptions( settings );debug( settings );

     

  • stitlownstitlown Posts: 282
    Chohole said:

    Ah, Chohole, your star shines ever brighter.  Thanks for this pointer and the notes on how to tailor it into "export selected".  Cheers, Lx

  • ChoholeChohole Posts: 33,604

    You're welcome    but it is Rob that you should thank.  He supplies the info,  I just pass it on

  • TDBAGZTDBAGZ Posts: 165

    Still need this in 4.12.

    I have a scene with 1000's of objects and I need to quickly export a handful in postion, edit them, and then import back in postion. 

    I have customized the export and imports setting as the Blender settings are not ideal by default.

    I also have everything organized in groups in daz, but visibilty doesnt effect parented children nodes.

    Short of a Blender bridge. A selected only export option would save time, hassel, relieve stress of possible crashing, lost work, and corrupt data when making a huge scene disappear and reappear over and over using the "Hidden" Properties option.

  • GutoCraftsGutoCrafts Posts: 50
    edited December 2020

    2020 Solution.

    Select the item you want to export.

    Go to file - > export. Choose the extension (obj or fbx) and type the file name. After you hit save, the export options window will appear. Select the following options in that window:

    For obj, check the option "filter objects"

    For fbx, check the item "selected" and the item "prop" OR "figure". For example, If you want to export a geneses asset, select figure. if you want to export an environment prop, select prop.

    If you are still getting unwanted objects in your exported file, try to unparent the object before exporting and make sure that you have selected only the things you want to export.

    aa.png
    626 x 500 - 29K
    bb.png
    367 x 357 - 14K
    Post edited by GutoCrafts on
Sign In or Register to comment.