Home | Trees | Index | Help |
|
---|
Module Ipo :: Class Ipo |
|
Note:
Blender Materials, Lamps and Worlds have texture channels which
allow the user to assign textures to them. The Blender Ipo Window allows
the user to access the IpoCurves for these channels by specifying a
number between 0 and 9 (the number appears next to the Ipo type in the
window header). Prior to Version 2.42, the BPy API did not allow users to
access these texture channels in a predictable manner. A new attribute
named channel
was added to the API in Version
2.42 to correct this problem.
from Blender import Ipo ipo = Ipo.Get('MatIpo') for channel in xrange(2): ipo.channel = channel print 'channel is',channel print ' len is',len(ipo) names = dict([(x[1],x[0]) for x in ipo.curveConsts.items()]) for curve in [Ipo.MA_R,Ipo.MA_COL]: print ' ',names[curve],'is',curve in ipowill output:
channel is 0 len is 4 MA_R is True MA_COL is True channel is 1 len is 3 MA_R is True MA_COL is False
Method Summary | |
---|---|
Boolean |
The "in" operator for Ipos. |
IpoCurve or None |
This operator is similar to the Python dictionary mapping operator [], except that the user cannot assign arbitrary keys. |
IpoCurve |
Iterator for Ipos. |
int |
Returns the number of curves defined for the Ipo. |
IpoCurve object |
Add a new curve to the Ipo object. |
None |
Delete an existing curve from the Ipo object (deprecated). |
float |
Gets the value at a specific time of a curve of the Ipo (deprecated). |
list of 9 floats |
Gets a beztriple of the Ipo (deprecated). |
int |
Gets the blocktype of the Ipo. |
IpoCurve object |
Return the specified IpoCurve (deprecated). |
This method is unsupported. | |
float |
Gets the current value of a curve of the Ipo (deprecated). |
list of IpoCurves |
Gets all the IpoCurves of the Ipo (deprecated). |
string |
Gets the name of the Ipo (deprecated). |
int |
Gets the number of curves of the Ipo (deprecated). |
list of floats |
Gets the rctf of the Ipo. |
None |
Sets the beztriple of the Ipo (deprecated). |
None |
Sets the blocktype of the Ipo. |
None |
Sets the name of the Ipo (deprecated). |
None |
Sets the rctf of the Ipo. |
Instance Variable Summary | |
---|---|
int or None | channel : the current texture channel for Blender object which support textures
(materials, lamps and worlds). |
constant or list of strings. Read-only. | curveConsts : The valid Ipo curves for this Ipo. |
list of Ipocurves. | curves : Ipo curves currently defined for the Ipo. |
string | name : The Ipo datablock's name |
Method Details |
---|
__contains__()
The "in" operator for Ipos. It returns True if the
specified IpoCurve exists for the Ipo. This operator should not
be used to test for whether a curve constant is valid for a particular
Ipo type. Many constants for different Ipo types have the same value,
and it is the constant's value used internally. No exceptions are
raised if the argument is not a valid curve constant or or string, nor
does the operator return True when the curve constant is valid
but does not currently exist. As such, it should only be used to test
for specific curves when the Ipo type is known:
|
__getitem__()
This operator is similar to the Python dictionary mapping operator
[], except that the user cannot assign arbitrary keys. Each Ipo type
has a pre-defined set of IpoCurves which may or may not exist at a
given time. This operator will either return an IpoCurve object if the
specified curve exists, return None if the curve does not exists, or
throws a KeyError exception if the curve is not valid for this Ipo
type.
|
__iter__()Iterator for Ipos. It returns all the defined IpoCurve objects associated with the Ipo. For example:from Blender import Ipo ipo = Ipo.Get() if len(ipo) > 0: ipo = ipo[0] print 'ipo name is',ipo.name for icu in ipo: print ' curve name is',icu.namemight result in: ipo name is ObIpo curve name is LocX curve name is LocY curve name is LocZ
|
__len__()
Returns the number of curves defined for the Ipo.
|
addCurve(curvename)Add a new curve to the Ipo object. The possible values for curvename are:
curveConsts to determine the set of valid
names.
|
delCurve(curvename)Delete an existing curve from the Ipo object (deprecated). Use themapping operator [] instead:
from Blender import Ipo ipo = Ipo.Get('ObIpo') ipo[Ipo.LOCX] = None
|
EvaluateCurveOn(curvepos, time)Gets the value at a specific time of a curve of the Ipo (deprecated). Note: new scripts should useIpoCurve.evaluate() .
|
getBeztriple(curvepos, pointpos)Gets a beztriple of the Ipo (deprecated). Note: UseIpoCurve.bezierPoints instead.
|
getBlocktype()Gets the blocktype of the Ipo.
|
getCurve(curve)Return the specified IpoCurve (deprecated). Use themapping
operator [] instead. If the curve does not exist in
the Ipo, None is returned. curve can be either a string or an
integer, denoting either the name of the Ipo curve or its internal
adrcode. The possible Ipo curve names are:
|
getCurveBP(curvepos)This method is unsupported. BPoint Ipo curves are not implemented. Calling this method throws a NotImplementedError exception.
|
getCurveCurval(curvepos)Gets the current value of a curve of the Ipo (deprecated). Note: new scripts should useIpoCurve.evaluate() .
|
getCurves()Gets all the IpoCurves of the Ipo (deprecated). Use theiterator operator
[] instead.
|
getName()Gets the name of the Ipo (deprecated). See thename
attribute.
|
getNcurves()Gets the number of curves of the Ipo (deprecated). Uselen(ipo) instead.
|
getRctf()Gets the rctf of the Ipo. Kind of bounding box...
|
setBeztriple(curvepos, pointpos, newbeztriple)Sets the beztriple of the Ipo (deprecated). Note: useIpoCurve.bezierPoints to get a BezTriple
point, then use the BezTriple API to set the point's
attributes.
|
setBlocktype(newblocktype)Sets the blocktype of the Ipo.
|
setName(newname)Sets the name of the Ipo (deprecated). See thename
attribute.
|
setRctf(newrctf)Sets the rctf of the Ipo.
|
Instance Variable Details |
---|
curvesIpo curves currently defined for the Ipo.
|
nameThe Ipo datablock's name
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Sun Feb 11 13:30:19 2007 | http://epydoc.sf.net |