Macros
A macro is a part of a pipeline that you keep under a name, to use again in other pipelines: a blur you like, a colour correction, a noise you always build the same way. Where a shader or a pipeline of your library is a node by itself (see Composing), a macro is a group of nodes: once placed, it is a group of the pipeline, with its own inputs and outputs, that you can open and read.
A macro is made of nodes. For a piece of code (one GLSL function, such as a noise or a distance), a snippet is the right tool, and it can also go into a shader.
Make a macro
- Select the nodes that make the macro, on the canvas.
- Right-click one of them and choose Create Macro, or press
Cmd+M(Ctrl+Mon Windows and Linux). - Give it a name and press Create Macro.
The nodes become a group, and that group is the first use of the macro. A group that you have already named yourself becomes a macro under that name, with no question asked.
A macro keeps the images its nodes use: it does not depend on a file of your library.
A macro with a function
A Function node can be part of a macro, with its parameters, its inputs and its return: they are kept as they are, and every copy has its own function. Two things to know:
- The parameters of a function stay inside it: they are not ports of the macro. A macro has the ports of its group: to give the macro an input or an output, wire it to a group input or output, as in any group.
- The macro shows the parameters of its function on its left side, before its own inputs, as a function node does: they are there to be read, not wired (the call gives them).
- A function is used through its
fnoutput. If the call (Call Function) is in the macro too, nothing else is needed. If the call is outside, wire thefnof the function to a group output of the macro (typefn): the call placed after it takes the parameters of the function.
Where macros are
Macros are not in your library, and not in the explorer. They are kept by ISF Studio, for you: the same ones in every window and every library. A macro made in one window is in the others at once.
Open the Toolbox (the second activity of the bar on the left): its Macros section lists them, above the snippets. The search field of the Toolbox finds them by name, or by the name of the group they are in.
Arrange them in groups
Macros live in a tree of groups, like folders:
- Right-click the empty part of the list, or a group, and choose New Group.
- Drag a macro, or a group, onto another group to move it. Drop it on the empty part of the list to bring it back to the top.
- Right-click a macro or a group to Rename it, or Delete… it. A deleted macro goes to the trash of your computer.
Moving or renaming a macro does not break the pipelines that use it: they find it again.
Place a macro in a pipeline
- Right-click a macro in the Toolbox and choose Add to Pipeline; or
- right-click the canvas, and choose the macro in the Macros submenu of the add menu, which comes last.
The macro is placed as a group, in the middle of the view or where you right-clicked. The first one takes the name of the macro, the next ones are numbered. Placing a macro is one step of the history: it can be undone.
Macros are not offered in the vertex graph.
A macro and its copies
A macro placed in a pipeline is a copy: the pipeline holds the nodes of the macro as they were when you placed it, so the pipeline works, and can be shared, whatever happens to the macro afterwards (see Sharing). It also remembers which macro it comes from, and tells if the macro has changed since:
| State | What it means |
|---|---|
| Linked | The macro is as it was when the copy was made. |
| Outdated | The macro was changed since: the copy takes it in by itself, in the pipeline in front (see below). |
| Missing | The macro is not there any more: deleted, or this computer does not have it. The copy keeps working as a group. |
Right-click a copy in a pipeline:
- Edit Macro opens the macro itself in a tab, like a pipeline. Every pipeline that uses it is told that it changed. It is not available when the macro is missing.
- Update from Macro takes the macro as it is now into the copy: its ports and its nodes. It is only available when the macro is outdated, which is rare, since the copies follow the macro by themselves. A connection is kept when the new macro has a port of the same name and the same type, and dropped when it has not. It is one step of the history.
- Make Unique cuts the copy from its macro: it becomes a group like any other, and later changes of the macro no longer reach it.
The copies follow the macro: when a macro is saved, every copy in the pipeline in front takes it in, and a pipeline that was behind does it when you open it. A copy that sits inside a group, or inside another macro, follows too: when a macro changes (new inputs, say), the copies of the macros that hold it take the change in, with no need to open the group or to open and save the outer macro first. Update from Macro is available on a macro that holds a macro that changed. Each update is one step of the history, so it can be undone, and Make Unique is what keeps a copy as it is.
Change a macro
Double-click a macro in the Toolbox, or choose Edit Macro: a notice says that this opens the macro itself, then it opens in a tab, and you edit it as any pipeline. Save it, and the pipelines that use it take the change in (see above).
Double-click a copy in a pipeline, and ISF Studio asks what you mean, since editing it here is not the same thing as editing the macro:
- Edit Macro changes the macro for every pipeline that uses it.
- Make Unique cuts this copy from the macro, and opens it, to change this one only.
The question can be switched off with Do not show again.
Share macros
Macros are kept by ISF Studio, not in your library, so they are shared as files:
- A macro on its own is a
.istpipefile. - Several macros, with the groups they are in, are a macro pack: a
.istmacrofile.
Export
Right-click in the Toolbox, in the Macros list:
- Export Macro… on a macro saves it as a
.istpipe. - Export Group… on a group saves it, and what is inside it, as a pack.
- Export All Macros… on the empty part of the list saves every macro as a pack. It is also a backup of your macros.
The file keeps the images a macro uses, so it works on any computer.
Import
Any of these:
- File > Import > Macros…, then choose a
.istmacroor a.istpipefile. - Double-click a
.istmacrofile: in the explorer, where packs are listed like any file of your library, or in the file manager of your computer. A dialog says which macros come in, and asks what to do about the ones that are already there. - Drag a file onto the Macros list of the Toolbox.
- In the explorer, right-click a
.istpipethat is a macro (one you exported) and choose Add to Macros.
A pack goes into a group named after it, so that what comes from two packs does not mix. A macro on its own goes to the top. The groups of the pack, the empty ones too, come with it.
A .istpipe that is not a macro (a pipeline made of one group is a macro, any other is not) is refused, and ISF Studio says so.
When a macro is already there
Each macro has an identity of its own, kept in its file. ISF Studio compares what you import with the macros you have:
| What it finds | What happens |
|---|---|
| Nothing like it | The macro is added. |
| The same macro, as it is | It is left out: nothing changes. |
| The same macro in another version | You choose Replace, Keep both or Leave out. Replace is what an update is. The copies in your pipelines then show as outdated, and you update them when you want (see A macro and its copies). |
| Another macro with the same name | You choose the same three. Keep both gives the new one a number: Blur 2. |
Nothing is replaced without your word when a choice is asked, and what you replace goes where the old macro was, even if you moved it.
Macro packs can also be put online by the project's Resources: the page lists them with the other resources.
In the editions
Making, arranging, placing and importing macros is part of what is free, and has no limit of its own in any edition. Exporting macros, as a file or a pack, needs ISF Studio Pro, like the export of shaders and libraries (see Pricing).