SkinningTools.UI.markingMenu
¶
Module Contents¶
Classes¶
the marking menu filter |
|
marking menu popup window |
|
simple widget to install the eventfilter on to test the markingmenu |
Functions¶
|
convenience function to display and build the testing application |
-
SkinningTools.UI.markingMenu.
_DEBUG
¶
-
class
SkinningTools.UI.markingMenu.
MarkingMenuFilter
(name='MarkingMenu', isDebug=False, parent=None)¶ the marking menu filter this eventfilter will grab mouse inputs and when the conditions are met it will spawn a popup window at the mouse location
-
_singleton
¶
-
eventFilter
(self, obj, event)¶ the event filter here we check if all conditions necessary for the widget to spawn are met
-
static
singleton
()¶ singleton method making sure that this object can only exist once and cannot be instantiated more then once
-
-
class
SkinningTools.UI.markingMenu.
radialMenu
(parent=None, flags=Qt.FramelessWindowHint)¶ marking menu popup window this window will spawn without frame or background we draw everything in this window with QGraphicsScene items the window should remove itself when the mouse button is released returning info on the object that is under the mouse
- Todo
make a connection with the main widget to override certain values in the setup
-
__borders
¶
-
__geoSize
= 800¶
-
__radius
= 80¶
-
_availableSpaces
= 8¶
-
_green
¶
-
_red
¶
-
brush
¶
-
pen
¶
-
value
¶
-
__MMButton
(self, inText, position, inValue=None, inFunction=None, operation=1)¶ single marking menu button
- Parameters
inText (string) – the text to display
position (QPos) – position on the circle
inValue (float) – the value it will represent
inFunction (<function>) – the function to run once triggered
operation (int) – the operation on how to treat the weight
- Note operation
{ 0:removes the values, 1:sets the values, 2: adds the values}
- Returns
the widget with all functionality
- Return type
QLabel
-
__MMCheck
(self, inText, position, inValue=True, inFunction=None)¶ single marking menu checkbox
- Parameters
inText (string) – the text to display
position (QPos) – position on the circle
inValue (float) – the value it will represent
inFunction (<function>) – the function to run once triggered
- Returns
the widget with all functionality
- Return type
QCheckBox
-
__drawUI
(self)¶ build the ui, the main ui is a circle on which we can spawn the necessary buttons
-
__funcPressed
(self, _, value, operation=0)¶ function that will run when a button is clicked
- Parameters
value (float) – the value that will be set on the selection
operation (int) – the operation on how to treat the weight
- Note operation
{ 0:removes the values, 1:sets the values, 2: adds the values}
-
_buildButtons
(self)¶ build up the marking menu based on given bone and all elements necessary
-
_changeVal
(self, item, value, operation=0)¶
-
_getValue
(self)¶
-
_setCheckState
(self, item, *_)¶ function that will run once the checkbox state has changed in this case it will change soft selection settings
- Parameters
item (QCheckbox) – the checkbox
-
_setPen
(self, color, width, style)¶ override function to change the pen style of the widget
- Parameters
color (QColor) – the color to be used in drawing
width (int) – widht of the pen stroke
style (Qt.penStyle) – style of the stroke (single line/ dash pattern)
-
_setValue
(self, value)¶
-
getActiveItem
(self)¶ return the activated item that is in collision with the mouse
- Returns
widget under mouse
- Return type
QWidget
-
static
rotateVec
(origin, point, angle)¶ angular math to get the correct positions on a circle based on center, length and angle
- Parameters
origin (QPos) – center of the circle
point (QPos) – top point of the circle (12 o`clock)
angle (QPos) – the angle at wich to rotate the point clockwise
- Returns
position on the circle at the given angle
- Return type
QPos
-
setName
(self, inName)¶
-
showAtMousePos
(self)¶ show the current setup at the position on screen where the mouse is located, the center of the circle is positioned directly on the mouse
-
updateLine
(self, pos)¶ a line from the center of the circle to the position of the mouse this to display which element will be chosen on mouse release the collision of the line with any of the buttons will show an outline on the object to highlite the selection
- Parameters
pos (QPos) – position of the mouse
-
class
SkinningTools.UI.markingMenu.
testWidget
(parent=None)¶ simple widget to install the eventfilter on to test the markingmenu this will not use the dcc application but a seperate window, where debug is forced so it will always draw the popup window
-
SkinningTools.UI.markingMenu.
testUI
()¶ convenience function to display and build the testing application