Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade-sverchok-addon button fails to update 0.6.0 to 1.0.0 and from 1.0.0 onwards also silently fails. #4291

Closed
luckychris opened this issue Aug 18, 2021 · 19 comments
Assignees
Labels

Comments

@luckychris
Copy link

Sverchok version 1.0:

in Blender 2.93 -> show socket menu does work

in Blender 3.0 -> show socket menu does not work.

-> I am working/testing on Mac.

socket_menu_not_working

@luckychris
Copy link
Author

yes, upgraded today by the great update buttons in sverchok. It is mac version....maybe that's the reason?

@zeffii
Copy link
Collaborator

zeffii commented Aug 18, 2021

shouldn't be. The code that determines whether or not the menu is shown is here:

sverchok/core/sockets.py

Lines 97 to 106 in 2be8ed9

class SV_MT_SocketOptionsMenu(bpy.types.Menu):
bl_label = "Socket Options"
def draw(self, context):
node = context.node
if not node:
return
layout = self.layout
if hasattr(context.socket, 'draw_menu_items'):
context.socket.draw_menu_items(context, layout)

if you look locally for that file core/sockets.py and the lines listed above, it should show the same code (without a poll function) . if you do see a poll function, then the update feature might be broken.

@luckychris
Copy link
Author

yep, i see the poll function.

@zeffii
Copy link
Collaborator

zeffii commented Aug 18, 2021

the upgrade sverchok addon button and its functionality is not something that gets much attention unless users notify us that it's broken. Sverchok devs use git to contuously synchronize Sverchok and all its branches with eachother.

I know for a fact that the current sverchok-addon upgrade fails to update from 0.6.0 to 1.0.0, so there is some bug to iron out.

@zeffii
Copy link
Collaborator

zeffii commented Aug 18, 2021

yep, i see the poll function.

then it didn't upgrade. so the bug is not with the menu, but with the sverchok-add-on upgrade

@luckychris
Copy link
Author

i have already 1.0 now ;) but also there....looks like update button does not work 😢 i installed with your help to 1.0 via that "magic" script

@luckychris
Copy link
Author

is there a magic update script too? for 1.0 ?

@zeffii
Copy link
Collaborator

zeffii commented Aug 18, 2021

remove all sverchok directories listed under scripts/addons and scripts/addons_contrib in any folder under blender 3.0 , then run that script .

when the script is run on a fresh Blender without sverchok folders (even in the alternative places that it looks..also those are linked in the other thread) then the script will run.

but i'll investigate the sverchok-addon upgrader.. it would be useful to know wtf is going on.

@zeffii
Copy link
Collaborator

zeffii commented Aug 18, 2021

in the meantime, you can just comment out that poll function... or delete it so you are left with the same code as I linked above.

but obviously the Sverchok on your system will not upgrade correctly until the cause of update-addon failure is identified.

@zeffii zeffii changed the title Show socket menu does work in Blender 2.93, but not in 3.0 update-addon button fails to update 0.6.0 to 1.0.0 and from 1.0.0 onwards also fails. Aug 18, 2021
@zeffii zeffii changed the title update-addon button fails to update 0.6.0 to 1.0.0 and from 1.0.0 onwards also fails. upgrade-sverchok-addon button fails to update 0.6.0 to 1.0.0 and from 1.0.0 onwards also fails. Aug 18, 2021
@zeffii zeffii changed the title upgrade-sverchok-addon button fails to update 0.6.0 to 1.0.0 and from 1.0.0 onwards also fails. upgrade-sverchok-addon button fails to update 0.6.0 to 1.0.0 and from 1.0.0 onwards also silently fails. Aug 18, 2021
@zeffii zeffii self-assigned this Aug 18, 2021
@zeffii
Copy link
Collaborator

zeffii commented Aug 18, 2021

OK.. it looks like the unzip generated a folder that wasn't called sverchok. I will look into that.

in the meantime, it might be worth installing the add-on a different way. Seen as you are having troubles, maybe it's worth the extra 30 seconds to do it the oldschool way.

https://docs.blender.org/manual/en/latest/editors/preferences/addons.html

describes an alternative way to install addons. This is the way I install addons, so i can have one directory for all my 3rd party addons, and point both Blender 2.9+ and 3.0 at that directory.

  • make a directory somewhere on a disk, called it scripts
  • inside scripts have two folders
    • addons
    • addons_contrib
  • unzip the sverchok folder
    • rename the resulting folder to sverchok if it has any excess names/version info.
  • drop the sverchok folder into addons_contrib so you have
    • scripts/addons_contrib/sverchok
  • in Blender preferences, go to paths and set the File Paths field to the location of your scripts folder
  • restart Blender
  • sverchok should now be listed in testing or community, find it and ticksverchok`
  • Allow it a few seconds to enable.

@zeffii
Copy link
Collaborator

zeffii commented Aug 18, 2021

ok. but that doesn't make any sense. that's why you should try the alternative "by hand" installation method I describe above.

forget about scripts and the autoupgrade button for a while :)

@zeffii
Copy link
Collaborator

zeffii commented Aug 18, 2021

There are three ways to install add-ons

  1. using the install from file feature in Blender/preferences/addons
  2. placing the unzipped folder into scripts/addons_contrib to get scripts/addons_contrib/sverchok/.. ,
    • or instead of addons_contrib it can be addons, but addons is really meant for Blender included addons. It's a formality, Blender doesn't care. It's not a problem once you know that's the distinction. The add-on can be placed in either, but not both.
    • for this method you can use the user defined scripts directory setting in preferences/File Paths , by pointing the Scripts field at the location of your own scripts directory. Detailed here
  3. using a bootstrap script, which does what 1 and 2 do but using python and bpy in a convoluted looking way.

i suggest you do one of two things regarding (un)zipped vstable* versions, and indeed all sverchok* zips/folders on your machine.

  • remove them (they can always be downloaded again), or
  • rename them from whatever to _whatever (adding an underscore character infront of the filename/foldername , so they don't interfere.

i have a computer beside me, non dev machine, with win10 and just Blender 3.0 , with not a single zip or folder of sverchok* on it. I made small cosmetic modifications to the bootstrap script, it downloads, unpacks, and enables sverchok no problems.

Repository owner deleted a comment from luckychris Aug 18, 2021
Repository owner deleted a comment from luckychris Aug 18, 2021
@zeffii
Copy link
Collaborator

zeffii commented Aug 18, 2021

i'm just removing a bit of noise from this thread, including my own posts :)

Repository owner deleted a comment from luckychris Aug 18, 2021
Repository owner deleted a comment from luckychris Aug 18, 2021
Repository owner deleted a comment from luckychris Aug 18, 2021
@zeffii
Copy link
Collaborator

zeffii commented Aug 18, 2021

i'd like to keep the issue in this thread clear.

primary issue

The upgrade mechanism is not working as expected.

secondary issue

It is unrelated to the bootstrap script (altho, the latest bootstrap script should work if you have no folders that start with sverchok in any of the locations that Blender is looking.


i'll focus on the upgrade operator ( the thing that's triggered by hitting the Upgrade Svechok addon button ). To fix it first some hardcoding is needed :)

@zeffii
Copy link
Collaborator

zeffii commented Aug 18, 2021

@luckychris a slightly awkward realization is

  • if you installed sverchok as sverchok-master and the folder is called sverchok-master inside scripts/addons/.. ,
  • then the upgrade button should work:
    • press it,
    • let it do its thing and
    • restart Blender after it says it's completed.

if there is no upgrade button to press.. then execute this from the TextEditor

import sverchok
from sverchok.utils.context_managers import sv_preferences

with sv_preferences() as prefs:
    prefs.dload_archive_path="https://github.com/nortikin/sverchok/archive/"
    prefs.dload_archive_name="master"

import bpy
bpy.ops.node.sverchok_update_addon()

@zeffii
Copy link
Collaborator

zeffii commented Aug 18, 2021

i will find time to figure out tomorrow how to make it folder-name-agnostic , i don't think it was always this fussy.

@luckychris
Copy link
Author

just downloaded latest zip from master, and it directly worked

even the update button worked

and....tadaaa....

image

circle with nurbs works too...so it's fine now ;) thank you guys for all your support

@zeffii
Copy link
Collaborator

zeffii commented Aug 19, 2021

while the issue was closed, i don't consider it fixed. The takeaway thoughts here are

  • the upgrade mechanism seems to work if the sverchok dir is called sverchok-master
    • this is the default archive zip name that github provides for master

two things that would be neat

  • allowing users to set the branch for downloading specific branches
  • allow arbitrary sverchok folder name.

the extraction process should:

  • look at the current directory name
  • make sure that the downloaded zip is extracted into the current directory (or somehow make sure it is renamed once extracted)

@zeffii
Copy link
Collaborator

zeffii commented Aug 24, 2021

find the current folder / current enabled name of the add-on from sverchok.__file__

>>> import os
>>> os.path.basename(os.path.dirname(sverchok.__file__))
'sverchok-master'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants