<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">Hello,</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Guillem and I have been discussing what the user should see when converting a subpatch to an abstraction, for his GSOC project. There are many possibilities; here's one scenario I came up with as a starting point (w/ some additions by Guillem):</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><div class="gmail_default">1. User is in a subpatch window OR has a single [pd ] object selected (Guillem added right-click popup for the latter scenario – extremely convenient, and could have the same thing right-clicking subpatch canvas).</div><div class="gmail_default">2. They hit the hotkey/menu/whatever.</div><div class="gmail_default">3. Up comes the file chooser. Suppose they want to store it in a "Tools" directory, which is in the same directory as the root patch.</div><div class="gmail_default">4. Get path from that selection, and convert to relative path if possible.</div><div class="gmail_default">5. Bring up new dialog asking if they want to replace the subpatch with the abstraction yes/no, and a toggle to "try to replace every copied instance of this subpatch with abstraction". They hit "yes"</div><div class="gmail_default">6. If the Tools path is [declare]ed on the root patch, replace the subpatch with the abstraction basename. Otherwise, [Tools/basename]. If the toggle was selected, run routine to go through the root patch and compare binbuf for replacement.</div><div class="gmail_default">7. Preserve connections, of course.</div><div class="gmail_default">8. Anything to do about the new abstraction creation arguments? Presumably nothing.</div><div class="gmail_default">9. What to do about subpatch recursion? Ico suggested throwing an error like when you try to include an instance of an abstraction in itself.</div><div class="gmail_default">10. What does undo do? I think it must undo the subpatch replacement(s), if any.</div><div class="gmail_default">11. What happens with namespace clash? If I save with an object name that already exists, I think it throws an error only if you try to replace.</div><div class="gmail_default"><br></div><div class="gmail_default">Much of the complexity is due to path. Any way to simplify? Could bring up the secondary dialog to replace subpatches only if the path is at the same level as or deeper than the root patch, so no ../ or absolute paths.</div><div class="gmail_default"><br></div><div class="gmail_default">Matt</div></div></div>