Viewer Draw MKII¶
Built on the core of the original ViewerDraw, this version allows all of the following features.
- Vertex Size (via N-Panel)
- Vertex Color
- Edge Width (via N-Panel)
- Edge Color
- Face shading: Flat vs Normal
- Vertex, Edges, Faces displays can be toggled.
- Defining Normal of Brigtness Source (via N-Panel)
Faux Transparancyvia dotted edges or checkered polygons.
ngons tesselation(via N-Panel) - see description below
- bake and bake all. (via N-Panel, show bake interface is not on by default)
draws using display lists
Uses OpenGL display list to cache the drawing function. This optimizes for rotating the viewport around static geometry. Changing the geometry clears the display cache, with big geometry inputs you may notice some lag on the initial draw + cache.
By default vdmk2 drawing routine fills all polygons using the standard
GL_POLYGON, which uses the triangle fan approach ( see here )
This is a fast way to draw large amounts of quads and triangles. This default (while faster) doesn’t draw concave ngons correctly.
ngons tesselation will draw any Ngons using a slightly more involved but appropriate algorithm. The algorithm turns all ngons into individual triangles and fills them, edge drawing will be unchanged and still circumscribe the original polygon.
If you are always working on complex ngons, have a look at configuring defaults for this node.
verts + edg_pol + matrices
Some info here.
|verts||verts list or nested verts list.|
|edge_pol||edge lists or polygon lists, if the first member of any atomic list has two keys, the rest of the list is considered edges. If it finds 3 keys it assumes Faces. Some of the slowness in the algorithm is down to actively preventing invalid key access if you accidentally mix edges+faces input.|
|matrices||matrices can multiply the incoming vert+edg_pol geometry. 1 set of vert+edges can be turned into 20 ‘clones’ by passing 20 matrices. See example|
Directly to 3d view. Baking produces proper meshes and objects.
Tips on usage
The viewer will stay responsive on larger geometry when you hide elements of the representation, especially while making updates to the geometry. If you don’t need to see vertices, edges, or faces hide them. (how often do you need to see all topology when doing regular modeling?). If you see faces you can probably hide edges and verts.
System specs will play a big role in how well this scripted BGL drawing performs. Don’t expect miracles, but if you are conscious about what you feed the Node it should perform quite well given the circumstances.