Open zeffii opened 4 years ago
which issues? :)
console printout here: https://github.com/nortikin/sverchok/pull/3089#issuecomment-621717912
sv: import settings
sv: import all modules
sv: append app.handlers
sv: enable internal debug logging.
2020-04-30 13:20:12,177 [INFO] sverchok.utils.logging: log level, 20
Exception in module register(): C:\Users\zeffi\Desktop\scripts\addons_contrib\sverchok\__init__.py
Traceback (most recent call last):
File "C:\Users\zeffi\Desktop\test_blenders\current_28\2.83\scripts\modules\addon_utils.py", line 382, in enable
mod.register()
File "C:\Users\zeffi\Desktop\scripts\addons_contrib\sverchok\__init__.py", line 86, in register
sv_registration_utils.register_all(imported_modules + node_list)
File "C:\Users\zeffi\Desktop\scripts\addons_contrib\sverchok\core\__init__.py", line 24, in sv_register_modules
m.register()
File "C:\Users\zeffi\Desktop\scripts\addons_contrib\sverchok\nodes\scene\viewer_layer.py", line 493, in register
subscribe_to_viewer_nodes_name_changes()
File "C:\Users\zeffi\Desktop\scripts\addons_contrib\sverchok\nodes\scene\viewer_layer.py", line 75, in subscribe_to_viewer_nodes_name_changes
subscribe_to_changes(subscribe_to, "Viewer node name changed", viewer_name_change_callback)
File "C:\Users\zeffi\Desktop\scripts\addons_contrib\sverchok\core\handlers.py", line 35, in subscribe_to_changes
options={"PERSISTENT", }
RuntimeError: subscribe_rna, missing bl_rna attribute from 'RNAMetaPropGroup' instance (may not be registered)
locally i was merging the viewerlayer node into my prop_search_use_pointerproperty
branch,, and that stopped working until i reset hard to
$ git reset --hard c8595a7
$ git reset --soft HEAD@{1}
$ git commit -m "revert to c8595a7"
maybe renaming the persistent handler introduced issues for .blends that are saved with the old handler name. I have a startup.blend that has a default SV NodeTree .
I imagine the die hard Sverchok heads all have a startup.blend with a NodeTree ready to rok.
maybe subscribe_to_viewer_nodes_name_changes()
should be done not in the viewer_layer node register function, but instead after all nodes are loaded.
confirmed, master is broken
RuntimeError: subscribe_rna, missing bl_rna attribute from 'RNAMetaPropGroup' instance (may not be registered)
subscribe_to_viewer_nodes_name_changes()
should not happen in that node's register.
over the last couple of months we've seen reports from people on different operating systems that seem to suggest that the order in which python registers objects differs across implementations. Maybe i'm missing something here, but subscribe_to_viewer_nodes_name_changes()
should probably be called after it knows for sure that those two nodes are indeed registered.
i'd like to branch the current master as master_developement
, then revert current master Head to the last working version, and we fix stuff in master_development branch..
done https://github.com/nortikin/sverchok/pull/3147 master_development
is now where you fix this beast. it might be super simple, but it needs to work on all machines.
what bothers me here is that travis did not catch this either.
Anybody working on fixing this? Should I be the one updating the VLN to get it to work? the problem is I cant get to replicate this on my system, so I’m not sure if I would fix anything if i tried :)
As I mentioned in the #3089 PR, one way to fix the problem could be to remove the call to subscribe_to_viewer_nodes_name_changes() from the VLN register function.. but that means it would have to be added somewhere else (e.g. sv_init?) so that the new VLN nodes would have the subscriptions set.
One problem with this (though it may not be a big problem) is that this subscription call would be made multiple times for every VLN node created, when in fact this should be done only one time (at least given the way the subscriptions are set right now). The VLN subscription essentially registers a VLN function as a callback in which then all the VLN nodes in the tree are notified about any viewer name change:
def viewer_name_change_callback(self):
''' Subscription callback for viewer node name change (calls from handlers.py) '''
# propagate the name change callback to all Viewer Layer nodes
for node_tree in sverchok_trees():
layer_nodes = [n for n in node_tree.nodes if n.bl_idname == "SvViewerLayerNode"]
for node in layer_nodes:
node.viewer_changed_name()
def subscribe_to_viewer_nodes_name_changes():
''' Subscribe to name change of various viewer nodes (calls to handlers.py) '''
VIZ_NODE1 = sverchok.nodes.viz.vd_draw_experimental.SvVDExperimental
VIZ_NODE2 = sverchok.nodes.viz.viewer_idx28.SvIDXViewer28
subscribe_to_list = [(VIZ_NODE1, "name"), (VIZ_NODE2, "name")]
for subscribe_to in subscribe_to_list:
subscribe_to_changes(subscribe_to, "Viewer node name changed", viewer_name_change_callback)
If the subscriptions would be done in the sv_init of every VLN node then maybe a better way to setp the subscriptions would be to have each VLN node subscribe to changes by providing a node method as a callback (rather then a global method that calls all the VLN nodes as shown above). In this case though, I’d have to figure out a way for these callbacks to be properly set on loading the blend file (the current implementation covers both cases.. new VLN nodes or reloading file with VLN nodes in it). I’ll have to think more about this.
Let me know if you have any suggestions.
Nice.. :(
When I provide self.method to subscribe .. I get an error:
subscribe_to_changes(subscribe_to, "Viewer node name changed", self.viewer_name_change_callback)
File "/Users/atokirina/Library/Application Support/Blender/2.82/scripts/addons/sverchok/core/handlers.py", line 35, in subscribe_to_changes
options={"PERSISTENT", }
TypeError: notify expects a function, found method
apparently the bpy.msgbus.subscribe_rna doesn’t like methods as a notification callback. wtf?
Are you sure you dont want to try this? https://github.com/nortikin/sverchok/pull/3089#issuecomment-621512702
@vicdoval sure.. that would be a solution :) though this msgbus mechanism may be useful in other cases.. so figuring out how to make it work in this case may be useful nonetheless.
apparently the bpy.msgbus.subscribe_rna doesn’t like methods as a notification callback. wtf?
It looks like update parameter of a property. It takes only functions, but also there is no complaints about static methods.
annotations
annotations resolved here https://github.com/nortikin/sverchok/commit/ac41b6970d327ca350224c93e52fe25cd8e53057
annotations also fixed here #3152 :D
we will get to this issue once issues with existing nodes are not as profound.