[Bf-blender-cvs] [182e84d] master: Nla Strip Curves: Getting more stuff working

Joshua Leung noreply at git.blender.org
Sat Mar 28 15:08:10 CET 2015


Commit: 182e84da88a8efd708a5423cf043643c62219cad
Author: Joshua Leung
Date:   Mon Mar 23 00:01:13 2015 +1300
Branches: master
https://developer.blender.org/rB182e84da88a8efd708a5423cf043643c62219cad

Nla Strip Curves: Getting more stuff working

* Clicking anywhere on the expander collapses it (like for the gpencil one)
* Deleting these curves works now (but has the side effect of turning off
  the animated influence/time options too, as it is assumed that when those
  are enabled there is a corresponding fcurve)

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

M	source/blender/editors/animation/anim_channels_edit.c

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

diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c
index 85a4fd4..b241d75 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -1606,6 +1606,27 @@ static int animchannels_delete_exec(bContext *C, wmOperator *UNUSED(op))
 				ANIM_fcurve_delete_from_animdata(&ac, adt, fcu);
 				break;
 			}
+			case ANIMTYPE_NLACURVE:
+			{
+				/* NLA Control Curve - Deleting it should disable the corresponding setting... */
+				NlaStrip *strip = (NlaStrip *)ale->owner;
+				FCurve *fcu = (FCurve *)ale->data;
+				
+				if (STREQ(fcu->rna_path, "strip_time")) {
+					strip->flag &= ~NLASTRIP_FLAG_USR_TIME;
+				}
+				else if (STREQ(fcu->rna_path, "influence")) {
+					strip->flag &= ~NLASTRIP_FLAG_USR_INFLUENCE;
+				}
+				else {
+					printf("ERROR: Trying to delete NLA Control Curve for unknown property '%s'\n", fcu->rna_path);
+				}
+				
+				/* unlink and free the F-Curve */
+				BLI_remlink(&strip->fcurves, fcu);
+				free_fcurve(fcu);
+				break;
+			}
 			case ANIMTYPE_GPLAYER:
 			{
 				/* Grease Pencil layer */
@@ -2772,6 +2793,19 @@ static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index,
 			notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
 			break;
 		}
+		case ANIMTYPE_NLACONTROLS:
+		{
+			AnimData *adt = (AnimData *)ale->data;
+			
+			/* toggle expand
+			 *   - Although the triangle widget already allows this, since there's nothing else that can be done here now,
+			 *     let's just use it for easier expand/collapse for now
+			 */
+			adt->flag ^= ADT_NLA_SKEYS_COLLAPSED;
+			
+			notifierFlags |= (ND_ANIMCHAN | NA_EDITED);
+			break;
+		}
 		case ANIMTYPE_GPDATABLOCK:
 		{
 			bGPdata *gpd = (bGPdata *)ale->data;




More information about the Bf-blender-cvs mailing list