dna_viewer.builder package

Submodules

dna_viewer.builder.analog_gui module

class dna_viewer.builder.analog_gui.AnalogGui(options: Optional[dna_viewer.config.analog_gui.AnalogGui] = None)[source]

Bases: object

A builder class used for manipulating the AnalogGuiConfig used in the character building process

@type gui_path
Type

str

@param gui_path
Type

The location of the gui file

add_eye_locators() None[source]

Add eye locators to the analog gui

add_eyes() None[source]

Add eyes to the analog gui

build() None[source]

Start building the analog gui

dna_viewer.builder.character module

class dna_viewer.builder.character.Character(dna: dna_viewer.model.dna.DNA, config: Optional[dna_viewer.config.character.Character] = None)[source]

Bases: object

A builder class used for building the character

@type config
Type

CharacterConfig

@param config
Type

The character configuration options used for building the character

build() dna_viewer.builder.character.CharacterBuildResult[source]

Builds the character

class dna_viewer.builder.character.CharacterBuildResult[source]

Bases: object

A class used for returning data after finishing the character build process

@type nodes
Type

Dict[int, List[MObject]]

@param nodes
Type

The PyNode objects created in the build process by LOD number

static create(nodes: Dict[int, List[OpenMaya.MObject]]) dna_viewer.builder.character.CharacterBuildResult[source]

Character creator method returning a character build result object

@type nodes: Dict[int, List[MObject]] @param nodes: The PyNode objects created in the build process by LOD number

nodes: Dict[int, List[OpenMaya.MObject]] = {}

dna_viewer.builder.gui module

class dna_viewer.builder.gui.Gui(options: Optional[dna_viewer.config.gui.Gui] = None)[source]

Bases: object

A builder class used for manipulating the GuiConfig used in the character building process

@type gui_path
Type

str

@param gui_path
Type

The location of the gui file

build() None[source]

Start building the gui

position_gui(group_name: str) None[source]

Sets the gui position to align with the character eyes

dna_viewer.builder.joint module

class dna_viewer.builder.joint.Joint(joints: List[dna_viewer.model.joint.Joint], linear_modifier: float, angle_modifier: float)[source]

Bases: object

A builder class used for adding joints to the scene

@type joints
Type

List[JointModel]

@param joints
Type

data representing the joints

@type linear_modifier
Type

float

@param linear_modifier
Type

The linear modifier that should be applied to the joints

@type angle_modifier
Type

float

@param angle_modifier
Type

The linear modifier that should be applied to the joints

@type joint_flags
Type

Dict[str, bool]

@param joint_flags
Type

A mapping used for setting flags that are used to avoid adding the same joint multiple times

add_joint_to_scene(joint: dna_viewer.model.joint.Joint) None[source]

Adds the given joint to the scene

@type joint: JointModel @param joint: The joint to be added to the scene

process() None[source]

Starts adding all the provided joints to the scene

dna_viewer.builder.maya_mesh module

class dna_viewer.builder.maya_mesh.MayaMesh(config: dna_viewer.config.mesh.Mesh, dna: dna_viewer.model.dna.DNA)[source]

Bases: object

A builder class used for adding joints to the scene

@type config
Type

MeshConfig

@param config
Type

The mesh configuration options used for creating meshes

@type data
Type

MeshModel

@param data
Type

mesh data used in the mesh creation process

@type fn_mesh
Type

om.MFnMesh

@param fn_mesh
Type

OpenMaya class used for creating the mesh

@type mesh_object
Type

om.MObject

@param mesh_object
Type

the object representing the mesh

@type dag_modifier
Type

om.MDagModifier

@param dag_modifier
Type

OpenMaya class used for naming the mesh

add_blend_shapes(add_mesh_name_to_blend_shape_channel_name: bool) None[source]

Adds blend shapes to the mesh

add_normals() None[source]

Add normals to the mesh

add_skin(joint_names: List[str], joint_ids: List[int]) None[source]

Adds skin to the mesh

@type joint_names: List[str] @param joint_names: Joint names needed for adding the skin cluster

@type joint_ids: List[int] @param joint_ids: Joint indices needed for setting skin weights

create_neutral_mesh() OpenMaya.MObject[source]

Creates the neutral mesh using the config provided for this builder class object

@rtype: om.MObject @returns: the instance of the created mesh object

dna_viewer.builder.mesh module

class dna_viewer.builder.mesh.Mesh(character_config: dna_viewer.config.character.Character, dna: dna_viewer.model.dna.DNA, mesh_index: int)[source]

Bases: object

A builder class used for adding joints to the scene

@type dna
Type

DNA

@param dna
Type

The location of the DNA file

@type mesh_index
Type

int

@param mesh_index
Type

The mesh index we are working with

@type joint_ids
Type

List[int]

@param joint_ids
Type

The joint indices used for adding skin

@type joint_names
Type

List[str]

@param joint_names
Type

The joint names used for adding skin

@type options
Type

BuildOptions

@param options
Type

The build options that will be applied when creating the mesh

@type modifiers
Type

SpaceModifiers

@param modifiers
Type

Space modifiers that should be applied when creating the mesh

@type config
Type

Character

@param config
Type

The character configuration options used for getting information about the DNA path, build options and space modifiers

@type mesh
Type

MayaMeshBuilder

@param mesh
Type

The builder class object for creating the meshes

@type dna
Type

DNA

@param dna
Type

The DNA object that was loaded in

add_blend_shapes() None[source]

Reads in the blend shapes, then adds them to the mesh if it is set in the build options

add_normals() None[source]

Adds normals to the mesh if it is set in the build options

add_skin() None[source]

Adds skin to the mesh if it is set in the build options

build() None[source]

Starts the build process, creates the neutral mesh, then adds normals, blends shapes and skin if needed

create_neutral_mesh() None[source]

Creates the neutral mesh

dna_viewer.builder.rig_logic module

class dna_viewer.builder.rig_logic.RigLogic(config: Optional[dna_viewer.config.rig_logic.RigLogic] = None)[source]

Bases: object

A builder class used for adding joints to the scene

@type config
Type

RigLogicConfig

@param config
Type

The rig logic configuration containing naming options used for creating the execution string that will be called from maya to create the rig logic

build_command() str[source]

Creates the command string that will be executed in maya to create the rig logic

@rtype: str @returns: the string representing the command that needs to be executed

dna_viewer.builder.scene module

class dna_viewer.builder.scene.Scene(config: Optional[dna_viewer.config.scene.Scene] = None)[source]

Bases: object

A builder class used for building the character

@type config
Type

Optional[SceneConfig]

@param config
Type

The scene configuration options used for building the scene

add_display_layers() None[source]

Adds the display layers to the scene

build() dna_viewer.builder.scene.SceneResult[source]

Starts the scene building process

build_scene(build_result: dna_viewer.builder.scene.SceneResult) None[source]

Builds the scene for the configuration from @config

@type build_result: SceneResult @param build_result: The SceneResult object that will contain results

get_display_layers() List[int][source]

Gets a lod id list that need to be created for the meshes from @config

save_scene() None[source]

Saves the scene from @config

set_units() None[source]

Sets the translation and rotation units of the scene from @config

exception dna_viewer.builder.scene.SceneError(message: str)[source]

Bases: dna_viewer.util.error.DNAViewerError

An error class that inherits DNAViewerError and gets raised in the scene building process

class dna_viewer.builder.scene.SceneResult[source]

Bases: object

A class used for returning data after finishing the scene build process

@type character_results
Type

List[CharacterBuildResult]

@param character_results
Type

A list of all character build results from the scene building process

character_results: List[dna_viewer.builder.character.CharacterBuildResult] = []

Module contents