From d2103b98363575f4b3b1a617e13cd9d7461e81f9 Mon Sep 17 00:00:00 2001 From: satabol Date: Sat, 19 Aug 2023 22:12:10 +0300 Subject: [PATCH] correct a little --- old_nodes/__init__.py | 6 +++--- old_nodes/getprop.py | 2 -- old_nodes/objects_mk3.py | 11 +---------- old_nodes/setprop.py | 4 +--- 4 files changed, 5 insertions(+), 18 deletions(-) diff --git a/old_nodes/__init__.py b/old_nodes/__init__.py index de7c2391f5..6f1dbaeb50 100644 --- a/old_nodes/__init__.py +++ b/old_nodes/__init__.py @@ -128,7 +128,7 @@ def register_all(): # when a code of an old node is copied to old folder # it can be copied with other classes (property groups) # which does not change it version to MK2, so we have the error - sv_logger.error( (bl_id, e) ) + sv_logger.error( e ) def register(): @@ -141,8 +141,8 @@ def register(): def unregister(): - for i, mod in enumerate(imported_mods.values()): + for mod in imported_mods.values(): try: mod.unregister() except Exception as e: - sv_logger.error( (mod, e) ) + sv_logger.error(e) diff --git a/old_nodes/getprop.py b/old_nodes/getprop.py index e47d443fc9..fff00f7151 100644 --- a/old_nodes/getprop.py +++ b/old_nodes/getprop.py @@ -208,10 +208,8 @@ def process(self): self.outputs[0].sv_set(wrap_output_data(self.obj)) def register(): -# bpy.utils.register_class(SvSetPropNode) bpy.utils.register_class(SvGetPropNode) def unregister(): -# bpy.utils.unregister_class(SvSetPropNode) bpy.utils.unregister_class(SvGetPropNode) diff --git a/old_nodes/objects_mk3.py b/old_nodes/objects_mk3.py index 523862d878..e8776f2cf9 100644 --- a/old_nodes/objects_mk3.py +++ b/old_nodes/objects_mk3.py @@ -42,7 +42,6 @@ class SvOB3BItemOperator(bpy.types.Operator, SvGenericNodeLocator): bl_idname = "node.sv_ob3b_collection_operator" bl_label = "generic bladibla" - #bl_options = {'INTERNAL'} fn_name: StringProperty(default='') idx: IntProperty() @@ -311,12 +310,4 @@ def load_from_json(self, node_data: dict, import_version: float): classes = [SvOB3BItemOperator, SvOB3BDataCollection, SVOB3B_UL_NamesList, SvOB3Callback, SvObjectsNodeMK3] -#register, unregister = bpy.utils.register_classes_factory(classes) -def register(): - for cls in classes: - bpy.utils.register_class(cls) - -def unregister(): - for cls in reversed(classes): - bpy.utils.unregister_class(cls) - +register, unregister = bpy.utils.register_classes_factory(classes) \ No newline at end of file diff --git a/old_nodes/setprop.py b/old_nodes/setprop.py index 4d427f7e7b..a34e206104 100644 --- a/old_nodes/setprop.py +++ b/old_nodes/setprop.py @@ -26,10 +26,8 @@ from mathutils import Matrix, Vector, Euler, Quaternion, Color from sverchok.node_tree import SverchCustomTreeNode - from sverchok.data_structure import Matrix_generate, updateNode, node_id - -from sverchok.old_nodes.getprop import assign_data +from sverchok.old_nodes.getprop import assign_data, get_object, apply_alias, parse_to_path, secondary_type_assesment, types class SvSetPropNode(SverchCustomTreeNode, bpy.types.Node): ''' Set Property '''