Importing symbols between projects


Hello,
When I'm importing a symbol from one project to another project, usually it comes with a copy of the function wich manage it.
If in the origin there is a function called main() that controls the symbol A, and, in the destination there is another function called main() that controls the symbol A' which I want to replace, how can I replace it without importing the main() function and keeping the links taking in acount that the functions are the same?
Thanks!

There´s no way, it´s a bug. It´s on the list - amongst many others... https://forums.tumult.com/t/duplicate-functions-bug/20511

2 Likes

Yeah… I had this very frequently and a client using a library of exported symbols sometimes sends me a file to do something with it and I discover he has the same function 10 times in the file… it is really hard to clean that up BTW.

Either it should silently take the existing function OR there should be a merge dialog. Like when editing an external file, it offers to keep the existing or import again.

1 Like

Have you considered the situation as I showed in the attached file?

That is precisely the bug you (and we) are, experiencing.

To help clarify what is happening under-the-hood: functions have their own unique identifiers which are not based on its name at all.

When you import a symbol, it references the function by this identifier. So if you delete the referenced function, the symbol no longer has a function associated with it, and thus shows "None" instead of trying to find another one with the same name.

This is a definite problem, and the solution of asking how to deal with functions with the same name (to merge or not) should improve this case.

Unfortunately for now you'll probably want to cleanup the functions manually. (You could do other stuff like have the function be a minimal stub calling out to a function named in a .js file or head html, but that's probably more trouble than it is worth).

This could work for code and in case of images, even giving a preview of both.

2 Likes