From K-3D

Revision as of 22:42, 11 May 2008 by Tshead (Talk | contribs)
Jump to: navigation, search



MeshPainterScript can be used to do arbitrary rendering of a mesh under script control. For example, the following script renders mesh points as blue dots:


from OpenGL.GL import *

glColor3d(0, 0, 1)

for point in Mesh.points():
	glVertex3d(point[0], point[1], point[2])


Note that you must have OpenGL bindings installed for your script engine - Python in this case. On most platforms this is a separate download - check with your distribution on how to obtain PyOpenGL first, or visit

Script Environment

The following parameters will be available to your script at runtime (see the documentation for your script engine for details on how these parameters can be accessed programmatically).

Name Description
Document A reference to the document that owns this node.
Node A reference to this node.
Mesh A reference to the mesh to be rendered.
PaintMesh Boolean value indicating whether the mesh should be visibly rendered.
SelectMesh Boolean value indicating whether the mesh should be rendered for interactive selection.
Personal tools