[Bf-interface] Permission to add python accessible functions to query available UI operations.

Julian Eisel eiseljulian at gmail.com
Mon Dec 12 18:00:15 CET 2016


Hi Dave,

You also mailed me in person, but sending my reply to the mailing list
in case others are interested in the topic.

Welcome to the world of open source! In this world, you don't need to
ask for any permissions to change something, usually you simply do the
needed changes and submit a patch (or pull request in GitHub terms).
The project developers then decide if the changes are acceptable for
the official project repository or not. Of course it's totally fine to
ask if there's a chance to get your planned changes accepted at all.
I'll interpret your mails as such a question.

----

I'd say almost everything you propose could (and IMHO should) be done
as a Python add-on. That's exactly why we have the Python add-on
system, to extend and complement the core functionality of Blender
with additional useful tools for artists. I'd probably not accept a
complete C implementation of what you describe, as long as it doesn't
have any clear advantage over having it as an add-on.
It is totally up to you how you want to publish your add-on (e.g. you
could sell it on blendermarket.com or just provide it as free
download). If you'd like to have it bundled with the official Blender
releases, you have to ask the add-on team for review and inclusion in
the official add-on repository. I'm not part of this team but I'd say
functionality-wise chances are good that it'll be accepted.
(More info: https://wiki.blender.org/index.php/Dev:Doc/Process/Addons)

However, to reach your goals you'd probably still need to do some
modifications on the C code. From what I can tell that would be at
least:
* Expose operator-type iterator to BPY (indeed similar to pyop_dir,
but returning a list actual operator-type objects, not just a list of
their identifiers)
* API to get shortcuts for an Operator
Both would be useful additions to the Python API I guess, however I'm
*not* the maintainer of this (not sure who is now... Sergey? Bastien?)
and thus can't give a definite answer.

So as Bastien already suggested you in IRC, get the C changes done and
reviewed individually. I'd suggest you develop the add-on alongside
with this and publish it (or propose for inclusion) whenever you feel
like it's ready.
Hopefully this will help you getting started. Looking forward to hear
about progress!

Cheers,
- Julian -

On 8 December 2016 at 20:55, Dave B <daveb68prg at gmail.com> wrote:
> Summary
> =======
> I would like to add new methods accessible from python that would query the
> state of the UI.  The first method I researched would be similar to the
> function pyop_dir, but instead calling it with a context, calling poll on
> the operators, and then returning only applicable operators plus additional
> information such as description, help link, ...
>
> The reason is I would like to be able to create a "learning" tool that has
> the minimum impact on the Blender source code base (both python and C) that
> would allow a new user (or an experienced user) to execute a command that
> will query the UI for available operations based on the current goal and
> context and provide every way to access those operations (i.e. short cut
> keys, headers, popup menus, and panels).
>
> The learning tool would support both course work and goal driven operations
> by maintaining both a filter and a hierarchy of operations.  The hierarchies
> would leverage the UI best practice (IMO) of no container containing more
> than 7 child items.  I believe this would allow humans to navigate the
> system prior to having memorized all of the commands, all of the shortcut
> keys, and locations to execute a command from that an efficient user would
> already know.  I have not used many addons, but I believe this would also
> "reveal" buttons only available in panels that are not currently visible.
> Based on either an objective, such as mesh editing, or a training course
> that introduces new features in a controlled manner, the available and
> applicable commands would be filtered to show the smallest applicable set in
> the proper hierarchy to allow the new user to discover and recall the short
> cut keys and access methods for the goal they are trying to accomplish.
> Once an operation was selected, the tool will show you the help page, the
> access methods, related online videos (submitted by the authors), and the
> users personal assessment of their understanding of the function so in
> learning sessions they can focus on full mastery of a section of the system.
>
> Reasoning
> ========
> When I started trying to learn blender, I found that it was non obvious to
> me how to get started.  I purchased some on line courses.  In walking
> through those, they got me started and I started to learn specific parts of
> the UI and I could "re-execute" the steps of what the instructor made but
> always felt like there was much more to the tools and anytime I needed
> something slighting different, I was lost.  I also found that having to
> scrub through 20 minutes of video to find out how they did something was not
> very cost effective.  Perhaps it is my bad memory.  I then started reading
> the Blender Manual page by page.  This has been the most useful so far.  I
> was getting pretty good at modeling, but still found that by watching you
> tube videos I would see something that I either forgot from the manual or
> misinterpreted in my read and trial.  I also have found that some of the
> short cut keys are missing from the menus and the only way to identify those
> is to manually go through user preferences and find those commands and see
> what shortcut keys are associated with them.  I did submit two bug reports
> related to these.
>
> I don't like to learn a tool by watching others work and duplicating what
> they did never knowing if I know the most efficient way to accomplish
> something or all of the tools as my disposal.  I am looking to create the
> sort of tool that would allow me (or any new user) to break Blender into its
> components, learn one section at a time and know I am using it in the most
> efficient manner possible.  As new features come out in subsequent releases
> OR I start using new add-ins, this tool becomes essential again.
>
>
> Limitation of Changes
> ================
> Based on the code bases I have written over the years I would be very
> hesitant to allow a developer I know little about to make these types of
> changes to my code base.  My objective will be to introduce the fewest lines
> of new code that follows the current practices.  Outside of the code that
> exposes these functions to python, it will never run unless the user has
> initiated it via a python command.  This should minimize the possible side
> effects of this code.  I have included a summary of my qualifications below
> to hopefully give you a little more comfort.
>
> I have analyzed the C source code and checked every place the ability to
> iterate over operators is accessed and determine that this is not currently
> exposed to python in a way that I could accomplish my objective.
>
> Qualifications
> ==========
> 1991-1996 Senior Programmer for Computer Design Inc.'s Design Concept 3D.
> NURBS based modeler written in C and using GL4.
> 1996
> 1997-1998 Worked with 3D CAD systems writitng addins for an inspection
> facilit.  Whatever language the CAD environment was exposing
> 1999-2003 Developed Laboratory tops manufacturing systems (2d and 3d) using
> VB5, C++, OpenGL,
> 2004 to present have been employed full time as a developer for a 3
> different companies and developed a variety of .NET client applications and
> servers in large code bases.  Have dabbled in web technologies.
>
> Thank you for your consideration.
>
> Dave Ball
>
> _______________________________________________
> Bf-interface mailing list
> Bf-interface at blender.org
> https://lists.blender.org/mailman/listinfo/bf-interface
>


More information about the Bf-interface mailing list