[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40726] trunk/blender/source/blender/ editors/space_action/action_edit.c: Bugfix [#28781] Grease pencil segfaults when deleting or duplicating
Joshua Leung
aligorith at gmail.com
Sat Oct 1 02:56:37 CEST 2011
Revision: 40726
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40726
Author: aligorith
Date: 2011-10-01 00:56:36 +0000 (Sat, 01 Oct 2011)
Log Message:
-----------
Bugfix [#28781] Grease pencil segfaults when deleting or duplicating
frames in dopesheet
Modified Paths:
--------------
trunk/blender/source/blender/editors/space_action/action_edit.c
Modified: trunk/blender/source/blender/editors/space_action/action_edit.c
===================================================================
--- trunk/blender/source/blender/editors/space_action/action_edit.c 2011-09-30 20:26:14 UTC (rev 40725)
+++ trunk/blender/source/blender/editors/space_action/action_edit.c 2011-10-01 00:56:36 UTC (rev 40726)
@@ -459,6 +459,8 @@
/* copy keyframes */
if (ac.datatype == ANIMCONT_GPENCIL) {
// FIXME...
+ BKE_report(op->reports, RPT_ERROR, "Keyframe pasting is not available for Grease Pencil mode");
+ return OPERATOR_CANCELLED;
}
else {
if (copy_action_keys(&ac)) {
@@ -497,13 +499,15 @@
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
- if(ac.reports==NULL) {
+ if (ac.reports==NULL) {
ac.reports= op->reports;
}
/* paste keyframes */
if (ac.datatype == ANIMCONT_GPENCIL) {
// FIXME...
+ BKE_report(op->reports, RPT_ERROR, "Keyframe pasting is not available for Grease Pencil mode");
+ return OPERATOR_CANCELLED;
}
else {
if (paste_action_keys(&ac, offset_mode, merge_mode)) {
@@ -680,12 +684,13 @@
duplicate_action_keys(&ac);
/* validate keyframes after editing */
- ANIM_editkeyframes_refresh(&ac);
+ if (ac.datatype != ANIMCONT_GPENCIL)
+ ANIM_editkeyframes_refresh(&ac);
/* set notifier that keyframes have changed */
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
- return OPERATOR_FINISHED; // xxx - start transform
+ return OPERATOR_FINISHED;
}
static int actkeys_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
@@ -709,9 +714,6 @@
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-
- /* to give to transform */
- RNA_def_enum(ot->srna, "mode", transform_mode_types, TFM_TRANSLATION, "Mode", "");
}
/* ******************** Delete Keyframes Operator ************************* */
@@ -764,7 +766,8 @@
delete_action_keys(&ac);
/* validate keyframes after editing */
- ANIM_editkeyframes_refresh(&ac);
+ if (ac.datatype != ANIMCONT_GPENCIL)
+ ANIM_editkeyframes_refresh(&ac);
/* set notifier that keyframes have changed */
WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
@@ -1381,6 +1384,10 @@
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
+ // XXX...
+ if (ac.datatype == ANIMCONT_GPENCIL)
+ return OPERATOR_PASS_THROUGH;
+
/* get snapping mode */
mode= RNA_enum_get(op->ptr, "type");
@@ -1491,6 +1498,10 @@
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
+ // XXX...
+ if (ac.datatype == ANIMCONT_GPENCIL)
+ return OPERATOR_PASS_THROUGH;
+
/* get mirroring mode */
mode= RNA_enum_get(op->ptr, "type");
More information about the Bf-blender-cvs
mailing list