[Bf-python] BMesh python api proposal.

Campbell Barton ideasman42 at gmail.com
Sun Feb 19 20:47:59 CET 2012


On Mon, Feb 20, 2012 at 5:15 AM, Jason van Gumster
<jason at handturkeystudios.com> wrote:
>
> Campbell Barton <ideasman42 at gmail.com> wrote:
>
>> Since INTERLICHTSPIELHAUS asked, heres what I think our BMesh python
>> api will look like, Ill probably start work on it in a few weeks.
>>
>> http://wiki.blender.org/index.php/Dev:2.6/Source/Modeling/BMesh/Python
>>
>> There is not too much creative about this, its just a pythonic
>> wrapping of the C api, which should be much more useful then previous
>> apis.
>>
>> Some open issues are listed at the bottom of the wiki.
>
> Am I correct in my understanding that the BMElem.select_set() function will
> allow Python scripts to select/deselect mesh elements (vertices, faces, etc.)
> without toggling in and out of Edit/Object mode? If so, this will be a very
> welcome improvement, particularly for scripts that deal with high resolution
> meshes.
>
> Of course, if I'm misunderstanding the use of that function, then I'd like to
> know if there *is* a plan to get away from the Edit/Object mode toggle dance
> when selecting mesh elements.
>
>  -Jason

Python bmesh access will solve this annoyance of having to stuff about
with editmode switching - you will be able to operate on the mesh
direct.

Since you bring it up -
BMElem.select_set(True)
BMElem.select = True

This seems odd having both. the difference is the function flushes selections.
- so selecting a face will also select its vert's, de-selecting one of
those verts will de-select any faces its used in  for eg,
in some cases you might want to set every elements selection
explicitly and not have BMesh be smart about flushing them for you.



More information about the Bf-python mailing list