diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2003-07-16 05:44:51 +0400 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2003-07-16 05:44:51 +0400 |
commit | d6c7427053c4a2a26a869034c91671c008cf4579 (patch) | |
tree | b83f9711569f51fb7d381293d9fecee81b90bf96 /source | |
parent | aec17932a05d81d04869c7cc56d68fac85985e8d (diff) |
Exppython docs:
- Added a very brief intro to the api doc and updated the command to generate
the documentation (it's in a comment in Blender.py). Improved the NMesh ex.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/python/api2_2x/doc/Blender.py | 42 | ||||
-rw-r--r-- | source/blender/python/api2_2x/doc/NMesh.py | 14 |
2 files changed, 33 insertions, 23 deletions
diff --git a/source/blender/python/api2_2x/doc/Blender.py b/source/blender/python/api2_2x/doc/Blender.py index 9a104eda699..c6bfd2f9d8c 100644 --- a/source/blender/python/api2_2x/doc/Blender.py +++ b/source/blender/python/api2_2x/doc/Blender.py @@ -4,18 +4,17 @@ # Doc system used: epydoc - http://epydoc.sf.net # command line: -# epydoc -t Blender.py -n "Blender" --no-private --no-frames Blender.py \ -# Camera.py Lamp.py Material.py BGL.py Window.py Text.py Image.py NMesh.py \ -# Scene.py Draw.py Armature.py Types.py Curve.py Effect.py Ipo.py Metaball.py \ -# World.py +# epydoc -o BPY_API_228 --url "http://www.blender.org" -t Blender.py \ +# -n "Blender" --no-private --no-frames Blender.py \ +# Types.py Scene.py Object.py NMesh.py Material.py Camera.py Lamp.py \ +# Armature.py Metaball.py Effect.py Curve.py Ipo.py World.py BGL.py Window.py \ +# Draw.py Image.py Text.py """ -This is the main Blender module. +The main Blender module. -Blender Python -============== - - - The L{Blender} module +The Blender Python API Reference +================================ Submodules: ----------- @@ -25,33 +24,40 @@ Blender Python - L{Object} - L{NMesh} - L{Material} + - L{Armature} - L{Camera} - L{Lamp} - - L{Armature} + - L{World} - L{Metaball} - L{Effect} - L{Curve} - L{Ipo} - - L{World} - L{BGL} - - L{Window} - L{Draw} + - L{Window} - L{Image} - L{Text} Introduction: ------------- - - What scripting is, why have it - - What Python is, links - - More about what scripting can give us - - Overview of the Blender Python modules - - Links to Blender, Blender Python, later: script lists + + This Reference documents the Blender Python API, a growing collection of + Python modules (libs) that give access to part of the program's internal data + and functions. + + Through scripting, Blender can be extended in realtime. Possibilities range + from simple functionality to importers / exporters and even more complex + "applications". Blender scripts are written in + U{Python <www.python.org>}, an impressive high level, multi-paradigm, + open-source language. @author: The Blender Python Team -@requires: Blender 2.27-NewPy (2.28 pre-release) or newer. +@requires: Blender 2.28 pre-release or newer. @version: 0.1 @see: U{www.blender.org<http://www.blender.org>} @see: U{projects.blender.org<http://projects.blender.org>} +@see: U{www.python.org<http://www.python.org>} +@see: U{www.python.org/docs<http://www.python.org/docs>} """ def Set (request, data): diff --git a/source/blender/python/api2_2x/doc/NMesh.py b/source/blender/python/api2_2x/doc/NMesh.py index d0e4a903c3e..b66fc0b19f0 100644 --- a/source/blender/python/api2_2x/doc/NMesh.py +++ b/source/blender/python/api2_2x/doc/NMesh.py @@ -11,13 +11,17 @@ This module provides access to B{Mesh Data} objects in Blender. Example:: import Blender - from Blender import NMesh, Object, Scene + from Blender import NMesh, Material # me = NMesh.GetRaw("Plane") # get the mesh data called "Plane" - if me.materials: - print me.materials # print the list of materials - mat = me.materials[0] # grab the first material in the list - mat.R = 1.0 # redefine its red component + + if not me.materials: # if there are no materials ... + newmat = Material.New() # create one ... + me.materials.append(newmat) # and append it to the mesh's list of mats + + print me.materials # print the list of materials + mat = me.materials[0] # grab the first material in the list + mat.R = 1.0 # redefine its red component for v in me.verts: # loop the list of vertices v.co[0] *= 2.5 # multiply the coordinates v.co[1] *= 5.0 |