Module Text3d
[hide private]
[frames] | no frames]

Source Code for Module Text3d

  1  # Blender.Text3d module and the Text3d PyType object 
  2   
  3  """ 
  4  The Blender.Text3d submodule. 
  5   
  6  Text3d Objects 
  7  ============== 
  8   
  9  This module provides access to B{Font} objects in Blender. 
 10   
 11  Example:: 
 12          import Blender 
 13          from Blender import Curve, Object, Scene, Text3d 
 14          txt = Text3d.New("MyText")  # create a new Text3d object called MyText 
 15          scn = Scene.GetCurrent()    # get current scene 
 16          ob = scn.objects.new(txt)   # create an object from the obdata in the current scene 
 17          ob.makeDisplayList()        # rebuild the display list for this object 
 18          Window.RedrawAll() 
 19  """ 
 20   
21 -def New (name = None):
22 """ 23 Create a new Text3d object. 24 @type name: string 25 @param name: The name for the new object.. 26 @rtype: Blender Text3d 27 @return: The created Text3d Data object. 28 """
29
30 -def Get (name = None):
31 """ 32 Get the Text3d object(s) from Blender. 33 @type name: string 34 @param name: The name of the Text3d object. 35 @rtype: Blender Text3d or a list of Blender Text3d's 36 @return: It depends on the 'name' parameter: 37 - (name): The Text3d object with the given name; 38 - (): A list with all Text3d objects in the current scene. 39 """
40 -class Text3d:
41 """ 42 The Text3d object 43 ================= 44 This object gives access Blender's B{Font} objects 45 @ivar frameWidth: The width of the active frame [0.0 - 50.0] 46 @ivar frameHeight: The height of the active frame [0.0 - 50.0] 47 @ivar frameX: The X position of the active frame [0.0 - 50.0] 48 @ivar frameY: The Y position of the active frame [0.0 - 50.0] 49 50 @ivar totalFrames: The total number of text frames (read only) 51 @ivar activeFrame: The active frame for this text data. 52 """ 53
54 - def getName():
55 """ 56 Get the name of this Text3d object. 57 @rtype: string 58 """
59
60 - def setName( name ):
61 """ 62 Set the name of this Text3d object. 63 @type name: string 64 @param name: The new name. 65 @returns: None 66 """
67
68 - def getText():
69 """ 70 Get text string for this object 71 @rtype: string 72 """
73
74 - def setText( name ):
75 """ 76 Set the text string in this Text3d object 77 @type name: string 78 @param name: The new text string for this object. 79 @returns: None 80 """
81
82 - def getDrawMode():
83 """ 84 Get the drawing mode (3d, front, and/or back) 85 Gets the text3d's drawing modes. Uses module constants 86 - DRAW3D : "3D" is set 87 - DRAWFRONT : "Front" is set 88 - DRAWBACK : "Back" is set 89 @rtype: tuple of module constants 90 """
91
92 - def setDrawMode(val):
93 """ 94 Set the text3d's drawing mode. Uses module constants 95 - DRAW3D 96 - DRAWFRONT 97 - DRAWBACK 98 @rtype: None 99 @type val: single module constant or tuple of module constants 100 @param val : The Text3d's modes. See L{getDrawMode} for the meaning of 101 the constants. 102 """
103
104 - def getUVordco():
105 """ 106 Return whether UV coords are used for Texture mapping 107 """
108
109 - def setUVordco(val):
110 """ 111 Set the font to use UV coords for Texture mapping 112 """
113
114 - def getBevelAmount():
115 """ 116 Get the Text3d's bevel resolution value. 117 @rtype: float 118 """
119
120 - def setBevelAmount(bevelresol):
121 """ 122 Set the Text3d's bevel resolution value. 123 @rtype: None 124 @type bevelresol: float 125 @param bevelresol: The new Curve's bevel resolution value. 126 """
127
129 """ 130 Return Default text resolution. 131 @rtype: float 132 """
133
134 - def setDefaultResolution(resolu):
135 """ 136 Sets Default text Resolution. 137 @rtype: None 138 @type resolu: float 139 @param resolu: The new Curve's U-resolution value. 140 """
141
142 - def getWidth():
143 """ 144 Get the Text3d's width value. 145 @rtype: float 146 """
147
148 - def setWidth(width):
149 """ 150 Set the Text3d's width value. 151 @rtype: None 152 @type width: float 153 @param width: The new text3d's width value. 154 """
155
156 - def getExtrudeDepth():
157 """ 158 Get the text3d's ext1 value. 159 @rtype: float 160 """
161
162 - def setExtrudeDepth(ext1):
163 """ 164 Set the text3d's ext1 value. 165 @rtype: None 166 @type ext1: float 167 @param ext1: The new text3d's ext1 value. 168 """
169
171 """ 172 Get the text3d's ext2 value. 173 @rtype: float 174 """
175
176 - def setExtrudeBevelDepth(ext2):
177 """ 178 Set the text3d's ext2 value. 179 @rtype: None 180 @type ext2: float 181 @param ext2: The new text3d's ext2 value. 182 """
183
184 - def getShear():
185 """ 186 Get the text3d's shear value. 187 @rtype: float 188 """
189
190 - def setShear(shear):
191 """ 192 Set the text3d's shear value. 193 @rtype: None 194 @type shear: float 195 @param shear: The new text3d's shear value. 196 """
197
198 - def getSize():
199 """ 200 Get the text3d's size value. 201 @rtype: float 202 """
203
204 - def setSize(size):
205 """ 206 Set the text3d's size value. 207 @rtype: None 208 @type size: float 209 @param size: The new text3d's size value. 210 """
211
212 - def getLineSeparation():
213 """ 214 Get the text3d's ext2 value. 215 @rtype: float 216 """
217
218 - def setLineSeparation(sep):
219 """ 220 Set the text3d's ext2 value. 221 @rtype: None 222 @type sep: float 223 @param sep: The new text3d's separation value. 224 """
225
226 - def getSpacing():
227 """ 228 Get the text3d's spacing value. 229 @rtype: float 230 """
231
232 - def setSpacing(spacing):
233 """ 234 Set the text3d's spacing value. 235 @rtype: None 236 @type spacing: float 237 @param spacing: The new text3d's spacing value. 238 """
239
240 - def getXoffset():
241 """ 242 Get the text3d's Xoffset value. 243 @rtype: float 244 """
245
246 - def setXoffset(xof):
247 """ 248 Set the text3d's Xoffset value. 249 @rtype: None 250 @type xof: float 251 @param xof: The new text3d's Xoffset value. 252 """
253
254 - def getYoffset():
255 """ 256 Get the text3d's Yoffset value. 257 @rtype: float 258 """
259
260 - def setYoffset(yof):
261 """ 262 Set the text3d's Yoffset value. 263 @rtype: None 264 @type yof: float 265 @param yof: The new text3d's Yoffset value. 266 """
267
268 - def getAlignment():
269 """ 270 Get the text3d's alignment value. Uses module constants 271 - LEFT 272 - RIGHT 273 - MIDDLE 274 - FLUSH 275 @rtype: module constant 276 """
277
278 - def setAlignment(align):
279 """ 280 Set the text3d's Alignment value. Uses module constants 281 - LEFT 282 - RIGHT 283 - MIDDLE 284 - FLUSH 285 @rtype: None 286 @type align: module constant 287 @param align: The new text3d's Alignment value. 288 """
289
290 - def getMaterial(index):
291 """ 292 get the material index of a character. 293 @rtype: int 294 @return: the material index if the character 295 @type index: int 296 @param index: the index of the character in a string 297 """
298
299 - def setMaterial(index, material_index):
300 """ 301 Set a characters material. 302 @note: after changing this youll need to update the object with object.makeDisplayList() to see the changes. 303 @rtype: None 304 @type index: int 305 @param index: the index of the character in a string 306 @type material_index: int 307 @param material_index: the material index set set the character. 308 """
309
310 - def addFrame():
311 """ 312 Adds a text frame. maximum number of frames is 255. 313 @rtype: None 314 """
315
316 - def removeFrame(index):
317 """ 318 Removed the frame at this index 319 @rtype: None 320 """
321 import id_generics 322 Text3d.__doc__ += id_generics.attributes 323