From K-3D

Jump to: navigation, search


Scripted OpenGL Drawable
Plugin Status:Stable
Categories:All Plugins, Stable Plugins, OpenGL Plugins, Script Plugins


Name Value


Label Description Type Script Name
Input Matrix Input matrix k3d::matrix4 input_matrix
Output Matrix Output Matrix k3d::matrix4 output_matrix
Viewport Visible Controls whether this node will be visibile in the viewport. k3d::bool_t viewport_visible
Script Script source code k3d::string_t script


DrawableScript can be used to do arbitrary drawing in a viewport under script control. For example, the following script renders a yellow square centered on the origin:


  from OpenGL.GL import *

  glColor3f(1, 1, 0)

  glVertex3f(-1, -1, 0)
  glVertex3f(1, -1, 0)
  glVertex3f(1, 1, 0)
  glVertex3f(-1, 1, 0)

  print "Couldn't load OpenGL module"

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.
Personal tools