We’re planning to extend macros with more information:
Display a tooltip text when mouse hovers above the macro icon in the user interface.
Add ability to name macros and display the name in macro manager dialog. Ideally, some convention is required here - the name and tooltip could be parsed from the first few lines of the script only when they are comments with a specific format.
For example, I think this is a good start:
Ideally you could change the name and tooltip in the Edit Macros panel that is in ParaView master. Currently, it shows only the macro name, which is not editable, and icon.
We could make the macro name editable, and add a second column that let’s you modify the tooltip text. The name and tooltip info could be saved wherever the icon file name is saved, probably in settings?
This idea predates the existence of the Edit Macros window. It could be considered as a way to initialize the name, tooltip, and icon, but that might not be necessary.
To clarify: Python Macros can take user input with the Python input() function call. That function accepts a an optional message that is currently only printed to the Python console. The intent of this change would be to take that message and show it somehow on the dialog window that currently looks like
Nice, please make it configurable in the macro editor.
Ideally you could change the name and tooltip in the Edit Macros panel that is in ParaView master. Currently, it shows only the macro name, which is not editable, and icon.
Yes please
the name and tooltip could be parsed from the first few lines of the script only when they are comments with a specific format.
That doesnt sound like a good idea to me. The macro should ideally be only a python script and meta data about it should be stored in the settings. If needed, a import/export feature could be added to handle metadata and scripts somehow.
This is a customer request, so are there similar alternatives? They’d like ParaView macro scripts to follow a convention that specifies the macro name and tooltip text with the intention of having ParaView macro manager display these under the “Name” and “Tooltip text” in the UI, overriding the defaults as alluded to by @nicolas.vuaille
Got name and tooltip editing to work. Earlier, you could double click on the macro column and a script editor would open up allowing a user to edit python code. However, since we made macro names editable, the old behavior cannot be sandwiched in here directly.
What are your thoughts on showing a button at the end of the macro column which when clicked opens up a code editor? Taking inspiration from programmable filters.