Create macro function w/ Python?

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
gendou
Posts: 0
Joined: Tue Jun 17, 2003 7:57 am
Location: Indianapolis, IN

Create macro function w/ Python?

Post by gendou »

Hi,

First, I'm not a programmer but understand the basic ideas of programming (decisions, variables, etc) and I wanted to know if it's possible to create a"macro" script to execute several keystrokes at once? I would like the script to show up in the "Scripts" menu so that it can be added to the new Tuhopuu toolbar as a button.

I want to make the script execute the keystrokes Esc, F, B, B or a single B at the end. I want to use box (or paint) selection, exit that mode, make face, enter select mode again, in one command. I'm looking for a shortcut in the too-complex command list for building poly-by-poly objects. I hate that there's no streamlined "select > create face > continue selecting" function or a good bridging command (like the Cinema 4D bridging command, NOT a connecting vert loops command!!). The closest I can get is Edge mode > select 2 edges > F-key, but if I have copied a row of points ot laid individual points, I'm stuck with the tedious keystroke chain above.

Is it possible to write a short python command to execute this keys list or rather, something like a "make face from selection while remaining in selection mode" script?

I may not have explained this in the clearest manner, but I hope it was clear enough to get my question/problem across.

thanks!

kitsu
Posts: 0
Joined: Sun Jun 06, 2004 8:08 am

Post by kitsu »

First of all I believe that this post should have been made on Elysiun.com, not here. Since this is the developers forum I would assume that this subforum is for discussing Blender Python (Bpy) development, not developing with python...

Anyway this sounds like a great exercise for the new space handlers so I spent a few minutes messing around with it. I ran into some problems but I came up with something useable. I'm going to post a new thread at Elysiun under python with my little scriptlet, hopefully you will find it useful.

gendou
Posts: 0
Joined: Tue Jun 17, 2003 7:57 am
Location: Indianapolis, IN

Post by gendou »

You know what, after I posted this I thought that myself but I didn't want to cross-post on the boards, so I thought I'd wait and see what happened here before posting on elysiun.

Thanks for checking it out, I'll look for your post on the user forums.
-G

macouno
Posts: 0
Joined: Tue Nov 18, 2003 3:37 am

Post by macouno »

I think in here is just as good as elysiun though you'd get more responses there... not only the python/blender integration is discussed here but script development as well.

You should be able to program something like that but I doubt it'll be as simple as keystrokes... You will probably end up programming in what those keystrokes you want would result in....

So if you want a face created... yes you can have python create a face. You can have it create a face out of the selected verts too. You can have it do almost anything... just have a look in the python documentation and play with it a little.

Post Reply