Why can't I post in the Coding category?

I joined this site to ask a Python question. Your site tells me I have to gain cred or something before I can’t ask a Python question.

I am really too old to have to wait, might not remember why I joined this site if I don’t ask the question soon.

Is there like a secret handshake or something I have to know or ‘Joe Sent Me’ kind of thing?

My question, in case this gets seen by anyone that knows is:
I wrote a Python script I call ‘Text Bubble’, to help me create text bubbles like this easily:

I was able to figure out everything via Python except for the how to send text.
I can enter edit mode with this:

bpy.ops.object.text_add(enter_editmode=False, align=‘WORLD’, location=(0, 0, 0), scale=(1, 1, 1))
bpy.context.object.data.align_x = ‘CENTER’
bpy.context.object.data.align_y = ‘CENTER’
bpy.context.object.data.extrude = 0.06
bpy.ops.font.open(filepath=“C:\Windows\Fonts\ARLRDBD.TTF”, relative_path=True)
bpy.context.object.location[0] = 0.16
bpy.ops.object.editmode_toggle()
bpy.ops.font.delete(type=‘PREVIOUS_OR_SELECTION’)
bpy.ops.font.delete(type=‘PREVIOUS_OR_SELECTION’)
bpy.ops.font.delete(type=‘PREVIOUS_OR_SELECTION’)
bpy.ops.font.delete(type=‘PREVIOUS_OR_SELECTION’)

Any help is appreciated on telling me how to do the C# equivalent of SendKeys(text) in Python?

I did find a Text example of Blender.org, but that appears to be for drawing 2D text, not text for the 3D Text editor (Control + A - Text).

Thanks for any tips on manipulating 3D Text via Python.

Corby / Data Juggler

I found it (I think), answer came from:

https://docs.blender.org/api/current/bpy.ops.font.html

bpy.ops.font.text_insert(text = ‘’, accent = false)

Sorry to answer my own question, I had not found the above page yet when I posted.

Though the answer is completed I would just point out something better, to change the text directly so is easier.


# this line was copied directly fron the INFO PANEL
# (when you are unsure about how something is done
#  you would be able to have a peek in the info panel
#  just in case something that interests you is shown)
bpy.ops.object.text_add(enter_editmode=False, align='WORLD', location=(0, 0, 0), scale=(1, 1, 1))

# this one I had to look up
# (is good idea to explore the docs API because it might
#  give you a clue about something if needed)
# https://docs.blender.org/api/current/bpy.types.TextCurve.html#bpy.types.TextCurve.body
C.object.data.body = 'Hello'

Thank you, I tried to unsolve mine way when it didn’t work, but this site said ‘Try again in 24 hours’ and I forgot.

I will try your way, thanks,

1 Like

You can’t post in top-level categories - you need to select the proper subcategory first, like you did :slight_smile: