Browse Source

Merge branch 'hook-radius-driver-names' into 'master'

Fix: hook radius drivers broken on Blender 5.2 (duplicate variable names)

See merge request josephbburg/mantis!11
josephbburg 1 month ago
parent
commit
3aecaf79e7
1 changed files with 3 additions and 0 deletions
  1. 3 0
      deformer_nodes.py

+ 3 - 0
deformer_nodes.py

@@ -355,11 +355,14 @@ class DeformerHook(MantisDeformerNode):
         from .drivers import CreateDrivers
         axes='XYZ'
         for i in range(3):
+            suffix = "" if i == 0 else f"_{i:03d}" # explicit names -- 5.2 no longer uniquifies duplicates
             var = var_template.copy()
+            var["name"]="a"+suffix
             var["channel"]="SCALE_"+axes[i]
             driver["vars"].append(var)
             if isinstance(hook, (Bone, PoseBone)):
                 var1=var1_template.copy()
+                var1['name']="b"+suffix
                 var1['channel']="SCALE_"+axes[i]
                 driver['vars'].append(var1)
         CreateDrivers([driver])