[Bf-blender-cvs] [30efd99a84b] temp-nla-strip-alignment: - renamed NlaStripPreBlendTransform to NlaBlendTransform, preblend to blend, etc

Wayde Moss noreply at git.blender.org
Thu Dec 10 06:13:38 CET 2020


Commit: 30efd99a84b39912b9430b607a05bba21e9f0b77
Author: Wayde Moss
Date:   Sat Nov 28 02:54:52 2020 -0500
Branches: temp-nla-strip-alignment
https://developer.blender.org/rB30efd99a84b39912b9430b607a05bba21e9f0b77

- renamed NlaStripPreBlendTransform to NlaBlendTransform, preblend to blend, etc

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

M	release/scripts/startup/bl_ui/properties_nla.py
M	source/blender/blenkernel/BKE_nla.h
M	source/blender/blenkernel/intern/anim_sys.c
M	source/blender/blenkernel/intern/nla.c
M	source/blender/editors/space_nla/nla_buttons.c
M	source/blender/makesdna/DNA_anim_types.h
M	source/blender/makesrna/RNA_access.h
M	source/blender/makesrna/intern/rna_nla.c

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

diff --git a/release/scripts/startup/bl_ui/properties_nla.py b/release/scripts/startup/bl_ui/properties_nla.py
index d29caa2b7e0..e7f15270173 100644
--- a/release/scripts/startup/bl_ui/properties_nla.py
+++ b/release/scripts/startup/bl_ui/properties_nla.py
@@ -33,8 +33,8 @@ def get_active_strip(context):
     items =  [strip for strip in context.selected_nla_strips if strip.active]
     return items[0] if items else None 
 
-class OBJECT_OT_nla_add_preblend(bpy.types.Operator):
-    bl_idname = "object.nla_add_preblend"
+class OBJECT_OT_nla_add_blend(bpy.types.Operator):
+    bl_idname = "object.nla_add_blend"
     bl_label = "Add Preblend Transform"
     bl_options = {'REGISTER', 'UNDO'}
 
@@ -44,19 +44,19 @@ class OBJECT_OT_nla_add_preblend(bpy.types.Operator):
 
     def execute(self, context):
         active_strip = get_active_strip(context)
-        print(dict(active_strip.preblend_transforms))
-        k = active_strip.preblend_transforms.add()
+        print(dict(active_strip.blend_transforms))
+        k = active_strip.blend_transforms.add()
 
         # print(k.path_from_id("location"))
-        # print(active_strip.path_resolve("preblend_transforms"))
+        # print(active_strip.path_resolve("blend_transforms"))
         # print(k.id_data)
         return {'FINISHED'}
-class OBJECT_OT_nla_remove_preblend(bpy.types.Operator):
-    bl_idname = "object.nla_remove_preblend"
+class OBJECT_OT_nla_remove_blend(bpy.types.Operator):
+    bl_idname = "object.nla_remove_blend"
     bl_label = "Remove Preblend Transform"
     bl_options = {'REGISTER', 'UNDO'}
 
-    preblend_index : IntProperty()
+    blend_index : IntProperty()
 
     @classmethod
     def poll(cls,context):
@@ -64,16 +64,16 @@ class OBJECT_OT_nla_remove_preblend(bpy.types.Operator):
 
     def execute(self, context):
         active_strip = get_active_strip(context)
-        active_strip.preblend_transforms.remove_at(preblend_index=self.preblend_index)
+        active_strip.blend_transforms.remove_at(blend_index=self.blend_index)
 
         return {'FINISHED'}
 
-class OBJECT_OT_nla_preblend_add_bone(bpy.types.Operator):
-    bl_idname = "object.preblend_add_bone"
+class OBJECT_OT_nla_blend_add_bone(bpy.types.Operator):
+    bl_idname = "object.blend_add_bone"
     bl_label = "Preblend Add Bone"
     bl_options = {'REGISTER', 'UNDO'}
 
-    preblend_index : IntProperty()
+    blend_index : IntProperty()
 
     @classmethod
     def poll(cls,context):
@@ -81,16 +81,16 @@ class OBJECT_OT_nla_preblend_add_bone(bpy.types.Operator):
 
     def execute(self, context):
         active_strip = get_active_strip(context)
-        preblend = active_strip.preblend_transforms[self.preblend_index]
-        bone = preblend.bones.add()
+        blend = active_strip.blend_transforms[self.blend_index]
+        bone = blend.bones.add()
         bone.name ="Hips"
         return {'FINISHED'}
-class OBJECT_OT_nla_preblend_remove_bone(bpy.types.Operator):
-    bl_idname = "object.preblend_remove_bone"
+class OBJECT_OT_nla_blend_remove_bone(bpy.types.Operator):
+    bl_idname = "object.blend_remove_bone"
     bl_label = "Preblend Remove Bone"
     bl_options = {'REGISTER', 'UNDO'}
 
-    preblend_index : IntProperty()
+    blend_index : IntProperty()
     bone_index : IntProperty()
 
     @classmethod
@@ -99,8 +99,8 @@ class OBJECT_OT_nla_preblend_remove_bone(bpy.types.Operator):
 
     def execute(self, context):
         active_strip = get_active_strip(context)
-        preblend = active_strip.preblend_transforms[self.preblend_index]
-        preblend.bones.remove_at(self.bone_index)
+        blend = active_strip.blend_transforms[self.blend_index]
+        blend.bones.remove_at(self.bone_index)
 
         return {'FINISHED'}
 
@@ -121,7 +121,7 @@ class OBJECT_PT_nla_alignment(Panel):
         active_strip = get_active_strip(context)
 
 
-        layout.prop(active_strip,"preblend_transforms")
+        layout.prop(active_strip,"blend_transforms")
         
         # layout.prop(active_strip,"frame_start")
         # layout.prop(context.active_object,"location")
@@ -130,39 +130,39 @@ class OBJECT_PT_nla_alignment(Panel):
         #     c = context.active_pose_bone.constraints
         #     if(c):
         #         layout.prop(c[0],'type')
-        layout.operator(OBJECT_OT_nla_add_preblend.bl_idname,text='New Transform',icon='ADD')
+        layout.operator(OBJECT_OT_nla_add_blend.bl_idname,text='New Transform',icon='ADD')
         box = layout.box()
-        for i,preblend in enumerate(active_strip.preblend_transforms):
+        for i,blend in enumerate(active_strip.blend_transforms):
             row = box.row(align=True)
             row.label(text="World Transform")
-            row.operator(OBJECT_OT_nla_remove_preblend.bl_idname,text='',icon='REMOVE').preblend_index = i 
+            row.operator(OBJECT_OT_nla_remove_blend.bl_idname,text='',icon='REMOVE').blend_index = i 
 
-            box.prop(preblend,"location")
-            box.prop(preblend,"euler")
-            box.prop(preblend,"scale")
+            box.prop(blend,"location")
+            box.prop(blend,"euler")
+            box.prop(blend,"scale")
 
             col = box.column(align=True)
             row = col.row(align=True)
             #todo: support for objects?
             row.label(text="Bones")
-            row.operator(OBJECT_OT_nla_preblend_add_bone.bl_idname,text='',icon='ADD').preblend_index = i 
-            for j,bone in enumerate(preblend.bones):
+            row.operator(OBJECT_OT_nla_blend_add_bone.bl_idname,text='',icon='ADD').blend_index = i 
+            for j,bone in enumerate(blend.bones):
                 row = col.row(align=True)
                 # print([b for b in context.active_object.data.bones])
                 # row.prop_search(bone,"name",context.active_object.data,"bones",text='')
                 row.prop(bone,"name")
-                op = row.operator(OBJECT_OT_nla_preblend_remove_bone.bl_idname,text='',icon='REMOVE')
-                op.preblend_index = i 
+                op = row.operator(OBJECT_OT_nla_blend_remove_bone.bl_idname,text='',icon='REMOVE')
+                op.blend_index = i 
                 op.bone_index = j 
 
 
 classes = (
     # Object Panels
     OBJECT_PT_nla_alignment,
-    OBJECT_OT_nla_add_preblend,
-    OBJECT_OT_nla_remove_preblend,
-    OBJECT_OT_nla_preblend_remove_bone,
-    OBJECT_OT_nla_preblend_add_bone,
+    OBJECT_OT_nla_add_blend,
+    OBJECT_OT_nla_remove_blend,
+    OBJECT_OT_nla_blend_remove_bone,
+    OBJECT_OT_nla_blend_add_bone,
 )
 
 if __name__ == "__main__":  # only for live edit.
diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h
index 398265c709a..550185970e9 100644
--- a/source/blender/blenkernel/BKE_nla.h
+++ b/source/blender/blenkernel/BKE_nla.h
@@ -67,17 +67,16 @@ struct NlaStrip *BKE_nlastrip_new(struct bAction *act);
 struct NlaStrip *BKE_nlastack_add_strip(struct AnimData *adt,
                                         struct bAction *act,
                                         const bool is_liboverride);
-struct NlaStripPreBlendTransform *BKE_nlastrip_new_preblend_transform(struct NlaStrip *strip);
-void BKE_nlastrip_free_preblend_transform(struct NlaStrip *strip,
-                                          struct NlaStripPreBlendTransform *preblend);
-void BKE_nlastrip_free_preblend_transform_at(struct NlaStrip *strip, int preblend_index);
-
-struct NlaStripPreBlendTransform_BoneName *BKE_preblend_transform_new_bone(
-    struct NlaStripPreBlendTransform *preblend);
-void BKE_preblend_transform_free_bone(struct NlaStripPreBlendTransform *preblend,
-                                      struct NlaStripPreBlendTransform_BoneName *bone_name);
-void BKE_preblend_transform_free_bone_at(struct NlaStripPreBlendTransform *preblend,
-                                         int bone_name_index);
+struct NlaBlendTransform *BKE_nlastrip_new_blend_transform(struct NlaStrip *strip);
+void BKE_nlastrip_free_blend_transform(struct NlaStrip *strip,
+                                          struct NlaBlendTransform *blend);
+void BKE_nlastrip_free_blend_transform_at(struct NlaStrip *strip, int blend_index);
+
+struct NlaBlendTransform_BoneTarget *BKE_blend_transform_new_bone(
+    struct NlaBlendTransform *blend);
+void BKE_blend_transform_free_bone(struct NlaBlendTransform *blend,
+                                      struct NlaBlendTransform_BoneTarget *bone_name);
+void BKE_blend_transform_free_bone_at(struct NlaBlendTransform *blend, int bone_name_index);
 struct NlaStrip *BKE_nla_add_soundstrip(struct Main *bmain,
                                         struct Scene *scene,
                                         struct Speaker *speaker);
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 17cf8423b12..b2eb9dce398 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -3053,7 +3053,7 @@ void nlastrip_evaluate(PointerRNA *ptr,
 {
   /**
    * Todo: for blending rotation channels, its sometimes important to choose whether to ipo
-   * through shorter or longer angle- maybe make it a toggle on preblend data? Otherwise can't
+   * through shorter or longer angle- maybe make it a toggle on blend data? Otherwise can't
    * properly align character flips due to it rotating in wrong direction... would need to be
    * applied using quaternion which means doing similar rotation grabbing and manipulation from/to
    * nla channels again which sucks..but doable..
@@ -3073,26 +3073,26 @@ void nlastrip_evaluate(PointerRNA *ptr,
   nlastrip_evaluate_raw_value(
       ptr, channels, NULL, nes, &snapshot_raw, anim_eval_context, &blendmode, &influence);
 
-  /* Apply preblend transforms to each bone's raw snapshot values.  */
+  /* Apply blend transforms to each bone's raw snapshot values.  */
   Object *object = (Object *)ptr->data;
   bPose *pose = object->pose;
   /**
-   * Assumes preblend xformed bones are root bones with no parents. ( I think that would affect
-   * conversion to bone local space?). If it has an animated parent, then preblend xforms generally
+   * Assumes blend xformed bones are root bones w

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list