diff --git a/release/scripts/mgear/shifter_classic_components/squash_01/__init__.py b/release/scripts/mgear/shifter_classic_components/squash_01/__init__.py index 312276b7..30c67834 100644 --- a/release/scripts/mgear/shifter_classic_components/squash_01/__init__.py +++ b/release/scripts/mgear/shifter_classic_components/squash_01/__init__.py @@ -24,47 +24,57 @@ def addObjects(self): self.normal = self.guide.blades["blade"].z * -1 self.binormal = self.guide.blades["blade"].x - t = transform.getTransformLookingAt(self.guide.apos[0], - self.guide.apos[1], - self.normal, - axis="yx", - negate=self.negate) - self.ctl_npo = primitive.addTransform(self.root, - self.getName("ctl_npo"), t) - self.ctl = self.addCtl(self.ctl_npo, - "base_ctl", - t, - self.color_ik, - "square", - w=1.0, - tp=self.parentCtlTag) - - self.ref_base = primitive.addTransform(self.ctl, - self.getName("ref_base"), - t) + t = transform.getTransformLookingAt( + self.guide.apos[0], + self.guide.apos[1], + self.normal, + axis="yx", + negate=self.negate, + ) + self.ctl_npo = primitive.addTransform( + self.root, self.getName("ctl_npo"), t + ) + self.ctl = self.addCtl( + self.ctl_npo, + "base_ctl", + t, + self.color_ik, + "square", + w=1.0, + tp=self.parentCtlTag, + ) + + self.ref_base = primitive.addTransform( + self.ctl, self.getName("ref_base"), t + ) + self.in_SDK = primitive.addTransform( + self.ref_base, self.getName("in_SDK"), t + ) t = transform.setMatrixPosition(t, self.guide.apos[1]) - self.ik_cns = primitive.addTransform(self.ctl, - self.getName("ik_cns"), - t) - self.squash_npo = primitive.addTransform(self.ik_cns, - self.getName("squash_npo"), - t) - self.squash_ctl = self.addCtl(self.squash_npo, - "squash_ctl", - t, - self.color_ik, - "crossarrow", - w=1.0, - ro=dt.Vector(1.5708, 0, 0), - tp=self.ctl) + self.ik_cns = primitive.addTransform( + self.ctl, self.getName("ik_cns"), t + ) + self.squash_npo = primitive.addTransform( + self.ik_cns, self.getName("squash_npo"), t + ) + self.squash_ctl = self.addCtl( + self.squash_npo, + "squash_ctl", + t, + self.color_ik, + "crossarrow", + w=1.0, + ro=dt.Vector(1.5708, 0, 0), + tp=self.ctl, + ) attribute.setKeyableAttributes(self.squash_ctl, ["tx", "ty", "tz"]) - self.ref_squash = primitive.addTransform(self.squash_ctl, - self.getName("ref_squash"), - t) + self.ref_squash = primitive.addTransform( + self.squash_ctl, self.getName("ref_squash"), t + ) self.div_cns = [] @@ -87,7 +97,59 @@ def addAttributes(self): "ikref", "Ik Ref", 0, - self.settings["ikrefarray"].split(",")) + self.settings["ikrefarray"].split(","), + ) + + # setup param + self.squashX_att = self.addSetupParam( + "squashX", + "Squash X Mult", + "double", + self.settings["squashX"], + 0, + 1, + ) + self.squashY_att = self.addSetupParam( + "squashY", + "Squash Y Mult", + "double", + self.settings["squashY"], + 0, + 1, + ) + self.squashZ_att = self.addSetupParam( + "squashZ", + "Squash Z Mult", + "double", + self.settings["squashZ"], + 0, + 1, + ) + + self.stretchX_att = self.addSetupParam( + "stretchX", + "Stretch X Mult", + "double", + self.settings["stretchX"], + 0, + 1, + ) + self.stretchY_att = self.addSetupParam( + "stretchY", + "Stretch Y Mult", + "double", + self.settings["stretchY"], + 0, + 1, + ) + self.stretchZ_att = self.addSetupParam( + "stretchZ", + "Stretch Z Mult", + "double", + self.settings["stretchZ"], + 0, + 1, + ) # ===================================================== # OPERATORS @@ -100,31 +162,38 @@ def addOperators(self): we shouldn't create any new object in this method. """ - applyop.aimCns(self.ref_base, - self.squash_ctl, - axis="yx", - wupType=2, - wupVector=[1, 0, 0], - wupObject=self.ctl, - maintainOffset=False) - applyop.aimCns(self.ref_squash, - self.ctl, - axis="-yx", - wupType=2, - wupVector=[1, 0, 0], - wupObject=self.squash_ctl, - maintainOffset=False) + applyop.aimCns( + self.ref_base, + self.squash_ctl, + axis="yx", + wupType=2, + wupVector=[1, 0, 0], + wupObject=self.ctl, + maintainOffset=False, + ) + applyop.aimCns( + self.ref_squash, + self.ctl, + axis="-yx", + wupType=2, + wupVector=[1, 0, 0], + wupObject=self.squash_ctl, + maintainOffset=False, + ) bIncrement = 1.0 blend = 0 for i, div_cns in enumerate(self.div_cns): intMatrix = applyop.gear_intmatrix_op( - self.ref_base.attr("worldMatrix"), + self.in_SDK.attr("worldMatrix"), self.ref_squash.attr("worldMatrix"), - blend) + blend, + ) - applyop.gear_mulmatrix_op(intMatrix.attr("output"), - div_cns.attr("parentInverseMatrix[0]"), - div_cns) + applyop.gear_mulmatrix_op( + intMatrix.attr("output"), + div_cns.attr("parentInverseMatrix[0]"), + div_cns, + ) blend = blend + bIncrement @@ -132,10 +201,12 @@ def addOperators(self): dist_node = node.createDistNode(self.squash_ctl, self.ctl) rootWorld_node = node.createDecomposeMatrixNode( - self.ctl.attr("worldMatrix")) + self.ctl.attr("worldMatrix") + ) - div_node = node.createDivNode(dist_node + ".distance", - rootWorld_node + ".outputScaleY") + div_node = node.createDivNode( + dist_node + ".distance", rootWorld_node + ".outputScaleY" + ) div_node = node.createDivNode(div_node + ".outputX", d) rev_node = node.createReverseNode(div_node + ".outputX") @@ -144,9 +215,31 @@ def addOperators(self): add_node.input1D[0].set(1.0) rev_node.outputX >> add_node.input1D[1] - div_node.outputX >> self.ref_base.scaleY - add_node.output1D >> self.ref_base.scaleX - add_node.output1D >> self.ref_base.scaleZ + # div_node.outputX >> self.ref_base.scaleY + # add_node.output1D >> self.ref_base.scaleX + # add_node.output1D >> self.ref_base.scaleZ + + self.conditional_scale_multiplier( + div_node.outputX, + div_node.outputX, + self.stretchX_att, + self.squashX_att, + self.ref_base.scaleX, + ) + self.conditional_scale_multiplier( + div_node.outputX, + add_node.output1D, + self.stretchY_att, + self.squashY_att, + self.ref_base.scaleY, + ) + self.conditional_scale_multiplier( + div_node.outputX, + div_node.outputX, + self.stretchZ_att, + self.squashZ_att, + self.ref_base.scaleZ, + ) # ===================================================== # CONNECTOR @@ -169,3 +262,52 @@ def setRelation(self): def connect_standard(self): """standard connection definition for the component""" self.connect_standardWithSimpleIkRef() + + # helper + def conditional_scale_multiplier( + self, cond_attr, driver_attr, attrA, attrB, output_value + ): + """ + Adjusts the output value to be 1 when driver_attr is 1.0, and uses attrA or attrB + to multiply based on the difference from 1.0 when driver_attr changes. + + Args: + driver_attr (pm.Attribute): The driving attribute. + attrA (pm.Attribute): Attribute to multiply with if driver_attr differs from 1.0. + attrB (pm.Attribute): Attribute to multiply with if driver_attr differs from 1.0. + output_value (pm.Attribute): The attribute to receive the final scaled value. + """ + # Create necessary nodes + condition_node = pm.createNode("condition") + multiply_node_a = pm.createNode("multiplyDivide") + multiply_node_b = pm.createNode("multiplyDivide") + plus_minus_node = pm.createNode("plusMinusAverage") + subtract_node = pm.createNode("plusMinusAverage") + + # Setup subtract node to calculate difference from 1.0 + subtract_node.operation.set(2) # Subtract operation + subtract_node.input1D[0].set(1.0) + driver_attr >> subtract_node.input1D[1] + + # Setup condition node + cond_attr >> condition_node.firstTerm + condition_node.secondTerm.set(1) + condition_node.operation.set(4) # Less than + + # Connect subtract node to multiply nodes + subtract_node.output1D >> multiply_node_a.input1X + attrA >> multiply_node_a.input2X + subtract_node.output1D >> multiply_node_b.input1X + attrB >> multiply_node_b.input2X + + # Connect multiply nodes to condition node + multiply_node_a.outputX >> condition_node.colorIfFalseR + multiply_node_b.outputX >> condition_node.colorIfTrueR + + # Setup plusMinusAverage node + plus_minus_node.operation.set(1) # Sum operation + plus_minus_node.input1D[0].set(1.0) + condition_node.outColorR >> plus_minus_node.input1D[1] + + # Connect plusMinusAverage node to output value + plus_minus_node.output1D >> output_value diff --git a/release/scripts/mgear/shifter_classic_components/squash_01/guide.py b/release/scripts/mgear/shifter_classic_components/squash_01/guide.py index 0e84e444..b4b912c5 100644 --- a/release/scripts/mgear/shifter_classic_components/squash_01/guide.py +++ b/release/scripts/mgear/shifter_classic_components/squash_01/guide.py @@ -64,6 +64,12 @@ def addParameters(self): -1, None, None) + self.pSquashX = self.addParam("squashX", "double", 1, 0, 1) + self.pSquashY = self.addParam("squashY", "double", 1, 0, 1) + self.pSquashZ = self.addParam("squashZ", "double", 1, 0, 1) + self.pStretchX = self.addParam("stretchX", "double", 1, 0, 1) + self.pStretchY = self.addParam("stretchY", "double", 1, 0, 1) + self.pStretchZ = self.addParam("stretchZ", "double", 1, 0, 1) ########################################################## # Setting Page @@ -120,6 +126,27 @@ def populate_componentControls(self): for item in refArrayItems: self.settingsTab.refArray_listWidget.addItem(item) + self.settingsTab.squashX_slider.setValue(int(self.root.attr("squashX").get() * 100)) + self.settingsTab.squashX_spinBox.setValue(int(self.root.attr("squashX").get() * 100)) + + self.settingsTab.squashY_slider.setValue(int(self.root.attr("squashY").get() * 100)) + self.settingsTab.squashY_spinBox.setValue(int(self.root.attr("squashY").get() * 100)) + + self.settingsTab.squashZ_slider.setValue(int(self.root.attr("squashZ").get() * 100)) + self.settingsTab.squashZ_spinBox.setValue(int(self.root.attr("squashZ").get() * 100)) + + + self.settingsTab.stretchX_slider.setValue(int(self.root.attr("stretchX").get() * 100)) + self.settingsTab.stretchX_spinBox.setValue(int(self.root.attr("stretchX").get() * 100)) + + self.settingsTab.stretchY_slider.setValue(int(self.root.attr("stretchY").get() * 100)) + self.settingsTab.stretchY_spinBox.setValue(int(self.root.attr("stretchY").get() * 100)) + + self.settingsTab.stretchZ_slider.setValue(int(self.root.attr("stretchZ").get() * 100)) + self.settingsTab.stretchZ_spinBox.setValue(int(self.root.attr("stretchZ").get() * 100)) + + + def create_componentLayout(self): self.settings_layout = QtWidgets.QVBoxLayout() @@ -140,6 +167,24 @@ def create_componentConnections(self): "ikrefarray")) self.settingsTab.refArray_listWidget.installEventFilter(self) + self.settingsTab.squashX_slider.valueChanged.connect(partial(self.updateSlider, self.settingsTab.squashX_slider, "squashX")) + self.settingsTab.squashX_spinBox.valueChanged.connect(partial(self.updateSlider, self.settingsTab.squashX_spinBox, "squashX")) + + self.settingsTab.squashY_slider.valueChanged.connect(partial(self.updateSlider, self.settingsTab.squashY_slider, "squashY")) + self.settingsTab.squashY_spinBox.valueChanged.connect(partial(self.updateSlider, self.settingsTab.squashY_spinBox, "squashY")) + + self.settingsTab.squashZ_slider.valueChanged.connect(partial(self.updateSlider, self.settingsTab.squashZ_slider, "squashZ")) + self.settingsTab.squashZ_spinBox.valueChanged.connect(partial(self.updateSlider, self.settingsTab.squashZ_spinBox, "squashZ")) + + self.settingsTab.stretchX_slider.valueChanged.connect(partial(self.updateSlider, self.settingsTab.stretchX_slider, "stretchX")) + self.settingsTab.stretchX_spinBox.valueChanged.connect(partial(self.updateSlider, self.settingsTab.stretchX_spinBox, "stretchX")) + + self.settingsTab.stretchY_slider.valueChanged.connect(partial(self.updateSlider, self.settingsTab.stretchY_slider, "stretchY")) + self.settingsTab.stretchY_spinBox.valueChanged.connect(partial(self.updateSlider, self.settingsTab.stretchY_spinBox, "stretchY")) + + self.settingsTab.stretchZ_slider.valueChanged.connect(partial(self.updateSlider, self.settingsTab.stretchZ_slider, "stretchZ")) + self.settingsTab.stretchZ_spinBox.valueChanged.connect(partial(self.updateSlider, self.settingsTab.stretchZ_spinBox, "stretchZ")) + def eventFilter(self, sender, event): if event.type() == QtCore.QEvent.ChildRemoved: if sender == self.settingsTab.refArray_listWidget: diff --git a/release/scripts/mgear/shifter_classic_components/squash_01/settingsUI.py b/release/scripts/mgear/shifter_classic_components/squash_01/settingsUI.py index f6a9444c..a7d0403e 100644 --- a/release/scripts/mgear/shifter_classic_components/squash_01/settingsUI.py +++ b/release/scripts/mgear/shifter_classic_components/squash_01/settingsUI.py @@ -1,42 +1,126 @@ -# MGEAR is under the terms of the MIT License +# -*- coding: utf-8 -*- -# Copyright (c) 2016 Jeremie Passerin, Miquel Campos +# Form implementation generated from reading ui file 'C:/datawork/repo/mgear4/release/scripts/mgear/shifter_classic_components/squash_01/settingsUI.ui', +# licensing of 'C:/datawork/repo/mgear4/release/scripts/mgear/shifter_classic_components/squash_01/settingsUI.ui' applies. +# +# Created: Thu Nov 16 13:22:19 2023 +# by: pyside2-uic running on PySide2 5.12.5 +# +# WARNING! All changes made in this file will be lost! -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: - -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -# Author: Jeremie Passerin -# Author: Miquel Campos www.mcsgear.com -# Date: 2016 / 10 / 10 - -import mgear.core.pyqt as gqt -QtGui, QtCore, QtWidgets, wrapInstance = gqt.qt_import() +from PySide2 import QtCore, QtGui, QtWidgets class Ui_Form(object): def setupUi(self, Form): Form.setObjectName("Form") - Form.resize(290, 188) - self.gridLayout = QtWidgets.QGridLayout(Form) - self.gridLayout.setObjectName("gridLayout") + Form.resize(494, 748) + self.verticalLayout_2 = QtWidgets.QVBoxLayout(Form) + self.verticalLayout_2.setObjectName("verticalLayout_2") + self.groupBox = QtWidgets.QGroupBox(Form) + self.groupBox.setObjectName("groupBox") + self.verticalLayout = QtWidgets.QVBoxLayout(self.groupBox) + self.verticalLayout.setObjectName("verticalLayout") + self.horizontalLayout = QtWidgets.QHBoxLayout() + self.horizontalLayout.setObjectName("horizontalLayout") + self.squashX_label = QtWidgets.QLabel(self.groupBox) + self.squashX_label.setObjectName("squashX_label") + self.horizontalLayout.addWidget(self.squashX_label) + self.squashX_slider = QtWidgets.QSlider(self.groupBox) + self.squashX_slider.setMinimumSize(QtCore.QSize(0, 15)) + self.squashX_slider.setMaximum(100) + self.squashX_slider.setOrientation(QtCore.Qt.Horizontal) + self.squashX_slider.setObjectName("squashX_slider") + self.horizontalLayout.addWidget(self.squashX_slider) + self.squashX_spinBox = QtWidgets.QSpinBox(self.groupBox) + self.squashX_spinBox.setMaximum(100) + self.squashX_spinBox.setObjectName("squashX_spinBox") + self.horizontalLayout.addWidget(self.squashX_spinBox) + self.verticalLayout.addLayout(self.horizontalLayout) + self.horizontalLayout_2 = QtWidgets.QHBoxLayout() + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.squashY_label = QtWidgets.QLabel(self.groupBox) + self.squashY_label.setObjectName("squashY_label") + self.horizontalLayout_2.addWidget(self.squashY_label) + self.squashY_slider = QtWidgets.QSlider(self.groupBox) + self.squashY_slider.setMinimumSize(QtCore.QSize(0, 15)) + self.squashY_slider.setMaximum(100) + self.squashY_slider.setOrientation(QtCore.Qt.Horizontal) + self.squashY_slider.setObjectName("squashY_slider") + self.horizontalLayout_2.addWidget(self.squashY_slider) + self.squashY_spinBox = QtWidgets.QSpinBox(self.groupBox) + self.squashY_spinBox.setMaximum(100) + self.squashY_spinBox.setObjectName("squashY_spinBox") + self.horizontalLayout_2.addWidget(self.squashY_spinBox) + self.verticalLayout.addLayout(self.horizontalLayout_2) + self.horizontalLayout_3 = QtWidgets.QHBoxLayout() + self.horizontalLayout_3.setObjectName("horizontalLayout_3") + self.squashZ_label = QtWidgets.QLabel(self.groupBox) + self.squashZ_label.setObjectName("squashZ_label") + self.horizontalLayout_3.addWidget(self.squashZ_label) + self.squashZ_slider = QtWidgets.QSlider(self.groupBox) + self.squashZ_slider.setMinimumSize(QtCore.QSize(0, 15)) + self.squashZ_slider.setMaximum(100) + self.squashZ_slider.setOrientation(QtCore.Qt.Horizontal) + self.squashZ_slider.setObjectName("squashZ_slider") + self.horizontalLayout_3.addWidget(self.squashZ_slider) + self.squashZ_spinBox = QtWidgets.QSpinBox(self.groupBox) + self.squashZ_spinBox.setMaximum(100) + self.squashZ_spinBox.setObjectName("squashZ_spinBox") + self.horizontalLayout_3.addWidget(self.squashZ_spinBox) + self.verticalLayout.addLayout(self.horizontalLayout_3) + self.horizontalLayout_4 = QtWidgets.QHBoxLayout() + self.horizontalLayout_4.setObjectName("horizontalLayout_4") + self.stretchX_label = QtWidgets.QLabel(self.groupBox) + self.stretchX_label.setObjectName("stretchX_label") + self.horizontalLayout_4.addWidget(self.stretchX_label) + self.stretchX_slider = QtWidgets.QSlider(self.groupBox) + self.stretchX_slider.setMinimumSize(QtCore.QSize(0, 15)) + self.stretchX_slider.setMaximum(100) + self.stretchX_slider.setOrientation(QtCore.Qt.Horizontal) + self.stretchX_slider.setObjectName("stretchX_slider") + self.horizontalLayout_4.addWidget(self.stretchX_slider) + self.stretchX_spinBox = QtWidgets.QSpinBox(self.groupBox) + self.stretchX_spinBox.setMaximum(100) + self.stretchX_spinBox.setObjectName("stretchX_spinBox") + self.horizontalLayout_4.addWidget(self.stretchX_spinBox) + self.verticalLayout.addLayout(self.horizontalLayout_4) + self.horizontalLayout_5 = QtWidgets.QHBoxLayout() + self.horizontalLayout_5.setObjectName("horizontalLayout_5") + self.stretchY_label = QtWidgets.QLabel(self.groupBox) + self.stretchY_label.setObjectName("stretchY_label") + self.horizontalLayout_5.addWidget(self.stretchY_label) + self.stretchY_slider = QtWidgets.QSlider(self.groupBox) + self.stretchY_slider.setMinimumSize(QtCore.QSize(0, 15)) + self.stretchY_slider.setMaximum(100) + self.stretchY_slider.setOrientation(QtCore.Qt.Horizontal) + self.stretchY_slider.setObjectName("stretchY_slider") + self.horizontalLayout_5.addWidget(self.stretchY_slider) + self.stretchY_spinBox = QtWidgets.QSpinBox(self.groupBox) + self.stretchY_spinBox.setMaximum(100) + self.stretchY_spinBox.setObjectName("stretchY_spinBox") + self.horizontalLayout_5.addWidget(self.stretchY_spinBox) + self.verticalLayout.addLayout(self.horizontalLayout_5) + self.horizontalLayout_6 = QtWidgets.QHBoxLayout() + self.horizontalLayout_6.setObjectName("horizontalLayout_6") + self.stretchZ_label = QtWidgets.QLabel(self.groupBox) + self.stretchZ_label.setObjectName("stretchZ_label") + self.horizontalLayout_6.addWidget(self.stretchZ_label) + self.stretchZ_slider = QtWidgets.QSlider(self.groupBox) + self.stretchZ_slider.setMinimumSize(QtCore.QSize(0, 15)) + self.stretchZ_slider.setMaximum(100) + self.stretchZ_slider.setOrientation(QtCore.Qt.Horizontal) + self.stretchZ_slider.setObjectName("stretchZ_slider") + self.horizontalLayout_6.addWidget(self.stretchZ_slider) + self.stretchZ_spinBox = QtWidgets.QSpinBox(self.groupBox) + self.stretchZ_spinBox.setMaximum(100) + self.stretchZ_spinBox.setObjectName("stretchZ_spinBox") + self.horizontalLayout_6.addWidget(self.stretchZ_spinBox) + self.verticalLayout.addLayout(self.horizontalLayout_6) + self.verticalLayout_2.addWidget(self.groupBox) self.upvRefArray_groupBox = QtWidgets.QGroupBox(Form) self.upvRefArray_groupBox.setObjectName("upvRefArray_groupBox") - self.verticalLayout = QtWidgets.QVBoxLayout(self.upvRefArray_groupBox) - self.verticalLayout.setObjectName("verticalLayout") + self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.upvRefArray_groupBox) + self.verticalLayout_3.setObjectName("verticalLayout_3") self.upvRefArray_horizontalLayout = QtWidgets.QHBoxLayout() self.upvRefArray_horizontalLayout.setObjectName("upvRefArray_horizontalLayout") self.upvRefArray_verticalLayout_1 = QtWidgets.QVBoxLayout() @@ -62,15 +146,42 @@ def setupUi(self, Form): spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.upvRefArray_verticalLayout_2.addItem(spacerItem) self.upvRefArray_horizontalLayout.addLayout(self.upvRefArray_verticalLayout_2) - self.verticalLayout.addLayout(self.upvRefArray_horizontalLayout) - self.gridLayout.addWidget(self.upvRefArray_groupBox, 0, 0, 1, 1) + self.verticalLayout_3.addLayout(self.upvRefArray_horizontalLayout) + self.verticalLayout_2.addWidget(self.upvRefArray_groupBox) + spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.verticalLayout_2.addItem(spacerItem1) self.retranslateUi(Form) + QtCore.QObject.connect(self.squashX_slider, QtCore.SIGNAL("valueChanged(int)"), self.squashX_spinBox.setValue) + QtCore.QObject.connect(self.squashX_spinBox, QtCore.SIGNAL("valueChanged(int)"), self.squashX_slider.setValue) + QtCore.QObject.connect(self.squashY_slider, QtCore.SIGNAL("valueChanged(int)"), self.squashY_spinBox.setValue) + QtCore.QObject.connect(self.squashY_spinBox, QtCore.SIGNAL("valueChanged(int)"), self.squashY_slider.setValue) + QtCore.QObject.connect(self.squashZ_slider, QtCore.SIGNAL("valueChanged(int)"), self.squashZ_spinBox.setValue) + QtCore.QObject.connect(self.squashZ_spinBox, QtCore.SIGNAL("valueChanged(int)"), self.squashZ_slider.setValue) + QtCore.QObject.connect(self.stretchX_slider, QtCore.SIGNAL("valueChanged(int)"), self.stretchX_spinBox.setValue) + QtCore.QObject.connect(self.stretchX_spinBox, QtCore.SIGNAL("valueChanged(int)"), self.stretchX_slider.setValue) + QtCore.QObject.connect(self.stretchY_slider, QtCore.SIGNAL("valueChanged(int)"), self.stretchY_spinBox.setValue) + QtCore.QObject.connect(self.stretchY_spinBox, QtCore.SIGNAL("valueChanged(int)"), self.stretchY_slider.setValue) + QtCore.QObject.connect(self.stretchZ_slider, QtCore.SIGNAL("valueChanged(int)"), self.stretchZ_spinBox.setValue) + QtCore.QObject.connect(self.stretchZ_spinBox, QtCore.SIGNAL("valueChanged(int)"), self.stretchZ_slider.setValue) + QtCore.QObject.connect(self.squashX_slider, QtCore.SIGNAL("sliderMoved(int)"), self.squashX_spinBox.setValue) + QtCore.QObject.connect(self.squashY_slider, QtCore.SIGNAL("sliderMoved(int)"), self.squashY_spinBox.setValue) + QtCore.QObject.connect(self.squashZ_slider, QtCore.SIGNAL("sliderMoved(int)"), self.squashZ_spinBox.setValue) + QtCore.QObject.connect(self.stretchX_slider, QtCore.SIGNAL("sliderMoved(int)"), self.stretchX_spinBox.setValue) + QtCore.QObject.connect(self.stretchY_slider, QtCore.SIGNAL("sliderMoved(int)"), self.stretchY_spinBox.setValue) + QtCore.QObject.connect(self.stretchZ_slider, QtCore.SIGNAL("sliderMoved(int)"), self.stretchZ_spinBox.setValue) QtCore.QMetaObject.connectSlotsByName(Form) def retranslateUi(self, Form): - Form.setWindowTitle(gqt.fakeTranslate("Form", "Form", None, -1)) - self.upvRefArray_groupBox.setTitle(gqt.fakeTranslate("Form", "Tip Reference Array", None, -1)) - self.refArrayAdd_pushButton.setText(gqt.fakeTranslate("Form", "<<", None, -1)) - self.refArrayRemove_pushButton.setText(gqt.fakeTranslate("Form", ">>", None, -1)) + Form.setWindowTitle(QtWidgets.QApplication.translate("Form", "Form", None, -1)) + self.groupBox.setTitle(QtWidgets.QApplication.translate("Form", "Squash/Stretch Multipliers", None, -1)) + self.squashX_label.setText(QtWidgets.QApplication.translate("Form", "Squash X", None, -1)) + self.squashY_label.setText(QtWidgets.QApplication.translate("Form", "Squash Y", None, -1)) + self.squashZ_label.setText(QtWidgets.QApplication.translate("Form", "Squash Z", None, -1)) + self.stretchX_label.setText(QtWidgets.QApplication.translate("Form", "Stretch X", None, -1)) + self.stretchY_label.setText(QtWidgets.QApplication.translate("Form", "Stretch Y", None, -1)) + self.stretchZ_label.setText(QtWidgets.QApplication.translate("Form", "Stretch Z", None, -1)) + self.upvRefArray_groupBox.setTitle(QtWidgets.QApplication.translate("Form", "Tip Reference Array", None, -1)) + self.refArrayAdd_pushButton.setText(QtWidgets.QApplication.translate("Form", "<<", None, -1)) + self.refArrayRemove_pushButton.setText(QtWidgets.QApplication.translate("Form", ">>", None, -1)) diff --git a/release/scripts/mgear/shifter_classic_components/squash_01/settingsUI.ui b/release/scripts/mgear/shifter_classic_components/squash_01/settingsUI.ui index 56898f47..11e41507 100644 --- a/release/scripts/mgear/shifter_classic_components/squash_01/settingsUI.ui +++ b/release/scripts/mgear/shifter_classic_components/squash_01/settingsUI.ui @@ -6,20 +6,233 @@ 0 0 - 290 - 188 + 494 + 748 Form - - + + + + + Squash/Stretch Multipliers + + + + + + + + Squash X + + + + + + + + 0 + 15 + + + + 100 + + + Qt::Horizontal + + + + + + + 100 + + + + + + + + + + + Squash Y + + + + + + + + 0 + 15 + + + + 100 + + + Qt::Horizontal + + + + + + + 100 + + + + + + + + + + + Squash Z + + + + + + + + 0 + 15 + + + + 100 + + + Qt::Horizontal + + + + + + + 100 + + + + + + + + + + + Stretch X + + + + + + + + 0 + 15 + + + + 100 + + + Qt::Horizontal + + + + + + + 100 + + + + + + + + + + + Stretch Y + + + + + + + + 0 + 15 + + + + 100 + + + Qt::Horizontal + + + + + + + 100 + + + + + + + + + + + Stretch Z + + + + + + + + 0 + 15 + + + + 100 + + + Qt::Horizontal + + + + + + + 100 + + + + + + + + + Tip Reference Array - + @@ -84,8 +297,310 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + - + + + squashX_slider + valueChanged(int) + squashX_spinBox + setValue(int) + + + 297 + 69 + + + 425 + 64 + + + + + squashX_spinBox + valueChanged(int) + squashX_slider + setValue(int) + + + 426 + 77 + + + 240 + 73 + + + + + squashY_slider + valueChanged(int) + squashY_spinBox + setValue(int) + + + 343 + 110 + + + 436 + 117 + + + + + squashY_spinBox + valueChanged(int) + squashY_slider + setValue(int) + + + 420 + 98 + + + 337 + 101 + + + + + squashZ_slider + valueChanged(int) + squashZ_spinBox + setValue(int) + + + 373 + 146 + + + 427 + 151 + + + + + squashZ_spinBox + valueChanged(int) + squashZ_slider + setValue(int) + + + 427 + 166 + + + 350 + 145 + + + + + stretchX_slider + valueChanged(int) + stretchX_spinBox + setValue(int) + + + 368 + 194 + + + 409 + 196 + + + + + stretchX_spinBox + valueChanged(int) + stretchX_slider + setValue(int) + + + 424 + 184 + + + 357 + 197 + + + + + stretchY_slider + valueChanged(int) + stretchY_spinBox + setValue(int) + + + 368 + 227 + + + 464 + 247 + + + + + stretchY_spinBox + valueChanged(int) + stretchY_slider + setValue(int) + + + 425 + 229 + + + 372 + 229 + + + + + stretchZ_slider + valueChanged(int) + stretchZ_spinBox + setValue(int) + + + 351 + 270 + + + 410 + 274 + + + + + stretchZ_spinBox + valueChanged(int) + stretchZ_slider + setValue(int) + + + 420 + 284 + + + 359 + 287 + + + + + squashX_slider + sliderMoved(int) + squashX_spinBox + setValue(int) + + + 191 + 68 + + + 412 + 55 + + + + + squashY_slider + sliderMoved(int) + squashY_spinBox + setValue(int) + + + 157 + 108 + + + 444 + 112 + + + + + squashZ_slider + sliderMoved(int) + squashZ_spinBox + setValue(int) + + + 153 + 151 + + + 427 + 149 + + + + + stretchX_slider + sliderMoved(int) + stretchX_spinBox + setValue(int) + + + 170 + 197 + + + 426 + 200 + + + + + stretchY_slider + sliderMoved(int) + stretchY_spinBox + setValue(int) + + + 220 + 235 + + + 438 + 226 + + + + + stretchZ_slider + sliderMoved(int) + stretchZ_spinBox + setValue(int) + + + 184 + 280 + + + 418 + 274 + + + +