* Added more doc files for epydoc and a test for the camera module.

* Moved public declarations in camera and lamp to a new file: bpy_types.h.
* Fixed minor bugs in material, rgbTuple and Lamp + other minor changes.
* Made part of the changes to conform to decided naming conventions.
This commit is contained in:
2003-06-24 07:21:17 +00:00
parent a0ea4df1ba
commit 06ee04fb05
25 changed files with 1330 additions and 1362 deletions

View File

@@ -9,8 +9,8 @@ Example::
from Blender import Camera, Object, Scene
c = Camera.New('ortho'). # create new ortho camera data
c.lens = 35.0 # set lens value
cur = Scene.getCurrent(). # get current Scene
c.lens = 35.0 # set lens value
cur = Scene.getCurrent(). # get current scene
ob = Object.New('Camera'). # make camera object
ob.link(c). # link camera data with this object
cur.link(ob). # link object into scene
@@ -24,19 +24,19 @@ def New (type = 'persp', name = 'CamData'):
@param type: The Camera type: 'persp' or 'ortho'.
@type name: string
@param name: The Camera Data name.
@rtype: Camera
@rtype: Blender Camera
@return: The created Camera Data object.
"""
def Get (name = None):
"""
Get the Camera Data object(s).rom Blender.
Get the Camera Data object(s) from Blender.
@type name: string
@param name: The name of the Camera Data.
@rtype: Camera or a list of Cameras
@rtype: Blender Camera or a list of Blender Cameras
@return: It depends on the 'name' parameter:
- (name).The Camera Data object with the given name;
- (). A list with all Camera Data objects in the current Scene.
- (name): The Camera Data object with the given name;
- (): A list with all Camera Data objects in the current scene.
"""
class Camera:
@@ -45,42 +45,45 @@ class Camera:
======================
This object gives access to Camera-specific data in Blender.
@cvar name: The Camera Data name.
@cvar type: The type: 'persp':0 or 'ortho':1.
@cvar type: The Camera type: 'persp':0 or 'ortho':1.
@cvar mode: The mode flags: B{or'ed value}: 'showLimits':1, 'showMist':2.
@cvar lens: The lens value in [1.0, 250.0].
@cvar clipStart: The clip start value in [0.0, 100.0].
@cvar clipEnd: The clip end value in [1.0, 5000.0].
@cvar drawSize: The draw size value in [0.1, 10.0].
@warning: Most member variables assume values in some [Min, Max] interval.
When trying to set them, the given parameter will be clamped to lie in
that range: if val < Min, then val = Min, if val > Max, then val = Max.
"""
def getName(self):
def getName():
"""
Get the name of this Camera Data object.
@rtype: string
"""
def setName(self, name):
def setName(name):
"""
Set the name of this Camera Data object.
@type name: string
@param name: The new name.
"""
def getType(self):
def getType():
"""
Get this Camera's type.
@rtype: int
@return: 0 for 'persp' or 1 for 'ortho'.
"""
def setType(self, type):
def setType(type):
"""
Set this Camera's type.
@type type: string
@param type: The Camera type: 'persp' or 'ortho'.
"""
def getMode(self):
def getMode():
"""
Get this Camera's mode flags.
@rtype: int
@@ -88,10 +91,10 @@ class Camera:
resp. 01 and 10 in binary.
"""
def setMode(self, mode1 = None, mode2 = None):
def setMode(mode1 = None, mode2 = None):
"""
Set this Camera's mode flags. Mode strings given are turned 'on'.
Those not provided are turned 'off', so cam.setMode().- without
Those not provided are turned 'off', so cam.setMode() -- without
arguments -- turns off all mode flags for Camera cam.
@type mode1: string
@type mode2: string
@@ -99,58 +102,54 @@ class Camera:
@param mode2: A mode flag: 'showLimits' or 'showMist'.
"""
def getLens(self):
def getLens():
"""
Get the lens value.
@rtype: float
"""
def setLens(self, lens):
def setLens(lens):
"""
Set the lens value.
@type lens: float
@param lens: The new lens value.
@warning: The value will be clamped to the min/max limits of this variable.
"""
def getClipStart(self):
def getClipStart():
"""
Get the clip start value.
@rtype: float
"""
def setClipStart(self, clipStart):
def setClipStart(clipstart):
"""
Set the clip start value.
@type clipStart: float
@param clipStart: The new lens value.
@warning: The value will be clamped to the min/max limits of this variable.
@type clipstart: float
@param clipstart: The new lens value.
"""
def getClipEnd(self):
def getClipEnd():
"""
Get the clip end value.
@rtype: float
"""
def setClipEnd(self, clipEnd):
def setClipEnd(clipend):
"""
Set the clip end value.
@type clipEnd: float
@param clipEnd: The new clip end value.
@warning: The value will be clamped to the min/max limits of this variable.
@type clipend: float
@param clipend: The new clip end value.
"""
def getDrawSize(self):
def getDrawSize():
"""
Get the draw size value.
@rtype: float
"""
def setDrawSize(self, drawSize):
def setDrawSize(drawsize):
"""
Set the draw size value.
@type drawSize: float
@param drawSize: The new draw size value.
@warning: The value will be clamped to the min/max limits of this variable.
@type drawsize: float
@param drawsize: The new draw size value.
"""