Trees | Indices | Help |
|
---|
|
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.
The current channel setting has an effect on the operators [], len() and others. For example, suppose a Material has three IpoCurves (R, G, and B), and two texture channels (numbered 0 and 1), and furthermore channel 0 has one Ipocurve (Col). The IpoCurve Col can only be "seen" through the API when ipo.channel is 0. Setting ipo.channel to 1 will cause this curve to be ignored by len(ipo):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
|
|||
Boolean |
|
||
IpoCurve or None |
|
||
IpoCurve |
|
||
int |
|
||
string |
|
||
None |
|
||
list of IpoCurves |
|
||
IpoCurve object |
|
||
IpoCurve object |
|
||
None |
|
||
int |
|
||
None |
|
||
list of floats |
|
||
None |
|
||
int |
|
||
|
|||
list of 9 floats |
|
||
None |
|
||
float |
|
||
float |
|
|
|||
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. |
||
bool |
fakeUser When set to True, this datablock wont be removed, even if nothing is using it. |
||
string or None |
lib path to the blend file this datablock is stored in (readonly). |
||
string |
name unique name within each blend file. |
||
IDGroup |
properties Returns an IDGroup reference to this datablocks's ID Properties. |
||
bool |
tag A temporary tag that to flag data as being used within a loop. |
||
int |
users The number of users this datablock has. |
|
ipo = Object.Get('Cube').ipo # get Object-type Ipo if ipo: print Ipo.OB_LOCX in ipo # prints "True" if 'LocX' curve exists print Ipo.MA_R in ipo # also prints "True" since MA_R and OB_LOCX are have the same value print 'hiccup' in ipo # always prints "False" since argument is not a constant
|
|
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
|
|
|
|
|
|
|
from Blender import Ipo ipo = Ipo.Get('ObIpo') ipo[Ipo.LOCX] = None
|
|
Warning: 'newblocktype' should not be changed unless you really know what you are doing ... |
|
Warning: rctf should not be changed unless you really know what you are doing ... |
|
|
|
|
|
|
|
channelthe current texture channel for Blender object which support textures (materials, lamps and worlds). Returns None if the Ipo does not support texture channels. Value must be in the range [0,9].
|
curveConstsThe valid Ipo curves for this Ipo. These can be used by the [] mapping operator. The value depends on the Ipo curve type. If the Ipo is any type other than a Key or Shape Ipo, this attribute returns a set of constants that can be used to specify a particular curve. For Key or Shape Ipos, the attribute returns a list of all defined keys by name.
|
fakeUserWhen set to True, this datablock wont be removed, even if nothing is using it. All data has this disabled by default except for Actions.
|
libpath 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
|
nameunique 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
|
tagA 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.
|
usersThe number of users this datablock has. (readonly) Zero user datablocks are de-allocated after reloading and saving.
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Sat Sep 19 13:57:29 2009 | http://epydoc.sourceforge.net |