[Bf-python] TypeError adding Text to a scene

Ron Wheeler rwheeler at artifact-software.com
Mon Oct 5 16:59:05 CEST 2009


That certainly fits with what I had tried. I did not get the Text3d to 
work but that might have been caused by other misunderstandings on my part.

I will try again and see where I fall down next.

Any idea about where to find the sources for the documentation?
I would not mind putting some effort into fixing things where I can.


Thanks for helping me onto the track. I am trying to script an animation 
of some very simple objects that are replicated in various combinations 
in different animations.

Probably a programmer's solution to a problem that would be more easily 
solved by a graphic artist. :-)


Ron

Nery Chucuy wrote:
> Hello Ron,
>
> I've been using Python API for some time and yes, the documentation is 
> not that clear but if you put a attention you'll get what you want.
>
> What I think you want to use in this case is not a Text but a Text3d. 
> Text is for the TextEditor and Text3d is for the object that appears 
> through the menu: Add>Text.
>
> Hope this helps,
>
> Nery Chucuy (idesisnery)
>
> 2009/10/5 Ron Wheeler <rwheeler at artifact-software.com 
> <mailto:rwheeler at artifact-software.com>>
>
>     In general, the API documentation is terrible (examples use methods or
>     properties that do not appear in the documentation,
>     lots of properties and methods seem to work that are not documented)
>     but I have not been able to find the sources for any of the
>     documentation or find the code for the classes in the sources so I can
>     read them for the whole story.
>
>     I am currently stuck on trying to add Text to a scene as a child of a
>     mesh that I want to animate with a script.
>
>     The following code is supposed to generate a text Object that I can
>     associate to a mesh as a child.
>
>     It generates an error.
>     The scn is OK and I can add a camara, a Lamp and a bunch of meshes
>     to it
>     but creating text in the scene does not seem to work.
>
>
>     def makeTextObject(scn,name,text,type="top"):
>       myTxt=Text.New("MyText")
>       myTxt.write("test Text")
>       print "Made a text called " + myTxt.name
>
>       textOb = scn.objects.new(myTxt)    #Generates the TypeError
>
>       print "Made a Text object called " + textOb.name + "containing"
>     + text
>       return textOb
>
>
>
>     TypeError: expected an object and optionally a string as arguments
>
>     x
>     _______________________________________________
>     Bf-python mailing list
>     Bf-python at blender.org <mailto:Bf-python at blender.org>
>     http://lists.blender.org/mailman/listinfo/bf-python
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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/20091005/595ce125/attachment.html>


More information about the Bf-python mailing list