I encounter a problem in all my zScripts…
Each time a plugin starts for the first time, its code is executed - I mean the code at the toplevel. For now that’s ok, but when you switch/use another, (like for example - just go in maya blend shapes plugin menu and just change from visible to all or so) the next time you use the previous plugin its toplevel code get executed again…
I’ve read about the “rebound effect” here but that’s to be implemented if you want YOUR plugin to switch back to another… SO my question is : what are the general guidelines to avoid that ? Put all init code in an init routine ? I think that must cause problems with interface stuff and memory bloc definitions…
I understand that variables are not very good to use in that scheme so I always store important persistent data in memory blocks.
If someone can clarify… thanks !