User Tools

Site Tools


Samples

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. These samples are provided for use under the CC Attribution 3.0 Unported license. All works derived from these samples must adhere to the terms of the license.

Each script in the samples section provides a linked title above the body of the script. Clicking this title will prompt you to choose a location and a file name to save the sample to. The saved file will include a copyright/license statement and the URL for the page that the sample came from near the top.


General

Timing


General Interface

  • Simple Input Dialog - Displays an input widget within a simple dialog that has the standard button layout found throughout the application, and reacts according to whether the user accepts or cancels.
  • Simple Image Dialog - Displays an image within a standard dialog.
  • Simple Composite Image Dialog - Displays a composite image within a standard dialog.
  • Simple Image Map Dialog - Displays an image that allows detecting interaction with pixels, a standard dialog.
  • Simple Text Browser Dialog - Displays a text browser within a simple dialog that has a slightly modified version of the standard buttons found on dialogs throughout the application.
  • widget_test - Tests various aspects of the various widget types.
  • Display Document - Dynamically locates a document in a mapped content directory and then prompts the OS to perform its default handling of the file.
  • Copy UI from Channel - Copies 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

  • Environment Backdrop Dialog - Causes the Environment pane to be shown; if docked or shown the pane is shown in place, otherwise the pane is shown in a non-modal dialog.
  • Face Transfer Settings - Displays/Edits the application settings supported by the Face Transfer (WIP) pane for overriding which assets to load (per supported figure generation/gender) when a figure is not selected, when applying a Material(s) Preset, and/or during a save operation.

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 - Adds 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 - Removes a StoreId from the database.
  • Store Info - Lists information about the StoreIds in the database.

Products

Categories

Compatibility Bases


File Input/Output

Save Filters

  • Save Filter Template Save - Demonstrates how to save the settings of a save filter to a JSON file.
  • Save Filter Template Apply - Demonstrates how to read recorded settings for a save filter from a JSON file and use them to control saving from that save filter.
  • Save Filter Template Batch - Demonstrates how to read recorded settings for a save filter from a JSON file and use them to batch control saving from that save filter.

Support Assets

Importers

  • Importer Settings - Allows you to inspect the script accessible settings of each importer.
  • Silent OBJ Import - Imports a Wavefront Object (*.obj), without displaying the importer settings dialog.
  • Silent FBX Import - Imports an Autodesk FBX file, without displaying the importer settings dialog.
  • Silent OBJ Morph Loader Import - Uses the Wavefront Object (*.obj) importer to provide options for loading a directory full of morph targets and control the Morph Loader Pro plugin without displaying the its option dialog.

Exporters

  • Exporter Settings - Allows you to inspect the script accessible settings of each exporter.
  • Silent OBJ Export - Exports a Wavefront Object (*.obj), without displaying the exporter settings dialog.
  • Silent FBX Export - Exports an Autodesk FBX file, without displaying the exporter settings dialog.
  • Export TriAx to Poser - Exports a TriAx Weight Mapped figure (e.g., 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 - Converts ascii scripts (*.dsa) to their binary (*.dsb) or encrypted (*.dse) counterpart.

Locating

  • File Listing - Recursively lists the files in a folder.
  • List Relative Paths - Lists the relative paths of files across mapped content directories.
  • File Find - Find the absolute path of a content file using a relative path.

Copying

  • File Copying - Recursively lists files in a folder (e.g., Figure Metrics configuration files, part of the Measure Metrics product) and recursively copies them to another folder.

Archives

  • Zip List Entries - List the entries contained within a zlib compressed (*.zip) archive.
  • Zip Compress All - Collect the entire contents of a directory into a zlib compressed (*.zip) archive.
  • Zip Compress Each - Collect individual files into a zlib compressed (*.zip) archive.
  • Zip Extract All - Extract the entire contents of a zlib compressed (*.zip) archive.
  • Zip Extract Each - Extract each file individually from a zlib compressed (*.zip) archive.

Directory Mapping

  • Save Mapped Paths - 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) - 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) - 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 - Lists the keyboard accelerators (aka “shortcuts”) for all known actions in a modal dialog.
  • Find Action Classname - Finds the classname of an action using its label.
  • Action Trigger - Demonstrates how to trigger an action, with and without settings to control the behavior of the action.
  • Action Menu Submenu - Creates a hierarchical submenu with a specified path if it does not exist, or finds a submenu at a specified path if it does exist, and positions the submenu within the parent menu immediately below a specified action or menu.

View Tools


Elements

  • Remove Prefixed Data - A script that walks the scene looking for data (in the form of nodes, properties, and element data items), and removes them.

Post-Load Data Items

  • Post-Load Script Data Item Add - A script that stores data on an element in the scene, which when re-loaded causes a script to be executed, and uses settings embedded in the data item to control how.
  • Post-Load Script Data Item Read - A companion script to the script above that executes after the element has been loaded and uses settings embedded in the data item to control its execution.
  • Post-Load View Proxy Create - A script that creates proxy nodes in the scene for each of the predefined view cameras, creates several properties on the proxy nodes that correspond with properties on the view cameras and links the properties on the view cameras to the corresponding properties on the proxy nodes. The script also embeds post-load data on each proxy node which causes a script to be executed after that node has been loaded into the scene in order to re-establish the links between the properties which are not otherwise saved.
  • Post-Load View Proxy Link Properties - A companion script to the script above that executes when a proxy node has been loaded and uses settings embedded in the post-load data item to re-establish links between its properties and the corresponding properties on the corresponding view camera.
  • Post-Load Material Proxy Create - A script that creates proxy properties on a node for a given set of properties on a surface and links the properties on the surface to the corresponding properties on the node, so that the surface properties can be animated. The script also embeds post-load data on the node which causes a script to be executed after that node has been loaded into the scene in order to re-establish the links between the properties which are not otherwise saved.
  • Post-Load Material Proxy Link Properties - A companion script to the script above that executes when a node has been loaded and uses settings embedded in the post-load data item to re-establish links between proxy properties on the node and the corresponding properties on the surface.

Post-Load Callbacks


Nodes

  • Create Instance - Creates an Instance of the primary selected object in the scene.
  • Create Instance Group - Creates an Instance Group of the primary selected Instance in the scene and any Instance siblings with the same target and mode.
  • Create Geometry Shell - Creates a Geometry Shell of the primary selected object in the scene and sets the offset distance of the Push Modifier that is automatically added.
  • Convert Figure to Props - Converts a complete figure into a collection of props, without any exporting/importing.
  • Node FaceGroup Map - Reveals the face group on a mesh that is associated with a given node; used to provide node selection in the viewport using the geometry for the object.
  • Adjust Rigging to Shape - Adjusts the positions of a figure's bones based on the difference between the default shape and the current shape.
  • Node Origin Center - Adjusts the origin of a node to the center of its local bounding box.
  • Node Align - Adjusts the positions of nodes in the scene in order to align them according to settings that correspond to those found on the Align (WIP) pane.
  • Node Visibility Toggle - Demonstrates the toggling of a setting (in this case, visibility) on selected nodes.

Materials

  • Deep Copy - Performs a “deep copy” of one material to another.
  • Select by Tag - Selects materials that have a particular tag.

Properties

  • Node Properties - Allows you to access all properties associated with a given node.
  • Node Property Presentations - Allows you to change colors used by all properties associated with a given node.
  • Node Property Sliders - Dynamically creates sliders for specific properties associated with a given node.
  • ERC Freeze - 'Freezes' (links) the current state of numeric properties on a node (or multiple nodes) to a controller property.
  • Material Properties - Allows you to access all properties associated with a given material.
  • Texture Modifier - Creates texture modifiers for material properties with images that cause the color of those images to toggle between normal/inverted.

Geometry

  • Geometry Info - Prints geometry information for the selected node.
  • generate_cube - Generates a geometric cube, demonstrating use of the geometry pipeline.
  • Generate Cylinder - Generates a geometric cylinder, demonstrating use of the geometry pipeline.
  • generate_cone - Generates a geometric cone, demonstrating use of the geometry pipeline.
  • Generate Sphere - Generates a geometric sphere, demonstrating use of the geometry pipeline.
  • generate_torus - Generates a geometric torus, demonstrating use of the geometry pipeline.
  • Generate Plane - Generates a geometric plane, demonstrating use of the geometry pipeline.
  • Geometry Triangulate - Converts geometry constructed of quadrilaterals into geometry constructed of adjacent triangles (both visually and in order of facet indices).
  • Geometry Detriangulate - Converts geometry constructed of adjacent triangles (both visually and in order of facet indices) into geometry constructed of quadrilaterals.

Modifiers

  • spawn_morph - Creates a morph target from the current state of the (base) mesh.
  • list_empty_morphs - Lists the morph targets that have no direct affect on the mesh.

Images



Simulating

  • Simulation Settings - Find Property - Allows you to retrieve a property displayed in the Simulation Settings pane, for the active simulation engine, using its name so that you can then modify its value.
  • Simulate Selected Group - Performs a custom simulation where the only participants are the selected nodes in the scene (and if a group node, all child nodes of the group).

Rendering

General

  • Render Settings - Find Property - Allows 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 Post-Process - Performs a post-processing operation on a render after it has been saved to file.

NVIDIA Iray

Scripted (3Delight) Renderer


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.

Core Functionality


Plugins

  • Plugins Load Config - Sets whether or not specific plugins should load when the application starts.

Tools

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

Utilities

  • Version Conversion - Converts a Daz Studio version string into its 32 and 64 bit hexadecimal and decimal values.

Remote Operation

  • Sub Script - Remotely executes another script, passing in predefined arguments to control the operation of the target script.
  • Symmetrize - No Dialog - Remotely executes the Symmetrize script, silently, by passing in predefined arguments to control the operation of the script without displaying its dialog.
  • Bake To Transforms - No Dialog - Remotely executes the Bake To Transforms script, silently, by passing in predefined arguments to control the operation of the script without displaying its dialog.
  • Figure Metrics - No Dialog - 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.