[Bf-extensions-cvs] [323d2345] asset-browser-poselib: Fix pose creation failure after recent changes in master

Julian Eisel noreply at git.blender.org
Wed Jun 23 12:11:59 CEST 2021


Commit: 323d2345701a02ab6ee183e112dc9a3cbff249b7
Author: Julian Eisel
Date:   Wed Jun 23 12:09:02 2021 +0200
Branches: asset-browser-poselib
https://developer.blender.org/rBA323d2345701a02ab6ee183e112dc9a3cbff249b7

Fix pose creation failure after recent changes in master

682a74e0909ba renamed properties and replaced existing float properties with
float-vector properties. This updates the Pose Libraries add-on to these
changes.

===================================================================

M	pose_library/pose_creation.py

===================================================================

diff --git a/pose_library/pose_creation.py b/pose_library/pose_creation.py
index 3119d34c..246784ea 100644
--- a/pose_library/pose_creation.py
+++ b/pose_library/pose_creation.py
@@ -73,19 +73,18 @@ class PoseActionCreator:
     params: PoseCreationParams
 
     # These were taken from Blender's Action baking code in `anim_utils.py`.
-    _bbone_prop_names = [
-        "bbone_curveinx",
-        "bbone_curveoutx",
-        "bbone_curveiny",
-        "bbone_curveouty",
-        "bbone_rollin",
-        "bbone_rollout",
-        "bbone_scaleinx",
-        "bbone_scaleoutx",
-        "bbone_scaleiny",
-        "bbone_scaleouty",
-        "bbone_easein",
-        "bbone_easeout",
+    # Items are (name, array_length) tuples.
+    _bbone_props = [
+        ("bbone_curveinx", None),
+        ("bbone_curveoutx", None),
+        ("bbone_curveinz", None),
+        ("bbone_curveoutz", None),
+        ("bbone_rollin", None),
+        ("bbone_rollout", None),
+        ("bbone_scalein", 3),
+        ("bbone_scaleout", 3),
+        ("bbone_easein", None),
+        ("bbone_easeout", None),
     ]
 
     def create(self) -> Optional[Action]:
@@ -191,7 +190,10 @@ class PoseActionCreator:
 
     def _store_bbone(self, dst_action: Action, bone_name: str) -> None:
         """Store bendy-bone parameters."""
-        for prop_name in self._bbone_prop_names:
+        for prop_name, array_length in self._bbone_props:
+          if array_length:
+            self._store_bone_array(dst_action, bone_name, prop_name, array_length)
+          else:
             self._store_bone_property(dst_action, bone_name, prop_name)
 
     def _store_bone_array(



More information about the Bf-extensions-cvs mailing list