Macro Recorder System similar to MEL in Maya
I came across a video that compares MAYA's MEL macro system to Blender's Phyton API Info system. See Here: Link
Although the gentlemen's compare isn't fair, it does bring up valid point and exposes the fact that Blender has no EASY, SIMPLIFIED macro system.
I don't see why Blender cannot have both an Phyton APi for programming new features and add-ons... and also have a simplified macro systems just like MEL. There are plenty of tasks I would of liked to of recorded with a macro, but, using the Phython API finfo window doesn't do simple macros that record each click or movement and just creates a simple running script. Instead non-programmers have to use the info window an maybe do complex coding.
I like the simple MEL macro way of doing things... this would be cool in Blender.... You can keep the API for complex stuff, but then add a new simplified macro recorder/playback system too.
16 Comments
Python is the easiest programming language in the world, I don't see where the problem is.
* @zebus3d * Phython is not hard for me.... but there are some users who do not know how. I didn't post the suggestion just for me.
It's not solely a programming thing. It's about the ability of create macro in blender. In MEL's case, user can copy and paste event and replay it as macro. I believe Blender already doing similar thing under the hood, but it's only output result than outputting a run-able script.
I don't know exactly, but maybe it's that what you searching for ? blender-addons.org/command-recorder-addon/
* @josef hochberger * Yeah... that seems pretty good. Haven't tried it yet. But, a system like that would work.
* @pixelinkmedia * Well, tried to install... but did not work at all. That's too bad. Followed install instructions to the tee.
* @pixelinkmedia * Figured out why it doesn't install.... developer has a filename issue that I left on their bug tracking. To get it to work, you have rename your ZIP from "CommanderRecorder2.8-master.zip" to "CommanderRecorder.zip".... AND then after installing zip, add-on doesn't show. You have to go to blenders plugin folder and then rename the folder CommanderRecorder2.8-master" to CommanderRecorder" as well. Then it will be visible in Pref and you can enable it.
After playing with mentioned add-on below... it doesn't work properly, It doesn't handle moving a vertex or going in and out of edit mode. This add-on only does basic commands... not a reliable macro program such as MEL which can handle clicking and moving of individual vertices.
* @pixelinkmedia * Further notes... the add-on does do in/out edit mode, but it doesn't move vertices, It can do extrude though
* @pixelinkmedia * That's simply not how Blender works, though. There's no call to Python when you move a vertex in edit mode. Blender would be as slow as Maya is if it did that. And of course, there's the problem of context. Should the macro assume you want to operate on the active selection, or attempt to select what was selected prior? It's not easy to solve these kinds of problems, and I wouldn't say MEL is a good solution. It works, at least, and but Blender always tries to aim a little higher than that. I'd like to see more discussion on how to handle these specific sorts of problems. Maybe you should start a devtalk thread?
Edit: maybe bpy.ops could be extended further (extrude is an operator but simple grab isn't). But it doesn't seem like the right way to do a macro system, since ops is so much slower than data access. What is needed is a quick way of translating bpy.ops calls to appropriate bpy.data calls, I think.
I wouldn't suggest a separate API. However, being able to do more useful copy/paste actions from the Info editor to build macros would be nice.
.
Command Recorder
addon
free
It isn't feasible to maintain two API's. Maya manages this by only using MEL internally (Python in Maya is a wrapper) and C++ externally (because it's closed source and can't support additions directly. The C++ API also has a Python wrapper). Blender's API would need some major (and in my opinion, backwards) changes to support such a thing.
But the bigger issue is: MEL macros are a bandage over a slow UI. Maya doesn't have a hotkey-friendly workflow. In most cases, it's better to improve the hotkeys to make the workflow faster. Macros are also context-sensitive, which is problematic because it either requires the selection state of everything to be managed by the API (Maya selects by executing a MEL select command every time you click) or assumptions to be made. In Blender, selection isn't an attribute of the object, but of the view-layer the object is in.
Just food for thought. I agree macros could be a lot easier, but at what cost? MEL is a terrible language, both in terms of its ugly syntax and its bad, buggy behavior.
Perhaps this would be easier to discuss if there were a few examples of where and why Blender doesn't produce macros correctly? I think another issue is that Blender doesn't report the full context or the "macro-friendly" way of doing things in the info panel. Maybe instead of a new API, there could be a special info panel that reports commands as they should appear in macro scripts?
This is a really big change to propose, with lots of cost just in keeping it working. Maybe the solution is to modify the way the info panel works?
* @Josephbburg * Well, I don't think you have to mess with the API. Currently, you can insert basic movements/edits etc in the info window and create a basic macro script. But, not every blender user is comfortable using Phython. As per the link that Joef Hochberger posted, it is possible to create something without messing with the API.
* @pixelinkmedia * Fair enough, but that is what you suggested above! I'm all for improving the info panel to be more useful.
Also, note I have not provided any screenshots or such-like as the basic system is illustrated in the video. It would be up to developers to develop a macro system and how to implement it.