Change the appearance of vertex in wireframe view mode

172 views
Skip to first unread message

Xiyu Wang

unread,
Dec 14, 2013, 11:14:42 PM12/14/13
to python_in...@googlegroups.com
Hi all,

When we use nCloth animation in Maya, we can fix some vertices using transform constraint. And those fixed vertices will look bold in wireframe view mode.

I want to design a plugin to have the same feature: when user changes some attributes of a vertex, I want that vertex looks different from the others (bold or in different color). I went through the documentation of MFnMesh, but it seems with that class we can only change the color of vertices in render mode. Does anyone know a way to change the appearance of vertex in wireframe mode just like nCloth?

Ævar Guðmundsson

unread,
Dec 15, 2013, 5:42:42 PM12/15/13
to python_in...@googlegroups.com
Hi Xiyu

  I'm not fully sure what it is you are trying to do but if it helps I think what I think you are describing is doable, just forget about the MFnMesh approach as what you are after is a user display plugin, rather than a mesh influencing plugin so to say.
  I don't have access to Maya right now but the settings for vertex sizes are in Display --> polygons --> Set vertex size.


Three ways to go about this that I can think of quickly, don't have any examples but hope this gets you started:
a)
  Since the setting is there, then there is definitely a configuration file somewhere on your hard drive where the vertex size setting you save is stored.  This may be a global setting ( just one size per Maya instance ) but if you are in luck then this draw setting is per camera, you can build yourself a layered persp camera which displays a matrix part of your workspace per size settings { 3 different size settings in your plugin == 3 cameras baked into one, each displaying the vertex size you set that part of the geometry to }
b)
  You tap into the actual workspace 2.0 API, look around for anything that's per vertex and see if you can simply add a scaling effect of sorts.  Instancing using Alembic, Assemblies, and Workspace 2.0 shows amazing real time response times.  If all you are after is an enhanced wireframe mode rather than a full blown real time shaded environment then create a plugin that picks up whenever you are in wireframe mode and slap a literal lambert shaded polyCube on each vertex.  The effort for Workspace 2.0 to render wireframe is so minimal you can get away with adding actual geometry to help with the visual side without everything turning sluggish.
c)
  Write a shader that does the trick, all shaders, even the simplest ones, have the core functionality of doing things to geometry per vertex.  Again here this would be drawing additional squares on top of your geometry while retaining performance speeds but at the end of the day you should get the same effect.

  Hope this ramble helps and you manage to get your plugin working, please share if you do!
Reply all
Reply to author
Forward
0 new messages