[Bf-python] BMesh python api proposal.

Daniel Monteiro Basso danielmbasso at gmail.com
Fri Feb 24 16:04:33 CET 2012


On Fri, Feb 24, 2012 at 1:27 PM, Campbell Barton <ideasman42 at gmail.com>wrote:

> you have a point - but the way I see it, its implicit with many python
> api's that - attributes provide direct access and functions have
> side-effects.


Yep, unless the attribute is actually a property, but then that's usually
expected (e.g. ORM wrappers that performs operations on the underlying data
storage).


in this case the side effect of calling select is to
> update selection of other geometry.
> So while its not great, its not totally un-pythonic IMHO.
>

Sure, and let me make clear that I'm not complaining, the way it is now is
already good. It is just that I see room for a little improvement.

select_set(select, flush=False) is more clear and can work, but is
> redundant since you may as well just assign .select = ... in that
> case.
>

I agree. The problem is that if the 'flush' argument is removed then 'set'
isn't simply 'set' anymore.
Some suggestions:
.propagate_select(select)
.flush_select(select)
.set_linked_select(select)  # not good, probably misleading?
.set_select(select)  # Verb-Object, consistent with other methods such as
calc_face_angle

Cheers,

Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20120224/2716c378/attachment.html>


More information about the Bf-python mailing list