dna_viewer.reader package

Submodules

dna_viewer.reader.behavior module

class dna_viewer.reader.behavior.Behavior(stream_reader: dna.BinaryStreamReader)[source]

Bases: object

A class used for reading the behavior part of the DNA file

@type reader
Type

BinaryStreamReader

@param reader
Type

The stream reader being used

@type behavior
Type

BehaviorModel

@param behavior
Type

The object that holds the behavior data read from the DNA file

add_animated_maps() None[source]

Reads in the animated maps part of the behavior

add_blend_shapes() None[source]

Reads in the blend shapes part of the behavior

add_gui_to_raw() None[source]

Reads in the gui to raw mapping

add_joints() None[source]

Reads in the joints part of the behavior

add_psd() None[source]

Reads in the PSD part of the behavior

read() dna_viewer.model.behavior.Behavior[source]

Starts reading in the behavior part of the DNA

@rtype: BehaviorModel @returns: the instance of the created behavior model

dna_viewer.reader.definition module

class dna_viewer.reader.definition.Definition(stream_reader: dna.BinaryStreamReader)[source]

Bases: object

A class used for reading the definition part of the DNA file

@type reader
Type

BinaryStreamReader

@param reader
Type

The stream reader being used

@type definition
Type

DefinitionModel

@param definition
Type

The object that holds the definition data read from the DNA file

add_animated_maps() None[source]

Reads in the animated maps of the definition

add_blend_shape_channels() None[source]

Reads in the neutral joints part of the definition

add_controls() None[source]

Reads in the gui and raw controls of the definition

add_joints() None[source]

Reads in the joints of the definition

add_mesh_blend_shape_channel_mapping() None[source]

Reads in the mesh blend shape channel mapping

add_meshes() None[source]

Reads in the meshes of the definition

add_neutral_joints() None[source]

Reads in the neutral joints part of the definition

read() dna_viewer.model.definition.Definition[source]

Starts reading in the definition part of the DNA

@rtype: DefinitionModel @returns: the instance of the created definition model

dna_viewer.reader.descriptor module

class dna_viewer.reader.descriptor.Descriptor(stream_reader: dna.BinaryStreamReader)[source]

Bases: object

A class used for reading the descriptor part of the DNA file

@type reader
Type

BinaryStreamReader

@param reader
Type

The stream reader being used

@type descriptor
Type

DescriptorModel

@param descriptor
Type

The object that holds the descriptor data read from the DNA file

add_basic_data() None[source]

Reads in the character name, archetype, gender and age

add_db_data() None[source]

Reads in the db data from the DNA file

add_geometry_data() None[source]

Sets the translation unit, rotation unit, and coordinate system from the DNA file

add_metadata() None[source]

Reads in the metadata provided from the DNA file

read() dna_viewer.model.descriptor.Descriptor[source]

Starts reading in the descriptor part of the DNA

@rtype: DescriptorModel @returns: the instance of the created descriptor model

dna_viewer.reader.dna module

class dna_viewer.reader.dna.DNA(path: str)[source]

Bases: object

A class used to represent the character config

static load_dna(path: str) dna_viewer.model.dna.DNA[source]

Loads in the DNA from the given file path

@type dna: DNAModel @param dna: The DNA data

@rtype: DNA @returns: An object representing the DNA data

load_mesh(mesh_index: int) dna_viewer.model.geometry.Mesh[source]

Loads geometry data for a single mesh at the given index

@type mesh_index: int @param mesh_index: mesh index

@rtype: Mesh @returns: mesh data

load_meshes() None[source]

Loads all the mesh data

read() dna_viewer.model.dna.DNA[source]

Reads in the base DNA data as well as the meshes

@rtype: DNAModel @returns: The DNA data

read_base() None[source]

Reads in the base DNA data without the mesh data

read_behavior() dna_viewer.model.behavior.Behavior[source]

Reads the descriptor part of the DNA

@rtype: DescriptorModel @returns: Descriptor data from the DNA

read_definition() dna_viewer.model.definition.Definition[source]

Reads the definition part of the DNA

@rtype: DefinitionModel @returns: Definition data from the DNA

read_descriptor() dna_viewer.model.descriptor.Descriptor[source]

Reads the descriptor part of the DNA

@rtype: DescriptorModel @returns: Descriptor data from the DNA

read_geometry_for_mesh_index(mesh_index: int) dna_viewer.model.geometry.Mesh[source]

Reads the geometry for a given mesh index

@type mesh_index: int @param mesh_index: mesh index

@rtype: Mesh @returns: Mesh data

dna_viewer.reader.dna.load_dna(dna_path: Optional[str] = None) dna_viewer.model.dna.DNA[source]

dna_viewer.reader.geometry module

class dna_viewer.reader.geometry.Geometry(stream_reader: dna.BinaryStreamReader, mesh_index: int)[source]

Bases: object

A class used for reading the geometry part of the DNA file

@type reader
Type

BinaryStreamReader

@param reader
Type

The stream reader being used

@type mesh
Type

Mesh

@param mesh
Type

The mesh model

@type mesh_index
Type

int

@param mesh_index
Type

The mesh index

add_face_vertex_layouts() None[source]

Reads in the face vertex layouts

add_layouts() None[source]

Reads in the vertex layouts

add_mesh_name() None[source]

Reads in the mesh name

add_normals() None[source]

Reads in the normals

add_positions() None[source]

Reads in the vertex positions

add_skin_weights() None[source]

Reads in the skin weights

add_texture_coordinates() None[source]

Reads in the texture coordinates

add_topology() None[source]

Reads in the positions, texture coordinates, normals, layouts and face vertex layouts

read() dna_viewer.model.geometry.Mesh[source]

Starts reading in the mesh from the geometry part of the DNA

@rtype: Mesh @returns: The instance of the mesh model

read_blend_shapes(mesh: dna_viewer.model.geometry.Mesh, mesh_index: int) None[source]

Reads in the blend shapes

@type mesh: Mesh @param mesh: The mesh model

@type mesh_index: int @param mesh_index: The mesh index

read_target_deltas(blend_shape_target_index: int) Dict[int, dna_viewer.model.geometry.Point3][source]

Reads in the target deltas

@rtype: Dict[int, Point3] @returns: Mapping of vertex indices to positions

Module contents