ART_PhysiqueEditorUI

class Tools.Rigging.ART_PhysiqueEditorUI.ART_PhysiqueEditorUI(mainUI, parent=None)[source]

This class creates the physique editor tool, which allows you to change the form of the proxy geo.

For this tool to work, the joint mover files associated with each of the modules must have morph targets added that follow the naming convention. For the weight sliders, the morph must be named either thin_[proxy_geo_name] or heavy_[proxy_geo_name], where [proxy_geo_name] would be something like: pelvis_proxy_geo. For the muscle sliders, the morph targets will have a prefix of either slim or buff, followed by the proxy geo name.

Important

The valid morph target prefixes are listed below.

Important

The blendshape nodes themselves are named: physique_[proxy_geo_name]_shapes.

If implementing length, a length_grp must be created and is parented under the top-most mover of the module. In the case of the torso module, this would be the pelvis mover. Under this group, is an empty group node for each of the child movers, so in this case, spine 1 - 3, and these are named [joint_name]_length_pos, where joint name would be spine_01 for example. These group nodes are currently aligned perfectly to the corresponding joint mover. The idea here is that when the length group is scaled, the actual joint movers can then be snapped to these length_pos nodes to match that scaled amount. This is different than just scaling the pelvis mover in the torso example, as that globally scales everything. This length group only gives us the positions from the scaling, meaning the thickness of the proxy geometry remains unchanged, but the distance between the joints has increased.

Note

As of now, only the 3 spine torso module has physique support, and only the 1 neck head module. Support for the other variants will come in the future.

Important

morph targets should be removed from the scene once iteration is complete, otherwise errors will occur during the building of the rig.

__init__(mainUI, parent=None)[source]

Instantiates the class, gets settings values from QSettings. Calls on building the interface. Creates a bunch of lists for the different slider types and slider states. Calls on findModuleShapes.

See also

ART_PhysiqueEditorUI.findModuleShapes()

adjustModuleHeight(slider, passive=False, *args)[source]

Takes in the slider value of the passed in slider, and scales the root mover within a remapped range.

Parameters:
  • slider – Slider of which to query the value.
  • passive – Whether or not to scale the root mover or to just simply update the UI with the height info.
  • args
Returns:

None

adjustModuleLength(module, slider, *args)[source]

For the given module, take in the passed in slider to get the value, and scale the module’s length grp by the remapped range amount, then snap the joint movers of the module to the children of the module’s length group to quickly change the length of the module.

Note

This does not need to be implemented on every module. Only a couple modules have this functionality.

Parameters:
  • module – the module to operate on.
  • slider – the slider whose value to query.
  • args
Returns:

None

buildInterface()[source]

Main function that builds the innterface for the tool. The interface consists of a global section, a module overrides section, and within each module override, a proxy geo override for each piece of proxy geo.

../../_images/physiqueEditor.png
Returns:None
closeEvent(event)[source]

When the interface is closed, this function gathers the slider data and adds it to a network node, so that when the interface is opened again, the sliders are in the state they were last in, which is the state that represents the character’s physique.

Parameters:event – close event
Returns:None
findModuleShapes()[source]

Go through each module, and select all module nodes under that module. Within those nodes, find the proxy geo, and see if any of the proxy geo has blendshapes. If there are blendshapes, append that data to self.blendshapes list.

Returns:None
getHeight()[source]

Gets the character’s bounds and computes the height in centimeters.

Returns:None
populateUI()[source]

When the interface is launched, if there is a physique_data node in the scene, that data is used to set the sliders on the UI to represent the character’s physique.

Todo

This only works within a maya session. If a character has been saved with a physique, and the maya session is new, then when the UI is opened, these lists will have no data to populate and the UI will not represent the character’s physique settings. This data needs to ideally be stored on the character node in the scene rather than in these lists.

Returns:None
remapRange(oldMax, oldMin, newMax, newMin, value)[source]

Takes in the old range, and a new range, and a slider value, and returns a value remapped from the old range to the new range. For example, if the old range is 0 - 100, and the new range is 0.0 to 2.0, and the slider value is 65, the returned value would be 1.3.

Parameters:
  • oldMax – the old maximum value in the range
  • oldMin – the old minimum value in the range
  • newMax – the new maximum value in the new range
  • newMin – the new minimum value in the new range
  • value – the current slider value
Returns:

the new value in the newly remapped range.

resetAll()[source]

Resets all sliders: global, module overrides, and morph target overrides.

Returns:None
resetHeight(slider, value)[source]

Resets the character height to 1.0 (whatever 1 represents, which is the original height).

Parameters:
  • slider – slider whose value to set.
  • value – value to set on the slider.
Returns:

None

resetSlider(slider, value)[source]

Resets a singular slider to the given default value.

Parameters:
  • slider – Slider whose value to reset.
  • value – The value to reset to.
Returns:

None

resetSliderGlobal(slider, value, sliders, macro=False)[source]

When a global slider is reset, that slider’s value is set to the input value. If macro is True, then any associated sliders to that global slider (for example, all module weight sliders) are also reset.

Parameters:
  • slider – slider whose value to set
  • value – the value to set the slider to.
  • sliders – any subsequent sliders that should also be set to that value.
  • macro – Whether or not to reset associated sliders
Returns:

None

resetSliderModule(slider, value, module, keywords, length=False)[source]

Takes in a global module slider, and a value to reset to, and for all module sliders whose ‘name’ property matches any of the keywords, set those morph target sliders to 0.

Parameters:
  • slider – global module override slider whose value to reset
  • value – value to reset to.
  • module – module to act on.
  • keywords – keywords to search for on each module slider’s name property.
  • length – whether or not to reset length (scale to 1)
Returns:

None

setComboSliderValues(module, slider, keyword1, keyword2, *args)[source]

Given the arguments, look at all sliders belonging to the input module, searching for sliders whose ‘name’ property matches the keywords, then setting those sliders’ values accordingly.

Parameters:
  • module – The module to act on
  • slider – The slider whose value to query.
  • keyword1 – The first property keyword to search for in the list of moduleSliders
  • keyword2 – The second property keyword to search for in the list of moduleSliders
  • args
Returns:

None

See also

ART_PhysiqueEditorUI.setComoboValue()

setComoboValue(value, keyword1, keyword2)[source]

Takes an input value and remaps it to 0.0 - 1.0 to then be set on an opposing set of morph targets. ( like thin and heavy)

Parameters:
  • value – a value between 0 and 100.
  • keyword1 – a search keyword for a morph target (for example, thin and heavy).
  • keyword2 – a search keyword for a morph target (for example, thin and heavy).
Returns:

list of pair values, where the first entry is the morph target keyword and the second is the value.

See also

ART_PhysiqueEditor.remapRange()

setGlobalSliders(slider, sliderList, *args)[source]

Takes the value of a global slider and applies it to a list of sliders associated to the global slider. For example, adjusting the global weight slider should then adjust all module weight sliders.

Parameters:
  • slider – the global slider whose value to query.
  • sliderList – the list of sliders this global slider should affect.
  • args
Returns:

None

setSingleValue(value, keyword1)[source]

Takes an input value and remaps it to 0.0 - 1.0 to then be set on a single morph target.

Parameters:
  • value – a value between 0 and 100.
  • keyword1 – a search keyword for a morph target (for example, gender).
Returns:

pair of data where the first entry is the morph target, and the second is the value to set.

See also

ART_PhysiqueEditor.remapRange()

setSliderValues(slider, morph, *args)[source]

Takes in a slider whose value is queried, then remaps that to a 0.0 - 1.0 range and sets the corresponding morph target to that value.

Parameters:
  • slider – The slider whose value to query.
  • morph – The morph whose value needs to be set.
  • args
Returns:

None

toggleSlider(button, slider, *args)[source]

Toggles whether the slider is enabled or disabled for user input. By default, override sliders are disabled until toggled.

Parameters:
  • button – The lock/unlock button whose state to query.
  • slider – The slider to disable/enable
  • args
Returns:

None

Tools.Rigging.ART_PhysiqueEditorUI.run(ui_inst)[source]

Deletes the UI if it exists, then instatiates the class, building the tool and the UI.

Parameters:ui_inst – the ART_RigCreatorUI instance.
Returns:the instance of this tool