[Bf-committers] Blender roadmap article on code blog

Campbell Barton ideasman42 at gmail.com
Thu Jun 27 04:33:26 CEST 2013


On Thu, Jun 27, 2013 at 10:58 AM, Jed <jedfrechette at gmail.com> wrote:
> David Jeske wrote
>> In short, I want to help more of the blender community turn into blender
>> devs and debuggers.
>>
>> ...clip...
>>
>> Python isn't used for
>> enough of blender, and the code which is there is very hard to read,
>> understand, change because there are no types and there is no compile
>> typechecking.
>
> As someone with a fair bit of experience using Python for various things but
> only the occasional need to write Blender scripts I agree about the existing
> Python code being hard to read.

Am happy to take criticism for python code, but curious which parts
you found problematic to follow.

> However, the difficulties I've had have
> never really been due to lack of types. Instead, wildly varying styles and
> often little if any inline documentation have been the biggest issues for
> me. Combine this with the fact that Python is a pretty thin wrapper around
> the underlying structures, which I don't fully understand, and I'm usually
> able to come up with something that works but I'm never quite sure if I've
> done it the "right" way.

I've tried to include examples in the text editors templates to help
give users some samples of working scripts,
is there some area you think should be added to here that would help?

> Personally, I would love to see all new Python code complying to Google's
> Python Style Guide. In fairness, the new code I've looked at usually is
> better, however, often I'm looking at IO addons and other tools that have
> been around for awhile gathering cruft.

IMHO we are pretty good with style (bundled scripts follow pep8,
although 80-column width optional),
I had a quick look over google's standards and while we don't follow
all, a lot of them are aligned with pep8 (and common sense),

if you think there are some we could benefit from, I'd be interested
to know which ones specifically.


As for the IO scripts definitely gather cruft, **but i can explain!** :)
first we rushed in a direct port from 2.4x - was gsoc project, and we
we're happy to have something functional (otherwise uses had to go
back to 2.4x),
then with BMesh if further complicated things since we had to deal
with tessface/ngon conversions.
So at this point they are really not nice to read - we just fix bugs
and keep them working.

> Oh yeah, the biggest problem: Blender's Python console isn't iPython. :-)

Integrating ipython is fairly straightforward, can be optional console
mode from the menu (if ipython is found).
IIRC at the time the py-console was added  ipython didn't have python3
support so we did our own.

> --
> View this message in context: http://blender.45788.x6.nabble.com/Blender-roadmap-article-on-code-blog-tp109587p110189.html
> Sent from the Bf-committers mailing list archive at Nabble.com.
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers



-- 
- Campbell


More information about the Bf-committers mailing list