friggog / tree-gen

Procedural generation of tree models in blender
GNU General Public License v3.0
827 stars 74 forks source link

Addon activation error on Blender 2.91 #43

Closed Darknoodles closed 3 years ago

Darknoodles commented 3 years ago

Hello ! I'm getting this error when trying to activate on Blender 2.91

Traceback (most recent call last): File "N:\Blender\Builds\stable\blender-2.91.0-windows64\2.91\scripts\modules\addon_utils.py", line 351, in enable mod = __import__(module_name) File "N:\Blender\Scripts\addons\tree-gen\__init__.py", line 13, in <module> from . import gui File "N:\Blender\Scripts\addons\tree-gen\gui.py", line 12, in <module> from ch_trees import parametric, utilities ModuleNotFoundError: No module named 'ch_trees' Is there something i'm missing ? Note that my addons folder is not the one located in the blender install, but a separated folder used in the paths in Blender prefs.

friggog commented 3 years ago

My mistake! This commit should fix it - would be very helpful if you could test this out and confirm it works!

Darknoodles commented 3 years ago

Hello, just tried it. It fixes the initial problem, but other import problems come. Traceback (most recent call last): File "N:\Blender\Builds\stable\blender-2.91.0-windows64\2.91\scripts\modules\addon_utils.py", line 351, in enable mod = import(module_name) File "N:\Blender\Scripts\addons\tree-gen__init__.py", line 13, in

from . import gui File "N:\Blender\Scripts\addons\tree-gen\gui.py", line 12, in from . import parametric, utilities File "N:\Blender\Scripts\addons\tree-gen\parametric\__init__.py", line 1, in from . import gen File "N:\Blender\Scripts\addons\tree-gen\parametric\gen.py", line 23, in from ..leaf import Leaf File "N:\Blender\Scripts\addons\tree-gen\leaf.py", line 8, in import leaf_shapes as leaf_geom ModuleNotFoundError: No module named 'leaf_shapes' Le mar. 29 déc. 2020 à 10:10, Charlie Hewitt a écrit : > My mistake! This commit > > should fix it - would be very helpful if you could test this out and > confirm it works! > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > , > or unsubscribe > > . >
Darknoodles commented 3 years ago

Quick reply, i fixed it by changing the line to "from . import leaf_shapes as leaf_geo". Error is gone, but another comes :p

Traceback (most recent call last): File "N:\Blender\Builds\stable\blender-2.91.0-windows64\2.91\scripts\modules\addon_utils.py", line 351, in enable mod = import(module_name) File "N:\Blender\Scripts\addons\tree-gen__init__.py", line 13, in

from . import gui File "N:\Blender\Scripts\addons\tree-gen\gui.py", line 44, in class TreeGen(bpy.types.Operator): File "N:\Blender\Scripts\addons\tree-gen\gui.py", line 60, in TreeGen _scene.custom_tree_load_params_input = _props.EnumProperty(name="", default="ch_trees.parametric.tree_params.quaking_aspen", items=parametric_items) ValueError: bpy_struct "Scene" registration error: custom_tree_load_params_input could not register Le mar. 29 déc. 2020 à 11:11, Laurent Fouetillou < darknoodlesorigine@gmail.com> a écrit : > Hello, just tried it. > It fixes the initial problem, but other import problems come. > Traceback (most recent call last): > File > "N:\Blender\Builds\stable\blender-2.91.0-windows64\2.91\scripts\modules\addon_utils.py", > line 351, in enable > mod = __import__(module_name) > File "N:\Blender\Scripts\addons\tree-gen\__init__.py", line 13, in > > from . import gui > File "N:\Blender\Scripts\addons\tree-gen\gui.py", line 12, in > from . import parametric, utilities > File "N:\Blender\Scripts\addons\tree-gen\parametric\__init__.py", line > 1, in > from . import gen > File "N:\Blender\Scripts\addons\tree-gen\parametric\gen.py", line 23, in > > from ..leaf import Leaf > File "N:\Blender\Scripts\addons\tree-gen\leaf.py", line 8, in > import leaf_shapes as leaf_geom > ModuleNotFoundError: No module named 'leaf_shapes' > > > Le mar. 29 déc. 2020 à 10:10, Charlie Hewitt a > écrit : > >> My mistake! This commit >> >> should fix it - would be very helpful if you could test this out and >> confirm it works! >> >> — >> You are receiving this because you authored the thread. >> Reply to this email directly, view it on GitHub >> , >> or unsubscribe >> >> . >> >
friggog commented 3 years ago

Ok - I think I've fixed the above problems, have another go now!

Darknoodles commented 3 years ago

Just tested, it works :) This addon is a really nice job !

Le mar. 29 déc. 2020 à 12:16, Charlie Hewitt notifications@github.com a écrit :

Ok - I think I've fixed the above problems, have another go now!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/friggog/tree-gen/issues/43#issuecomment-752040157, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4H47FLBMOSPFAORB3VDV3SXG3CFANCNFSM4VMQNKFQ .

sambow23 commented 3 years ago

Hey, getting a similar error as well, imported through the Add-ons menu in Blender Preferences

TypeError: EnumProperty(..., default='tree-gen.parametric.tree_params.quaking_aspen'): not found in enum members Traceback (most recent call last): File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.91\scripts\modules\addon_utils.py", line 351, in enable mod = __import__(module_name) File "C:\Users\Administrator\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\tree-gen-master\__init__.py", line 14, in <module> from . import gui File "C:\Users\Administrator\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\tree-gen-master\gui.py", line 44, in <module> class TreeGen(bpy.types.Operator): File "C:\Users\Administrator\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\tree-gen-master\gui.py", line 60, in TreeGen _scene.custom_tree_load_params_input = _props.EnumProperty(name="", default="tree-gen.parametric.tree_params.quaking_aspen", items=parametric_items) ValueError: bpy_struct "Scene" registration error: custom_tree_load_params_input could not register

friggog commented 3 years ago

Hmm interesting, will look into this - I think @luketimothyjones wrote this stuff initially which I’ve now hacked about so he may have some ideas

samipfjo commented 3 years ago

I remember fixing a similar issue with the plugin in the past, this is usually rooted in the existence or absence of __init__.py in directories. It's best practice to use named imports rather than relative for sake of readability, so the optimal starting point would be returning to the initial import structure figuring out why the module has fallen apart (the starting point being __init__.py). Could also be Blender being picky. I can take a look.

samipfjo commented 3 years ago

Renaming the tree-gen-master folder to tree-gen inside of tree-gen-master.zip fixes the issue.

Edit: For better user experience, perhaps we should look into using GitHub releases?

friggog commented 3 years ago

Good catch - have fixed with https://github.com/friggog/tree-gen/commit/0ff4fe76801f0256fd551fe3e4e8790ea38fab09

Happy to use releases, haven't used it before so not sure how it works - I guess this would allow people to grab versions for specific blender releases without us having to keep those branches active for example? Lets start a separate issue