Toolsets
Controls Core
- class ControlsCore(*args: Any, **kwargs: Any)
Bases:
QObject- property properties
- updateSelectedObjs(message=True, deselect=True)
Remembers the object selection so controls can be deselected while changing
Updates self.selObjs
- Parameters:
message (bool) – Report the message to the user if nothing selected
message – Deselect the objects after recording
- Return isSelection:
False if nothing is selected
- Rtype isSelection:
bool
- saveControlsToLibrary(newControlName)
Should be overridden
- Parameters:
newControlName
- Returns:
- refreshPrefs()
Refreshes the preferences reading and updating from the json preferences file
- Return success:
True if successful
- Rtype success:
bool
- property directories
- property activeDirectories
- global_sendCntrlColor()
Updates all GUIs with the current color
- replaceCurves()
Replaces the curves of one shape node from another. Last selected object remains with it’s shape switched
- sendControlSelection()
Updates all GUIs with the current selection memory self.selObjs
- filterCurveTransformsOnlyUpdateSelObj(disableHierarchy=False, deselect=True)
Should be overridden
- Parameters:
disableHierarchy
deselect
- Returns:
- filterCurveJoining()
Filters the curves for joining, either combine or replace
The first objects (not the last) must include nurbsCurves, and the last object must be a transform or joint If so then return the object list, otherwise returns an empty list :return objList: An object list now checked, will be empty if the filtering failed. :rtype objList: list(str)
- scaleCVs(positive)
UI function that scales nurbs curve objects based on their CVs, will not affect transforms
- Parameters:
positive (bool) – is the scale bigger positive=True, or smaller positive=False
- rotateCVs(positive=True)
Rotates CVs by local space rotation
- absoluteScale(nullTxt='')
Scales all controls from any selected part of the rig, to an exact size give by the GUI
- offsetColorSelected(offsetTuple, resetClicked)
Offset the selected control color (and potential children) when the color is changed if there’s a selection
- Parameters:
offsetTuple (tuple) – The offset as (hue, saturation, value)
resetClicked (bool) – Has the reset been activated (alt clicked)
- getColorSelected()
From selection get the color of the current control curve and change the GUI to that color
- selectControlsByColor(color=None)
Selects the controls that match the GUI color
- setControlLineWidth()
Changes the lineWidth attribute of a curve (control) making the lines appear thicker or thinner.
Note: Don’t add @undodecorator.undoDecorator, it doesn’t need it
- freezeControlTracker()
Freezes the scale tracker attributes setting them to a scale of 1.0 no matter the current scale
- pureName()
Pure name
- Returns:
- replaceWithShapeDesign(designName='')
- buildControlsAll(designName='', forceCreate=False, freeze=False, group=False)
Builds all styles depending on the combo value
Note: Undo is built into this function
- deleteShapeDesignFromDisk(designName, directory)
Delete shape design from disk
- Parameters:
designName
- Returns:
filesFullPathDeleted
- renameShapeDesignOnDisk(designName, renameText, directory)
Rename the shape design on disk
- Parameters:
designName
- Returns:
fileRenameList
- colorSelected(color)
Change the selected control color (and potential children) when the color is changed if a selection
Controls Directories
- buildControlsDirectories()
Creates the asset directory if it is missing
- Return shapesDefaultPath:
The path of the control shapes directory
- Rtype shapesDefaultPath:
str
- copyDefaultControlShapes(shapesDefaultPath)
Copies the default control shapes to the zoo_preferences/assets location
- defaultControlsPath()
Get the default controls path
- Return controlShapesInternalPath:
internal path of the zoo_controls_joints/preferences/assets/control_shapes dir
- Rtype controlShapesInternalPath:
str
- buildUpdateControlsJointsPrefs(prefsData)
Creates the control shape folder if it doesn’t exist
- Creates if it doesn’t exist:
userPath/zoo_preferences/assets/control_shapes
Checks the json data is valid, if not updates the data to defaults if directories aren’t found