MeshPainterScript

From K-3D

(Difference between revisions)
Jump to: navigation, search
(Importing text file)
Line 1: Line 1:
-
<plugin>MeshPainterScript</plugin>
+
<!-- Machine-generated file, do not edit by hand! -->
-
 
+
== Description ==  
-
== Overview ==
+
{| border="0" cellpadding="5" cellspacing="0"
-
 
+
|-
-
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:
+
|Scripted Mesh Painter
-
 
+
|}
-
<pre>
+
<table border="0" cellpadding="5" cellspacing="0">
-
#python
+
<tr><td><b>Plugin Status:</b></td><td>[[Plugin Status|Stable]]</td></tr>
-
 
+
<tr><td><b>Categories:</b></td><td>[[All Plugins]], [[Stable Plugins]], [[OpenGL Plugins]], [[Painters Plugins]], [[Scripting Plugins]]</td></tr>
-
from OpenGL.GL import *
+
</table>
-
 
+
== Properties ==  
-
glPushAttrib(GL_ALL_ATTRIB_BITS)
+
-
glDisable(GL_LIGHTING)
+
-
glPointSize(5)
+
-
glColor3d(0, 0, 1)
+
-
 
+
-
glBegin(GL_POINTS)
+
-
for point in Mesh.points():
+
-
glVertex3d(point[0], point[1], point[2])
+
-
glEnd()
+
-
 
+
-
glPopAttrib()
+
-
</pre>
+
-
 
+
-
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 http://pyopengl.sourceforge.net
+
-
 
+
-
== 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).
+
-
 
+
{| border="1" cellpadding="5" cellspacing="0"
{| border="1" cellpadding="5" cellspacing="0"
-
! Name
+
! Label
! Description
! Description
 +
! Type
 +
! Script Name
|-
|-
-
| '''Document'''
+
|'''Selection Weight'''
-
| A reference to the document that owns this node.
+
|Node selection state, 1 = selected, 0 = unselected.
-
|-
+
|[[Property Types#k3d::double_t|k3d::double_t]]
-
| '''Node'''
+
|selection_weight
-
| 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'''
+
|'''Script'''
-
| Boolean value indicating whether the mesh should be rendered for interactive selection.
+
|Script source code
 +
|[[Property Types#k3d::string_t|k3d::string_t]]
 +
|script
|}
|}
 +
<!-- Machine-generated file, do not edit by hand! -->

Revision as of 21:30, 11 May 2008

Description

Scripted Mesh Painter
Plugin Status:Stable
Categories:All Plugins, Stable Plugins, OpenGL Plugins, Painters Plugins, Scripting Plugins

Properties

Label Description Type Script Name
Selection Weight Node selection state, 1 = selected, 0 = unselected. k3d::double_t selection_weight
Script Script source code k3d::string_t script
Personal tools