DNAViewer.dnalib package
Submodules
dna_viewer.dnalib.behavior module
- class dna_viewer.dnalib.behavior.AnimatedMapsConditionalTable(lods: typing.List[int] = <factory>, conditional_table: dna_viewer.dnalib.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
- @param conditional_table
- Type
Data needed for animated maps
- conditional_table: dna_viewer.dnalib.behavior.ConditionalTable
- lods: List[int]
- class dna_viewer.dnalib.behavior.Behavior(reader: dna.BinaryStreamReader, layers: Optional[List[dna_viewer.dnalib.layer.Layer]])[source]
Bases:
dna_viewer.dnalib.definition.Definition
@type reader: BinaryStreamReader @param reader: The binary stream reader being used
@type gui_to_raw: ConditionalTable @param gui_to_raw: Mapping data about gui to raw values
@type psd: PSDMatrix @param psd: The data representing Pose Space Deformation
@type blend_shapes: BlendShapesData @param blend_shapes: The data representing blend shapes
@type animated_maps: AnimatedMapsConditionalTable @param animated_maps: The data representing animated maps
@type joints: JointGroups @param joints: The data representing joints
- class dna_viewer.dnalib.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.dnalib.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.dnalib.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.dnalib.behavior.JointGroups(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.dnalib.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.dnalib.behavior.JointGroup]
- joint_row_count: Optional[int] = None
- joint_variable_attribute_indices: List[List[int]]
- class dna_viewer.dnalib.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.dnalib.definition module
- class dna_viewer.dnalib.definition.Definition(reader: dna.BinaryStreamReader, layers: Optional[List[dna_viewer.dnalib.layer.Layer]])[source]
Bases:
dna_viewer.dnalib.descriptor.Descriptor
A class used for reading and accessing the definition part of the DNA file
- @type reader
- Type
BinaryStreamReader
- @param reader
- Type
The binary stream reader being used
- @type definition
- Type
DefinitionModel
- @param definition
- Type
The object that holds the definition data read from the DNA file
- @type joints
- Type
- @param joints
- Type
The data about joints
- @type blend_shape_channels
- Type
- @param blend_shape_channels
- Type
The names and indices of blend shape channels
- @type animated_maps
- Type
- @param animated_maps
- Type
The names and indices of animated maps
- @type meshes
- Type
- @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
- add_mesh_blend_shape_channel_mapping() → None[source]
Reads in the mesh blend shape channel mapping
- class dna_viewer.dnalib.definition.GeometryEntity(names: typing.List[str] = <factory>, lod_indices: 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 lod_indices
- Type
List[List[int]]
- @param lod_indices
- Type
List of indices per lod
- lod_indices: List[List[int]]
- names: List[str]
- class dna_viewer.dnalib.definition.Joints(names: typing.List[str] = <factory>, lod_indices: typing.List[typing.List[int]] = <factory>, parent_index: typing.List[int] = <factory>)[source]
Bases:
dna_viewer.dnalib.definition.GeometryEntity
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]
dna_viewer.dnalib.descriptor module
- class dna_viewer.dnalib.descriptor.Descriptor(reader: dna.BinaryStreamReader, layers: Optional[List[dna_viewer.dnalib.layer.Layer]])[source]
Bases:
object
A class used for reading and accessing the descriptor part of the DNA file
- @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
- add_geometry_data() → None[source]
Sets the translation unit, rotation unit, and coordinate system from the DNA file
- layer_enabled(layer: dna_viewer.dnalib.layer.Layer) → bool[source]
dna_viewer.dnalib.dnalib module
- class dna_viewer.dnalib.dnalib.DNA(dna_path: str, layers: Optional[List[dna_viewer.dnalib.layer.Layer]] = None)[source]
Bases:
dna_viewer.dnalib.behavior.Behavior
,dna_viewer.dnalib.geometry.Geometry
A class used for accessing data in DNA file.
@type dna_path: str @param dna_path: The path of the DNA file
@type layers: Optional[List[Layer]] @param layers: List of parts of DNA to be loaded. If noting is passed, whole DNA is going to be loaded. Same as
passing Layer.all.
- create_reader(dna_path: str) → dna.BinaryStreamReader[source]
Creates a stream reader needed for reading values from the DNA file.
@type dna_path: str @param dna_path: The path of the DNA file
@rtype: DNA @returns: The reader needed for reading values from the DNA file
- get_all_meshes_grouped_by_lod() → List[List[int]][source]
Gets the list of list of mesh indices grouped by the lod number.
@type dna: DNA @param dna: Instance of DNA.
@rtype: List[List[int]] @returns: The list of list of mesh indices grouped by the lod number
- get_blend_shape_target_deltas_with_vertex_id(mesh_index: int, blend_shape_target_index: int) → List[Tuple[int, dna_viewer.model.Point3]][source]
dna_viewer.dnalib.geometry module
- class dna_viewer.dnalib.geometry.Geometry(reader: dna.BinaryStreamReader, layers: Optional[List[dna_viewer.dnalib.layer.Layer]])[source]
Bases:
dna_viewer.dnalib.definition.Definition
- add_face_vertex_layouts(mesh_index: int) → List[List[int]][source]
Reads in the face vertex layouts
- add_mesh_blend_shapes(mesh_index: int) → List[dna_viewer.model.BlendShape][source]
Reads in the blend shapes
@type mesh_index: int @param mesh_index: The mesh index
- add_mesh_skin_weights(mesh_index: int) → dna_viewer.model.SkinWeightsData[source]
Reads in the skin weights
- add_mesh_topology(mesh_index: int) → dna_viewer.model.Topology[source]
Reads in the positions, texture coordinates, normals, layouts and face vertex layouts
- add_positions(mesh_index: int) → List[dna_viewer.model.Point3][source]
Reads in the vertex positions
- add_texture_coordinates(mesh_index: int) → List[dna_viewer.model.UV][source]
Reads in the texture coordinates
- get_blend_shape_target_delta(mesh_index: int, blend_shape_target_index: int, delta_index: int) → Tuple[int, int, int][source]
- get_blend_shape_target_vertex_indices(mesh_index: int, blend_shape_target_index: int) → List[int][source]
- get_vertex_texture_coordinate(mesh_index: int, texture_coordinate_index: int) → Tuple[float, float][source]