| 
									
										
										
										
											2003-07-10 00:23:11 +00:00
										 |  |  | # Blender.Ipo module and the Ipo PyType object | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | """
 | 
					
						
							|  |  |  | The Blender.Ipo submodule | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-05-24 15:14:32 +00:00
										 |  |  | B{New}: Ipo updates to both the program and bpython access. | 
					
						
							| 
									
										
										
										
											2004-07-28 17:46:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  | This module provides access to the Ipo Data in Blender. An Ipo is composed of | 
					
						
							| 
									
										
										
										
											2005-05-24 15:14:32 +00:00
										 |  |  | several IpoCurves. | 
					
						
							| 
									
										
										
										
											2003-08-05 10:19:28 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  | A datatype is defined : IpoCurve type. The member functions of this data type | 
					
						
							|  |  |  | are given below. | 
					
						
							| 
									
										
										
										
											2003-07-10 00:23:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Example:: | 
					
						
							|  |  |  |   import Blender | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |   ob = Blender.Ipo.Get('ipo')    # retrieves an ipo object | 
					
						
							| 
									
										
										
										
											2003-07-22 00:27:03 +00:00
										 |  |  |   ob.setName('ipo1') | 
					
						
							|  |  |  |   print ob.name | 
					
						
							|  |  |  |   print ipo.getRctf() | 
					
						
							|  |  |  |   ipo.setRctf(1,2,3,4) | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |    | 
					
						
							| 
									
										
										
										
											2003-07-10 00:23:11 +00:00
										 |  |  | """
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-03-05 06:25:49 +00:00
										 |  |  | def New (type, name): | 
					
						
							| 
									
										
										
										
											2003-07-10 00:23:11 +00:00
										 |  |  |   """
 | 
					
						
							|  |  |  |   Creates a new Ipo. | 
					
						
							| 
									
										
										
										
											2004-03-05 06:25:49 +00:00
										 |  |  |   @type type: string | 
					
						
							| 
									
										
										
										
											2003-07-10 00:23:11 +00:00
										 |  |  |   @type name: string | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |   @param type: The Ipo's blocktype. Depends on the object the ipo will be | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  |       linked to. Currently supported types are Object, Camera, World, | 
					
						
							| 
									
										
										
										
											2005-05-21 04:20:57 +00:00
										 |  |  |       Material, Texture, Lamp, Action, Constraint, Sequence, Curve, Key. | 
					
						
							| 
									
										
										
										
											2004-03-05 06:25:49 +00:00
										 |  |  |   @param name: The name for this Ipo. | 
					
						
							| 
									
										
										
										
											2003-07-10 00:23:11 +00:00
										 |  |  |   @rtype: Blender Ipo | 
					
						
							|  |  |  |   @return: The created Ipo. | 
					
						
							|  |  |  |   """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def Get (name = None): | 
					
						
							|  |  |  |   """
 | 
					
						
							|  |  |  |   Get the Ipo from Blender. | 
					
						
							|  |  |  |   @type name: string | 
					
						
							|  |  |  |   @param name: The name of the requested Ipo, or nothing. | 
					
						
							|  |  |  |   @rtype: Blender Ipo or a list of Blender Ipos | 
					
						
							|  |  |  |   @return: It depends on the 'name' parameter: | 
					
						
							|  |  |  |       - (name): The Ipo with the given name; | 
					
						
							|  |  |  |       - ():     A list with all Ipos in the current scene. | 
					
						
							|  |  |  |   """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Ipo: | 
					
						
							|  |  |  |   """
 | 
					
						
							|  |  |  |   The Ipo object | 
					
						
							|  |  |  |   ============== | 
					
						
							|  |  |  |   This object gives access to generic data from all objects in Blender. | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |   It has no attributes. | 
					
						
							| 
									
										
										
										
											2003-07-10 00:23:11 +00:00
										 |  |  |   """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def getName(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     Gets the name of the Ipo. | 
					
						
							|  |  |  |     @rtype: string | 
					
						
							|  |  |  |     @return: the name of the Ipo. | 
					
						
							| 
									
										
										
										
											2003-07-10 00:23:11 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-10-27 21:50:36 +00:00
										 |  |  |   def getCurves(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     Gets all the IpoCurves of the Ipo. | 
					
						
							|  |  |  |     @rtype: list of IpoCurves | 
					
						
							|  |  |  |     @return: A list (possibly void) containing all the IpoCurves associated to the Ipo object. | 
					
						
							| 
									
										
										
										
											2003-10-27 21:50:36 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-10-26 21:22:24 +00:00
										 |  |  |   def getCurve(curvename): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     Return the IpoCurve with the given name. The possible values for | 
					
						
							|  |  |  |     'curvename' are: | 
					
						
							| 
									
										
										
										
											2004-07-27 14:18:32 +00:00
										 |  |  |      | 
					
						
							| 
									
										
										
										
											2005-05-21 04:20:57 +00:00
										 |  |  |       1. Camera Ipo:  Lens, ClSta, ClEnd, Apert, FDist. | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |       2. Material Ipo: R, G, B, SpecR, SpecG, SpecB, MirR, MirG, MirB, Ref, | 
					
						
							| 
									
										
										
										
											2005-05-21 04:20:57 +00:00
										 |  |  |       Alpha, Emit, Amb, Spec, Hard, SpTra, Ior, Mode, HaSize, Translu, | 
					
						
							| 
									
										
										
										
											2004-07-27 14:18:32 +00:00
										 |  |  |       RayMir, FresMir, FresMirI, FresTra, FresTraI, TraGlow, OfsX, OfsY, | 
					
						
							| 
									
										
										
										
											2005-05-21 04:20:57 +00:00
										 |  |  |       OfsZ, SizeX, SizeY, SizeZ, texR, texG, texB, DefVar, Col, Nor, Var, | 
					
						
							|  |  |  |       Disp. | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |       3. Object Ipo: LocX, LocY, LocZ, dLocX, dLocY, dLocZ, RotX, RotY, RotZ, | 
					
						
							| 
									
										
										
										
											2004-07-27 14:18:32 +00:00
										 |  |  |       dRotX, dRotY, dRotZ, SizeX, SizeY, SizeZ, dSizeX, dSizeY, dSizeZ, | 
					
						
							| 
									
										
										
										
											2005-05-21 04:20:57 +00:00
										 |  |  |       Layer, Time, ColR, ColG, ColB, ColA, FStreng, FFall, Damping, | 
					
						
							| 
									
										
										
										
											2004-07-27 14:18:32 +00:00
										 |  |  |       RDamp, Perm. | 
					
						
							| 
									
										
										
										
											2005-05-21 04:20:57 +00:00
										 |  |  |       4. Lamp Ipo: Energ, R, G, B, Dist, SpoSi, SpoBl, Quad1, Quad2, HaInt. | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  |       5. World Ipo: HorR, HorG, HorB, ZenR, ZenG, ZenB, Expos, Misi, MisDi, | 
					
						
							| 
									
										
										
										
											2004-07-27 14:18:32 +00:00
										 |  |  |       MisSta, MisHi, StaR, StaG, StaB, StarDi, StarSi, OfsX, OfsY, OfsZ, | 
					
						
							|  |  |  |       SizeX, SizeY, SizeZ, TexR, TexG, TexB, DefVar, Col, Nor, Var. | 
					
						
							| 
									
										
										
										
											2005-05-21 04:20:57 +00:00
										 |  |  |       5. World Ipo: HorR, HorG, HorB, ZenR, ZenG, ZenB, Expos, Misi, MisDi, | 
					
						
							|  |  |  |       MisSta, MisHi, StarR, StarB, StarG, StarDi, StarSi, OfsX, OfsY, OfsZ,i | 
					
						
							|  |  |  |       SizeX, SizeY, SizeZ, texR, texG, texB, DefVar, Col, Nor, Var. | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  |       6. Texture Ipo: NSize, NDepth, NType, Turb, Vnw1, Vnw2, Vnw3, Vnw4, | 
					
						
							| 
									
										
										
										
											2004-07-27 14:18:32 +00:00
										 |  |  |       MinkMExp, DistM, ColT, iScale, DistA, MgType, MgH, Lacu, Oct, | 
					
						
							| 
									
										
										
										
											2005-05-21 04:20:57 +00:00
										 |  |  |       MgOff, MgGain, NBase1, NBase2. | 
					
						
							| 
									
										
										
										
											2004-07-27 14:18:32 +00:00
										 |  |  |       7. Curve Ipo: Speed. | 
					
						
							| 
									
										
										
										
											2005-04-24 19:03:39 +00:00
										 |  |  |       8. Key Ipo: Speed, 'Key 1' - 'Key 63'. | 
					
						
							| 
									
										
										
										
											2005-05-21 04:20:57 +00:00
										 |  |  |       9. Action Ipo: LocX, LocY, LocZ, SizeX, SizeY, SizeZ, QuatX, QuatY, | 
					
						
							|  |  |  |       QuatZ, QuatW. | 
					
						
							| 
									
										
										
										
											2004-07-28 17:46:29 +00:00
										 |  |  |       10. Sequence Ipo: Fac. | 
					
						
							|  |  |  |       11. Constraint Ipo: Inf. | 
					
						
							| 
									
										
										
										
											2005-05-21 04:20:57 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     @type curvename : string | 
					
						
							|  |  |  |     @rtype: IpoCurve object | 
					
						
							|  |  |  |     @return: the corresponding IpoCurve, or None. | 
					
						
							| 
									
										
										
										
											2003-10-26 21:22:24 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-05-25 19:31:13 +00:00
										 |  |  |   def addCurve(curvename): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-10-25 04:46:49 +00:00
										 |  |  |     Add a new curve to the IPO object.   Throws an exception if the curve | 
					
						
							|  |  |  |     already exists in the IPO.  The possible values for 'curvename' are: | 
					
						
							| 
									
										
										
										
											2005-05-21 04:20:57 +00:00
										 |  |  |       1. Camera Ipo:  Lens, ClSta, ClEnd, Apert, FDist. | 
					
						
							|  |  |  |       2. Material Ipo: R, G, B, SpecR, SpecG, SpecB, MirR, MirG, MirB, Ref, | 
					
						
							|  |  |  |       Alpha, Emit, Amb, Spec, Hard, SpTra, Ior, Mode, HaSize, Translu, | 
					
						
							|  |  |  |       RayMir, FresMir, FresMirI, FresTra, FresTraI, TraGlow, OfsX, OfsY, | 
					
						
							|  |  |  |       OfsZ, SizeX, SizeY, SizeZ, texR, texG, texB, DefVar, Col, Nor, Var, | 
					
						
							|  |  |  |       Disp. | 
					
						
							|  |  |  |       3. Object Ipo: LocX, LocY, LocZ, dLocX, dLocY, dLocZ, RotX, RotY, RotZ, | 
					
						
							|  |  |  |       dRotX, dRotY, dRotZ, SizeX, SizeY, SizeZ, dSizeX, dSizeY, dSizeZ, | 
					
						
							|  |  |  |       Layer, Time, ColR, ColG, ColB, ColA, FStreng, FFall, Damping, | 
					
						
							|  |  |  |       RDamp, Perm. | 
					
						
							|  |  |  |       4. Lamp Ipo: Energ, R, G, B, Dist, SpoSi, SpoBl, Quad1, Quad2, HaInt. | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  |       5. World Ipo: HorR, HorG, HorB, ZenR, ZenG, ZenB, Expos, Misi, MisDi, | 
					
						
							| 
									
										
										
										
											2005-05-21 04:20:57 +00:00
										 |  |  |       MisSta, MisHi, StaR, StaG, StaB, StarDi, StarSi, OfsX, OfsY, OfsZ, | 
					
						
							|  |  |  |       SizeX, SizeY, SizeZ, TexR, TexG, TexB, DefVar, Col, Nor, Var. | 
					
						
							|  |  |  |       5. World Ipo: HorR, HorG, HorB, ZenR, ZenG, ZenB, Expos, Misi, MisDi, | 
					
						
							|  |  |  |       MisSta, MisHi, StarR, StarB, StarG, StarDi, StarSi, OfsX, OfsY, OfsZ,i | 
					
						
							|  |  |  |       SizeX, SizeY, SizeZ, texR, texG, texB, DefVar, Col, Nor, Var. | 
					
						
							|  |  |  |       6. Texture Ipo: NSize, NDepth, NType, Turb, Vnw1, Vnw2, Vnw3, Vnw4, | 
					
						
							|  |  |  |       MinkMExp, DistM, ColT, iScale, DistA, MgType, MgH, Lacu, Oct, | 
					
						
							|  |  |  |       MgOff, MgGain, NBase1, NBase2. | 
					
						
							|  |  |  |       7. Curve Ipo: Speed. | 
					
						
							|  |  |  |       8. Key Ipo: Speed, 'Key 1' - 'Key 63'. | 
					
						
							|  |  |  |       9. Action Ipo: LocX, LocY, LocZ, SizeX, SizeY, SizeZ, QuatX, QuatY, | 
					
						
							|  |  |  |       QuatZ, QuatW. | 
					
						
							|  |  |  |       10. Sequence Ipo: Fac. | 
					
						
							|  |  |  |       11. Constraint Ipo: Inf. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     @type curvename : string | 
					
						
							|  |  |  |     @rtype: IpoCurve object | 
					
						
							|  |  |  |     @return: the corresponding IpoCurve, or None. | 
					
						
							| 
									
										
										
										
											2004-05-25 19:31:13 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-04-24 19:03:39 +00:00
										 |  |  |   def removeCurve(curvename): | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  |     Remove a existing curve from the IPO object. See addCurve() for possible values for curvename. | 
					
						
							|  |  |  |     @type curvename : string | 
					
						
							|  |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return: None. | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-07-10 00:23:11 +00:00
										 |  |  |   def setName(newname): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     Sets the name of the Ipo. | 
					
						
							|  |  |  |     @type newname: string | 
					
						
							|  |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return: None | 
					
						
							| 
									
										
										
										
											2003-07-10 00:23:11 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def getBlocktype(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     Gets the blocktype of the Ipo. | 
					
						
							|  |  |  |     @rtype: int | 
					
						
							|  |  |  |     @return: the blocktype of the Ipo. | 
					
						
							| 
									
										
										
										
											2003-07-10 00:23:11 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-07-10 00:23:11 +00:00
										 |  |  |   def setBlocktype(newblocktype): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     Sets the blocktype of the Ipo. | 
					
						
							|  |  |  |     @type newblocktype: int  | 
					
						
							|  |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return: None | 
					
						
							|  |  |  |     @warn: 'newblocktype' should not be changed unless you really know what | 
					
						
							|  |  |  |        you are doing ... | 
					
						
							| 
									
										
										
										
											2003-07-10 00:23:11 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def getRctf(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     Gets the rctf of the Ipo. | 
					
						
							|  |  |  |     Kind of bounding box... | 
					
						
							|  |  |  |     @rtype: list of floats | 
					
						
							|  |  |  |     @return: the rctf of the Ipo. | 
					
						
							| 
									
										
										
										
											2003-07-10 00:23:11 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-07-10 00:23:11 +00:00
										 |  |  |   def setRctf(newrctf): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     Sets the rctf of the Ipo. | 
					
						
							|  |  |  |     @type newrctf: four floats. | 
					
						
							|  |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return: None | 
					
						
							|  |  |  |     @warn: rctf should not be changed unless you really know what you are | 
					
						
							|  |  |  |        doing ... | 
					
						
							| 
									
										
										
										
											2003-07-10 00:23:11 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def getNcurves(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     Gets the number of curves of the Ipo. | 
					
						
							|  |  |  |     @rtype: int  | 
					
						
							|  |  |  |     @return: the number of curve of the Ipo. | 
					
						
							| 
									
										
										
										
											2003-07-10 00:23:11 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |      | 
					
						
							| 
									
										
										
										
											2003-07-10 00:23:11 +00:00
										 |  |  |   def getCurveBP(curvepos): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-12-17 17:34:51 +00:00
										 |  |  |     This method is unsupported.  BPoint Ipo curves are not implemented. | 
					
						
							|  |  |  |     Calling this method throws a NotImplementedError exception. | 
					
						
							|  |  |  |     @raise NotImplementedError: this method B{always} raises an exception | 
					
						
							| 
									
										
										
										
											2003-07-10 00:23:11 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-12-17 17:34:51 +00:00
										 |  |  |   | 
					
						
							| 
									
										
										
										
											2003-07-10 00:23:11 +00:00
										 |  |  |   def getBeztriple(curvepos,pointpos): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     Gets a beztriple of the Ipo. | 
					
						
							|  |  |  |     @type curvepos: int | 
					
						
							|  |  |  |     @param curvepos: the position of the curve in the ipo | 
					
						
							|  |  |  |     @type pointpos: int | 
					
						
							|  |  |  |     @param pointpos: the position of the point in the curve. | 
					
						
							|  |  |  |     @rtype: list of 9 floats | 
					
						
							|  |  |  |     @return: the beztriple of the Ipo, or an error is raised. | 
					
						
							| 
									
										
										
										
											2003-07-10 00:23:11 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-07-10 00:23:11 +00:00
										 |  |  |   def setBeztriple(curvepos,pointpos,newbeztriple): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     Sets the beztriple of the Ipo. | 
					
						
							|  |  |  |     @type curvepos: int | 
					
						
							|  |  |  |     @param curvepos: the position of the curve in the ipo | 
					
						
							|  |  |  |     @type pointpos: int | 
					
						
							|  |  |  |     @param pointpos: the position of the point in the curve. | 
					
						
							|  |  |  |     @type newbeztriple: list of 9 floats | 
					
						
							|  |  |  |     @param newbeztriple: the new value for the point | 
					
						
							|  |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return: None | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  |      | 
					
						
							| 
									
										
										
										
											2004-08-07 14:14:55 +00:00
										 |  |  |   def getCurveCurval(curvepos): | 
					
						
							| 
									
										
										
										
											2003-07-10 00:23:11 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     Gets the current value of a curve of the Ipo. | 
					
						
							|  |  |  |     @type curvepos: int or string | 
					
						
							|  |  |  |     @param curvepos: the position of the curve in the ipo or the name of the | 
					
						
							|  |  |  |         curve | 
					
						
							|  |  |  |     @rtype: float | 
					
						
							|  |  |  |     @return: the current value of the selected curve of the Ipo. | 
					
						
							| 
									
										
										
										
											2003-07-10 00:23:11 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2003-08-01 19:47:01 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |   def EvaluateCurveOn(curvepos,time): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     Gets the current value of a curve of the Ipo. | 
					
						
							|  |  |  |     @type curvepos: int | 
					
						
							|  |  |  |     @param curvepos: the position of the curve in the ipo | 
					
						
							|  |  |  |     @type time: float | 
					
						
							|  |  |  |     @param time: the position of the curve in the ipo | 
					
						
							|  |  |  |     @rtype: float | 
					
						
							|  |  |  |     @return: the current value of the selected curve of the Ipo at the given | 
					
						
							|  |  |  |         time. | 
					
						
							| 
									
										
										
										
											2003-08-01 19:47:01 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2003-08-05 10:19:28 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | class IpoCurve: | 
					
						
							|  |  |  |   """
 | 
					
						
							|  |  |  |   The IpoCurve object | 
					
						
							|  |  |  |   =================== | 
					
						
							|  |  |  |   This object gives access to generic data from all ipocurves objects in Blender. | 
					
						
							| 
									
										
										
										
											2004-03-25 06:18:56 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |   Important Notes for Rotation Curves:\n | 
					
						
							| 
									
										
										
										
											2005-05-24 15:14:32 +00:00
										 |  |  |   For the rotation IpoCurves, the y values for points are in units of 10 degrees.  For example, 45.0 degrees is stored as 4.50 degrees.  These are the same numbers you see in the Transform Properties pupmenu ( NKey ) in the IPO Curve Editor window.  Positive rotations are in a counter-clockwise direction, just like in math class. | 
					
						
							| 
									
										
										
										
											2004-03-25 06:18:56 +00:00
										 |  |  |    | 
					
						
							| 
									
										
										
										
											2005-06-15 06:22:26 +00:00
										 |  |  |   @ivar name: The Curve Data name. | 
					
						
							|  |  |  |   @ivar bezierPoints : The list of the Bezier points. | 
					
						
							| 
									
										
										
										
											2003-08-05 10:19:28 +00:00
										 |  |  |   """
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-05-24 15:14:32 +00:00
										 |  |  |   def setExtrapolation(extendmode): | 
					
						
							| 
									
										
										
										
											2003-08-05 10:19:28 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-05-24 15:14:32 +00:00
										 |  |  |     Sets the extend mode of the curve. | 
					
						
							|  |  |  |     @type extendmode: string | 
					
						
							|  |  |  |     @param extendmode: the extend mode of the curve. | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |         Can be Constant, Extrapolation, Cyclic or Cyclic_extrapolation. | 
					
						
							|  |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return: None | 
					
						
							| 
									
										
										
										
											2003-08-05 10:19:28 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-08-05 10:19:28 +00:00
										 |  |  |   def getExtrapolation(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-05-24 15:14:32 +00:00
										 |  |  |     Gets the extend mode of the curve. | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     @rtype: string | 
					
						
							| 
									
										
										
										
											2005-05-24 15:14:32 +00:00
										 |  |  |     @return: the extend mode of the curve. Can be Constant, Extrapolation, Cyclic or Cyclic_extrapolation. | 
					
						
							| 
									
										
										
										
											2003-08-05 10:19:28 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |      | 
					
						
							| 
									
										
										
										
											2003-08-05 10:19:28 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |   def setInterpolation(interpolationtype): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-05-24 15:14:32 +00:00
										 |  |  |     Sets the interpolation type of the curve. | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     @type interpolationtype: string | 
					
						
							| 
									
										
										
										
											2005-05-24 15:14:32 +00:00
										 |  |  |     @param interpolationtype: the interpolation type of the curve. Can be Constant, Bezier, or Linear. | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return: None | 
					
						
							| 
									
										
										
										
											2003-08-05 10:19:28 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  |   def getInterpolation(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-05-24 15:14:32 +00:00
										 |  |  |     Gets the interpolation type of the curve. | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     @rtype: string | 
					
						
							| 
									
										
										
										
											2005-05-24 15:14:32 +00:00
										 |  |  |     @return: the interpolation type of the curve. Can be Constant, Bezier, or Linear. | 
					
						
							| 
									
										
										
										
											2003-08-05 10:19:28 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |      | 
					
						
							| 
									
										
										
										
											2003-08-05 10:19:28 +00:00
										 |  |  |   def addBezier(coordlist): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     Adds a Bezier point to a curve. | 
					
						
							|  |  |  |     @type coordlist: tuple of (at least) 2 floats | 
					
						
							|  |  |  |     @param coordlist: the x and y coordinates of the new Bezier point. | 
					
						
							|  |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return: None | 
					
						
							| 
									
										
										
										
											2003-08-05 10:19:28 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-04-24 19:03:39 +00:00
										 |  |  |   | 
					
						
							|  |  |  |   def delBezier(index): | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  |     Deletes a Bezier point from a curve. | 
					
						
							|  |  |  |     @type index: integer | 
					
						
							|  |  |  |     @param index: the index of the Bezier point.  Negative values index from the end of the list. | 
					
						
							|  |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return: None | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2003-08-05 10:19:28 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-05-24 15:14:32 +00:00
										 |  |  |   def recalc(): | 
					
						
							| 
									
										
										
										
											2003-08-05 10:19:28 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-05-24 15:14:32 +00:00
										 |  |  |     Recomputes the curve after changes to control points. | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return: None | 
					
						
							| 
									
										
										
										
											2003-08-05 10:19:28 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def getName(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     Returns the name of the ipo curve. This name can be: | 
					
						
							| 
									
										
										
										
											2005-05-21 04:20:57 +00:00
										 |  |  |       1. Camera Ipo:  Lens, ClSta, ClEnd, Apert, FDist. | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  |       2. Material Ipo: R, G, B, SpecR, SpecG, SpecB, MirR, MirG, MirB, Ref, | 
					
						
							| 
									
										
										
										
											2005-05-21 04:20:57 +00:00
										 |  |  |       Alpha, Emit, Amb, Spec, Hard, SpTra, Ior, Mode, HaSize, Translu, | 
					
						
							| 
									
										
										
										
											2004-07-27 14:18:32 +00:00
										 |  |  |       RayMir, FresMir, FresMirI, FresTra, FresTraI, TraGlow, OfsX, OfsY, | 
					
						
							| 
									
										
										
										
											2005-05-21 04:20:57 +00:00
										 |  |  |       OfsZ, SizeX, SizeY, SizeZ, texR, texG, texB, DefVar, Col, Nor, Var, | 
					
						
							|  |  |  |       Disp. | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  |       3. Object Ipo: LocX, LocY, LocZ, dLocX, dLocY, dLocZ, RotX, RotY, RotZ, | 
					
						
							| 
									
										
										
										
											2004-07-27 14:18:32 +00:00
										 |  |  |       dRotX, dRotY, dRotZ, SizeX, SizeY, SizeZ, dSizeX, dSizeY, dSizeZ, | 
					
						
							| 
									
										
										
										
											2005-05-21 04:20:57 +00:00
										 |  |  |       Layer, Time, ColR, ColG, ColB, ColA, FStreng, FFall, Damping, | 
					
						
							|  |  |  |       RDamp, Perm. | 
					
						
							|  |  |  |       4. Lamp Ipo: Energ, R, G, B, Dist, SpoSi, SpoBl, Quad1, Quad2, HaInt. | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  |       5. World Ipo: HorR, HorG, HorB, ZenR, ZenG, ZenB, Expos, Misi, MisDi, | 
					
						
							| 
									
										
										
										
											2004-07-27 14:18:32 +00:00
										 |  |  |       MisSta, MisHi, StaR, StaG, StaB, StarDi, StarSi, OfsX, OfsY, OfsZ, | 
					
						
							| 
									
										
										
										
											2005-05-21 04:20:57 +00:00
										 |  |  |       SizeX, SizeY, SizeZ, TexR, TexG, TexB, DefVar, Col, Nor, Var. | 
					
						
							|  |  |  |       5. World Ipo: HorR, HorG, HorB, ZenR, ZenG, ZenB, Expos, Misi, MisDi, | 
					
						
							|  |  |  |       MisSta, MisHi, StarR, StarB, StarG, StarDi, StarSi, OfsX, OfsY, OfsZ,i | 
					
						
							|  |  |  |       SizeX, SizeY, SizeZ, texR, texG, texB, DefVar, Col, Nor, Var. | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  |       6. Texture Ipo: NSize, NDepth, NType, Turb, Vnw1, Vnw2, Vnw3, Vnw4, | 
					
						
							| 
									
										
										
										
											2004-07-27 14:18:32 +00:00
										 |  |  |       MinkMExp, DistM, ColT, iScale, DistA, MgType, MgH, Lacu, Oct, | 
					
						
							| 
									
										
										
										
											2005-05-21 04:20:57 +00:00
										 |  |  |       MgOff, MgGain, NBase1, NBase2. | 
					
						
							|  |  |  |       7. Curve Ipo: Speed. | 
					
						
							|  |  |  |       8. Key Ipo: Speed, 'Key 1' - 'Key 63'. | 
					
						
							|  |  |  |       9. Action Ipo: LocX, LocY, LocZ, SizeX, SizeY, SizeZ, QuatX, QuatY, | 
					
						
							|  |  |  |       QuatZ, QuatW. | 
					
						
							|  |  |  |       10. Sequence Ipo: Fac. | 
					
						
							|  |  |  |       11. Constraint Ipo: Inf. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     @rtype: string | 
					
						
							|  |  |  |     @return: the name of the ipo curve. | 
					
						
							| 
									
										
										
										
											2003-08-05 10:19:28 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def getPoints(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     Returns all the points of the ipo curve. | 
					
						
							|  |  |  |     @rtype: list of BezTriples | 
					
						
							|  |  |  |     @return: the points of the ipo curve. | 
					
						
							| 
									
										
										
										
											2003-08-05 10:19:28 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-04-06 21:13:12 +00:00
										 |  |  |   def evaluate( time ): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     Compute the value of the IpoCurve at a particular time. | 
					
						
							|  |  |  |     @type time: float | 
					
						
							|  |  |  |     @param time: value along the X axis | 
					
						
							|  |  |  |     @rtype: float | 
					
						
							|  |  |  |     @return: the Y value of the curve at the given time | 
					
						
							| 
									
										
										
										
											2004-04-06 21:13:12 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-08-05 10:19:28 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | class BezTriple: | 
					
						
							|  |  |  |   """
 | 
					
						
							|  |  |  |   The BezTriple object | 
					
						
							|  |  |  |   ==================== | 
					
						
							| 
									
										
										
										
											2004-04-07 22:42:02 +00:00
										 |  |  |   This object gives access to generic data from all beztriple objects in Blender.  If an attribute is listed as being 'read-only' that means you cannot write to it.  Use the set*() methods instead. | 
					
						
							| 
									
										
										
										
											2005-06-15 06:22:26 +00:00
										 |  |  |   @ivar pt : a list of the [x,y] coordinates for knot point of this BezTriple.  read-only. | 
					
						
							|  |  |  |   @ivar vec : a list of the 3 points [ handle, knot, handle ] that comprise a BezTriple.  See the getTriple() method for an example of the format.  read-only. | 
					
						
							| 
									
										
										
										
											2003-08-05 10:19:28 +00:00
										 |  |  |   """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def getPoints(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     Returns the xy coordinates of the Bezier knot point. | 
					
						
							|  |  |  |     @rtype: list of floats | 
					
						
							|  |  |  |     @return: list of the x and y coordinates of the Bezier point. | 
					
						
							| 
									
										
										
										
											2003-08-05 10:19:28 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def setPoints(newval): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     Sets the point xy coordinates of the Bezier knot point. | 
					
						
							|  |  |  |     @type newval: tuple of 2 floats | 
					
						
							|  |  |  |     @param newval: the x and y coordinates of the new Bezier point. | 
					
						
							|  |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return: None | 
					
						
							| 
									
										
										
										
											2003-08-05 10:19:28 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-04-06 21:13:12 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |   def getTriple(): | 
					
						
							| 
									
										
										
										
											2004-06-08 04:41:02 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  |     Returns the x,y,z coordinates for each of the three points that make up | 
					
						
							|  |  |  |     a BezierTriple. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     The return list looks like this [ [H1x, H1y, H1z], [Px, Py, Pz], | 
					
						
							|  |  |  |     [H2x, H2y, H2z] ] . | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     Example:: | 
					
						
							|  |  |  |       # where bt is of type BezierTriple | 
					
						
							|  |  |  |       #  and h1, p, and h2 are lists of 3 floats | 
					
						
							|  |  |  |       h1, p, h2 = bt.getTriple() | 
					
						
							|  |  |  |      | 
					
						
							|  |  |  |     @rtype: list consisting of 3 lists of 3 floats | 
					
						
							|  |  |  |     @return: handle1, knot, handle2 | 
					
						
							|  |  |  |     """
 |