Follow for updates on what robertjoosten is creating.
This plugin will register a node and a command. With the command it will be possible to query the volume of a mesh and with the node you can query not only the volume but also the surface area of all the faces.
Copy the rjMeshInfo.py file in any of the directories that are in your MAYA_PLUG_IN_PATH environment variable:
Copy all the png files in any of the directories that are in your XBMLANGPATH environment variable:
Command: import maya.cmds as cmds volume = cmds.polyVolume(ws=True, ch=False)
By setting the constructionHistory argument to True, instead of the volume being returned as a float, the meshInfo node will be returned that in order can be used to query the volume.
import maya.cmds as cmds meshInfo = cmds.createNode("meshInfo")