A Maya node that can convert a float to a string so it can be used in combination with an annotation.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
icons updated icon Nov 9, 2017
plug-ins update installation method Aug 26, 2018
.gitignore update installation method Aug 26, 2018
LICENSE update installation method Aug 26, 2018
README.md Update README.md Aug 26, 2018
floatToString.mel update installer Oct 3, 2018
floatToString.mod update installation method Aug 26, 2018

README.md

maya-plugin-float-to-string

This plugin will register a Maya node that can convert a float to a string so it can be used in combination with an annotation. The display precision can be adjusted and so can a prefix and suffix be added.

Installation

  • Extract the content of the .rar file anywhere on disk.
  • Drag the floatToString.mel file in Maya to permanently install the plugin.

Usage

Node:

from maya import cmds

# create nodes
floatToString = cmds.createNode("floatToString")
annotation = cmds.createNode("annotationShape")

# set attributes
cmds.setAttr("{0}.precision".format(floatToString), 1)
cmds.setAttr("{0}.prefix".format(floatToString), "height:", type="string")
cmds.setAttr("{0}.suffix".format(floatToString), "mm", type="string")

# connect to annotation
cmds.connectAttr(
    "{0}.output".format(floatToString),
    "{0}.text".format(annotation)
)