Module Camera :: Class Camera

Class Camera

source code

The Camera Data object

This object gives access to Camera-specific data in Blender.


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.

Instance Methods
string
getName()
Get the name of this Camera Data object.
source code
 
setName(name)
Set the name of this Camera Data object.
source code
Ipo
getIpo()
Get the Ipo associated with this camera data object, if any.
source code
 
setIpo(ipo)
Link an ipo to this camera data object.
source code
 
clearIpo()
Unlink the ipo from this camera data object.
source code
int
getType()
Get this Camera's type.
source code
 
setType(type)
Set this Camera's type.
source code
int
getMode()
Get this Camera's mode flags.
source code
 
setMode(mode1=None, mode2=None)
Set this Camera's mode flags.
source code
float
getLens()
Get the lens value.
source code
 
setLens(lens)
Set the lens value.
source code
float
getScale()
Get the scale value.
source code
 
setScale(scale)
Set the scale value.
source code
float
getClipStart()
Get the clip start value.
source code
 
setClipStart(clipstart)
Set the clip start value.
source code
float
getClipEnd()
Get the clip end value.
source code
 
setClipEnd(clipend)
Set the clip end value.
source code
float
getDrawSize()
Get the draw size value.
source code
 
setDrawSize(drawsize)
Set the draw size value.
source code
list
getScriptLinks(event)
Get a list with this Camera's script links of type 'event'.
source code
 
clearScriptLinks(links=None)
Delete script links from this Camera.
source code
 
addScriptLink(text, event)
Add a new script link to this Camera.
source code
 
insertIpoKey(keytype)
Inserts keytype values in camera ipo at curframe.
source code
Camera
__copy__()
Make a copy of this camera
source code
Instance Variables
  alpha
The PassePart alpha [0.0, 1.0].
  angle
The lens value in degrees [7.323871, 172.847331], only relevant to *persp* cameras.
  clipEnd
The clip end value in [1.0, 5000.0].
  clipStart
The clip start value in [0.0, 100.0].
  dofDist
The dofDist value in [0.0, 5000.0].
  drawLimits
Toggle the option to show limits in the 3d view.
  drawMist
Toggle the option to show mist in the 3d view.
  drawName
Toggle the option to show the camera name in the 3d view.
  drawPassepartout
Toggle the option to show pass part out in the 3d view.
  drawSize
The display size for the camera an the 3d view [0.1, 10.0].
  drawTileSafe
Toggle the option to show tile safe in the 3d view.
bool fakeUser
When set to True, this datablock wont be removed, even if nothing is using it.
Blender Ipo ipo
The "camera data" ipo linked to this camera data object.
  lens
The lens value in [1.0, 250.0], only relevant to *persp* cameras.
string or None lib
path to the blend file this datablock is stored in (readonly).
  mode
The mode flags: ORed value: 'showLimits':1, 'showMist':2.
string name
unique name within each blend file.
IDGroup properties
Returns an IDGroup reference to this datablocks's ID Properties.
  scale
The scale value in [0.01, 1000.00], only relevant to *ortho* cameras.
  shiftX
The horizontal offset of the camera [-2.0, 2.0].
  shiftY
The vertical offset of the camera [-2.0, 2.0].
bool tag
A temporary tag that to flag data as being used within a loop.
  type
The Camera type: 'persp' or 'ortho'
int users
The number of users this datablock has.
Method Details

getName()

source code 
Get the name of this Camera Data object. (deprecated) See the name attribute.
Returns: string

setName(name)

source code 
Set the name of this Camera Data object. (deprecated) See the name attribute.
Parameters:
  • name (string) - The new name.

getIpo()

source code 
Get the Ipo associated with this camera data object, if any. (deprecated)
Returns: Ipo
the wrapped ipo or None. (deprecated) See the ipo attribute.

setIpo(ipo)

source code 
Link an ipo to this camera data object. (deprecated) See the ipo attribute.
Parameters:
  • ipo (Blender Ipo) - a "camera data" ipo.

clearIpo()

source code 
Unlink the ipo from this camera data object. (deprecated) See the ipo attribute.
Returns:
True if there was an ipo linked or False otherwise.

getType()

source code 
Get this Camera's type. (deprecated) See the type attribute.
Returns: int
0 for 'persp' or 1 for 'ortho'.

setType(type)

source code 
Set this Camera's type. (deprecated) See the type attribute.
Parameters:
  • type (string) - The Camera type: 'persp' or 'ortho'.

getMode()

source code 
Get this Camera's mode flags. (deprecated) See the mode attribute.
Returns: int
OR'ed value: 'showLimits' is 1, 'showMist' is 2, or respectively, 01 and 10 in binary.

setMode(mode1=None, mode2=None)

source code 
Set this Camera's mode flags. Mode strings given are turned 'on'. (deprecated) See the mode attribute. Those not provided are turned 'off', so cam.setMode() -- without arguments -- turns off all mode flags for Camera cam.
Parameters:
  • mode1 (string) - A mode flag: 'showLimits' or 'showMist'.
  • mode2 (string) - A mode flag: 'showLimits' or 'showMist'.

getLens()

source code 
Get the lens value. (deprecated) See the lens attribute.
Returns: float

Warning: lens is only relevant for perspective (getType) cameras.

setLens(lens)

source code 
Set the lens value. (deprecated) See the lens attribute.
Parameters:
  • lens (float) - The new lens value.

Warning: lens is only relevant for perspective (type) cameras.

getScale()

source code 
Get the scale value. (deprecated) See the scale attribute.
Returns: float

Warning: scale is only relevant for ortho (type) cameras.

setScale(scale)

source code 
Set the scale value. (deprecated) See the scale attribute.
Parameters:
  • scale (float) - The new scale value in [0.01, 1000.00].

Warning: scale is only relevant for ortho (getType) cameras.

getClipStart()

source code 
Get the clip start value. (deprecated) See the clipStart attribute.
Returns: float

setClipStart(clipstart)

source code 
Set the clip start value. (deprecated) See the clipStart attribute.
Parameters:
  • clipstart (float) - The new lens value.

getClipEnd()

source code 
Get the clip end value. (deprecated) See the clipEnd attribute.
Returns: float

setClipEnd(clipend)

source code 
Set the clip end value. (deprecated) See the clipEnd attribute.
Parameters:
  • clipend (float) - The new clip end value.

getDrawSize()

source code 
Get the draw size value. (deprecated) See the drawSize attribute.
Returns: float

setDrawSize(drawsize)

source code 
Set the draw size value. (deprecated) See the drawSize attribute.
Parameters:
  • drawsize (float) - The new draw size value.

getScriptLinks(event)

source code 
Get a list with this Camera's script links of type 'event'.
Parameters:
  • event (string) - "FrameChanged", "Redraw" or "Render".
Returns: list
a list with Blender Text names (the script links of the given 'event' type) or None if there are no script links at all.

clearScriptLinks(links=None)

source code 
Delete script links from this Camera. If no list is specified, all script links are deleted.
Parameters:
  • links (list of strings) - None (default) or a list of Blender Text names.

addScriptLink(text, event)

source code 
Add a new script link to this Camera.
Parameters:
  • text (string) - the name of an existing Blender Text.
  • event (string) - "FrameChanged", "Redraw" or "Render".

insertIpoKey(keytype)

source code 
Inserts keytype values in camera ipo at curframe. Uses module constants.
Parameters:
  • keytype (Integer) - -LENS -CLIPPING
Returns:
py_none

__copy__()

source code 
Make a copy of this camera
Returns: Camera
a copy of this camera

Instance Variable Details

fakeUser

When set to True, this datablock wont be removed, even if nothing is using it. All data has this disabled by default except for Actions.
Type:
bool

ipo

The "camera data" ipo linked to this camera data object. Set to None to clear the ipo.
Type:
Blender Ipo

lib

path to the blend file this datablock is stored in (readonly).

lib will be None unless you are using external blend files with (File, Append/Link)

Note: the path may be relative, to get the full path use Blender.sys.expandpath
Type:
string or None

name

unique name within each blend file.

The name is case sensitive and 21 characters maximum length.

Note: a blend file may have naming collisions when external library data is used, be sure to check the value of lib.

Note: Setting a value longer then 21 characters will be shortened
Type:
string

tag

A temporary tag that to flag data as being used within a loop. always set all tags to True or False before using since blender uses this flag for its own internal operations.
Type:
bool

users

The number of users this datablock has. (readonly) Zero user datablocks are de-allocated after reloading and saving.
Type:
int