xzhuah / NodeTreeStore

The is the repository for NodeTreeStore Blender Addon. I am using to collect users' feedback
GNU General Public License v3.0
5 stars 0 forks source link

Error messages with blender 3.6 / 3.6.1rc /4.0 on Intel MacOS Metal & Nodetreestore #1

Open nurb2kea opened 1 year ago

nurb2kea commented 1 year ago

Hi,

I get this error messages with blender 3.6 / 3.6.1rc /4.0 on Intel MacOS Metal & Nodetreestore.

Python: Traceback (most recent call last):

File "/Applications/BLENDER/ADDONS etc/addons/nodeTreeStore/node/addons/nodeTreeStore/operators/LuxCoreNodeTreeOperators.py", line 27, in poll

bpy.context.scene.luxcore_node_tree_sub_category = \

AttributeError: Writing to ID classes in this context is not allowed: Scene, Scene datablock, error setting Scene.luxcore_node_tree_sub_category

Python: Traceback (most recent call last):

File "/Applications/BLENDER/ADDONS etc/addons/nodeTreeStore/node/addons/nodeTreeStore/operators/ShaderNodeTreeOperators.py", line 507, in poll

context.scene.shader_node_tree_category_items) > 0 and context.scene.shader_node_tree_category_items_index >= 0 and context.active_object is not None and context.space_data.tree_type == "ShaderNodeTree"

AttributeError: 'SpaceView3D' object has no attribute 'tree_type'. Did you mean: 'rna_type'?

xzhuah commented 1 year ago

Thanks for reporting, I will try to reproduce this error with the mentioned blender versions. I need some details about how to reproduce these errors? What action did you do before seeing these errors? Does this affect the normal usage of the addon? These errors indicate that some operations are invoked in an unexpected context. For example, trying to invoke some node tree store operations in 3D viewport instead of Node Editor View. Usually these errors won't affect the normal usage of the addon. Let me know if you keep seeing this error when using the addon or you just see it once very ocassionally?

nurb2kea commented 1 year ago

Hi,

when I start up blender and open the 'Menu Search' popup, then this error will pop up in the 'Info' editor/window. I tried it even with blender 3.1with with the same result. If I open the 'operators search' nothing happens. Other addons like 'Originie' have the same behaviour.

nurb2kea commented 1 year ago

?

xzhuah commented 1 year ago

Ininteresting. So the LuxCoreNodeTreeOperators is the Operator I built for LuxCoreRender, which uses a different set of Nodes. I would say very few user actually using LuxCoreRender in Blender these days, so most user would never use this LuxCoreNodeTreeOperator. If you are not using LuxCoreRender in blender, you should never got a chance to use these operators.

But looks like the 'Menu Search' popup would go over all the existing operators and try to add them to the list, and that is a corner case I didn't expect before. I think this shouldn't block the normal usage of addon or other function in Blender.

nurb2kea commented 1 year ago

Ok, maybe we could comment the luxcore operators out in a luxcore free version or a preferences switch for luxcore or not!? I got rid of most error messages by asking the devs of other adons to have a look after it. Originie, Baga and Nodetreestore are the last in the list to get rid of it.

Hope we can archive it in this case too!? Thanks

nurb2kea commented 1 year ago

Hi,

here I got the solution from Baga to get rid of the traceback message in all blender versions !!

First the Traceback bug, then the talk with baga, then the solution !

Screenshot_2023-07-19_at_11 09 57_am

Screenshot 2023-07-21 at 4 49 18 pm bagapie_geopack_create py

It is triggered in connection with the 'Menu Search' from blender and the addon code! Hope that helps you to get rid of this bug in all blender versions incl. the coming 4.x versions. I'll share this with the devs of the other known addon having this issue to get all fixed asap.

Thanks in advance

Guido

PS: If you need the whole 'bagapie_geopack_create.py' file, let me know or you can download it via the free BagaPie addon. The only change he made is seen here in the screenshot image.

xzhuah commented 1 year ago

sounds good, I think use hasattr to check if the the "tree_type" is a valid attribute before accessing it would get rid of this error. I will include this fix in my next version. Thanks!

nurb2kea commented 1 year ago

??

xzhuah commented 1 year ago

Updated in 1.2.2, On Blender Market

You would probably still see some warning message when press F3. At some places, the addon define a function attribute inside the function (There is a long story for why we need to do that to support dynamic enum in blender) There is a module writtern for Luxcore render and will not get executed for blender without Luxcore render and this function that defines the attribute is not executed, which results in some missing attribute of a function. I haven't found good way to handle this situation yet, but the warning won't affect normal usage.