sverchok icon indicating copy to clipboard operation
sverchok copied to clipboard

Update problem

Open ArpegorPSGH opened this issue 2 years ago • 5 comments

First I would like to know if the update of the addon will be done directly where the addon is, wherever this is, or if it is installed in Blender default addon folder, because it seems update does not work well ; I had to pull the code from the repository to really update the addon. However, when I try to edit the code of the List Mask Join (In) node internally, it isn't the right file which is opened, but the old version, while the node in the tree is actually an instance of the new version. So, how should I go about updating Sverchok in my case? And is the mismatch of files a side effect of my updating problem, or is it something else entirely? I may have missed something when creating the new node?

ArpegorPSGH avatar Sep 14 '22 19:09 ArpegorPSGH

This operator is responsible for the update. https://github.com/nortikin/sverchok/blob/4cb1598416e88c704042a5ed061dc2485f540dbd/utils/sv_update_utils.py#L154-L155

I have a look at the code and it seems that the problem can be that new version is just unpacking inside folder of old add-on version. In this case extra old files won't be removed. If it's possible I would try to clear the folder with the add-on before unpacking new version.

Durman avatar Sep 15 '22 04:09 Durman

Well, it is perfectly normal that the new version is unpacked within the old addon, but there is no extra old files to remove, but instead a new old file to put into old nodes. And when I open internally, the file opened is the version in old nodes and not the one in node. Furthermore, Blender says that the file does not exist externally, so it seems to mean that the file is opened out of some strange cache somewhere. I'll try to close the file within Blender before trying to open it again. About updating, if the folder modification needs administrator authority, would it cause problems, even if I opened Blender as administrator before clicking the Sverchok update button?

ArpegorPSGH avatar Sep 15 '22 08:09 ArpegorPSGH

the view source / edit externally function does open the file it finds in the current sverchok directory.

https://github.com/nortikin/sverchok/blob/303b1f6070cbc9ac265a1333f92fc4efe50ee317/ui/development.py#L189-L192

which in turn calls

https://github.com/nortikin/sverchok/blob/303b1f6070cbc9ac265a1333f92fc4efe50ee317/ui/development.py#L244-L246

you can see the exact location from either TextEditor or External editor. no caching.

zeffii avatar Sep 15 '22 09:09 zeffii

So, maybe if a file with te same name is already opened in the editor, it does not open the new one. I'll have to check that.

ArpegorPSGH avatar Sep 15 '22 11:09 ArpegorPSGH

Okay, I checked, and it was indeed that the old file before updating was left open in Blender, and so the new one wouldn't open as they have the same name. So, the only interrogation I am left with now is : does update button work if addon folder is locked behind administrator privileges, even if I executed Blender in administrator mode?

ArpegorPSGH avatar Sep 15 '22 18:09 ArpegorPSGH