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
- 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
- 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_geometry_data() None [source]
Sets the translation unit, rotation unit, and coordinate system 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
- 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_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
- @param mesh
- Type
The mesh model
- @type mesh_index
- Type
int
- @param mesh_index
- Type
The mesh index
- 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