def unregister(): print("### Unloading CATS...") # # Unload mmd_tools try: mmd_tools_local.unregister() except AttributeError: print('Could not unregister local mmd_tools') pass # Unload all classes in reverse order count = 0 for cls in reversed(tools.register.__bl_ordered_classes): bpy.utils.unregister_class(cls) count += 1 print('Unregistered', count, 'CATS classes.') # Unload the updater addon_updater_ops.unregister() # Unregister all dynamic buttons and icons tools.supporter.unregister_dynamic_buttons() tools.supporter.unload_icons() # Remove shapekey button from shapekey menu bpy.types.MESH_MT_shape_key_specials.remove( tools.shapekey.addToShapekeyMenu) print("### Unloaded CATS successfully!")
def unregister(): print("### Unloading CATS...") # Unregister updater updater.unregister() # Register unloaded mmd_tools tabs if they are hidden to avoid issues when unloading mmd_tools if not bpy.context.scene.show_mmd_tabs: tools.common.toggle_mmd_tabs(shutdown_plugin=True) # Unload mmd_tools try: mmd_tools_local.unregister() except NameError: print('mmd_tools was not registered') pass except AttributeError: print('Could not unregister local mmd_tools') pass except ValueError: print('mmd_tools was not registered') pass # Unload all classes in reverse order count = 0 for cls in reversed(tools.register.__bl_ordered_classes): try: bpy.utils.unregister_class(cls) count += 1 except ValueError: pass except RuntimeError: pass print('Unregistered', count, 'CATS classes.') # Unregister all dynamic buttons and icons tools.supporter.unregister_dynamic_buttons() tools.supporter.unload_icons() # Remove shapekey button from shapekey menu try: bpy.types.MESH_MT_shape_key_specials.remove( tools.shapekey.addToShapekeyMenu) except AttributeError: print('shapekey button was not registered') pass # Remove folder from sys path if file_dir in sys.path: sys.path.remove(file_dir) print("### Unloaded CATS successfully!\n")
def unregister(): print("### Unloading CATS...") # Unregister updater updater.unregister() # Unload mmd_tools try: mmd_tools_local.unregister() except AttributeError: print('Could not unregister local mmd_tools') pass except ValueError: print('mmd_tools was not registered') pass # Unload all classes in reverse order count = 0 for cls in reversed(tools.register.__bl_ordered_classes): try: bpy.utils.unregister_class(cls) count += 1 except ValueError: pass except RuntimeError: pass print('Unregistered', count, 'CATS classes.') # Unregister all dynamic buttons and icons tools.supporter.unregister_dynamic_buttons() tools.supporter.unload_icons() # Remove shapekey button from shapekey menu try: bpy.types.MESH_MT_shape_key_specials.remove( tools.shapekey.addToShapekeyMenu) except AttributeError: print('shapekey button was not registered') pass # Remove folder from sys path if file_dir in sys.path: sys.path.remove(file_dir) print("### Unloaded CATS successfully!\n")