How to export only selected clothing as an object in DS

IsaacNewtonIsaacNewton Posts: 1,274

Is there a way to export a conformed and posed clothing figure as an object without exporting the character figure to which the clothing is conformed?

In other words I want the new clothing (and only the clothing) object to keep the shape it has whilst it is conformed and posed.

Post edited by IsaacNewton on

Comments

  • Syrus_DanteSyrus_Dante Posts: 983
    edited December 2017

    Yes there is a way - if you know how its easy.

    1. go to Scene pane and select the clothing you want to export - go to Parameters pane PropertyGroup: General>Mesh Resolution Property: Resolution Level and set it to "Base"

    2. right-click on the Scene pane and select Select>Invert Selection from the menu or press Ctrl+Shift+I - Now everything in the scene except the clothing should be selected

    3. check if "Consolidate Properties" is enabled / checked in the Parameters pane Options Menu - then go to Parameters pane PropertyGroup: Display>Scene View and switch the "(number) Visible" Property to OFF for all selected Items at once - Now only the clothing Item should be visible

    4. go to Main Menu: File>Export and choose FileType: Wavefront Object (*.OBJ)

    5. in the OBJ Export Options dialogue choose Preset: "DAZ Studio (1 unit = 1cm)" also there is this checkmark for Ignore Invisible Nodes that does the trick - see the two screenshots I once have made to explain it here and there again and again wink

     

    The good thing about this is you can also have the Smoothing Modifier active to collide with the character even it is invisible. Now you can create a Morph to eliminate "Poke through" but keep in mind to use the "Reverse Deformation" option in the Morphloader Pro options and dont change anything about the cloth or the character figures in the scene before import with Morphloader Pro or the Reverse Deformation wouldnt work like expected.

    Export_OBJ-Options_IgnoreInvisibleNodes_1.png 382 x 507 - 61K    |    Export_OBJ_IgnoreInvisibleNodes.png 505 x 638 - 132K

     

     

    Export_OBJ_IgnoreInvisibleNodes.png
    505 x 638 - 132K
    Export_OBJ-Options_IgnoreInvisibleNodes_1.png
    382 x 507 - 61K
    Post edited by Syrus_Dante on
  • IsaacNewtonIsaacNewton Posts: 1,274

    Thanks yes

    It makes me wonder that no one at DAZ thought .."Wouldn't it be a good idea to have this basic function available as a one click option?"  frown

  • IsaacNewtonIsaacNewton Posts: 1,274

    oops... having problems with this step:

    3. go to Parameters pane PropertyGroup>Scene View and switch the Visible Property to OFF

    In the Parameters Pane, where do I find Property Group?

     

  • Syrus_DanteSyrus_Dante Posts: 983
    edited December 2017

    sorry my fail - it should have read like this:

    PropertyGroup: Display>Scene View

    just expand the tree with the [G] symbols in front.

    Parameters_PropertyGroup_DisplaySceneView_1.png 283 x 380 - 30K

    My idea of these screenshots is once we have a bunch of them we can share them for different things to explain - feel free to use them for your own posts.

    Parameters_PropertyGroup_DisplaySceneView_1.png
    283 x 380 - 30K
    Post edited by Syrus_Dante on
  • IsaacNewtonIsaacNewton Posts: 1,274

    It looks like the Scene View is still refering to the clothing and not to everything else, so when I select Visible OFF, only the clothing disappears.

    So the question is how do I get the "Scene View" to refer to the selected items and not the one unselected item (the clothing)?

     

  • IsaacNewtonIsaacNewton Posts: 1,274

    By making everything except the clothing invisible I can export the clothing only. So, the trick will be to make everything in a scene invisible except the selected item....

  • Syrus_DanteSyrus_Dante Posts: 983
    edited December 2017

    Odd... I can't get this to work; the object I'm exporting appears to be everything except the clothing.

    OK? I thought this is the easiest step by step instruction I can give...I've Edit my 1st post to make it clear what should happen after the steps.

    2. right-click on the Scene pane and select Select>Invert Selection from the menu or press Ctrl+Shift+I

    Dont forget this 2nd step that I think is a real timesaver.

    Unlike other programs the DazStudio OBJ export just exports everything visible (with Ignore Invisible Nodes checked) in the scene and dont care about what you have selected before.

    Maybe just click visible off one by one for everything you dont want to export - this may be easier - this is done by clicking the eye symbol in the Scene pane where it says V|S|Node.

    Once you only see the clothing in the scene do the export with Base Geometry resolution!

     

    Post edited by Syrus_Dante on
  • IsaacNewtonIsaacNewton Posts: 1,274

    "OK? I thought this is the easiest step by step instruction I can give...I've Edit my 1st post to make it clear what should happen after the steps.

    2. right-click on the Scene pane and select Select>Invert Selection from the menu or press Ctrl+Shift+I

    Dont forget this 2nd step that I think is a real timesaver."

    The instruction is clear, no problem there. The problem is that although the clothing is the only thing not selected in the Scene Pane, in the Parameters Pane, the "Display>Scene View" refers to the clothing and not the other items in the scene. I cannot see one "Display>Scene View" option for all the selected items.

  • Syrus_DanteSyrus_Dante Posts: 983
    edited December 2017

    I cannot see one "Display>Scene View" option for all the selected items.

    Oh sorry - I just checked what caused this issue you had.

    I didnt thought of the "Consolidate Properties" option switch that you can find in the Options Menu of the Parameters pane.

    I have it on / checked by default. Now you should see the number of items you have selected in the brackets () in front of your Property to manipulate them all by one click (works also with morph sliders) for all selected Items. See the screenshot for details.

    Parameters_ConsolidateProperties_1.png 510 x 264 - 42K

     

    [PS] I've Edited my 1st Post to make this a clear instruction:

    3. check if "Consolidate Properties" is enabled / checked in the Parameters pane Options Menu - then go to Parameters pane PropertyGroup: Display>Scene View and switch the "(number) Visible" Property to OFF for all selected Items at once - Now only the clothing Item should be visible

     

    [Edit_1]: If you want to have an overview of the toggle Actions like "Consolidate Properties" on screen just add these Actions to some of your Toolbars - here you can see MyToolbar_Main:

    @ The single most useful feature needed in the next Daz Studio

    I've also added this Keyboard Navigation toggle Action to my toolbar to see if it is on or off.

    More Info here: How to Customize Daz Studio - to speed up Workflow!? [WIP]

    Parameters_ConsolidateProperties_1.png
    510 x 264 - 42K
    Post edited by Syrus_Dante on
  • Syrus_DanteSyrus_Dante Posts: 983
    edited December 2017

    Other examples from this forum where people asking for a better option to save Pose Presets without to allways select everything by their own in the save dialouge:

    Home » Public » Software » Daz Studio » v4.x » Reference Guide » User Interface (UI) » Action » Action Index » Save Script

    Save Script

    Default Shortcut(s)

    • Windows : Ctrl + S

    • Mac : Cmd + S

    Post edited by Syrus_Dante on
  • Thanks yes

    It makes me wonder that no one at DAZ thought .."Wouldn't it be a good idea to have this basic function available as a one click option?"  frown

    http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/file_io/export_obj_silent/start

  • Thanks yes

    It makes me wonder that no one at DAZ thought .."Wouldn't it be a good idea to have this basic function available as a one click option?"  frown

    There is in fact a sample script available to do just this http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/file_io/export_obj_silent/start

  • Syrus_DanteSyrus_Dante Posts: 983
    edited December 2017

    Thanks for the API References.
    I've picked my favourit options - now I just have to edit them to true - right? - save the "Silent OBJ Export.dsa" script and Customize my shortcuts for Silent OBJ Export : Ctrl+E

    eg. you can have a "SilentSelected_OBJ-Export.dsa" - edit the first line "oSettings.setBoolValue( "SelectedOnly", true );" - Ctrl+S - Done laugh as I see it isnt that complicated.

    --------------------------------------------------------------------------------	// Do not limit export to selection	oSettings.setBoolValue( "SelectedOnly", false );--------------------------------------------------------------------------------	// Do not export items that are parented to the selection	oSettings.setBoolValue( "IncludeParented", false );--------------------------------------------------------------------------------	// Do not ignore the geometry of invisible nodes	oSettings.setBoolValue( "IgnoreInvisible", false );--------------------------------------------------------------------------------	// Do not remove vertices that are floating, connected to nothing - i.e. LOD	oSettings.setBoolValue( "RemoveUnusedVerts", false );

     

    Post edited by Syrus_Dante on
  • But I cant find anything like "oSettings.setBoolValue( "Resolution Level:Base", true );" in it to set the Geometry resolution for silent Export.

  • I'm not sure where that would be, it should be findable by iterating over the members of oSettings ( for var n in oSettings ) { print ( n ) }; ) but for this you could also find the property on the object, get its value, set it to base, export, and restore the original value.

  • IsaacNewtonIsaacNewton Posts: 1,274

    Thanks very much Syrus, this is most helpful.

    I really think that DAZ should make this a basic one click option "Export this figure only, with modifications." rather than having to make sure half a dozen options in defferent sub menus are checked or unchecked.

    Unfortunately compatability with high end software like Maya that is used by a small percentage of DS users, seems to be a higher priority!

    Thanks yes

    It makes me wonder that no one at DAZ thought .."Wouldn't it be a good idea to have this basic function available as a one click option?"  frown

    http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/file_io/export_obj_silent/start

    Sorry, I'm not a programmer, I don't understand a word of that.

  • IsaacNewtonIsaacNewton Posts: 1,274

    Thanks yes

    It makes me wonder that no one at DAZ thought .."Wouldn't it be a good idea to have this basic function available as a one click option?"  frown

    There is in fact a sample script available to do just this http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/file_io/export_obj_silent/start

    OK, there is a script to do this, so how difficult would it be to include a button/option in the export dialogue box to just export the selected object as it is currently shown on the screen? I'm sure I'm not the only one who would find that useful.

  • Thanks yes

    It makes me wonder that no one at DAZ thought .."Wouldn't it be a good idea to have this basic function available as a one click option?"  frown

    There is in fact a sample script available to do just this http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/file_io/export_obj_silent/start

    OK, there is a script to do this, so how difficult would it be to include a button/option in the export dialogue box to just export the selected object as it is currently shown on the screen? I'm sure I'm not the only one who would find that useful.

    Download the script and put it somewhere you can find it in your content directory (e.g. in /Scripts/Utilities). Find the script in the Content Library, right-click, and select Create Custom Action - this will add the command to the Scripts menu, and create the Scripts menu if necessary. You can now use Window>Workspace>Customise to move it to a different menu if desired.

  • Syrus_DanteSyrus_Dante Posts: 983
    edited December 2017

    @IsaacNewton

    As far as I understand this Silent_OBJ_Export.dsa script can be used as a template to write your custom Presets for the OBJ Export Options predefined Settings.

    You just have to change some of the Settings in these lines "oSettings.setBoolValue(..., false);" to say true or the other way around - to control what Settings are choosen in the Custom OBJ Export Options.

    @Richard Haseltine

    • Althoug it says Silent in the title the script prompts for file name path default OS dialogue and also shows the OBJ Export Options by default in its current form - I wonder if its controlled by these lines:
    //oSettings.setIntValue( "RunSilent", 1);		//predefine RunSilent = 1 : yes?//********************************************************************************// Define whether or not to show the options after prompting for a fileoSettings.setIntValue( "RunSilent", (bShowOptions && !bOptionsBeforeFile ? 0 : 1) );		//there must be a Silent "bShowOptions" switch set - to avoid the default OS save file prompt?//********************************************************************************

     

    • I have reWritten the dialogue title to show what custom Export Preset is loaded by the script - My dialogue Title "Custom OBJ Export - Selected - Delete Loose Verts" unfortunatly the title dosnt change.
            //********************************************************************************	//String( "Custom Export : %1 : %2" )		//original	String( "Custom OBJ Export - Selected - Delete Loose Verts : %1 : %2" )	//Customized title bar caption	//********************************************************************************
    • And here is my complete custom script "Export-OBJ_Silent-Selected-DelLooseVerts.dsa" my modification of the original Silent_OBJ_Export.dsa script:

    /********************************************************************** 	Copyright (C) 2002-2017 Daz 3D, Inc. All Rights Reserved. 	This script is provided as part of the Daz Script Documentation. The	contents of this script, and\or any portion thereof, may only be used	in accordance with the following license: 	Creative Commons Attribution 3.0 Unported (CC BY 3.0)	- http://creativecommons.org/licenses/by/3.0 	To contact Daz 3D or for more information about Daz Script visit the	Daz 3D website: 	- http://www.daz3d.com	**********************************************************************	Modification of the original "Silent_OBJ_Export.dsa" Script Example**********************************************************************		FileName: Export-OBJ_Silent-Selected-DelLooseVerts.dsa	- added comments and [lines:*********] to modified Export Option Settings	- IgnoreInvisible : true	- RemoveUnusedVerts : true	- SelectedOnly : true	by Syrus_Dante 2017-12-14 **********************************************************************/// Source: http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/file_io/export_obj_silent/start// Define an anonymous function;// serves as our main loop,// limits the scope of variables(function(){		// Get the primary selection to use for the file name	var oNode = Scene.getPrimarySelection();	// If something is selected	if( oNode ){		// Get the node's skeleton		var oSkeleton = oNode.getSkeleton();		// If it has a skeleton		if( oSkeleton )	{			// That is the node we want for the name			oNode = oSkeleton;		}	}		// Get the export manager	var oExportMgr = App.getExportMgr();	// Define the class name the for Wavefront Object (*.obj) exporter	var sClassName = "DzObjExporter";	// Find the exporter	var oExporter = oExportMgr.findExporterByClassName( sClassName );	// If the exporter exists	if( oExporter ){		// Create a settings object		var oSettings = new DzFileIOSettings();				// Fill the settings object with the default options from the exporter		//oExporter.getDefaultOptions( oSettings );				// Define whether or not to show options		var bShowOptions = true;				// Define whether or not to show options before prompting for a path;		// requires 4.9.3.22 or later		var bOptionsBeforeFile = (bShowOptions && App.version64 >= 0x0004000900030016);				// Get the options for the exporter		if( !oExporter.getOptions( oSettings, bShowOptions && bOptionsBeforeFile, "" ) ){			// We're done...			return;		}				// Debug		//print( oSettings.toJsonString() );				// Set the desired settings for the exporter		//oSettings.setStringValue( "Preset", "Poser (1 unit = 8ft)" );				//********************************************************************************		// Set the scale to write the data		oSettings.setFloatValue( "Scale", 100 );	//Preset: DAZ Studio (1 unit = 1 cm)		//********************************************************************************		// Set the lateral axis to X		oSettings.setStringValue( "LatAxis", "X" );		// Set the vertical axis to Y		oSettings.setStringValue( "VertAxis", "Y" );		// Set the depth axis to Z		oSettings.setStringValue( "DepthAxis", "Z" );		// Do not invert the lateral axis		oSettings.setBoolValue( "InvertLat", false );		// Do not invert the vertical axis		oSettings.setBoolValue( "InvertVert", false );		// Do not invert the depth axis		oSettings.setBoolValue( "InvertDepth", false );		//********************************************************************************		// Do not ignore the geometry of invisible nodes		oSettings.setBoolValue( "IgnoreInvisible", true );	//Ignore Invisible is checked		//********************************************************************************		// Do not weld seams between parent and child bones on legacy figures - deprecated		oSettings.setBoolValue( "WeldSeams", false );		//FALSE keep the Geometry one continues mesh - Poser backward compatibility option?		//********************************************************************************		// Do not remove vertices that are floating, connected to nothing - i.e. LOD		oSettings.setBoolValue( "RemoveUnusedVerts", true );	//TRUE keep the Geometry clean - we dont want to have any floating vertices		//********************************************************************************		// Write vertex textures - UVs		oSettings.setBoolValue( "WriteVT", true );		//FALSE not needed for simple morph shapes / but needed if you want to have & edit textures & UV-Layout in some external editor - makes the output file bigger		//********************************************************************************		// Do not write vertex normals		oSettings.setBoolValue( "WriteVN", false );		//FALSE not needed for simple morph shapes / if just vertex position for the morph shape is needed - makes the output file bigger		//********************************************************************************		// Do not write object statements for each root node - i.e. figures, props		oSettings.setBoolValue( "WriteO", false );				// Write facet groups		oSettings.setBoolValue( "WriteG", true );		//TRUE keep Face Groups to edit Geometry		// Write facet groups according to whatever the geometry already has		oSettings.setBoolValue( "GroupGeom", true );		// Do not write facet groups according to the node it is associated with		oSettings.setBoolValue( "GroupNodes", false );		// Do not write facet groups according to surface groups		oSettings.setBoolValue( "GroupSurfaces", false );		// Do not write one facet group		oSettings.setBoolValue( "GroupSingle", false );				// Write surface groups		oSettings.setBoolValue( "WriteUsemtl", true );				// Do not write a material library		oSettings.setBoolValue( "WriteMtllib", false );		// Do not collect texture maps		oSettings.setBoolValue( "CollectMaps", false );		// Do not convert texture maps		oSettings.setBoolValue( "ConvertMaps", false );				// If the version is 4.5.0.114 or newer		if( App.version64 >= 0x0004000500000072 ){			//********************************************************************************			// Do not limit export to selection			oSettings.setBoolValue( "SelectedOnly", true );		//Selected Only will only export the currently selected (single/multible) Item(s) in the Daz Studio Scene			//********************************************************************************			// Do not limit export to the selected roots			oSettings.setBoolValue( "SelectedRootsOnly", false );			// Do not limit export to the primary selected root;			// this setting overrides SelectedRootsOnly			oSettings.setBoolValue( "PrimaryRootOnly", false );			// Do not export items that are parented to the selection			oSettings.setBoolValue( "IncludeParented", false );			// Do not triangulate n-gons			oSettings.setBoolValue( "TriangulateNgons", false );		}				// If the version is 4.9.3.22 or newer		if( App.version64 >= 0x0004000900030016 ){			// Do not collapse UVs Tiles			oSettings.setBoolValue( "CollapseUVTiles", false );						// Show individual settings in the dialog			oSettings.setBoolValue( "ShowIndividualSettings", true );		}		//oSettings.setIntValue( "RunSilent", 1);		//predefine RunSilent = 1 : yes?		//********************************************************************************		// Define whether or not to show the options after prompting for a file		oSettings.setIntValue( "RunSilent", (bShowOptions && !bOptionsBeforeFile ? 0 : 1) );		//there must be a Silent "bShowOptions" switch set - to avoid the default OS save file prompt?		//********************************************************************************				// Debug		//print( oSettings.toJsonString() );				// If we've got a node, construct the path using the		// exporter's last path, the node's name, and the		// exporter's extension...		// Otherwise, just use the exporter's last path		//********************************************************************************		//%1 = last used Path / %2 = Node Name . %3 = File extension		//********************************************************************************		var sInitialPath = ( oNode ?				String( "%1/%2.%3" )					.arg( oExportMgr.getExportPath() )					.arg( oNode.name )					.arg( oExporter.getExtension() ) :				oExportMgr.getExportPath() );				// Prompt the user to choose a file,		// use the exporter to build the title bar caption,		// the initial path and the filter		//********************************************************************************		var sPath = FileDialog.doFileDialog( false,		//TRUE prompt user ask for File name and save location?		//********************************************************************************			//String( "Custom Export : %1 : %2" )		//original			String( "Custom OBJ Export - Selected - Delete Loose Verts : %1 : %2" )		//Customized title bar caption			//********************************************************************************				.arg( oExporter.getDescription() )				.arg( oSettings.getStringValue( "Preset" ) ),			sInitialPath,			String( "%1 (*.%2)" )				.arg( oExporter.getDescription() )				.arg( oExporter.getExtension() ) );				// If the user didn't cancel and the file doesn't already		// exist, or the user wants to overwrite it		if( sPath && MainWindow.checkExistingFile( sPath ) ){			// Write the file using the options specified			oExporter.writeFile( sPath, oSettings );		}				// Clean up; don't leak memory		oExporter.deleteLater();	// We didn't find an exporter with the class name we wanted	} else {		// Inform the user		MessageBox.critical( qsTr("An exporter with the class name \"%1\" " +			"could not be found.").arg( sClassName ),			qsTr("Critical Error"), qsTr("&OK") );	}	// Finalize the function and invoke})();

     

    Post edited by Syrus_Dante on
  • Syrus_DanteSyrus_Dante Posts: 983
    edited December 2017
    But I cant find anything like "oSettings.setBoolValue( "Resolution Level:Base", true );" in it to set the Geometry resolution for silent Export

    I think I found it: "oShape.findProperty("lodlevel")" but I dont know how to switch the value from "High Resolution" to "Base"?

     

    Post edited by Syrus_Dante on
  • Syrus_DanteSyrus_Dante Posts: 983
    edited December 2017

    Althoug it says Silent in the title the script prompts for file name path default OS dialogue and also shows the OBJ Export Options by default in its current form - I wonder if its controlled by these lines:

    OK. Sorry I just had a second look over the script - now I found it:

    //********************************************************************************// Define whether or not to show options//var bShowOptions = true;   //originalvar bShowOptions = false;   //FALSE: the script runs Silent the last used path is used and the Label/Name? of the selected Item is used for filename//********************************************************************************

    But I dont like it to pick the last used folder - you never knew which it was the last time you exported a OBJ manualy - can we have a predefined Path / Filename to save our OBJ files in silent mode or preselected them in the Save File dialogue?

    Post edited by Syrus_Dante on
  • IsaacNewtonIsaacNewton Posts: 1,274

    Althoug it says Silent in the title the script prompts for file name path default OS dialogue and also shows the OBJ Export Options by default in its current form - I wonder if its controlled by these lines:

    OK. Sorry I just had a second look over the script - now I found it:

    //********************************************************************************// Define whether or not to show options//var bShowOptions = true;   //originalvar bShowOptions = false;   //FALSE: the script runs Silent the last used path is used and the Label/Name? of the selected Item is used for filename//********************************************************************************

    But I dont like it to pick the last used folder - you never knew which it was the last time you exported a OBJ manualy - can we have a predefined Path / Filename to save our OBJ files in silent mode or preselected them in the Save File dialogue?

    Being able to save the object to a user specified folder at time of export is a must!

  • I once found how to acces all the possible path locations DazStudio knows about your content directories and user paths and such. I had a second look lately and I coudn't find them anymore. I should have bookmarked those. Possible locations I've allready looked.

    API Reference » Object Index » DzSaveFilterMgr

    API Reference » Object Index » DzFileDialog

    API Reference » Object Index » DzExportMgr

    String : getExportPath()

    Return Value:

    • The current default directory that files are exported to.

    There are much more directories DazStudio has acces to like the path the current scene file is saved to for example. I think you can even acces the current windows user documents path and such.

    Nevermind I found them, they are members of the DzApp class. It can help to search the

    API Reference » Object Index some times =)

    Those functions return the possible save path as a string. You can construct some save path with the Current Author name as a sub folder for example.

    API Reference » Object Index » DzApp

     

    String getDataFolderName ()
    String getDataFolderPath ()
    String getDataFolderPathBase ()
    String getDAZDataPath ()
    String getGeneratedScriptsPath ()
    String getGeneratedShadersPath ()

    String getHomePath ()

    String getLoadSavePath ()

    String getPluginsPath ()
    String getProgramDataPath ()
    String getScriptsPath ()
    String getShadersPath ()
    String getTempPath ()
    String getTempRenderFilename ()
    String getUtilitiesPath ()

    Boolean setTempPath ( String tempPath )

     void restoreDefaultTempPath ()

Sign In or Register to comment.