Quellcode durchsuchen

enable blender 4.4.0

this commit hacks around a bug in the Python API regarding NodeTree.valid_socket_get()
and MantisUINode.insert_link(). I expect these to be fixed in a point release soon.
otherwise my addon mostly works out of the box.

This will not work in 4.4 directly, there seems to be some sort of tree parsing problem - but I
suspect it will be helpful to fix this for 4.3 too. so it will be the next commit.
Joseph Brandenburg vor 7 Monaten
Ursprung
Commit
2fbe90fcae
4 geänderte Dateien mit 11 neuen und 10 gelöschten Zeilen
  1. 0 3
      __init__.py
  2. 6 4
      base_definitions.py
  3. 2 2
      blender_manifest.toml
  4. 3 1
      i_o.py

+ 0 - 3
__init__.py

@@ -359,9 +359,6 @@ def on_save_post_handler(scene): # The DG has already updated and we can disable
             t.prevent_next_exec = False
 
 def register():
-    if bpy.app.version >= (4, 4):
-        raise NotImplementedError("Blender 4.4 is not supported at this time.")
-
     from bpy.utils import register_class
     
     for cls in classes:

+ 6 - 4
base_definitions.py

@@ -45,9 +45,9 @@ class MantisTree(NodeTree):
     
     parsed_tree={}
 
-    if bpy.app.version >= (3, 2):  # in 3.1 this can lead to a crash
+    if (bpy.app.version < (4, 4, 0)):  # in 4.4 this leads to a crash
         @classmethod
-        def valid_socket_type(cls, socket_type: str):
+        def valid_socket_type(cls : NodeTree, socket_type: str):
             # https://docs.blender.org/api/master/bpy.types.NodeTree.html#bpy.types.NodeTree.valid_socket_type
             from .socket_definitions import Tell_bl_idnames
             return socket_type in Tell_bl_idnames()
@@ -92,6 +92,7 @@ class MantisTree(NodeTree):
         #    - Non-hierarchy links should be ignored in the circle-check and so the links should be marked valid in such a circle
         #    - hierarchy-links should be marked invalid and prevent the tree from executing.
 
+
         
     
     def execute_tree(self,context, error_popups = False):
@@ -123,7 +124,7 @@ class SchemaTree(NodeTree):
 
     mantis_version:IntVectorProperty(default=[0,9,2])
 
-    if bpy.app.version >= (3, 2):  # in 3.1 this can lead to a crash
+    if (bpy.app.version < (4, 4, 0)):  # in 4.4 this leads to a crash
         @classmethod
         def valid_socket_type(cls, socket_type: str):
             # https://docs.blender.org/api/master/bpy.types.NodeTree.html#bpy.types.NodeTree.valid_socket_type
@@ -160,10 +161,11 @@ class MantisUINode:
             raise e
 
     def insert_link(self, link):
+        if (bpy.app.version < (4, 4, 0)):
+            return # this causes a crasah due to a bug.
         context = bpy.context
         if context.space_data:
             node_tree = context.space_data.path[0].node_tree
-            from . import readtree
             if node_tree.do_live_update:
                 node_tree.update_tree(context)
                 if (link.to_socket.is_linked == False):

+ 2 - 2
blender_manifest.toml

@@ -3,7 +3,7 @@ schema_version = "1.0.0"
 # Example of manifest file for a Blender extension
 # Change the values according to your extension
 id = "mantis"
-version = "0.9.15"
+version = "0.10.0"
 name = "Mantis"
 tagline = "Mantis is a rigging nodes toolkit"
 maintainer = "Nodespaghetti <josephbburg@protonmail.com>"
@@ -20,7 +20,7 @@ tags = ["Rigging", "Node"]
 blender_version_min = "4.2.0"
 # # Optional: Blender version that the extension does not support, earlier versions are supported.
 # # This can be omitted and defined later on the extensions platform if an issue is found.
-blender_version_max = "4.4.0"
+# blender_version_max = "4.5.0"
 
 # License conforming to https://spdx.org/licenses/ (use "SPDX: prefix)
 # https://docs.blender.org/manual/en/dev/advanced/extensions/licenses.html

+ 3 - 1
i_o.py

@@ -74,7 +74,9 @@ def export_to_json(trees, path="", write_file=True, only_selected=False):
                     "__slots__", "dimensions", "type", "interface",
                     "library_weak_reference", "parsed_tree", "node_tree_updater",
                     "asset_data", "preview",  # blender asset stuff
-                    "object_reference" ] # this one is here to hold on to widgets when appending
+                    "object_reference", # this one is here to hold on to widgets when appending
+                    "color_tag" , # added in blender 4.4, not used by Mantis, readonly.
+                    ] 
     # don't ignore: "bl_idname", "bl_label",
     # ignore the name, it's the dict - key for the node props
      # no that's stupid don't ignore the name good grief