Adverti horiz upsell

Mesh Data Gather 1.0.0 for Maya (maya plugin)

Return mesh data in arrays

License
Button download
100 Downloads

Compatibility

  • 2011

Operating Systems

  • Windows

History

Created:12/01/2010
Last Modified:12/01/2010
File Size: 20.5 KB

Keywords

data, faces, face, normal, normals, uvs

Plugin add couple commands to Maya for reading mesh data more easily what you can do with native script commands.

List of new commands.
  • double[] GetVertex(String meshName, int vertexIndex)
    Return mesh vertex as float array [x, y, z] in object space.
  • int[] GetFace(String meshName, int faceIndex)
    Return mesh faces as int list [A, B, C, ..., ...].
  • float[] GetUV(String meshName, int faceID, int faceVertexID, string uvSetName)
    Return UV coordinate as float array[U,V]
  • double[] GetVertexNormal(String meshName, int vertexIndex)
    Return mesh vertex normal as float array [x, y, z] in object space.
  • double[] GetFaceNormal(String meshName, int vertexIndex)
    Return mesh face normal as float array [x, y, z] in object space.

It's easy to use. Just load a plugin via PluginManager or via script. Here's example for Python.

Example 1 - Python Mesh Exporter

import maya.cmds as cmds
cmds.loadPlugin("MeshDataGather.mll")
 
meshesList = cmds.ls ( geometry=True )
for mesh in meshesList:
print "Get data from mesh " + mesh
print "Vertex data"
for i in range(0, cmds.polyEvaluate(v=True)):
v = cmds.GetVertex(mesh, i)
print v
print "Face data"
for i in range(0, cmds.polyEvaluate(f=True)):
f = cmds.GetFace(mesh, i)
print f
print "UV data"
for i in range(0, cmds.polyEvaluate(f=True)):
for j in range(0,3):
uv = cmds.GetUV(mesh, i, j, "uvSet1")
print uv
print "Vertex normal data"
for i in range(0, cmds.polyEvaluate(v=True)):
n = cmds.GetVertexNormal(mesh, i)
print n
print "Face normal data"
for i in range(0, cmds.polyEvaluate(f=True)):
n = cmds.GetFaceNormal(mesh, i)
print n
cmds.unloadPlugin("MeshDataGather.mll")



Vertex data

[-2.3661160469055176, -2.5435667037963867, 2.2962079048156738]
[2.3661160469055176, -2.5435667037963867, 2.2962079048156738]
[-2.3661160469055176, 2.5435662269592285, 2.296208381652832]
[2.3661160469055176, 2.5435662269592285, 2.296208381652832]
[-2.3661160469055176, 2.5435662269592285, -2.2962074279785156]
[2.3661160469055176, 2.5435662269592285, -2.2962074279785156]
[-2.3661160469055176, -2.5435667037963867, -2.2962079048156738]
[2.3661160469055176, -2.5435667037963867, -2.2962079048156738]
Face data
[0, 1, 3, 2]
[2, 3, 5, 4]
[4, 5, 7, 6]
[6, 7, 1, 0]
[1, 7, 5, 3]
[6, 0, 2, 4]
UV data
[0.24525937438011169, 0.0]
[0.75480425357818604, 0.0]
[0.75480425357818604, 1.0]
[2.2452592849731445, 1.0]
[2.7548043727874756, 1.0]
[1.2452592849731445, 1.0]
[1.7548043727874756, 1.0]
[1.2452592849731445, 1.0]
[1.2452592849731445, 0.0]
[1.7548043727874756, 0.0]
[1.2452592849731445, 0.0]
[0.75480425357818604, 0.0]
[0.75480425357818604, 0.0]
[1.2452592849731445, 0.0]
[1.2452592849731445, 1.0]
[-0.24519568681716919, 0.0]
[0.24525937438011169, 0.0]
[0.24525937438011169, 1.0]
Vertex normal data
[-0.5773501992225647, -0.57735025882720947, 0.5773501992225647]
[0.5773501992225647, -0.57735025882720947, 0.5773501992225647]
[-0.57735031843185425, 0.57735031843185425, 0.57735037803649902]
[0.57735031843185425, 0.57735031843185425, 0.57735037803649902]
[-0.5773501992225647, 0.57735025882720947, -0.5773501992225647]
[0.5773501992225647, 0.57735025882720947, -0.5773501992225647]
[-0.57735031843185425, -0.57735031843185425, -0.57735037803649902]
[0.57735031843185425, -0.57735031843185425, -0.57735037803649902]
Face normal data
[0.0, -9.3733973471898935e-08, 1.0]
[0.0, 1.0, 0.0]
[0.0, 9.3733973471898935e-08, -1.0]
[0.0, -1.0, 0.0]
[1.0, 7.4726491661181171e-09, 0.0]
[-1.0, -7.4726491661181171e-09, 0.0]

Please use the Bug System to report any bugs.
Please use the Feature Requests to give me ideas.
Please use the Support Forum if you have any questions or problems.
Please rate and review in the Review section.

People who favorited this item:

  • aarmbruster Armbruster
    aarmbruster Armbruster
  • Thacken5
    Thacken5