SHARE
TWEET

bartus

a guest Mar 27th, 2018 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/animation_nodes/__init__.py b/animation_nodes/__init__.py
  2. index 3d37c896..d5bf321b 100644
  3. --- a/animation_nodes/__init__.py
  4. +++ b/animation_nodes/__init__.py
  5. @@ -20,7 +20,7 @@ Created by Jacques Lucke
  6.  
  7.  
  8.  bl_info = {
  9. -    "name":        "Animation Nodes",
  10. +    "name":        "Animation Nodes (testing)",
  11.      "description": "Node based visual scripting system designed for motion graphics in Blender.",
  12.      "author":      "Jacques Lucke",
  13.      "version":     (2, 1, 1),
  14. @@ -45,9 +45,9 @@ compilationInfoPath = join(currentDirectory, "compilation_info.json")
  15.  addonName = basename(currentDirectory)
  16.  
  17.  
  18. -if addonName != "animation_nodes":
  19. +if addonName != "animation_nodes_test":
  20.      message = ("\n\n"
  21. -        "The name of the folder containing this addon has to be 'animation_nodes'.\n"
  22. +        "The name of the folder containing this addon has to be 'animation_nodes_test'.\n"
  23.          "Please rename it.")
  24.      raise Exception(message)
  25.  
  26. @@ -181,17 +181,24 @@ updateSocketInfo()
  27.  ##################################
  28.  
  29.  import bpy
  30. +import addon_utils
  31.  
  32.  def register():
  33. +    if "animation_nodes" in addon_utils.addons_fake_modules:
  34. +        default,state = addon_utils.check("animation_nodes")
  35. +        if state:
  36. +            addon_utils.disable("animation_nodes")
  37. +        #bpy.ops.wm.addon_disable(module="animation_nodes")
  38. +        #bpy.utils.unregister_module("animation_nodes")
  39.      bpy.utils.register_module(__name__)
  40.      for module in modules:
  41.          if hasattr(module, "register"):
  42.              module.register()
  43. -    print("Registered Animation Nodes with {} modules.".format(len(modules)))
  44. +    print("Registered Animation Nodes (test) with {} modules.".format(len(modules)))
  45.  
  46.  def unregister():
  47.      bpy.utils.unregister_module(__name__)
  48.      for module in modules:
  49.          if hasattr(module, "unregister"):
  50.              module.unregister()
  51. -    print("Unregistered Animation Nodes.")
  52. +    print("Unregistered Animation Nodes (test).")
  53. diff --git a/animation_nodes/execution/code_generator.py b/animation_nodes/execution/code_generator.py
  54. index 43235c29..f6752358 100644
  55. --- a/animation_nodes/execution/code_generator.py
  56. +++ b/animation_nodes/execution/code_generator.py
  57. @@ -40,9 +40,9 @@ def iter_Imports(nodes = []):
  58.      yield "import itertools"
  59.      yield "from time import perf_counter as getCurrentTime"
  60.      yield "from mathutils import Vector, Matrix, Quaternion, Euler"
  61. -    yield "AN = animation_nodes = sys.modules.get({})".format(repr(addonName))
  62. -    yield "from animation_nodes.data_structures import *"
  63. -    yield "from animation_nodes import algorithms"
  64. +    yield "AN = animation_nodes_test = sys.modules.get({})".format(repr(addonName))
  65. +    yield "from animation_nodes_test.data_structures import *"
  66. +    yield "from animation_nodes_test import algorithms"
  67.  
  68.  def get_ImportModules(nodes):
  69.      neededModules = {"bpy", "sys"}
  70. @@ -57,7 +57,7 @@ def getModulesNeededByNodes(nodes):
  71.      return list(moduleNames)
  72.  
  73.  def get_LoadMeasurementsDict():
  74. -    return "_node_execution_times = animation_nodes.execution.measurements.getMeasurementsDict()"
  75. +    return "_node_execution_times = animation_nodes_test.execution.measurements.getMeasurementsDict()"
  76.  
  77.  def iter_GetNodeReferences(nodes):
  78.      yield "nodes = bpy.data.node_groups[{}].nodes".format(repr(nodes[0].nodeTree.name))
  79. @@ -131,7 +131,7 @@ def iterNodeExecutionLines_Monitored(node, variables):
  80.          handleExecutionCodeCreationException(node)
  81.      yield "    pass"
  82.      yield "except Exception as e:"
  83. -    yield "    animation_nodes.problems.NodeRaisesExceptionDuringExecution({}).report()".format(repr(node.identifier))
  84. +    yield "    animation_nodes_test.problems.NodeRaisesExceptionDuringExecution({}).report()".format(repr(node.identifier))
  85.      yield "    raise"
  86.  
  87.  def iterNodeExecutionLines_MeasureTimes(node, variables):
  88. diff --git a/animation_nodes/nodes/object/object_id_key.py b/animation_nodes/nodes/object/object_id_key.py
  89. index dfa929d0..53cd16fa 100644
  90. --- a/animation_nodes/nodes/object/object_id_key.py
  91. +++ b/animation_nodes/nodes/object/object_id_key.py
  92. @@ -125,7 +125,7 @@ class ObjectIDKeyNode(bpy.types.Node, AnimationNode):
  93.                  yield "numbers = _key.getList(objects, %s)" % keyName
  94.  
  95.      def getList_Exists(self, objects):
  96. -        from animation_nodes.id_keys import doesIDKeyExist
  97. +        from animation_nodes_test.id_keys import doesIDKeyExist
  98.          return [doesIDKeyExist(object, self.keyDataType, self.keyName) for object in objects]
  99.  
  100.      def delete(self):
  101. diff --git a/setup.py b/setup.py
  102. index 6a994e2f..f8093b8d 100644
  103. --- a/setup.py
  104. +++ b/setup.py
  105. @@ -26,7 +26,7 @@ from _setuputils.setup_info_files import getSetupInfoList
  106.  from _setuputils.export import execute_Export, execute_ExportC
  107.  from _setuputils.compile_libraries import execute_CompileLibraries
  108.  
  109. -addonName = "animation_nodes"
  110. +addonName = "animation_nodes_test"
  111.  addonDirectory = os.path.join(currentDirectory, addonName)
  112.  defaultConfigPath = os.path.join(currentDirectory, "conf.default.json")
  113.  configPath = os.path.join(currentDirectory, "conf.json")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top