Regarding inputs/outputs for operators<br><br>
@Joe, agree, some python api calls this could be made less painful, but
if we&#39;re getting op-i/o in future releases its not so motivating to put
a lot of time into porting scripts which involve a lot of context
switches.<br><br>@Nathan,<br>&gt;&gt; I&#39;m not sure why there is such an obsession to make
operators also directly usable as nodes.<br>- Agree, even though it could be very cool.<br><br>Its useful because it effects how you can use the python api.<br>Without this you&#39;ll need python to setup the selection before operating on a list of objects.<br>
<br>Could support for this be added without all operators having to be converted over right away?<br>
<br>This way whenever we need this functionality (from python for
instance) we can add that in properly, rather then writing some python workaround.<br>Of course blender would need to stay usable during this change over (users should not notice).<br><br>-<br>-- Campbell<br><br>On Thu, Mar 19, 2009 at 8:00 PM, Nathan Vegdahl <span dir="ltr">&lt;<a href="mailto:cessen@cessen.com">cessen@cessen.com</a>&gt;</span> wrote:<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">(Note: in this mail I&#39;m referring to the current notion of &quot;operator&quot;<br>

when I use the term.)<br>
<br>
Another thought: I&#39;m not sure why there is such an obsession to make<br>
operators also directly usable as nodes.  Firstly, I&#39;m not at all sure<br>
that all operators make sense as nodes (delete object, for example?).<br>
Nor am I at all sure that all nodes would make sense as operators.  I<br>
don&#39;t really think a one-to-one mapping will work well here.<br>
<br>
Perhaps this is another argument for splitting operators into<br>
&quot;operators&quot; and &quot;tools&quot;.  Then we can also have &quot;nodes&quot; which sit on<br>
the same level as &quot;tools&quot;, but still without code duplication.<br>
<br>
--Nathan V<br>
<div><div></div><div class="h5"><br>
On Thu, Mar 19, 2009 at 7:48 PM, Nathan Vegdahl &lt;<a href="mailto:cessen@cessen.com">cessen@cessen.com</a>&gt; wrote:<br>
&gt; After talking with Brecht this morning I have a couple of ideas to<br>
&gt; throw out there.<br>
&gt;<br>
&gt; First:<br>
&gt; Change the name of &quot;operators&quot; to &quot;tools&quot;.<br>
&gt; &quot;Operator&quot; makes them sound much lower-level than they actually are,<br>
&gt; which I think is causing a lot of confusion.  The name doesn&#39;t<br>
&gt; communicate well their scope and purpose.  &quot;Tool&quot; matches their use in<br>
&gt; Blender much better:<br>
&gt; - They are highly contextual.<br>
&gt; - They are used directly by the user.<br>
&gt; - They deal with certain aspects of user-interaction (invoke() and modal()).<br>
&gt; - Unless I&#39;m misunderstanding something, there isn&#39;t really anything<br>
&gt; higher-level than them other than the actual GUI and event systems.<br>
&gt;<br>
&gt; Second:<br>
&gt; Presuming that the aforementioned renaming happens, we can then create<br>
&gt; something new to take the name &quot;operators&quot;.<br>
&gt; These operators would be lower-level, directly operating on data.<br>
&gt; They would be black-boxes that modify input data (or create/delete<br>
&gt; data) based only on passed parameters.  They would have no knowledge<br>
&gt; of context or user input.<br>
&gt;   &quot;Tools&quot; would then call operators to do the actual work on data.<br>
&gt; Tools depend on context, and handle the invoke()/modal() type stuff.<br>
&gt; Tools could even call multiple ops to do more complex tasks, but that<br>
&gt; still require user interaction.<br>
&gt;<br>
&gt; So layers of the system are like this:<br>
&gt;<br>
&gt; UI/events<br>
&gt; --<br>
&gt; Tools (used to be called operators)<br>
&gt; --<br>
&gt; Operators<br>
&gt;<br>
&gt;   The UI is the top-level stuff, the things that the user directly<br>
&gt; interacts with.<br>
&gt;   Tools are... well, tools.  Just like the current operators work,<br>
&gt; they presume a user will either be using them directly, or creating<br>
&gt; macros with them.  They always require context to function.  Tools can<br>
&gt; be called by Python too, but they still depend on proper context.<br>
&gt;   Operators are for scripting and API.  You pass them data and<br>
&gt; parameters, and they do things to the data.  They have no knowledge of<br>
&gt; context.<br>
&gt;<br>
&gt; I think this has a few advantages:<br>
&gt; 1) By splitting things into operators and tools, Blender provides a<br>
&gt; clean separation between functionality (data manipulation) and how<br>
&gt; that functionality is packaged for user consumption (context,<br>
&gt; invoke(), modal()).<br>
&gt; 2) Blender provides a clean API for scripters/programmers to use in<br>
&gt; the form of (newly named) operators.<br>
&gt; 3) Blender provides a clear way for scripters/programmers to create<br>
&gt; new tools that use combinations of existing functionality (write a<br>
&gt; tool using operators).<br>
&gt; 4) And the biggest one: we don&#39;t have to do it right now!!!  It is<br>
&gt; 100% compatible with the current design.  It can even be added<br>
&gt; gradually, over several releases.<br>
&gt;<br>
&gt; I hope this all makes sense.  It seems like a clean, flexible, robust,<br>
&gt; and easy-to-grasp system to me.  And it&#39;s one that we don&#39;t have to<br>
&gt; delay 2.5 for.<br>
&gt; But maybe I&#39;m a bit too enthusiastic right now. :-P<br>
&gt;<br>
&gt; Thoughts?  Comments?<br>
&gt;<br>
&gt; --Nathan V<br>
&gt;<br>
&gt; On Thu, Mar 19, 2009 at 11:51 AM, Ton Roosendaal &lt;<a href="mailto:ton@blender.org">ton@blender.org</a>&gt; wrote:<br>
&gt;&gt; Hi all,<br>
&gt;&gt;<br>
&gt;&gt; I&#39;ve spent some time today with Brecht evaluating the discussion, and<br>
&gt;&gt; the more I looked into it the more it was clear we&#39;re overshooting at<br>
&gt;&gt; the moment.<br>
&gt;&gt;<br>
&gt;&gt; Regardless whether the proposals are good or bad - the design proposal<br>
&gt;&gt; from Brecht really is high quality - it reveils a serious weakness in<br>
&gt;&gt; Blender we then should tackle as well. And that&#39;s (if I understand him<br>
&gt;&gt; well :) exactly Vekoon&#39;s point, the lack of good API definitions and<br>
&gt;&gt; quite some messyness on the Blender side (code is still assuming it<br>
&gt;&gt; runs in UI).<br>
&gt;&gt;<br>
&gt;&gt; Knowing the code of Blender quite well, and regarding the amount of<br>
&gt;&gt; work already done, I think that such specs better not become pursued<br>
&gt;&gt; now. It will add a gigantic extra effort to the 2.5 project of which I<br>
&gt;&gt; can&#39;t even predict if that&#39;s feasible.<br>
&gt;&gt;<br>
&gt;&gt; I&#39;ve asked myself and Brecht this basic question:<br>
&gt;&gt;<br>
&gt;&gt; &quot;Ignoring the script specs, what should we do to get Context/Operators<br>
&gt;&gt; work for everything we want with tools, with macros, redo/repeat and<br>
&gt;&gt; history stacks?&quot;<br>
&gt;&gt;<br>
&gt;&gt; With as simple answer: &quot;Not much&quot;. :)<br>
&gt;&gt;<br>
&gt;&gt; Secondly: &quot;what was the real issue we wanted to tackle especially?&quot;<br>
&gt;&gt;<br>
&gt;&gt; -&gt; Solve the context-defined definitions for &quot;Selection&quot; or &quot;Active&quot;.<br>
&gt;&gt;<br>
&gt;&gt; This for example to allow operators to pass on new &#39;selections&#39; like<br>
&gt;&gt; for Node systems, and obviously for scripters to define custom input<br>
&gt;&gt; and retrieve output.<br>
&gt;&gt;<br>
&gt;&gt; I think it&#39;s better to move this feature to the future, especially when<br>
&gt;&gt; we have operators really functional and users validating it. For the<br>
&gt;&gt; Python API we have to look at a way to make this future proof, and not<br>
&gt;&gt; halfway change APIs, but that&#39;s well possible if we just stick (for<br>
&gt;&gt; now) to this:<br>
&gt;&gt;<br>
&gt;&gt; -&gt; Python scripts that use Operators will only work within Context<br>
&gt;&gt;<br>
&gt;&gt; Which already offers a great advantage over what we had, and which<br>
&gt;&gt; sticks closely to the starting point that &quot;python should not do what<br>
&gt;&gt; user&#39;s cannot do&quot;.<br>
&gt;&gt;<br>
&gt;&gt; For example, in the operator case Brecht mentioned:<br>
&gt;&gt;    TEXT_OT_new(wmOperatorType *ot)<br>
&gt;&gt; The prefix will just define &quot;this operator runs inside text editor<br>
&gt;&gt; context&quot;. Period!<br>
&gt;&gt;<br>
&gt;&gt; For those obvious cases where Python needs to access data outside<br>
&gt;&gt; context, like for importing, or Mesh generating or animation system<br>
&gt;&gt; manipulations, we can add two easy to build apis:<br>
&gt;&gt;<br>
&gt;&gt; - A new MAIN_OT_xxx() operator set<br>
&gt;&gt;   This one can do context-free Main database ops, like adding Images,<br>
&gt;&gt; or unlinking (= set users zero!)<br>
&gt;&gt; - where appropriate, a basic set of RNA data ops.<br>
&gt;&gt;   This for example for context-free FCurve point insertion.<br>
&gt;&gt;<br>
&gt;&gt; Moving forward this way will still give a very powerful API to control<br>
&gt;&gt; and use Blender via scripting - provided you target at full<br>
&gt;&gt; integration. I&#39;m even quite sure you will be able to code good<br>
&gt;&gt; importers this way, just using the context-sensitive OBJECT_OT_add<br>
&gt;&gt; calls, move it to editmode, and use what we already have (or fix what<br>
&gt;&gt; we have).<br>
&gt;&gt;<br>
&gt;&gt; Lastly; if you look at what we&#39;ve already achieved, we&#39;ve improved a<br>
&gt;&gt; lot in Blender. If you look at the minimum we still have to do to make<br>
&gt;&gt; it work, it&#39;s still quite scary. So... let&#39;s now work on first bringing<br>
&gt;&gt; back Blender to work, and then worry again about new advanced features<br>
&gt;&gt; for node systems, scripting, etc.<br>
&gt;&gt;<br>
&gt;&gt; -Ton-<br>
&gt;&gt;<br>
&gt;&gt; ------------------------------------------------------------------------<br>
&gt;&gt; Ton Roosendaal  Blender Foundation   <a href="mailto:ton@blender.org">ton@blender.org</a>    <a href="http://www.blender.org" target="_blank">www.blender.org</a><br>
&gt;&gt; Blender Institute BV  Entrepotdok 57A  1018AD Amsterdam The Netherlands<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Bf-taskforce25 mailing list<br>
&gt;&gt; <a href="mailto:Bf-taskforce25@blender.org">Bf-taskforce25@blender.org</a><br>
&gt;&gt; <a href="http://lists.blender.org/mailman/listinfo/bf-taskforce25" target="_blank">http://lists.blender.org/mailman/listinfo/bf-taskforce25</a><br>
&gt;&gt;<br>
&gt;<br>
_______________________________________________<br>
Bf-taskforce25 mailing list<br>
<a href="mailto:Bf-taskforce25@blender.org">Bf-taskforce25@blender.org</a><br>
<a href="http://lists.blender.org/mailman/listinfo/bf-taskforce25" target="_blank">http://lists.blender.org/mailman/listinfo/bf-taskforce25</a><br>
</div></div></blockquote></div><br>