Module BezTriple

Source Code for Module BezTriple

 1  # Blender.BezTriple module and the BezTriple PyType object 
 2   
 3  """ 
 4  The Blender.BezTriple submodule 
 5   
 6  B{New}:  
 7    -  new attributes L{handleTypes<BezTriple.handleTypes>}, 
 8       L{selects<BezTriple.selects>} and L{weight<BezTriple.weight>}  
 9   
10  This module provides access to the BezTriple Data in Blender.  It is used by 
11  CurNurb and IpoCurve objects. 
12   
13  @type HandleTypes: readonly dictionary 
14  @var HandleTypes: The available BezTriple handle types. 
15      - FREE - handle has no constraints 
16      - AUTO - completely constrain handle based on knot position 
17      - VECT - constraint handle to line between current and neighboring knot 
18      - ALIGN - constrain handle to lie in a straight line with knot's other 
19      handle 
20      - AUTOANIM - constrain IPO handles to be horizontal on extremes 
21  """ 
22   
23 -def New (coords):
24 """ 25 Create a new BezTriple object. 26 27 @type coords: sequence of three or nine floats 28 @param coords: the coordinate values for the new control point. If three 29 floats are given, then the handle values are automatically generated. 30 @rtype: BezTriple 31 @return: a new BezTriple object 32 """
33
34 -class BezTriple:
35 """ 36 The BezTriple object 37 ==================== 38 This object gives access to generic data from all BezTriple objects in 39 Blender. 40 @ivar pt : the [x,y] coordinates for knot point of this BezTriple. After 41 changing coordinates of a Ipo curve, it is advisable to call 42 L{IpoCurve.recalc()<IpoCurve.IpoCurve.recalc>} to update the curve. 43 @type pt: list of two floats 44 @ivar vec : a list of the 3 points [ handle, knot, handle ] that comprise a 45 BezTriple, with each point composed of a list [x,y,z] of floats. The list 46 looks like [ [H1x, H1y, H1z], [Px, Py, Pz], [H2x, H2y, H2z] ]. 47 Example:: 48 # where bt is of type BezTriple 49 # and h1, p, and h2 are lists of 3 floats 50 h1, p, h2 = bt.vec 51 @type vec: list of points 52 @ivar tilt: the tilt/alpha value for the point 53 @type tilt: float 54 @ivar radius: the radius of this point (used for tapering bevels) 55 @type radius: float 56 @ivar hide: the visibility status of the knot. B{Note}: true/nonzero means 57 I{not} hidden. B{Note}: primarily intended for curves; not a good idea to 58 hide IPO control points. 59 @type hide: int 60 @ivar handleTypes: the types of the point's two handles. See 61 L{HandleTypes} for a complete description. 62 @type handleTypes list of two ints 63 @ivar selects: the select status for [handle, knot, handle]. True/nonzero 64 if the point is selected. 65 @type selects: list of three ints 66 @ivar weight: the weight assigned to the control point. Useful for 67 softbodies and possibly others. 68 @type weight: float 69 """ 70
71 - def getPoints():
72 """ 73 Returns the x,y coordinates of the Bezier knot point (B{deprecated}). 74 See the L{BezTriple.pt} attribute. 75 @rtype: list of floats 76 @return: list of the x and y coordinates of the Bezier point. 77 """
78
79 - def setPoints(newval):
80 """ 81 Sets the x,y coordinates of the Bezier knot point (B{deprecated}). 82 See the L{BezTriple.pt} attribute. 83 @type newval: tuple of 2 floats 84 @param newval: the x and y coordinates of the new Bezier point. 85 @rtype: None 86 @return: None 87 """
88
89 - def getTriple():
90 """ 91 Returns the x,y,z coordinates for each of the three points that make up 92 a BezierTriple (B{deprecated}). See the L{BezTriple.vec} attribute. 93 @rtype: list consisting of 3 lists of 3 floats 94 @return: handle1, knot, handle2 95 """
96