dna_viewer.ui package

Submodules

dna_viewer.ui.build_options_widget module

class dna_viewer.ui.build_options_widget.BuildOptionsWidget(elements: dna_viewer.ui.elements.Elements, on_generic_changed: Callable[[int], None])[source]

Bases: PySide2.QtWidgets.QWidget

Widget containing build options checkboxes

@type elements
Type

Elements

@param elements
Type

The object containing references to the UI elements

@type layout
Type

QHBoxLayout

@param layout
Type

The layout containing the build options checkboxes

create_checkbox(label: str, on_changed: Optional[Callable[[int], None]] = None, checked: bool = False, enabled: bool = False) PySide2.QtWidgets.QCheckBox[source]

Adds a checkbox with given parameters and connects them to the on_changed method

@type label: str @param label: The label of the checkbox

@type on_changed: Callable[[int], None] @param on_changed: The method that will get called when the checkbox changes states

@type checked: bool @param checked: The value representing if the checkbox is checked after creation

@type enabled: bool @param enabled: The value representing if the checkbox is enabled after creation

@rtype: QCheckBox @returns: the created checkbox object

on_joints_changed(state: int) None[source]

Method that gets called when the joints checkbox is changed

@type state: int @param state: The changed state of the checkbox

staticMetaObject = <PySide2.QtCore.QMetaObject object>
class dna_viewer.ui.build_options_widget.Checkbox(value)[source]

Bases: enum.Enum

An enumeration.

checked = 2
unchecked = 0

dna_viewer.ui.dna_viewer_window module

class dna_viewer.ui.dna_viewer_window.DnaViewerWindow(parent: Optional[PySide2.QtWidgets.QWidget] = None)[source]

Bases: PySide2.QtWidgets.QMainWindow

UI Window

@type elements
Type

Elements

@param elements
Type

The object containing references to the UI elements

@type elements_creator
Type

ElementsCreator

@param elements_creator
Type

The class used for creating UI elements

@type build_scene_successful
Type

bool

@param build_scene_successful
Type

A flag representing if building of the scene was a success

@type character_config
Type

Character

@param character_config
Type

The character configuration that will be processed

static activate_window() None[source]

Shows window if minimized

build_scene() None[source]

Start building the scene

create_main_widget() PySide2.QtWidgets.QWidget[source]

Creates the widget containing the UI elements

@rtype: QtWidgets.QWidget @returns: the main widget

create_ui() None[source]

Fills the window with UI elements

get_character_config() dna_viewer.config.character.Character[source]

Gets the character config from the UI elements

@rtype: Character @returns: character configuration object

static maya_main_window() PySide2.QtWidgets.QWidget[source]

Gets the MayaWindow instance

@throws RuntimeError

@rtype: QtWidgets.QWidget @returns: main window instance

process() None[source]

Start the build process of creation of scene from provided configuration from the UI

set_progress(text: Optional[str] = None, value: Optional[int] = None) None[source]

Setting text and/or value to progress bar

set_size() None[source]

Sets the window size

setup_window() None[source]

A method for setting up the window

static show_window() None[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>
window = None
dna_viewer.ui.dna_viewer_window.show_dna_viewer_window() None[source]

dna_viewer.ui.elements module

class dna_viewer.ui.elements.Elements[source]

Bases: object

Used for holding references to elements that get added to widgets

@type main_widget
Type

QWidget

@param main_widget
Type

The main widget that holds everything

@type select_dna_path
Type

FileChooser

@param select_dna_path
Type

The FileChooser widget for getting the DNA path

@type load_dna_btn
Type

QPushButton

@param load_dna_btn
Type

The button that starts loading in the DNA

@type mesh_tree_list
Type

QWidget

@param mesh_tree_list
Type

The widget that contains the meshes to be selected in a tree list

@type joints_cb
Type

QCheckBox

@param joints_cb
Type

The checkbox that represents if joints should be added

@type normals_cb
Type

QCheckBox

@param normals_cb
Type

The checkbox that represents if normals should be added

@type blend_shapes_cb
Type

QCheckBox

@param blend_shapes_cb
Type

The checkbox that represents if blend shapes should be added

@type skin_cb
Type

QCheckBox

@param skin_cb
Type

The checkbox that represents if skin should be added

@type rig_logic_cb
Type

QCheckBox

@param rig_logic_cb
Type

The checkbox that represents if rig logic should be added

@type select_gui_path
Type

FileChooser

@param select_gui_path
Type

The FileChooser widget for getting the gui path

@type select_analog_gui_path
Type

FileChooser

@param select_analog_gui_path
Type

The FileChooser widget for getting the analog gui path

@type select_aas_path
Type

FileChooser

@param select_aas_path
Type

The FileChooser widget for getting the additional assembly script path

@type process_btn
Type

QPushButton

@param process_btn
Type

The button that starts creating the scene and character

@type progress_bar
Type

QProgressBar

@param progress_bar
Type

The progress bar that shows the building progress

blend_shapes_cb: PySide2.QtWidgets.QCheckBox = None
static create_new_scene() None[source]

Creates a new scene

dna: dna_viewer.model.dna.DNA = None
get_aas_path() Optional[str][source]

Gets the additional assembly script file path

@rtype: Optional[str] @returns: The additional assembly script file path

get_analog_gui_path() Optional[str][source]

Gets the analog gui file path

@rtype: Optional[str] @returns: The analog gui file path

get_build_options() dna_viewer.config.character.BuildOptions[source]

Gets and returns a build options configuration from the corresponding UI elements

@rtype: BuildOptions @returns: The object containing build option configuration

get_dna_path() Optional[str][source]

Gets the DNA file path

@rtype: Optional[str] @returns: The DNA file path

static get_file_path(input: dna_viewer.ui.file_chooser.FileChooser) Optional[str][source]

Gets the file path contained in the provided FileChooser widget

@type input: FileChooser @param input: The FileChooser widget we want to get the file path from

@rtype: Optional[str] @returns: The value extracted from the FileChooser

get_gui_path() Optional[str][source]

Gets the gui file path

@rtype: Optional[str] @returns: The gui file path

static is_checked(checkbox: PySide2.QtWidgets.QCheckBox) bool[source]

Returns if the provided checkbox is checked and enabled

@type checkbox: QCheckBox @param checkbox: The checkbox thats value needs to be checked and enabled

@rtype: bool @returns: The flag representing if the checkbox is checked and enabled

joints_cb: PySide2.QtWidgets.QCheckBox = None
load_dna_btn: PySide2.QtWidgets.QPushButton = None
main_widget: PySide2.QtWidgets.QWidget = None
mesh_tree_list: PySide2.QtWidgets.QWidget = None
normals_cb: PySide2.QtWidgets.QCheckBox = None
process_btn: PySide2.QtWidgets.QPushButton = None
progress_bar: PySide2.QtWidgets.QProgressBar = None
rig_logic_cb: PySide2.QtWidgets.QCheckBox = None
select_aas_path: dna_viewer.ui.file_chooser.FileChooser = None
select_analog_gui_path: dna_viewer.ui.file_chooser.FileChooser = None
select_dna_path: dna_viewer.ui.file_chooser.FileChooser = None
select_gui_path: dna_viewer.ui.file_chooser.FileChooser = None
skin_cb: PySide2.QtWidgets.QCheckBox = None

dna_viewer.ui.elements_creator module

class dna_viewer.ui.elements_creator.ElementsCreator(window: PySide2.QtWidgets.QMainWindow, elements: dna_viewer.ui.elements.Elements)[source]

Bases: object

Used for creating elements that get added to the main window

@type window
Type

QMainWindow

@param window
Type

The main UI window

@type elements
Type

Elements

@param elements
Type

The container with references to the UI elements

@type body
Type

QVBoxLayout

@param body
Type

The body layout

@type header
Type

QHBoxLayout

@param header
Type

The header layout

create_aas_selector() dna_viewer.ui.file_chooser.FileChooser[source]

Creates and adds the additional assembly script selector widget

@rtype: FileChooser @returns: Additional assembly script selector widget

create_analog_gui_selector() dna_viewer.ui.file_chooser.FileChooser[source]

Creates and adds the analog gui selector widget

@rtype: FileChooser @returns: Analog gui selector widget

create_body() PySide2.QtWidgets.QVBoxLayout[source]

Creates the main body layout and adds needed widgets

@rtype: QVBoxLayout @returns: The created vertical box layout with the widgets added

create_body_widgets() None[source]

Creates and adds all needed widgets to the body

create_build_options() None[source]

Creates and adds the widget containing the build options checkboxes

create_dna_chooser() dna_viewer.ui.file_chooser.FileChooser[source]

Creates and adds the DNA chooser widget

@rtype: FileChooser @returns: Dna chooser widget

create_dna_selector() PySide2.QtWidgets.QWidget[source]

Creates and adds the DNA selector widget

@rtype: QWidget @returns: The created DNA selector widget

create_file_chooser(label: str, caption: str, filter: str) dna_viewer.ui.file_chooser.FileChooser[source]

Creates a file chooser widget that is used for selecting file paths

@type label: str @param label: The label in the FileDialog that pops up

@type caption: str @param caption: The caption in the FileDialog that pops up

@type filter: str @param filter: The file filter that is used in the FileDialog

@rtype: FileChooser @returns: The created file chooser object

create_gui_selector() dna_viewer.ui.file_chooser.FileChooser[source]

Creates the gui selector widget

@rtype: FileChooser @returns: Gui selector widget

create_header() PySide2.QtWidgets.QHBoxLayout[source]

Creates and adds to the header widget

@rtype: QHBoxLayout @returns: The created horizontal box layout with the widgets added

create_header_widgets() None[source]

Creates and adds all needed widgets to the header

create_help_btn() PySide2.QtWidgets.QWidget[source]

Creates the help button widget

@rtype: QHBoxLayout @returns: The created horizontal box layout with the widgets added

create_load_dna_button(dna_input: dna_viewer.ui.file_chooser.FileChooser) PySide2.QtWidgets.QWidget[source]

Creates and adds the load DNA button widget

@type input: FileChooser @param input: The file chooser object corresponding to the DNA selector widget

@rtype: QWidget @returns: The created load DNA button widget

create_mesh_selector() dna_viewer.ui.mesh_tree_list.MeshTreeList[source]

Creates and adds a mesh tree list where the entries are grouped by lods, this is used for selecting the meses that need to be processed

@rtype: MeshTreeList @returns: The created mesh tree list widget

create_process_btn(window: PySide2.QtWidgets.QMainWindow) PySide2.QtWidgets.QPushButton[source]

Creates and adds a process button

@type window: QMainWindow @param window: The instance of the window object

@rtype: QPushButton @returns: The created process button

create_progress_bar(window: PySide2.QtWidgets.QMainWindow) PySide2.QtWidgets.QProgressBar[source]

Creates and adds progress bar

@type window: QMainWindow @param window: The instance of the window object

@rtype: QProgressBar @returns: The created progress bar

is_enabled_and_checked(check_box: PySide2.QtWidgets.QCheckBox) bool[source]

Method that checks if check box is enabled in same time

@type check_box: QCheckBox @param check_box: The checkbox instance to check

on_dna_selected(input: dna_viewer.ui.file_chooser.FileChooser) None[source]

The method that gets called when a DNA file gets selected

@type input: FileChooser @param input: The file chooser object corresponding to the DNA selector widget

on_generic_changed(state: int) None[source]

Method that gets called when the checkbox is changed

@type state: int @param state: The changed state of the checkbox

on_help() None[source]

The method that gets called when the help button is clicked

on_load_dna_clicked(input: dna_viewer.ui.file_chooser.FileChooser) None[source]

The method that gets called when a DNA file gets selected

@type input: FileChooser @param input: The file chooser object corresponding to the DNA selector widget

set_riglogic_cb_enabled() None[source]

Method that sets enable state of riglogic check box

dna_viewer.ui.file_chooser module

class dna_viewer.ui.file_chooser.FileChooser(label_text: str, parent: Optional[PySide2.QtWidgets.QWidget] = None, placeholder: str = '', dialog_caption: str = 'Select a file', dialog_filter: str = 'All files (*.*)', button_text: str = '...', dir_selector: bool = False, on_changed: Optional[Callable[[int], None]] = None)[source]

Bases: PySide2.QtWidgets.QWidget

A custom widget used for selecting a file path using a FileDialog and an input field

@type fc_text_field: QLineEdit @param fc_text_field: The input text field for storing the result path

get_file_path() str[source]

Gets the file path from the text field

@rtype: str @returns: The file path contained in the text field

open_dialog() None[source]

Opens a file dialog, when a path is chosen, the text field gets filled with its value

staticMetaObject = <PySide2.QtCore.QMetaObject object>

dna_viewer.ui.mesh_tree_list module

class dna_viewer.ui.mesh_tree_list.MeshTreeList(elements: dna_viewer.ui.elements.Elements)[source]

Bases: PySide2.QtWidgets.QWidget

A custom widget that lists out meshes with checkboxes next to them, so these meshes can be selected to be processed. The meshes are grouped by LOD

@type elements: Elements @param elements: The object containing references to the UI elements

@type mesh_tree: QWidget @param mesh_tree: The widget that contains the meshes to be selected in a tree list

create_mesh_tree() PySide2.QtWidgets.QWidget[source]

Creates the mesh tree list widget

@rtype: QWidget @returns: The created widget

fill_mesh_list(lod_count: int, meshes: dna_viewer.model.definition.NamesAndIndices) None[source]

Fills the mesh list with the meshes, and groups them by lods

@type lod_count: int @param lod_count: The LOD count

@type meshes: NamesAndIndices @param meshes: The names and indices of all the meshes

get_selected_meshes() List[int][source]

Gets the selected meshes from the tree widget

@rtype: List[int] @returns: The list of mesh indices that are selected

staticMetaObject = <PySide2.QtCore.QMetaObject object>
tree_item_changed() None[source]

The method that gets called when a tree item gets its value changed

dna_viewer.ui.widgets module

class dna_viewer.ui.widgets.MessageDialog(title: str, message: str, icon: <class 'PySide2.QtWidgets.QMessageBox.Icon'> = PySide2.QtWidgets.QMessageBox.Icon.Information, parent: typing.Optional[PySide2.QtWidgets.QWidget] = None)[source]

Bases: PySide2.QtWidgets.QMessageBox

A widget for creating a message dialog

staticMetaObject = <PySide2.QtCore.QMetaObject object>
class dna_viewer.ui.widgets.QHLine[source]

Bases: PySide2.QtWidgets.QFrame

A widget for creating a horizontal line

staticMetaObject = <PySide2.QtCore.QMetaObject object>
class dna_viewer.ui.widgets.QVSpacer[source]

Bases: PySide2.QtWidgets.QSpacerItem

A widget for creating a vertical line

Module contents