def setup_ui(self): self.size.valueChanged.connect(self.ctrl.on_size_changed) self.orientation_cbbox.insertItems(0, ["X", "Y", "Z"]) self.orientation_cbbox.currentTextChanged.connect( self.ctrl.on_orientation_changed) self.rotate_order_cbbox.insertItems( 0, ["xyz", "yzx", "zxy", "xzy", "yxz", "zyx"]) self.rotate_order_cbbox.currentTextChanged.connect( self.ctrl.on_rotate_order_changed) main_layout = QtWidgets.QVBoxLayout() orientation_layout = QtWidgets.QVBoxLayout() orientation_grp = grpbox("Orientation :", orientation_layout) orientation_layout.addWidget(self.orientation_cbbox) size_layout = QtWidgets.QVBoxLayout() size_grp = grpbox("Size :", size_layout) size_layout.addWidget(self.size) rotate_order_layout = QtWidgets.QVBoxLayout() rotate_order_grp = grpbox("Rotate_Order :", rotate_order_layout) rotate_order_layout.addWidget(self.rotate_order_cbbox) main_layout.addWidget(orientation_grp) main_layout.addWidget(size_grp) main_layout.addWidget(rotate_order_grp) self.setLayout(main_layout)
def setup_ui(self): # self.modules_cbbox.setModel(self.ctrl.modules_with_output) # self.modules_cbbox.currentTextChanged.connect(self.ctrl.on_modules_cbbox_changed) # # self.outputs_cbbox.setModel(self.ctrl.outputs_model) # self.outputs_cbbox.currentTextChanged.connect(self.ctrl.on_outputs_cbbox_changed) # self.side_cbbox.insertItems(0, ["Left", "Center", "Right"]) # self.side_cbbox.currentTextChanged.connect(self.ctrl.on_side_cbbox_changed) self.how_many_ctrls.setMinimum(1) self.how_many_ctrls.valueChanged.connect( self.ctrl.on_how_many_ctrls_changed) self.mesh_to_follow.textChanged.connect( self.ctrl.on_mesh_to_follow_changed) self.set_mesh_btn.clicked.connect(self.ctrl.set_mesh_to_follow) # self.refresh_btn.clicked.connect(self.ctrl.look_for_parent) self.prebuild_btn.clicked.connect(self.ctrl.prebuild) main_layout = QtWidgets.QVBoxLayout() # select_parent_layout = QtWidgets.QVBoxLayout() # select_parent_grp = grpbox("Select parent", select_parent_layout) # cbbox_layout = QtWidgets.QHBoxLayout() # cbbox_layout.addWidget(self.modules_cbbox) # cbbox_layout.addWidget(self.outputs_cbbox) # select_parent_layout.addLayout(cbbox_layout) # select_parent_layout.addWidget(self.refresh_btn) # side_layout = QtWidgets.QVBoxLayout() # side_grp = grpbox("Side", side_layout) # side_layout.addWidget(self.side_cbbox) options_layout = QtWidgets.QVBoxLayout() options_grp = grpbox("Options", options_layout) ctrls_layout = QtWidgets.QVBoxLayout() ctrls_text = QtWidgets.QLabel("How many ctrls :") ctrls_layout.addWidget(ctrls_text) ctrls_layout.addWidget(self.how_many_ctrls) mesh_to_follow_layout = QtWidgets.QVBoxLayout() mesh_to_follow_grp = grpbox("Mesh to attach the ctrls to:", mesh_to_follow_layout) mesh_to_follow_layout.addWidget(self.mesh_to_follow) mesh_to_follow_layout.addWidget(self.set_mesh_btn) options_layout.addLayout(ctrls_layout) # main_layout.addWidget(select_parent_grp) main_layout.addWidget(mesh_to_follow_grp) # main_layout.addWidget(side_grp) main_layout.addWidget(options_grp) self.setLayout(main_layout)
def setup_ui(self): self.modules_cbbox.setModel(self.ctrl.modules_with_output) self.modules_cbbox.currentTextChanged.connect( self.ctrl.on_modules_cbbox_changed) self.outputs_cbbox.setModel(self.ctrl.outputs_model) self.outputs_cbbox.currentTextChanged.connect( self.ctrl.on_outputs_cbbox_changed) self.refresh_btn.clicked.connect(self.ctrl.look_for_parent) self.prebuild_btn.clicked.connect(self.ctrl.prebuild) main_layout = QtWidgets.QVBoxLayout() select_parent_and_object_layout = QtWidgets.QVBoxLayout() select_parent_layout = QtWidgets.QVBoxLayout() select_parent_grp = grpbox("Select parent", select_parent_layout) parent_cbbox_layout = QtWidgets.QHBoxLayout() parent_cbbox_layout.addWidget(self.modules_cbbox) parent_cbbox_layout.addWidget(self.outputs_cbbox) select_parent_layout.addLayout(parent_cbbox_layout) select_parent_and_object_layout.addWidget(select_parent_grp) select_parent_and_object_layout.addWidget(self.refresh_btn) main_layout.addLayout(select_parent_and_object_layout) main_layout.addWidget(self.prebuild_btn) self.setLayout(main_layout)
def setup_ui(self): self.modules_cbbox.setModel(self.ctrl.modules_with_output) self.modules_cbbox.currentTextChanged.connect( self.ctrl.on_modules_cbbox_changed) self.outputs_cbbox.setModel(self.ctrl.outputs_model) self.outputs_cbbox.currentTextChanged.connect( self.ctrl.on_outputs_cbbox_changed) self.side_cbbox.insertItems(0, ["Left", "Right"]) self.side_cbbox.currentTextChanged.connect( self.ctrl.on_side_cbbox_changed) self.fk_ik_type_cbbox.insertItems(0, ["one_chain", "three_chains"]) self.fk_ik_type_cbbox.currentTextChanged.connect( self.ctrl.on_fk_ik_type_changed) self.refresh_btn.clicked.connect(self.ctrl.look_for_parent) self.prebuild_btn.clicked.connect(self.ctrl.prebuild) main_layout = QtWidgets.QVBoxLayout() select_parent_and_object_layout = QtWidgets.QVBoxLayout() select_parent_layout = QtWidgets.QVBoxLayout() select_parent_grp = grpbox("Select parent", select_parent_layout) parent_cbbox_layout = QtWidgets.QHBoxLayout() parent_cbbox_layout.addWidget(self.modules_cbbox) parent_cbbox_layout.addWidget(self.outputs_cbbox) select_parent_layout.addLayout(parent_cbbox_layout) select_parent_and_object_layout.addWidget(select_parent_grp) select_parent_and_object_layout.addWidget(self.refresh_btn) side_layout = QtWidgets.QVBoxLayout() side_grp = grpbox("Side", side_layout) side_layout.addWidget(self.side_cbbox) chain_type_layout = QtWidgets.QVBoxLayout() chain_type_grp = grpbox("Fk/Ik chain type", chain_type_layout) chain_type_layout.addWidget(self.fk_ik_type_cbbox) main_layout.addLayout(select_parent_and_object_layout) main_layout.addWidget(side_grp) main_layout.addWidget(chain_type_grp) main_layout.addWidget(self.prebuild_btn) self.setLayout(main_layout)
def setup_parts_ui(self): def create_category_combobox(): self.category_combobox.setModel(self.model.categories) self.category_combobox.currentIndexChanged.connect( self.main_ctrl.category_changed) self.category_combobox.currentIndexChanged.connect( lambda: self.add_btn.setDisabled(self.model.add_btn_disabled)) self.model.selected_category = self.category_combobox.currentText() return self.category_combobox def create_subcategory_combobox(): self.subcategory_combobox.setModel(self.model.subcategories) self.subcategory_combobox.currentIndexChanged.connect( self.main_ctrl.subcategory_changed) self.subcategory_combobox.currentIndexChanged.connect( lambda: self.add_btn.setDisabled(self.model.add_btn_disabled)) self.model.selected_subcategory = self.subcategory_combobox.currentText( ) return self.subcategory_combobox def create_script_selector(): return self.script_selector def create_name_textbox(): name_textbox = QtWidgets.QLineEdit() # Replace spaces with underscores def name_fixup(): old_cursor_pos = name_textbox.cursorPosition() name_textbox.setText(name_textbox.text().replace(" ", "_")) name_textbox.setCursorPosition(old_cursor_pos) name_textbox.setPlaceholderText("Name") # name_validator = QtGui.QRegExpValidator(QtCore.QRegExp("^[a-zA-Z][a-zA-Z\d#_ ]*")) # name_textbox.setValidator(name_validator) name_textbox.textChanged.connect(name_fixup) name_textbox.textChanged.connect(self.main_ctrl.name_changed) name_textbox.textChanged.connect( lambda: self.add_btn.setDisabled(self.model.add_btn_disabled)) return name_textbox def create_add_btn(): self.add_btn.setDisabled(1) return self.add_btn parts_layout = QtWidgets.QHBoxLayout() parts_grp = grpbox("Parts", parts_layout) parts_layout.addWidget(create_category_combobox()) parts_layout.addWidget(create_subcategory_combobox()) parts_layout.addWidget(create_script_selector()) parts_layout.addWidget(create_name_textbox()) parts_layout.addWidget(create_add_btn()) parts_grp.setLayout(parts_layout) self.main_layout.addWidget(parts_grp)
def setup_ui(self): main_layout = QtWidgets.QVBoxLayout() options_layout = QtWidgets.QVBoxLayout() options_grp = grpbox("Options", options_layout) ctrls_layout = QtWidgets.QVBoxLayout() ctrls_text = QtWidgets.QLabel("Option :") ctrls_layout.addWidget(ctrls_text) options_layout.addLayout(ctrls_layout) main_layout.addWidget(options_grp) self.setLayout(main_layout)
def setup_properties_ui(self): def create_scroll_area(): scroll_area = QtWidgets.QScrollArea() scroll_area.setWidgetResizable(1) scroll_area.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn) scrollable_widget = QtWidgets.QWidget() scrollable_widget.setLayout(self.scrollable_layout) scroll_area.setWidget(scrollable_widget) return scroll_area properties_layout = QtWidgets.QVBoxLayout() properties_grp = grpbox("Properties", properties_layout) properties_layout.addWidget(create_scroll_area()) self.main_layout.addWidget(properties_grp)
def setup_ui(self): text = QtWidgets.QLabel("Module de base") self.character_name.textChanged.connect( self.ctrl.on_character_name_changed) self.prebuild_btn.clicked.connect(self.ctrl.prebuild) main_layout = QtWidgets.QVBoxLayout() character_name_layout = QtWidgets.QVBoxLayout() character_name_grp = grpbox("Character name", character_name_layout) character_name_layout.addWidget(self.character_name) main_layout.addWidget(text) text.setAlignment(QtCore.Qt.AlignCenter) main_layout.addWidget(character_name_grp) main_layout.addWidget(self.prebuild_btn) self.setLayout(main_layout)
def setup_build_area(self): def create_execute_all_btn(): execute_all_btn = push_button("Execute All", self.main_ctrl.execute_all) return execute_all_btn def create_prebuild_all_btn(): prebuild_all_btn = push_button("Prebuild All", self.main_ctrl.prebuild_all) return prebuild_all_btn build_layout = QtWidgets.QHBoxLayout() build_grp = grpbox("Build", build_layout) build_layout.addWidget(create_prebuild_all_btn()) build_layout.addWidget(create_execute_all_btn()) self.main_layout.addWidget(build_grp) pass
def setup_ui(self): text = QtWidgets.QLabel("Select a curve to rig") self.how_many_ctrls.setMinimum(1) self.how_many_ctrls.valueChanged.connect( self.ctrl.on_how_many_ctrls_changed) main_layout = QtWidgets.QVBoxLayout() options_layout = QtWidgets.QVBoxLayout() options_grp = grpbox("Options", options_layout) ctrls_layout = QtWidgets.QVBoxLayout() ctrls_text = QtWidgets.QLabel("How many ctrls :") ctrls_layout.addWidget(ctrls_text) ctrls_layout.addWidget(self.how_many_ctrls) options_layout.addLayout(ctrls_layout) main_layout.addWidget(text) text.setAlignment(QtCore.Qt.AlignCenter) main_layout.addWidget(options_grp) self.setLayout(main_layout)
def setup_ui(self): self.modules_cbbox.setModel(self.ctrl.modules_with_output) self.modules_cbbox.currentTextChanged.connect( self.ctrl.on_modules_cbbox_changed) self.outputs_cbbox.setModel(self.ctrl.outputs_model) self.outputs_cbbox.currentTextChanged.connect( self.ctrl.on_outputs_cbbox_changed) self.how_many_jnts.setMinimum(1) self.how_many_jnts.valueChanged.connect( self.ctrl.on_how_many_jnts_changed) self.how_many_ctrls.setMinimum(2) self.how_many_ctrls.setMaximum(self.model.how_many_jnts) self.how_many_ctrls.valueChanged.connect( self.ctrl.on_how_many_ctrls_changed) self.how_many_levels.setMinimum(2) self.how_many_levels.setMaximum(self.model.how_many_jnts) self.how_many_levels.valueChanged.connect( self.ctrl.on_how_many_levels_changed) self.space_modules_cbbox.setModel(self.ctrl.modules_with_spaces) self.space_modules_cbbox.currentTextChanged.connect( self.ctrl.on_space_modules_cbbox_changed) self.spaces_cbbox.setModel(self.ctrl.spaces_model) self.spaces_cbbox.currentTextChanged.connect( self.ctrl.on_spaces_cbbox_changed) self.space_list_view.setSelectionMode( QtWidgets.QAbstractItemView.ExtendedSelection) self.space_list.setStringList(self.model.space_list) self.space_list_view.setModel(self.space_list) self.add_space_btn.clicked.connect(self.ctrl.add_space_to_list) self.remove_space_btn.clicked.connect(self.ctrl.remove_space_from_list) self.refresh_spaces_btn.clicked.connect(self.ctrl.look_for_spaces) self.refresh_btn.clicked.connect(self.ctrl.look_for_parent) self.prebuild_btn.clicked.connect(self.ctrl.prebuild) main_layout = QtWidgets.QVBoxLayout() select_parent_layout = QtWidgets.QVBoxLayout() select_parent_grp = grpbox("Select parent", select_parent_layout) cbbox_layout = QtWidgets.QHBoxLayout() cbbox_layout.addWidget(self.modules_cbbox) cbbox_layout.addWidget(self.outputs_cbbox) select_parent_layout.addLayout(cbbox_layout) select_parent_layout.addWidget(self.refresh_btn) select_spaces_layout = QtWidgets.QVBoxLayout() select_spaces_grp = grpbox("Select local spaces :", select_spaces_layout) spaces_cbbox_layout = QtWidgets.QHBoxLayout() spaces_cbbox_layout.addWidget(self.space_modules_cbbox) spaces_cbbox_layout.addWidget(self.spaces_cbbox) btn_layout = QtWidgets.QVBoxLayout() btn_layout.addWidget(self.refresh_spaces_btn) btn_layout.addWidget(self.add_space_btn) select_spaces_layout.addLayout(spaces_cbbox_layout) select_spaces_layout.addLayout(btn_layout) space_list_layout = QtWidgets.QVBoxLayout() space_list_grp = grpbox("local spaces :", space_list_layout) space_list_layout.addWidget(self.space_list_view) space_list_layout.addWidget(self.remove_space_btn) options_layout = QtWidgets.QVBoxLayout() options_grp = grpbox("Options", options_layout) how_many_layout = QtWidgets.QVBoxLayout() jnts_layout = QtWidgets.QVBoxLayout() jnts_text = QtWidgets.QLabel("How many jnts :") jnts_layout.addWidget(jnts_text) jnts_layout.addWidget(self.how_many_jnts) ctrls_layout = QtWidgets.QVBoxLayout() ctrls_text = QtWidgets.QLabel("How many ctrls sections in spine :") ctrls_layout.addWidget(ctrls_text) ctrls_layout.addWidget(self.how_many_ctrls) levels_layout = QtWidgets.QVBoxLayout() levels_text = QtWidgets.QLabel("How many autoswim levels :") levels_layout.addWidget(levels_text) levels_layout.addWidget(self.how_many_levels) how_many_layout.addLayout(jnts_layout) how_many_layout.addLayout(ctrls_layout) how_many_layout.addLayout(levels_layout) options_layout.addLayout(how_many_layout) main_layout.addWidget(select_parent_grp) main_layout.addWidget(options_grp) main_layout.addWidget(select_spaces_grp) main_layout.addWidget(space_list_grp) main_layout.addWidget(self.prebuild_btn) self.setLayout(main_layout)
def setup_ui(self): self.mesh_to_follow.textChanged.connect(self.ctrl.on_mesh_to_follow_changed) self.top_selection_view.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection) self.top_selection.setStringList(self.model.top_selection) self.top_selection_view.setModel(self.top_selection) self.set_top_btn.clicked.connect(self.ctrl.set_top_selection) self.add_top_btn.clicked.connect(self.ctrl.add_top_selection) self.remove_top_btn.clicked.connect(self.ctrl.remove_from_top_selection) self.bot_selection_view.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection) self.bot_selection.setStringList(self.model.bot_selection) self.bot_selection_view.setModel(self.bot_selection) self.set_bot_btn.clicked.connect(self.ctrl.set_bot_selection) self.add_bot_btn.clicked.connect(self.ctrl.add_bot_selection) self.remove_bot_btn.clicked.connect(self.ctrl.remove_from_bot_selection) self.top_creation_switch.stateChanged.connect(self.ctrl.on_top_creation_switch_changed) self.bot_creation_switch.stateChanged.connect(self.ctrl.on_bot_creation_switch_changed) self.how_many_top_ctrls_cbbox.insertItems(0, ["5", "7"]) self.how_many_top_ctrls_cbbox.currentTextChanged.connect(self.ctrl.on_how_many_top_ctrls_cbbox_changed) self.how_many_bot_ctrls_cbbox.insertItems(0, ["5", "7"]) self.how_many_bot_ctrls_cbbox.currentTextChanged.connect(self.ctrl.on_how_many_bot_ctrls_cbbox_changed) self.loft_axis_cbbox.insertItems(0, ["X", "Y", "Z"]) self.loft_axis_cbbox.currentTextChanged.connect(self.ctrl.on_loft_axis_cbbox_changed) self.set_mesh_btn.clicked.connect(self.ctrl.set_mesh_to_follow) self.prebuild_btn.clicked.connect(self.ctrl.prebuild) main_layout = QtWidgets.QVBoxLayout() mesh_to_follow_layout = QtWidgets.QVBoxLayout() mesh_to_follow_grp = grpbox("Mesh to attach the ctrls to:", mesh_to_follow_layout) mesh_to_follow_layout.addWidget(self.mesh_to_follow) mesh_to_follow_layout.addWidget(self.set_mesh_btn) top_selection_layout = QtWidgets.QVBoxLayout() self.top_selection_grp = grpbox("Select top Components :", top_selection_layout) top_selection_layout.addWidget(self.set_top_btn) top_selection_layout.addWidget(self.top_selection_view) top_btn_layout = QtWidgets.QHBoxLayout() top_btn_layout.addWidget(self.add_top_btn) top_btn_layout.addWidget(self.remove_top_btn) top_selection_layout.addLayout(top_btn_layout) bot_selection_layout = QtWidgets.QVBoxLayout() self.bot_selection_grp = grpbox("Select bot Components :", bot_selection_layout) bot_selection_layout.addWidget(self.set_bot_btn) bot_selection_layout.addWidget(self.bot_selection_view) bot_btn_layout = QtWidgets.QHBoxLayout() bot_btn_layout.addWidget(self.add_bot_btn) bot_btn_layout.addWidget(self.remove_bot_btn) bot_selection_layout.addLayout(bot_btn_layout) top_switch_layout = QtWidgets.QHBoxLayout() top_switch_text = QtWidgets.QLabel("Create Top Ribbon:") top_switch_layout.addWidget(top_switch_text) top_switch_layout.addWidget(self.top_creation_switch) bot_switch_layout = QtWidgets.QHBoxLayout() bot_switch_text = QtWidgets.QLabel("Create Bot Ribbon:") bot_switch_layout.addWidget(bot_switch_text) bot_switch_layout.addWidget(self.bot_creation_switch) how_many_top_layout = QtWidgets.QVBoxLayout() self.how_many_top_grp = grpbox("How many ctrls :", how_many_top_layout) how_many_top_layout.addWidget(self.how_many_top_ctrls_cbbox) how_many_bot_layout = QtWidgets.QVBoxLayout() self.how_many_bot_grp = grpbox("How many ctrls :", how_many_bot_layout) how_many_bot_layout.addWidget(self.how_many_bot_ctrls_cbbox) loft_axis_layout = QtWidgets.QHBoxLayout() loft_axis_grp = grpbox("Ribbons surface's main Axis:", loft_axis_layout) loft_axis_layout.addWidget(self.loft_axis_cbbox) # options_layout = QtWidgets.QVBoxLayout() # options_grp = grpbox("Options", options_layout) # # ctrls_layout = QtWidgets.QVBoxLayout() # ctrls_text = QtWidgets.QLabel("Option :") # ctrls_layout.addWidget(ctrls_text) # # options_layout.addLayout(ctrls_layout) main_layout.addWidget(mesh_to_follow_grp) main_layout.addWidget(loft_axis_grp) main_layout.addLayout(top_switch_layout) main_layout.addWidget(self.how_many_top_grp) main_layout.addWidget(self.top_selection_grp) main_layout.addLayout(bot_switch_layout) main_layout.addWidget(self.how_many_bot_grp) main_layout.addWidget(self.bot_selection_grp) # main_layout.addWidget(options_grp) self.setLayout(main_layout)