[Bf-python] TypeError adding Text to a scene

Ron Wheeler rwheeler at artifact-software.com
Wed Oct 7 19:31:04 CEST 2009


Thanks
That was a great help.

I was looking in the trunk of the svn and 
source/blender/python/api2_2x/doc/  does not exist.

But since you told me what I was looking for, I started working through 
the tags and found it right away.

If you look at the API description to Text3d
http://www.blender.org/documentation/249PythonDoc/

It says:

This module provides access to *Font* objects in Blender.

Example:

       import Blender
       from Blender import Curve, Object, Scene, Text3d
       txt = Text3d.New("MyText")  # create a new Text3d object called MyText
       scn = Scene.GetCurrent()    # get current scene
       ob = scn.objects.new(txt)   # create an object from the obdata in the current scene
       ob.makeDisplayList()        # rebuild the display list for this object
       Window.RedrawAll()


This is really not helpful.
What ##*&* is a "Font" object? That is not a term that a normal person 
would use to describe what you get. "Access" is only part of what it 
does. It also enables you  to create new ones.

According to the rest of the page there are only 2 functions "New" and 
"get".

I find it hard to believe that the rest of the Text3d functions are 
deprecated.

A quick look at the sources shows that there are more functions with 
descriptions. Why are they not showing up in the documentation?

The example would be a lot more hellpful if it actually showed how to 
get the text that you want into your scene.
I would also change the comments to relate a bit better to what the user 
wants to do not some unrelated discussion of internal functioning.
"obdata" is not defined or referenced in the documentation.

       import Blender

       from Blender import Curve, Object, Scene, Text3d

       txt = Text3d.New("MyText")  		# create a new Text3d object called MyText

       txt.setText("Words I want on the scene")  # associate the text "Words I want on the scene" with the text object

       scn = Scene.GetCurrent()    		# get current scene

       ob = scn.objects.new(txt)   		# create an object saying "Words I want on the scene"  in the current scene

       ob.makeDisplayList()        # rebuild the display list for this object - WHY??? DO I ALWAYS NEED TO DO THIS WITH Text3d?

       Window.RedrawAll()




I realize that documentation is hard to write for programmers since they 
are frequently too knowledgeable to understand what has to be explained  
and are often not application oriented.
Adding second language issues does not make it better.


How can I fix the source so that the Text3D description:
- has a useful example - once I figure out how, I would add the setting 
of the string (as above) and changing the font, the size, the alignment, 
orientation and perhaps even show it being extruded.
- describes where the object appears on the screen and how to change its 
orientation and location
- has ALL the non-deprecated functions listed and the deprecated 
function listed with a note that it is deprecated.

Why are the rest of the functions not showing up in the documentation? 
They seem to actually have descriptions. It is hard to use objects with 
most of the methods and properties undocumented.


Ron



Nery Chucuy wrote:
>
> 2009/10/5 Ron Wheeler <rwheeler at artifact-software.com 
> <mailto:rwheeler at artifact-software.com>>
>
>     ...
>     Any idea about where to find the sources for the documentation?
>     I would not mind putting some effort into fixing things where I can.
>
>
> At least on 2.4x python api documentation is on the folder:
>
> source/blender/python/api2_2x/doc/
>  
> However I don't think it worth for 2.4x maybe you can help to do that 
> on 2.5.About that you can ask to Campbell Barton ( ideasman on IRC).
>
> Regards,
>
> Nery Chucuy (idesisnery)
> ------------------------------------------------------------------------
>
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20091007/bbc464ee/attachment.html>


More information about the Bf-python mailing list