dna_viewer.model package

Submodules

dna_viewer.model.behavior module

class dna_viewer.model.behavior.AnimatedMapsData(lods: typing.List[int] = <factory>, conditional_table: dna_viewer.model.behavior.ConditionalTable = <factory>)[source]

Bases: object

A model class for holding data about animated maps

@type lods
Type

List[int]

@param lods
Type

A list of lod indices that the blend shapes are contained within

@type conditional_table
Type

ConditionalTable

@param conditional_table
Type

Data needed for animated maps

conditional_table: dna_viewer.model.behavior.ConditionalTable
lods: List[int]
class dna_viewer.model.behavior.Behavior(gui_to_raw: dna_viewer.model.behavior.ConditionalTable = <factory>, psd: dna_viewer.model.behavior.PSDMatrix = <factory>, blend_shapes: dna_viewer.model.behavior.BlendShapesData = <factory>, animated_maps: dna_viewer.model.behavior.AnimatedMapsData = <factory>, joints: dna_viewer.model.behavior.JointsData = <factory>)[source]

Bases: object

A model class for holding data about the behavior part of the DNA

@type gui_to_raw
Type

ConditionalTable

@param gui_to_raw
Type

Mapping data about gui to raw values

@type psd
Type

PSDMatrix

@param psd
Type

The data representing Pose Space Deformation

@type blend_shapes
Type

BlendShapesData

@param blend_shapes
Type

The data representing blend shapes

@type animated_maps
Type

AnimatedMapsData

@param animated_maps
Type

The data representing animated maps

@type joints
Type

JointsData

@param joints
Type

The data representing joints

animated_maps: dna_viewer.model.behavior.AnimatedMapsData
blend_shapes: dna_viewer.model.behavior.BlendShapesData
gui_to_raw: dna_viewer.model.behavior.ConditionalTable
joints: dna_viewer.model.behavior.JointsData
psd: dna_viewer.model.behavior.PSDMatrix
class dna_viewer.model.behavior.BlendShapesData(lods: typing.List[int] = <factory>, inputs: typing.List[int] = <factory>, outputs: typing.List[int] = <factory>)[source]

Bases: object

A model class for holding data about blend shapes

@type lods
Type

List[int]

@param lods
Type

A list of lod indices that the blend shapes are contained within

@type inputs
Type

List[int]

@param inputs
Type

The indices of inputs

@type outputs
Type

List[int]

@param outputs
Type

The indices of outputs

inputs: List[int]
lods: List[int]
outputs: List[int]
class dna_viewer.model.behavior.ConditionalTable(from_values: typing.List[float] = <factory>, to_values: typing.List[float] = <factory>, slope_values: typing.List[float] = <factory>, cut_values: typing.List[float] = <factory>, inputs: typing.List[int] = <factory>, outputs: typing.List[int] = <factory>)[source]

Bases: object

A model class for holding various values

@type from_values
Type

List[float]

@param from_values
Type

The list of values

@type to_values
Type

List[float]

@param to_values
Type

The list of values

@type slope_values
Type

List[float]

@param slope_values
Type

The list of slope values

@type cut_values
Type

List[float]

@param cut_values
Type

The list of cut values

@type inputs
Type

List[int]

@param inputs
Type

The indices of inputs

@type outputs
Type

List[int]

@param outputs
Type

The indices of outputs

cut_values: List[float]
from_values: List[float]
inputs: List[int]
outputs: List[int]
slope_values: List[float]
to_values: List[float]
class dna_viewer.model.behavior.JointGroup(lods: typing.List[int] = <factory>, values: typing.List[float] = <factory>, joints: typing.List[int] = <factory>, inputs: typing.List[int] = <factory>, outputs: typing.List[int] = <factory>)[source]

Bases: object

A model class for holding data about joint groups

@type lods
Type

List[int]

@param lods
Type

A list of lod indices that the joint group is contained within

@type values
Type

List[float]

@param values
Type

A list of values

@type joints
Type

List[int]

@param joints
Type

A list of joint indices

@type inputs
Type

List[int]

@param inputs
Type

The indices of inputs

@type outputs
Type

List[int]

@param outputs
Type

The indices of outputs

inputs: List[int]
joints: List[int]
lods: List[int]
outputs: List[int]
values: List[float]
class dna_viewer.model.behavior.JointsData(joint_row_count: typing.Optional[int] = None, joint_column_count: typing.Optional[int] = None, joint_variable_attribute_indices: typing.List[typing.List[int]] = <factory>, joint_groups: typing.List[dna_viewer.model.behavior.JointGroup] = <factory>)[source]

Bases: object

A model class for storing data about joints

@type joint_row_count
Type

int

@param joint_row_count
Type

The row count of the matrix that stores the joints data

@type joint_column_count
Type

int

@param joint_column_count
Type

The column count of the matrix that stores the joints data

@type joint_variable_attribute_indices
Type

List[List[int]]

@param joint_variable_attribute_indices
Type

List of joint variable attribute indices per LOD

@type joint_groups
Type

List[JointGroup]

@param joint_groups
Type

The list of joint groups

joint_column_count: Optional[int] = None
joint_groups: List[dna_viewer.model.behavior.JointGroup]
joint_row_count: Optional[int] = None
joint_variable_attribute_indices: List[List[int]]
class dna_viewer.model.behavior.PSDMatrix(count: typing.Optional[int] = None, rows: typing.List[int] = <factory>, columns: typing.List[int] = <factory>, values: typing.List[float] = <factory>)[source]

Bases: object

A model class for holding data about Pose Space Deformation

@type count
Type

int

@param count
Type

The list of values

@type rows
Type

List[int]

@param rows
Type

List of row indices used for storing values

@type columns
Type

List[int]

@param columns
Type

List of row indices used for storing values

@type values
Type

List[float]

@param values
Type

The list of values, that can be accessed from the row and column index

columns: List[int]
count: Optional[int] = None
rows: List[int]
values: List[float]

dna_viewer.model.definition module

class dna_viewer.model.definition.Definition(joints: dna_viewer.model.definition.Joints = <factory>, blend_shape_channels: dna_viewer.model.definition.NamesAndIndices = <factory>, animated_maps: dna_viewer.model.definition.NamesAndIndices = <factory>, meshes: dna_viewer.model.definition.NamesAndIndices = <factory>, gui_control_names: typing.List[str] = <factory>, raw_control_names: typing.List[str] = <factory>, mesh_blend_shape_channel_mapping: typing.List[typing.Tuple[int, int]] = <factory>, mesh_blend_shape_channel_mapping_indices_for_lod: typing.List[typing.List[int]] = <factory>, neutral_joint_translations: typing.List[dna_viewer.model.geometry.Point3] = <factory>, neutral_joint_rotations: typing.List[dna_viewer.model.geometry.Point3] = <factory>)[source]

Bases: object

A model class for holding data about the definition part of the DNA

@type joints
Type

Joints

@param joints
Type

The data about joints

@type blend_shape_channels
Type

NamesAndIndices

@param blend_shape_channels
Type

The names and indices of blend shape channels

@type animated_maps
Type

NamesAndIndices

@param animated_maps
Type

The names and indices of animated maps

@type meshes
Type

NamesAndIndices

@param meshes
Type

The names and indices of the meshes

@type gui_control_names
Type

List[str]

@param gui_control_names
Type

The list of gui control names

@type raw_control_names
Type

List[str]

@param raw_control_names
Type

The list of raw control names

@type mesh_blend_shape_channel_mapping
Type

List[Tuple[int, int]]

@param mesh_blend_shape_channel_mapping
Type

Mapping of mesh index to the blend shape channel index

@type mesh_blend_shape_channel_mapping_indices_for_lod
Type

List[List[int]]

@param mesh_blend_shape_channel_mapping_indices_for_lod
Type

The list of blend shape channel mapping indices by lod

@type neutral_joint_translations
Type

List[Point3]

@param neutral_joint_translations
Type

The list of neutral joint translations

@type neutral_joint_rotations
Type

List[Point3]

@param neutral_joint_rotations
Type

The list of neutral joint rotations

animated_maps: dna_viewer.model.definition.NamesAndIndices
blend_shape_channels: dna_viewer.model.definition.NamesAndIndices
gui_control_names: List[str]
joints: dna_viewer.model.definition.Joints
mesh_blend_shape_channel_mapping: List[Tuple[int, int]]
mesh_blend_shape_channel_mapping_indices_for_lod: List[List[int]]
meshes: dna_viewer.model.definition.NamesAndIndices
neutral_joint_rotations: List[dna_viewer.model.geometry.Point3]
neutral_joint_translations: List[dna_viewer.model.geometry.Point3]
raw_control_names: List[str]
class dna_viewer.model.definition.Joints(names: typing.List[str] = <factory>, indices_for_lod: typing.List[typing.List[int]] = <factory>, parent_index: typing.List[int] = <factory>)[source]

Bases: dna_viewer.model.definition.NamesAndIndices

A model class for holding data about the joints

@type parent_index
Type

List[int]

@param parent_index
Type

List of parent indices for each joint index

parent_index: List[int]
class dna_viewer.model.definition.NamesAndIndices(names: typing.List[str] = <factory>, indices_for_lod: typing.List[typing.List[int]] = <factory>)[source]

Bases: object

A model class for holding names and indices

@type names
Type

List[str]

@param names
Type

List of names

@type indices_for_lod
Type

List[List[int]]

@param indices_for_lod
Type

List of indices per lod

indices_for_lod: List[List[int]]
names: List[str]

dna_viewer.model.descriptor module

class dna_viewer.model.descriptor.Descriptor(name: typing.Optional[str] = None, archetype: typing.Optional[int] = None, gender: typing.Optional[int] = None, age: typing.Optional[int] = None, metadata: typing.Dict[str, str] = <factory>, translation_unit: typing.Optional[int] = None, rotation_unit: typing.Optional[int] = None, coordinate_system: typing.Optional[typing.Tuple[int, int, int]] = None, lod_count: typing.Optional[int] = None, db_max_lod: typing.Optional[int] = None, db_complexity: typing.Optional[str] = None, db_name: typing.Optional[str] = None)[source]

Bases: object

A model class for holding data about the definition part of the DNA

@type name
Type

str

@param name
Type

The name of the character

@type archetype
Type

int

@param archetype
Type

A value that represents the archetype of the character

@type gender
Type

int

@param gender
Type

A value that represents the gender of the character

@type age
Type

int

@param age
Type

The age of the character

@type metadata
Type

Dict[str, str]

@param metadata
Type

Metadata stored for the character

@type translation_unit
Type

int

@param translation_unit
Type

The translation unit that was used for creating the character

@type rotation_unit
Type

int

@param rotation_unit
Type

The translation unit that was used for creating the character

@type coordinate_system
Type

Tuple[int, int, int]

@param coordinate_system
Type

A tuple representing the coordinate system

@type lod_count
Type

int

@param lod_count
Type

The number of LODs for the characters

@type db_max_lod
Type

int

@param db_max_lod
Type

A LOD constraint representing the greatest LOD we wish wish to produce (ie. if the value is n, the potential LODs are 0, 1, .. n-1)

@type db_complexity
Type

str

@param db_complexity
Type

Will be used in future

@type db_name
Type

str

@param db_name
Type

DB identifier

age: int = None
archetype: int = None
coordinate_system: Optional[Tuple[int, int, int]] = None
db_complexity: str = None
db_max_lod: int = None
db_name: str = None
gender: int = None
lod_count: int = None
metadata: Dict[str, str]
name: str = None
rotation_unit: int = None
translation_unit: int = None

dna_viewer.model.dna module

class dna_viewer.model.dna.BaseDNA(descriptor: Optional[dna_viewer.model.descriptor.Descriptor] = None, definition: Optional[dna_viewer.model.definition.Definition] = None, behavior: Optional[dna_viewer.model.behavior.Behavior] = None, geometry: Optional[dna_viewer.model.geometry.Geometry] = None)[source]

Bases: object

A model class for holding data about the DNA

@type descriptor
Type

Descriptor

@param descriptor
Type

Data representing the descriptor part of the DNA

@type definition
Type

Definition

@param definition
Type

Data representing the definition part of the DNA

@type behavior
Type

Behavior

@param behavior
Type

Data representing the behavior part of the DNA

@type geometry
Type

Geometry

@param geometry
Type

Data representing the geometry part of the DNA

behavior: Optional[dna_viewer.model.behavior.Behavior] = None
definition: Optional[dna_viewer.model.definition.Definition] = None
descriptor: Optional[dna_viewer.model.descriptor.Descriptor] = None
geometry: Optional[dna_viewer.model.geometry.Geometry] = None
class dna_viewer.model.dna.DNA(path: str)[source]

Bases: dna_viewer.model.dna.BaseDNA

Used for getting data stored in the models

@type path: str @param path: The path to the DNA file

get_all_skin_weights_joint_indices_for_mesh(mesh_index: int) List[List[int]][source]
get_all_skin_weights_values_for_mesh(mesh_index: int) List[List[float]][source]
get_angle_unit() dna_viewer.config.units.AngleUnit[source]
get_angle_unit_int() int[source]
get_animated_map_names() List[str][source]
get_blend_shape_name(blend_shape_channel: int) str[source]
get_blend_shape_target_deltas_with_vertex_id(mesh_index: int, blend_shape_target_index: int) List[Tuple[int, dna_viewer.model.geometry.Point3]][source]
get_blend_shapes(mesh_index: int) List[dna_viewer.model.geometry.BlendShape][source]
get_character_name() str[source]
get_faces(mesh_index: int) List[List[int]][source]
get_geometry() dna_viewer.model.geometry.Geometry[source]
get_joint_indices_for_lod(lod: int) List[int][source]
get_layouts_for_mesh_index(mesh_index: int) List[dna_viewer.model.geometry.Layout][source]
get_linear_unit() dna_viewer.config.units.LinearUnit[source]
get_lod_count() int[source]
get_lowest_lod_containing_meshes(mesh_indices: List[int]) Optional[int][source]
get_maximum_influence_per_vertex(mesh_index: int) int[source]
get_mesh_count() int[source]
get_mesh_data(mesh_index: int) dna_viewer.model.geometry.Mesh[source]
get_mesh_id_from_mesh_name(mesh_name: str) Optional[int][source]
get_mesh_indices_for_lod(lod: int) List[int][source]
get_mesh_name(mesh_index: int) str[source]
get_mesh_names() List[str][source]
get_meshes_by_lods(mesh_indices: List[int]) List[List[int]][source]
get_normal_for_mesh_index_and_layout(mesh_index: int, layout: dna_viewer.model.geometry.Layout) dna_viewer.model.geometry.Point3[source]
get_polygon_faces_and_connects(mesh_index: Optional[int] = None, dna_faces: Optional[List[List[int]]] = None, dna_vertex_layout_positions: Optional[List[int]] = None) Tuple[List[int], List[int]][source]
get_raw_control_names() List[str][source]
get_skin_weight_matrix_for_mesh(mesh_index: int) List[List[Tuple[int, float]]][source]
get_texture_coordinate_index(mesh_index: int, layout_id: int) int[source]
get_translation_unit_int() int[source]
get_vertex_layout_positions_for_mesh_index(mesh_index: int) List[int][source]
get_vertex_normals_for_mesh(mesh_index: int) List[dna_viewer.model.geometry.Point3][source]
get_vertex_positions_for_mesh_index(mesh_index: int) List[dna_viewer.model.geometry.Point3][source]
get_vertex_texture_coordinates_for_mesh(mesh_index: int) List[dna_viewer.model.geometry.UV][source]
has_blend_shapes(mesh_index: int) bool[source]
read_all_neutral_joints() List[dna_viewer.model.joint.Joint][source]

dna_viewer.model.face_vertex module

class dna_viewer.model.face_vertex.FaceVertex(position: typing.Optional[dna_viewer.model.geometry.Point3] = None, texture_coordinate: typing.Optional[dna_viewer.model.geometry.UV] = None, normal: typing.Optional[dna_viewer.model.geometry.Point3] = None, layout: typing.Optional[dna_viewer.model.geometry.Layout] = None, skin_weight_values: typing.List[float] = <factory>, skin_weight_joint_indices: typing.List[int] = <factory>)[source]

Bases: object

A model class for holding data about face vertices

@type position
Type

Point3

@param position
Type

Represents position as a point in a 3 dimensional space

@type texture_coordinate
Type

UV

@param texture_coordinate
Type

Represents the UV values of the texture coordinate

@type normal
Type

Point3

@param normal
Type

Represents the normal as a 3 dimensional vector

@type layout
Type

Layout

@param layout
Type

The layout this vertex is contained within

@type skin_weight_values
Type

List[float]

@param skin_weight_values
Type

The list of the skin weight values

@type skin_weight_joint_indices
Type

List[int]

@param skin_weight_joint_indices
Type

List of the skin weight joint indices

layout: Optional[dna_viewer.model.geometry.Layout] = None
normal: Optional[dna_viewer.model.geometry.Point3] = None
position: Optional[dna_viewer.model.geometry.Point3] = None
skin_weight_joint_indices: List[int]
skin_weight_values: List[float]
texture_coordinate: Optional[dna_viewer.model.geometry.UV] = None

dna_viewer.model.geometry module

class dna_viewer.model.geometry.BlendShape(channel: typing.Optional[int] = None, deltas: typing.Dict[int, dna_viewer.model.geometry.Point3] = <factory>)[source]

Bases: object

A model class for holding data about the blend shape

@type channel
Type

int

@param channel
Type

The index pointing to the blend shape name

@type deltas
Type

Dict[int, Point3]

@param deltas
Type

A mapping of blend shape indices to the coordinate differences that are made by the blend shape

channel: int = None
deltas: Dict[int, dna_viewer.model.geometry.Point3]
class dna_viewer.model.geometry.Geometry(meshes: typing.Dict[int, dna_viewer.model.geometry.Mesh] = <factory>)[source]

Bases: object

A model class for holding data about the geometry part of the dna

@type meshes
Type

Dict[int, Mesh]

@param meshes
Type

Mapping of mesh indices to mesh models

meshes: Dict[int, dna_viewer.model.geometry.Mesh]
class dna_viewer.model.geometry.Layout(position_index: int = 0, texture_coordinate_index: int = 0, normal_index: int = 0)[source]

Bases: object

A model class for holding data about a single layout

@type position_index
Type

int

@param position_index
Type

An index representing position

@type texture_coordinate_index
Type

int

@param texture_coordinate_index
Type

A value representing the texture coordinate index

@type normal_index
Type

int

@param normal_index
Type

A value representing the normal index

normal_index: int = 0
position_index: int = 0
texture_coordinate_index: int = 0
class dna_viewer.model.geometry.Mesh(name: typing.Optional[str] = None, topology: dna_viewer.model.geometry.Topology = <factory>, skin_weights: dna_viewer.model.geometry.SkinWeightsData = <factory>, blend_shapes: typing.List[dna_viewer.model.geometry.BlendShape] = <factory>)[source]

Bases: object

A model class for holding data about the mesh

@type name
Type

str

@param name
Type

The name of the mesh

@type topology
Type

Topology

@param topology
Type

Data containing the topology of the mesh

@type skin_weights
Type

SkinWeightsData

@param skin_weights
Type

Data representing skin weights

@type blend_shapes
Type

List[BlendShape]

@param blend_shapes
Type

The list of blend shapes for the mesh

blend_shapes: List[dna_viewer.model.geometry.BlendShape]
name: str = None
skin_weights: dna_viewer.model.geometry.SkinWeightsData
topology: dna_viewer.model.geometry.Topology
class dna_viewer.model.geometry.Point3(x: float = 0.0, y: float = 0.0, z: float = 0.0)[source]

Bases: object

A model class for representing a 3 dimensional point

@type x
Type

float

@param x
Type

The value of x

@type y
Type

float

@param y
Type

The value of y

@type z
Type

float

@param z
Type

The value of z

x: float = 0.0
y: float = 0.0
z: float = 0.0
class dna_viewer.model.geometry.SkinWeightsData(maximum_influence_per_vertex: typing.Optional[int] = None, values: typing.List[typing.List[float]] = <factory>, joint_indices: typing.List[typing.List[int]] = <factory>)[source]

Bases: object

A model class for holding data about the skin weights

@type maximum_influence_per_vertex
Type

int

@param maximum_influence_per_vertex
Type

Number of maximum influences per vertex

@type values
Type

List[List[float]]

@param values
Type

The skin weight values per vertex index

@type joint_indices
Type

List[List[int]]

@param joint_indices
Type

The joint indces per vertex index

joint_indices: List[List[int]]
maximum_influence_per_vertex: int = None
values: List[List[float]]
class dna_viewer.model.geometry.Topology(positions: typing.List[dna_viewer.model.geometry.Point3] = <factory>, texture_coordinates: typing.List[dna_viewer.model.geometry.UV] = <factory>, normals: typing.List[dna_viewer.model.geometry.Point3] = <factory>, layouts: typing.List[dna_viewer.model.geometry.Layout] = <factory>, face_vertex_layouts: typing.List[typing.List[int]] = <factory>)[source]

Bases: object

A model class for holding data about the topology

@type positions
Type

List[Point3]

@param positions
Type

List of points in space representing the positions

@type texture_coordinates
Type

List[UV]

@param texture_coordinates
Type

List of UVs representing the positions

@type normals
Type

List[Point3]

@param normals
Type

List of 3 dimensional vectors representing the normals

@type layouts
Type

List[Layout]

@param layouts
Type

The list of Layout mappings

@type face_vertex_layouts
Type

List[List[int]]

@param face_vertex_layouts
Type

List of face vertex layout indices by face index

face_vertex_layouts: List[List[int]]
layouts: List[dna_viewer.model.geometry.Layout]
normals: List[dna_viewer.model.geometry.Point3]
positions: List[dna_viewer.model.geometry.Point3]
texture_coordinates: List[dna_viewer.model.geometry.UV]
class dna_viewer.model.geometry.UV(u: float = 0.0, v: float = 0.0)[source]

Bases: object

A model class for holding data about the UV

@type u
Type

float

@param u
Type

The value of u

@type v
Type

float

@param v
Type

The value of v

u: float = 0.0
v: float = 0.0

dna_viewer.model.joint module

class dna_viewer.model.joint.Joint(name: typing.Optional[str] = None, translation: dna_viewer.model.geometry.Point3 = <factory>, orientation: dna_viewer.model.geometry.Point3 = <factory>, parent_name: typing.Optional[str] = None)[source]

Bases: object

A model class for holding data about a single joint

@type name
Type

str

@param name
Type

The name of the joint

@type translation
Type

Point3

@param translation
Type

A point in 3 dimensional space which represents the translation of the joint

@type orientation
Type

Point3

@param orientation
Type

A point in 3 dimensional space which represents the orientation of the joint

@type parent_name
Type

str

@param parent_name
Type

The name of the parent joint

name: str = None
orientation: dna_viewer.model.geometry.Point3
parent_name: str = None
translation: dna_viewer.model.geometry.Point3

dna_viewer.model.mesh module

class dna_viewer.model.mesh.Mesh(dna_vertex_positions: typing.List[dna_viewer.model.geometry.Point3] = <factory>, dna_vertex_layout_positions: typing.List[int] = <factory>, dna_vertex_layout_normals: typing.List[dna_viewer.model.geometry.Point3] = <factory>, polygon_faces: typing.List[int] = <factory>, polygon_connects: typing.List[int] = <factory>, vertex_normals: typing.List[dna_viewer.model.geometry.Point3] = <factory>, derived_mesh_names: typing.List[str] = <factory>)[source]

Bases: object

A model class for holding data needed in the mesh building process

@type dna_vertex_positions
Type

List[Point3]

@param dna_vertex_positions
Type

Data representing the positions of the vertices

@type dna_vertex_layout_positions
Type

List[int]

@param dna_vertex_layout_positions
Type

Data representing layout position indices of vertices

@type dna_vertex_layout_normals
Type

List[Point3]

@param dna_vertex_layout_normals
Type

Data representing layout normals of vertices

@type polygon_faces
Type

List[int]

@param polygon_faces
Type

List of lengths of vertex layout indices

@type polygon_connects
Type

List[int]

@param polygon_connects
Type

List of vertex layout position indices

@type vertex_normals
Type

List[Point3]

@param vertex_normals
Type

List of vertex layout normal indices

@type derived_mesh_names
Type

List[str]

@param derived_mesh_names
Type

List of mesh names

derived_mesh_names: List[str]
dna_vertex_layout_normals: List[dna_viewer.model.geometry.Point3]
dna_vertex_layout_positions: List[int]
dna_vertex_positions: List[dna_viewer.model.geometry.Point3]
polygon_connects: List[int]
polygon_faces: List[int]
vertex_normals: List[dna_viewer.model.geometry.Point3]

Module contents