15
from Blender import Camera, Object, Scene
16
cam = Camera.New('ortho') # create new ortho camera data
17
cam.scale = 6.0 # set scale value for ortho view
18
scn = Scene.GetCurrent() # get current scene
19
ob = scn.objects.new(cam) # add a new camera object from the data
20
scn.setCurrentCamera(ob) # make this camera the active
15
from Blender import Camera, Object, Scene
16
cam = Camera.New('ortho') # create new ortho camera data
17
cam.scale = 6.0 # set scale value for ortho view
18
scn = Scene.GetCurrent() # get current scene
19
ob = scn.objects.new(cam) # add a new camera object from the data
20
scn.setCurrentCamera(ob) # make this camera the active
23
23
def New (type = 'persp', name = 'CamData'):
25
Create a new Camera Data object.
27
@param type: The Camera type: 'persp' or 'ortho'.
29
@param name: The Camera Data name.
30
@rtype: Blender Camera
31
@return: The created Camera Data object.
25
Create a new Camera Data object.
27
@param type: The Camera type: 'persp' or 'ortho'.
29
@param name: The Camera Data name.
30
@rtype: Blender Camera
31
@return: The created Camera Data object.
34
34
def Get (name = None):
36
Get the Camera Data object(s) from Blender.
38
@param name: The name of the Camera Data.
39
@rtype: Blender Camera or a list of Blender Cameras
40
@return: It depends on the I{name} parameter:
41
- (name): The Camera Data object with the given I{name};
42
- (): A list with all Camera Data objects in the current scene.
36
Get the Camera Data object(s) from Blender.
38
@param name: The name of the Camera Data.
39
@rtype: Blender Camera or a list of Blender Cameras
40
@return: It depends on the I{name} parameter:
41
- (name): The Camera Data object with the given I{name};
42
- (): A list with all Camera Data objects in the current scene.
47
The Camera Data object
48
======================
49
This object gives access to Camera-specific data in Blender.
50
@ivar name: The Camera Data name.
51
@ivar type: The Camera type: 'persp' or 'ortho'
52
@ivar mode: The mode flags: B{ORed value}: 'showLimits':1, 'showMist':2.
53
@ivar lens: The lens value in [1.0, 250.0], only relevant to *persp* cameras.
54
@ivar scale: The scale value in [0.01, 1000.00], only relevant to *ortho* cameras.
55
@ivar clipStart: The clip start value in [0.0, 100.0].
56
@ivar clipEnd: The clip end value in [1.0, 5000.0].
57
@ivar dofDist: The dofDist value in [0.0, 5000.0].
58
@ivar shiftx: The horizontal offset of the camera [-2.0, 2.0].
59
@ivar shifty: The vertical offset of the camera [-2.0, 2.0].
60
@ivar alpha: The PassePart alpha [0.0, 1.0].
61
@ivar drawSize: The display size for the camera an the 3d view [0.1, 10.0].
62
@type ipo: Blender Ipo
63
@ivar ipo: The "camera data" ipo linked to this camera data object.
64
Set to None to clear the ipo.
66
@ivar drawLimits: Toggle the option to show limits in the 3d view.
67
@ivar drawName: Toggle the option to show the camera name in the 3d view.
68
@ivar drawMist: Toggle the option to show mist in the 3d view.
69
@ivar drawTileSafe: Toggle the option to show tile safe in the 3d view.
70
@ivar drawPassepartout: Toggle the option to show pass part out in the 3d view.
72
@warning: Most member variables assume values in some [Min, Max] interval.
73
When trying to set them, the given parameter will be clamped to lie in
74
that range: if val < Min, then val = Min, if val > Max, then val = Max.
79
Get the name of this Camera Data object. (B{deprecated}) See the L{name} attribute.
85
Set the name of this Camera Data object. (B{deprecated}) See the L{name} attribute.
87
@param name: The new name.
92
Get the Ipo associated with this camera data object, if any. (B{deprecated})
94
@return: the wrapped ipo or None. (B{deprecated}) See the L{ipo} attribute.
99
Link an ipo to this camera data object. (B{deprecated}) See the L{ipo} attribute.
100
@type ipo: Blender Ipo
101
@param ipo: a "camera data" ipo.
106
Unlink the ipo from this camera data object. (B{deprecated}) See the L{ipo} attribute.
107
@return: True if there was an ipo linked or False otherwise.
112
Get this Camera's type. (B{deprecated}) See the L{type} attribute.
114
@return: 0 for 'persp' or 1 for 'ortho'.
119
Set this Camera's type. (B{deprecated}) See the L{type} attribute.
121
@param type: The Camera type: 'persp' or 'ortho'.
126
Get this Camera's mode flags. (B{deprecated}) See the L{mode} attribute.
128
@return: B{OR'ed value}: 'showLimits' is 1, 'showMist' is 2, or
129
respectively, 01 and 10 in binary.
132
def setMode(mode1 = None, mode2 = None):
134
Set this Camera's mode flags. Mode strings given are turned 'on'. (B{deprecated}) See the L{mode} attribute.
135
Those not provided are turned 'off', so cam.setMode() -- without
136
arguments -- turns off all mode flags for Camera cam.
139
@param mode1: A mode flag: 'showLimits' or 'showMist'.
140
@param mode2: A mode flag: 'showLimits' or 'showMist'.
145
Get the lens value. (B{deprecated}) See the L{lens} attribute.
147
@warn: lens is only relevant for perspective (L{getType}) cameras.
152
Set the lens value. (B{deprecated}) See the L{lens} attribute.
154
@param lens: The new lens value.
155
@warn: lens is only relevant for perspective (L{type}) cameras.
160
Get the scale value. (B{deprecated}) See the L{scale} attribute.
162
@warn: scale is only relevant for ortho (L{type}) cameras.
167
Set the scale value. (B{deprecated}) See the L{scale} attribute.
169
@param scale: The new scale value in [0.01, 1000.00].
170
@warn: scale is only relevant for ortho (L{getType}) cameras.
175
Get the clip start value. (B{deprecated}) See the L{clipStart} attribute.
179
def setClipStart(clipstart):
181
Set the clip start value. (B{deprecated}) See the L{clipStart} attribute.
182
@type clipstart: float
183
@param clipstart: The new lens value.
188
Get the clip end value. (B{deprecated}) See the L{clipEnd} attribute.
192
def setClipEnd(clipend):
194
Set the clip end value. (B{deprecated}) See the L{clipEnd} attribute.
196
@param clipend: The new clip end value.
201
Get the draw size value. (B{deprecated}) See the L{drawSize} attribute.
205
def setDrawSize(drawsize):
207
Set the draw size value. (B{deprecated}) See the L{drawSize} attribute.
208
@type drawsize: float
209
@param drawsize: The new draw size value.
212
def getScriptLinks (event):
214
Get a list with this Camera's script links of type 'event'.
216
@param event: "FrameChanged", "Redraw" or "Render".
218
@return: a list with Blender L{Text} names (the script links of the given
219
'event' type) or None if there are no script links at all.
222
def clearScriptLinks (links = None):
224
Delete script links from this Camera. If no list is specified, all
225
script links are deleted.
226
@type links: list of strings
227
@param links: None (default) or a list of Blender L{Text} names.
230
def addScriptLink (text, event):
232
Add a new script link to this Camera.
234
@param text: the name of an existing Blender L{Text}.
236
@param event: "FrameChanged", "Redraw" or "Render".
239
def insertIpoKey(keytype):
241
Inserts keytype values in camera ipo at curframe. Uses module constants.
242
@type keytype: Integer
251
Make a copy of this camera
253
@return: a copy of this camera
b'\\ No newline at end of file'
47
The Camera Data object
48
======================
49
This object gives access to Camera-specific data in Blender.
50
@ivar type: The Camera type: 'persp' or 'ortho'
51
@ivar mode: The mode flags: B{ORed value}: 'showLimits':1, 'showMist':2.
52
@ivar lens: The lens value in [1.0, 250.0], only relevant to *persp* cameras.
53
@ivar angle: The lens value in degrees [7.323871, 172.847331], only relevant to *persp* cameras.
54
@ivar scale: The scale value in [0.01, 1000.00], only relevant to *ortho* cameras.
55
@ivar clipStart: The clip start value in [0.0, 100.0].
56
@ivar clipEnd: The clip end value in [1.0, 5000.0].
57
@ivar dofDist: The dofDist value in [0.0, 5000.0].
58
@ivar shiftX: The horizontal offset of the camera [-2.0, 2.0].
59
@ivar shiftY: The vertical offset of the camera [-2.0, 2.0].
60
@ivar alpha: The PassePart alpha [0.0, 1.0].
61
@ivar drawSize: The display size for the camera an the 3d view [0.1, 10.0].
62
@type ipo: Blender Ipo
63
@ivar ipo: The "camera data" ipo linked to this camera data object.
64
Set to None to clear the ipo.
66
@ivar drawLimits: Toggle the option to show limits in the 3d view.
67
@ivar drawName: Toggle the option to show the camera name in the 3d view.
68
@ivar drawMist: Toggle the option to show mist in the 3d view.
69
@ivar drawTileSafe: Toggle the option to show tile safe in the 3d view.
70
@ivar drawPassepartout: Toggle the option to show pass part out in the 3d view.
72
@warning: Most member variables assume values in some [Min, Max] interval.
73
When trying to set them, the given parameter will be clamped to lie in
74
that range: if val < Min, then val = Min, if val > Max, then val = Max.
79
Get the name of this Camera Data object. (B{deprecated}) See the L{name} attribute.
85
Set the name of this Camera Data object. (B{deprecated}) See the L{name} attribute.
87
@param name: The new name.
92
Get the Ipo associated with this camera data object, if any. (B{deprecated})
94
@return: the wrapped ipo or None. (B{deprecated}) See the L{ipo} attribute.
99
Link an ipo to this camera data object. (B{deprecated}) See the L{ipo} attribute.
100
@type ipo: Blender Ipo
101
@param ipo: a "camera data" ipo.
106
Unlink the ipo from this camera data object. (B{deprecated}) See the L{ipo} attribute.
107
@return: True if there was an ipo linked or False otherwise.
112
Get this Camera's type. (B{deprecated}) See the L{type} attribute.
114
@return: 0 for 'persp' or 1 for 'ortho'.
119
Set this Camera's type. (B{deprecated}) See the L{type} attribute.
121
@param type: The Camera type: 'persp' or 'ortho'.
126
Get this Camera's mode flags. (B{deprecated}) See the L{mode} attribute.
128
@return: B{OR'ed value}: 'showLimits' is 1, 'showMist' is 2, or
129
respectively, 01 and 10 in binary.
132
def setMode(mode1 = None, mode2 = None):
134
Set this Camera's mode flags. Mode strings given are turned 'on'. (B{deprecated}) See the L{mode} attribute.
135
Those not provided are turned 'off', so cam.setMode() -- without
136
arguments -- turns off all mode flags for Camera cam.
139
@param mode1: A mode flag: 'showLimits' or 'showMist'.
140
@param mode2: A mode flag: 'showLimits' or 'showMist'.
145
Get the lens value. (B{deprecated}) See the L{lens} attribute.
147
@warn: lens is only relevant for perspective (L{getType}) cameras.
152
Set the lens value. (B{deprecated}) See the L{lens} attribute.
154
@param lens: The new lens value.
155
@warn: lens is only relevant for perspective (L{type}) cameras.
160
Get the scale value. (B{deprecated}) See the L{scale} attribute.
162
@warn: scale is only relevant for ortho (L{type}) cameras.
167
Set the scale value. (B{deprecated}) See the L{scale} attribute.
169
@param scale: The new scale value in [0.01, 1000.00].
170
@warn: scale is only relevant for ortho (L{getType}) cameras.
175
Get the clip start value. (B{deprecated}) See the L{clipStart} attribute.
179
def setClipStart(clipstart):
181
Set the clip start value. (B{deprecated}) See the L{clipStart} attribute.
182
@type clipstart: float
183
@param clipstart: The new lens value.
188
Get the clip end value. (B{deprecated}) See the L{clipEnd} attribute.
192
def setClipEnd(clipend):
194
Set the clip end value. (B{deprecated}) See the L{clipEnd} attribute.
196
@param clipend: The new clip end value.
201
Get the draw size value. (B{deprecated}) See the L{drawSize} attribute.
205
def setDrawSize(drawsize):
207
Set the draw size value. (B{deprecated}) See the L{drawSize} attribute.
208
@type drawsize: float
209
@param drawsize: The new draw size value.
212
def getScriptLinks (event):
214
Get a list with this Camera's script links of type 'event'.
216
@param event: "FrameChanged", "Redraw" or "Render".
218
@return: a list with Blender L{Text} names (the script links of the given
219
'event' type) or None if there are no script links at all.
222
def clearScriptLinks (links = None):
224
Delete script links from this Camera. If no list is specified, all
225
script links are deleted.
226
@type links: list of strings
227
@param links: None (default) or a list of Blender L{Text} names.
230
def addScriptLink (text, event):
232
Add a new script link to this Camera.
234
@param text: the name of an existing Blender L{Text}.
236
@param event: "FrameChanged", "Redraw" or "Render".
239
def insertIpoKey(keytype):
241
Inserts keytype values in camera ipo at curframe. Uses module constants.
242
@type keytype: Integer
251
Make a copy of this camera
253
@return: a copy of this camera
257
Camera.__doc__ += id_generics.attributes