User Tools

Site Tools


Samples

This page is a WIP. There is likely to be incomplete and or missing information while the page is being built.

Several sample scripts are provided below to illustrate some of the most common methods of extending Daz Studio and to help get you started developing your own scripts. You are free to modify, and use the scripts for yourself. You may not redistribute any portion or derivation of the samples, without prior written permission from Daz 3D. Please see the End User License Agreement for full details.

General

Timing

  • Single-Shot Timeout - The source of a script that will allow you to create a single-shot timer that executes a function when that timer reaches its predefined duration
  • Wait For Background Progress - The source of a script that will allow you to 'pause' a script while background progress is active

General Interface

  • Simple Input Dialog - The source for a script that displays an input widget within a simple dialog that has the standard button layout found throughout DAZ Studio, and reacts according to whether the user accepts or cancels.
  • Simple Image Dialog - The source for a simple script that displays an image within a standard dialog.
  • widget_test - The source for a simple script that tests various aspects of the widget types.
  • Progress - The source for a simple script that causes a modal progress dialog to be displayed and report progress.
  • Background Progress - The source for a simple script that causes the background_progress indicator to be displayed in the Status Bar and report progress.
  • Display Document - The source for a simple script that will dynamically locate a document in a mapped content directory and then prompt the OS to perform its default handling of the file.
  • Copy UI from Channel - The source for a script that will copy the interface of another channel (i.e., General Release, Public Build, Publishing Build, Private Build, Dev Build) to the channel of the executing build.

Specific Interface

Education/Assistance

  • Guide Pages - An overview of the concept behind Guide Pages, and the folder/files used to implement the concept.
  • Tip Pages - An overview of the concept behind Tip Pages, and the folder/files used to implement the concept.
  • Lesson Strips - An overview of the concept behind the Lesson Strips, and the folder/files used to implement the concept.
  • Interactive Lessons - An overview of the Interactive Lesson concept.

Metadata

Stores

  • Add Store Id - The source of a script that will add a StoreId to the database so that metadata that defines a product associated with that StoreId can be imported and ultimately show up within the database driven content views
  • Remove Store Id - The source of a script that will remove a StoreId from the database
  • Store Info - The source of a script that will list information about the StoreIds in the database

Products

  • List Products - The source for a script that will list products in the database.

Assets

  • Asset Categories - The source of a script that will list all of the categories that an asset is assigned to.

File Input/Output

Asset IO Save Filters

Support Assets

Setting Discovery

  • Importer Settings - The source of a script that will allow you to inspect the script accessible settings of all importers.
  • Exporter Settings - The source of a script that will allow you to inspect the script accessible settings of all exporters.

OBJ Import/Export

  • Silent OBJ Import - An example of how to import a Wavefront Object (*.obj), without displaying the importer settings dialog.
  • Silent OBJ Export - An example of how to export a Wavefront Object (*.obj), without displaying the exporter settings dialog.

FBX Import/Export

  • Silent FBX Import - An example of how to import an Autodesk FBX file, without displaying the importer settings dialog.
  • Silent FBX Export - An example of how to export an Autodesk FBX file, without displaying the exporter settings dialog.

Poser Export

  • Export TriAx to Poser - An example of how to export a TriAx Weight Mapped figure (i.e. Genesis) to Poser 9 and/or Pro 2012, without displaying the settings dialog for the Poser Character (*.cr2) exporter or the Wavefront Object (*.obj) exporter.

Conversion

  • DSA Converter - The source for a simple DAZ Script that will convert ascii scripts (*.dsa) to their binary (*.dsb) or encrypted (*.dse) counterpart.

Listing

  • File Listing - The source for a simple DAZ Script that will recursively list the files in a folder.

Directory Mapping

  • Save Mapped Paths - The source for a simple DAZ Script that produces another script that will clear any currently mapped content directories and subsequently set the mapped content directories to those that were mapped at the time the script was saved.
  • Install Manager Config (from DAZ Studio) - The source for a DAZ Script that parses information from an .ini file, converts it into a JSON object, provides a dialog that allows a user to select options that modify the data, and then converts the data back into its original form as it writes it back to the .ini file.
  • Install Manager Config (to DAZ Studio) - The source for a DAZ Script that parses information from an .ini file, converts it into a JSON object, provides a dialog that allows a user to select options for importing the data, and then modify the application settings to incorporate the data.

Actions

  • Action Accelerators - The source of a script that will list the keyboard accelerators (aka “shortcuts”) for all known actions in a modal dialog.
  • Find Action Classname - The source of a script that will find the classname of an action using its label.
  • Action Trigger - The source of a script that will trigger an action.

Elements

  • post_load_file_data_item - The source of a script that will store data on an element and cause a file to be loaded after that element has been loaded.
  • Post-Load Script Data Item - The source of a script that will store data on an element and cause a script to be executed after that element has been loaded, with the additional option of configuring how that script runs using stored settings.

Nodes

  • Create Instance - The source of a script that will create an Instance.
  • Create Instance Group - The source for a script that will create an Instance Group of like siblings.
  • Create Geometry Shell - The source of a script that will create a Geometry Shell and set the offset distance of the Push Modifier.
  • Convert Figure to Props - The source for a script that will convert a complete figure into a collection of props, without any exporting/importing.
  • Node FaceGroup Map - The source for a script that will reveal the face group on a mesh that is associated with a given node; used to provided node selection in the viewport using the geometry for the object.

Materials

  • Deep Copy - The source for a script that will perform a deep copy of one material to another.
  • Select by Tag - The source for a script that will select materials that have a particular tag.

Properties

  • Node Properties - The source of a script that will allow you to access all properties associated with a given node.
  • Node Property Presentations - The source of a script that will allow you to change colors used by all properties associated with a given node.
  • Node Property Sliders - The source of a script that demonstrates how to dynamically create sliders for specific properties associated with a given node.
  • Material Properties - The source of a script that will allow you to access all properties associated with a given material.
  • set_property_groups - The source for a script that will arrange specific properties into groups.

Geometry

  • Geometry Info - The source for a script that will print geometry information for the selected node.
  • generate_cube - The source for a script that will generate a geometric cube, demonstrating use of the geometry pipeline.
  • generate_cylinder - The source for a script that will generate a geometric cylinder, demonstrating use of the geometry pipeline.
  • generate_cone - The source for a script that will generate a geometric cone, demonstrating use of the geometry pipeline.
  • Generate Sphere - The source for a script that will generate a geometric sphere, demonstrating use of the geometry pipeline.
  • generate_torus - The source for a script that will generate a geometric torus, demonstrating use of the geometry pipeline.
  • Generate Plane - The source for a script that will generate a geometric plane, demonstrating use of the geometry pipeline.

Images

Core Functionality

Tools

  • calculator - The source for a calculator, written completely using DAZ Script' intrinsic types.

Utilities

  • Version Conversion - The source for a script that will convert a DAZ Studio version string into its 32 and 64 bit hexadecimal and decimal values.

Custom Shaders

Presets

Material Definitions

Shader Definitions

  • constant_shader_definition - The source for a shader definition script, a support file required by the Material Definition sample linked above, that builds the properties accessible to users, in the UI, via the Surface tab.
  • example_shader_definition - The source for an example shader definition script, showing property creation for passing tokens to the shader and alternatively for use in setting attributes via the rendertime script(s).

Shaders

  • constant_surface_shader - The RenderMan Shading Language (RSL) source for the standard RenderMan Constant Surface Shader.

Render-Time

  • default_rendertime_script - The source for a render time script, a support file required by the sample linked above, that sets object attributes.

Rendering

General

  • Render Settings - Find Property - The source for a script that will allow you to retrieve a property displayed in the Render Settings pane, for the active renderer, using its name so that you can then modify its value.
  • Render To RIB - The source for a script that will allow you to “render” to a RenderMan® Interface Bytestream (RIB) file.
  • Render To Backdrop - The source for a script that will allow you to render to an image that is immediately set as the backdrop.
  • Render To Viewport - The source for a script that will allow you to render to the viewport.
  • Render To Asset Icon - The source for a script that will allow you to render to the icon for the asset(s) selected in the Content Library pane.
  • Calculate Field of View (FOV) - The source for a script that will calculate the FOV of the camera for the active viewport.

Scripted Renderer

Remote Operation

  • Sub Script - The source for a script that remotely executes another script, passing in predefined arguments to control the operation of the target script.
  • Figure Metrics - No Dialog - The source for a script that remotely executes the Figure Metrics script, included as part of the Measure Metrics product, by passing in predefined arguments to control the operation of the script without displaying its dialog.