text 3D

how can we change the size and location of 3D text in python

like

txt= Text3d.New(“Ellipse Arch”) # Object name
txt.setText(myTextValue)
txt.setExtrudeDepth(0.01)

the what are the commands to change location and size or scale it ?

Thanks

RickyBlender you ask alot of questions that could be learned rather quickly with a quick look
through the documentation, I hate to be the guy that says ‘RTFM’, but I notice alot of your questions are going unanswered.

http://www.blender.org/documentation/248PythonDoc/

I think your question relates to the example at the top of the Text3d section in the docs. after your text is converted to a Blender.Object you then have access to setLocation and setSize

i did search it but very difficult to find something specific in python
there are no search engine per say
there is an index but it’s so limited and many times
what you find is not what you need

and there was just a new API

i’m not doing scipting eveyday so that’s why i ask the questions here
and i’m trying to learn it slowly but i’m not a programmer and python
is not easy to learn as such

its giving all kind of errors that are so fundamental and dfficult sometimes to
correrct without advices form here in this forum

so i’m slowly learning it but not easy to advance very fast
but i learning more and more with time

ok read the page on 3Dtext

but does not say how to change it into mesh
any example on this

then after the conversion i think i know how to move it and relocate & scale it

Thanks

this is the example in the docs.


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()

so lets change it to work with your needs.


import Blender
from Blender import Curve, Object, Scene, Text3d
#txt = Text3d.New("MyText")  # create a new Text3d object called MyText
txt= Text3d.New("Ellipse Arch") # Object name
txt.setText(myTextValue) 
txt.setExtrudeDepth(0.01)
scn = Scene.GetCurrent()    # get current scene
ob = scn.objects.new(txt)   # create an object from the obdata in the current scene
ob.setLocation(x,y,z)    #  your new location
ob.setSize(x,y,z)    # your new size 
ob.makeDisplayList()        # rebuild the display list for this object
Window.RedrawAll()

I hope that answers your question.

i like to understand thing to learn it right the first time if i can

now can you explain where the conversion to mesh is made!

don’t see any command saying to convert it to mesh

it seems to displace the text object to another location but wihtout converting it to mesh first !

i tough you said it was required to change it to mesh first then to relocate it !

Thanks

I did not say to convert it to mesh, I said convert it to a blender object,
but you are right, convert is not a correct term here. It is more like linking the data to an Object.
Every thing in blender is an object, and every object contains data.
in this example we created the data first

txt= Text3d.New(“Ellipse Arch”)

and later linked the data to an object

ob = scn.objects.new(txt) # create an object from the obdata in the current scene

Just to follow-up on the sentiment of RTM.

Now I don’t mean to be harsh. Merely some friendly advice to help speed you along.

The module tree
http://www.blender.org/documentation/248PythonDoc/module-tree.html

contains a link to the Text3d module
http://www.blender.org/documentation/248PythonDoc/Text3d-module.html
(The example being discussed is here)

Which contains a link to the Text3d object
http://www.blender.org/documentation/248PythonDoc/Text3d.Text3d-class.html

Within this page are one of two things that directly answer one of your two questions.
Specifically the “size” functions/methods “getSize” and “setSize

Also, the very first method shown is “getName()” which states “Get the name of this Text3d object.”

So for an existing Text3d object (once you know the name) you can get the Object in one of two ways:

Object.Get(nameOfMyText3dObject)

And from here you can set scaling, location, and a whole host of other things.

All from just a few minutes of inspection of the Python API.

You are of course free to ask any number of questions you want but, if you would spend a little more time with the API you might get beyond all these basic concepts a bit quicker. If you do I think you will find that asking questions to do with more complex ideas (i.e. beyond what the API actually DOES gives you) you might find that the help you will eventually need/want both quicker in coming and more amicable.

python is for me s very difficult language but i’md slowly leaqrning more and more
about it - but i don’t expect to become a vey advanced user before a long time

in any case i believe this is the role of this forum where you can ask questions and get answers like all the other forum for blender

now i wish there was more good tutorial on python with good example it would be
easier to learn more about it and faster also

i did find some intro to python like in wiki and other places but with all the new changes it would have to be updated to reflect the latest changes and it not always done immediately

but it has improve with time and i’m certain that in the futur i will be better like
blender is improving with time and that’s very encouraging to see it become
easier and more powefull to use with more tools

so i thank you guys for your help

Salutations