Python Developer's Guide

Interfacing with ShaderSpider

ShaderSpider contains many useful functions that you may wish to call upon from your own Wacros. While you may not copy code from ShaderSpider, you can access it as a module to use in other PoserPython scripts.

To access ShaderSpider's developer's module, ss6Dev, add this to your wacro's code:

import os, sys
sys.path.append(os.path.join("Runtime","Python","PoseWorks","ShaderSpider","Data"))
import ss6Dev


ss6Dev Objects


PresetDir
    This is the default directory for SS6 material group presets.


FXDir
    This is the default directory for FX6 partial shaders.


ss6Dev Functions


AskMaterials(<optional FigureType> figure)
    Returns a list of <MaterialType> materials (from figure's materials) that are selected using ShaderSpider's Material Selection window.

    figure defaults to the current figure.


CopyTo(<optional MaterialType> from_material, <optional ListType> to_materials)
    Applies settings from from_material to each <MaterialType> in to_materials.

    from_material defaults to the currently selected material.

    to_materials defaults to all materials on the current figure.


CopyToAll()
    Applies the current material to all materials on the current figure.


CopyToMap(<StringType> map, <optional FigureType> figure)
    Applies the current material's settings to all materials in the mapping group, map.

    figure defaults to the current figure.


CopyToSurface(<StringType> surface, <optional FigureType> figure)
    Applies the current material's settings to all materials in the surface group, surface.

    figure defaults to the current figure.


GetMatchingMaterials(
<FigureType> figure, <StringType> *keywords)
    Returns a list of <MaterialType> materials from figure that match any keywords.

    For example, GetMatchingMaterials(Victoria3, "lip", "nos") would return a list comprised of the Lips material and the Nostrils material.


LoadFX6(<StringType> loadpath, <optional ListType> materials)
    Applies the partial shader found at loadpath to each <MaterialType> in materials.

    materials defaults to a list of the current figure's materials.


Runtime(<StringType> filepath)
    Returns the Poser-formated version of string filepath.

    For example, Runtime("C:/Program Files/Poser 6/Runtime/Textures/myTexture.tif") returns ":Runtime:Textures:myTexture.tif"


SaveMATPose(<optional StringType> filepath, <optional FigureType> figure, <optional ListType> materials)
    Saves three MAT poses: One optimized for Poser 4/Artist, one for Poser Pro Pack and one for Poser 5/6, and then returns the three file paths as a tuple.

    filepath is the basic path of the poses.
    For example, "Poses/myMatPose.pz2" results in "Poses/myMatPose P4.pz2", "Poses/myMatPose PP.pz2", and "Poses/myMatPose P5_P6.pz2".

    figure is the figure to save the pose from. This defaults to the current figure.

    materials is a list of material objects, like one you would get from figure.Materials(). It defaults all of the figure's materials.


SaveFX6(<StringType> savepath, <ListType> from_inputs, <optional MaterialType> material)
    Saves a partial shader (FX6 file) to path savepath, including only the <InputType> objects listed in from_inputs that are a part of material's shader tree.

    material defaults to the currently selected material.


SmartCopyToEyes()
    Applies the current materials setting to all discernable eye materials on the current figure.


SmartCopyToHair()
    Applies the current materials setting to all discernable hair materials on the current figure.


SmartCopyToSkin()
    Applies the current materials setting to all discernable skin materials on the current figure.


Remember

You can use and distribute scripts you create that make use of ss6Dev, but you cannot redistribute ss6Dev or any of the files that come with ShaderSpider. Otherwise, you may distribute any wacros, FX6 or SS6 files that you create using ShaderSpider in any manner you see fit.