Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2010-02-01 12:26:50 +0300
committerJoshua Leung <aligorith@gmail.com>2010-02-01 12:26:50 +0300
commit3fc23b6cce989b75367ef2415a8beb3be6cde9d6 (patch)
treef65b5185c4ef1240ede99f0907c0e2a0dd2873ae /source/blender/editors/space_nla/nla_edit.c
parent0e6b88f993e034f1e3083bf26f08bc1dfd5ccf2e (diff)
NLA Editor Bugfix:
Operator to add action-clips now takes names without needing the "AC" prefix. The previous way was non-obvious for scripting usage, but did not cause too much trouble to replace.
Diffstat (limited to 'source/blender/editors/space_nla/nla_edit.c')
-rw-r--r--source/blender/editors/space_nla/nla_edit.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c
index 7e2aa6b5709..c60f73112f2 100644
--- a/source/blender/editors/space_nla/nla_edit.c
+++ b/source/blender/editors/space_nla/nla_edit.c
@@ -247,6 +247,7 @@ void NLA_OT_tweakmode_exit (wmOperatorType *ot)
/* Add a new Action-Clip strip to the active track (or the active block if no space in the track) */
/* pop up menu allowing user to choose the action to use */
+// TODO: at some point, we may have to migrate to a search menu to manage the case where there are many actions
static int nlaedit_add_actionclip_invoke (bContext *C, wmOperator *op, wmEvent *evt)
{
Main *m= CTX_data_main(C);
@@ -259,7 +260,7 @@ static int nlaedit_add_actionclip_invoke (bContext *C, wmOperator *op, wmEvent *
/* loop through Actions in Main database, adding as items in the menu */
for (act= m->action.first; act; act= act->id.next)
- uiItemStringO(layout, act->id.name+2, 0, "NLA_OT_actionclip_add", "action", act->id.name);
+ uiItemStringO(layout, act->id.name+2, 0, "NLA_OT_actionclip_add", "action", act->id.name+2);
uiItemS(layout);
uiPupMenuEnd(C, pup);
@@ -278,7 +279,7 @@ static int nlaedit_add_actionclip_exec (bContext *C, wmOperator *op)
int filter, items;
bAction *act = NULL;
- char actname[22];
+ char actname[20];
float cfra;
/* get editor data */
@@ -290,7 +291,7 @@ static int nlaedit_add_actionclip_exec (bContext *C, wmOperator *op)
/* get action to use */
RNA_string_get(op->ptr, "action", actname);
- act= (bAction *)find_id("AC", actname+2);
+ act= (bAction *)find_id("AC", actname);
if (act == NULL) {
BKE_report(op->reports, RPT_ERROR, "No valid Action to add.");
@@ -364,7 +365,7 @@ void NLA_OT_actionclip_add (wmOperatorType *ot)
/* props */
// TODO: this would be nicer as an ID-pointer...
- RNA_def_string(ot->srna, "action", "", 21, "Action", "Name of Action to add as a new Action-Clip Strip.");
+ ot->prop = RNA_def_string(ot->srna, "action", "", 19, "Action", "Name of Action to add as a new Action-Clip Strip.");
}
/* ******************** Add Transition Operator ***************************** */
@@ -1672,7 +1673,7 @@ void NLA_OT_fmodifier_add (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* id-props */
- RNA_def_enum(ot->srna, "type", fmodifier_type_items, 0, "Type", "");
+ ot->prop= RNA_def_enum(ot->srna, "type", fmodifier_type_items, 0, "Type", "");
RNA_def_boolean(ot->srna, "only_active", 0, "Only Active", "Only add F-Modifier of the specified type to the active strip.");
}