vertice selection

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
lukas
Posts: 0
Joined: Sun Sep 21, 2003 3:14 pm

vertice selection

Post by lukas » Sun Sep 21, 2003 3:53 pm

Hi,
please forgive me if i am using the wrong forum or something similar, i'm new 'round here.

Concerning vertice selection:
I read somewhere in this forum, that it is not possible right now (2.28a) to access/manipulate the current selection of vertices. This seems unfortunate, since imho it would greatly add to the possibilities of using phyton to write small helpers for mesh editing.
To give some concrete examples:
i would like to write a script that calculates the orthogonal projection of the 3d cursor to the nearest selected face/edge, or one that calculates intersections of selected faces/edges, or one that trims intersecting edges/faces. Or whatever. this kind of things. All these, while beeing realy simple as such, would depend on knowing which vertices are selected.

Concerning face selection:
AFAIK, getSelectedFaces returns only faces selected in Face Selection mode.
Why is this different from the faces "selected" in normal Edit Mode? Since the user interface somehow suggests a "selection" of faces/edges (if all vertices of the respective face are selected), wouldn't it be more intuitive to return that selection as well? Maybe the returned list should depend on wether called in Edit or Face Select mode? Well ok, i guess that's not so important as one can determine the selected faces/edges from examining the selected vertices.

Custom key bindings:
Is it possible to bind keys to custom python scripts? I would like that.

Cursor:
Access to the 3d cursor would also be nice, but i understand this is beeing worked upon?

Kind Regards,
Lukas

ilac
Posts: 131
Joined: Mon Oct 14, 2002 8:24 am

Re: vertice selection

Post by ilac » Sun Sep 21, 2003 4:56 pm

lukas wrote: Why is this different from the faces "selected" in normal Edit Mode?
Can't help you regarding the python stuff, but to give you a quick answer to this question:
A face selected in Edit mode does differ from a face selected in [UV] Face mode because in edit mode 'all faces determined by the selected vertices are chosen' as opposed to the actual faces in Face mode where not all faces determined by the vertices need be selected. This is a significant difference.

Example:

Imagine a grid of 3X1 squares (2 rows of 4 verts)
1_2_3_4
5_6_7_8

In face mode you can select the 2 outer faces without selectng the centre one. In edit mode to select the outer faces, you must select verts 1256 for face 1 and 3478 for face 3, which obviously means that your selection also has 2367 . ie face 2!

Don't know how the data is 'seen' via python though, so will let somebody answer that! :wink:

ascotan
Posts: 0
Joined: Thu May 29, 2003 10:32 pm
Location: Maryland, U.S.

Post by ascotan » Sun Sep 21, 2003 5:59 pm

Hopefully vertex selection will be added to NMesh soon (it's already witten). A new module EMesh is being built which will give access to a mesh in edit mode. Also some 3D cursor access has already been added to the CVS.

lukas
Posts: 0
Joined: Sun Sep 21, 2003 3:14 pm

Post by lukas » Mon Sep 22, 2003 10:29 am

ilac wrote: A face selected in Edit mode does differ from a face selected in [UV] Face mode because in edit mode 'all faces determined by the selected vertices are chosen' as opposed to the actual faces in Face mode where not all faces determined by the vertices need be selected.
Ahhhh.... of course. Stupid me :oops: . Thanks for pointing out.
ascotan wrote:Hopefully vertex selection will be added to NMesh soon (it's already witten). A new module EMesh is being built which will give access to a mesh in edit mode. Also some 3D cursor access has already been added to the CVS.
This sounds like great news. You guys can read thoughts, don't you? Actualy this EMesh module seems to be exactly what i was missing. :D Yipee!
Think i will start tracking cvs more closely. Are there any (preliminary) docs/specs on EMesh?

btw, what's the 'N' in NMesh ?

thx & Regards,
Lukas

ascotan
Posts: 0
Joined: Thu May 29, 2003 10:32 pm
Location: Maryland, U.S.

Post by ascotan » Mon Sep 22, 2003 8:13 pm

I don't know what the N was for. The original was called Mesh and NMesh was added later, i think, as a wrapper for the python script mesh as opposed the the blender mesh. Mesh was dropped but NMesh is still around. My guess in that the N is for pythoN. :p

Post Reply