Ver código fonte

Initialize Tree with correct version number

Joseph Brandenburg 3 semanas atrás
pai
commit
ad9b7853ac
2 arquivos alterados com 11 adições e 5 exclusões
  1. 3 3
      __init__.py
  2. 8 2
      base_definitions.py

+ 3 - 3
__init__.py

@@ -16,9 +16,9 @@ from .ops_generate_tree import GenerateMantisTree
 
 from .utilities import prRed
 
-MANTIS_VERSION_MAJOR=0
-MANTIS_VERSION_MINOR=12
-MANTIS_VERSION_SUB=28
+from .base_definitions import (MANTIS_VERSION_MAJOR,
+                               MANTIS_VERSION_MINOR,
+                               MANTIS_VERSION_SUB)
 
 classLists = [module.TellClasses() for module in [
  link_nodes_ui,

+ 8 - 2
base_definitions.py

@@ -79,6 +79,10 @@ def hash_tree(tree):
     links.sort(); hash_data+=''.join(links)
     return hash(hash_data)
 
+MANTIS_VERSION_MAJOR=0
+MANTIS_VERSION_MINOR=12
+MANTIS_VERSION_SUB=27
+
 class MantisTree(NodeTree):
     '''A custom node tree type that will show up in the editor type list'''
     bl_idname = 'MantisTree'
@@ -97,7 +101,8 @@ class MantisTree(NodeTree):
     is_exporting:BoolProperty(default=False)
     execution_id:StringProperty(default='')
     # prev_execution_id:StringProperty(default='')
-    mantis_version:IntVectorProperty(default=[0,9,2])
+    mantis_version:IntVectorProperty(default=[
+        MANTIS_VERSION_MAJOR, MANTIS_VERSION_MINOR, MANTIS_VERSION_SUB])
     # this prevents the node group from executing on the next depsgraph update
     # because I don't always have control over when the dg upadte happens.
     prevent_next_exec:BoolProperty(default=False)
@@ -189,7 +194,8 @@ class SchemaTree(NodeTree):
     is_executing:BoolProperty(default=False)
     is_exporting:BoolProperty(default=False)
 
-    mantis_version:IntVectorProperty(default=[0,9,2])
+    mantis_version:IntVectorProperty(default=[
+        MANTIS_VERSION_MAJOR, MANTIS_VERSION_MINOR, MANTIS_VERSION_SUB])
     # see the note in MantisTree
     interface_helper : StringProperty(default='')