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:
Diffstat (limited to 'source/blender/editors/curve')
-rw-r--r--source/blender/editors/curve/curve_ops.c8
-rw-r--r--source/blender/editors/curve/editcurve.c11
-rw-r--r--source/blender/editors/curve/editfont.c12
3 files changed, 18 insertions, 13 deletions
diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c
index 8a90dace40b..77c5ed1de2c 100644
--- a/source/blender/editors/curve/curve_ops.c
+++ b/source/blender/editors/curve/curve_ops.c
@@ -163,7 +163,10 @@ void ED_operatortypes_curve(void)
void ED_keymap_curve(wmWindowManager *wm)
{
- ListBase *keymap= WM_keymap_listbase(wm, "Font", 0, 0);
+ wmKeyMap *keymap;
+
+ keymap= WM_keymap_find(wm, "Font", 0, 0);
+ keymap->poll= ED_operator_editfont;
/* only set in editmode font, by space_view3d listener */
RNA_enum_set(WM_keymap_add_item(keymap, "FONT_OT_style_toggle", BKEY, KM_PRESS, KM_CTRL, 0)->ptr, "style", CU_BOLD);
@@ -212,7 +215,8 @@ void ED_keymap_curve(wmWindowManager *wm)
WM_keymap_add_item(keymap, "FONT_OT_text_insert", KM_TEXTINPUT, KM_ANY, KM_ANY, 0); // last!
/* only set in editmode curve, by space_view3d listener */
- keymap= WM_keymap_listbase(wm, "Curve", 0, 0);
+ keymap= WM_keymap_find(wm, "Curve", 0, 0);
+ keymap->poll= ED_operator_editsurfcurve;
WM_keymap_add_item(keymap, "OBJECT_OT_curve_add", AKEY, KM_PRESS, KM_SHIFT, 0);
WM_keymap_add_item(keymap, "CURVE_OT_vertex_add", ACTIONMOUSE, KM_PRESS, KM_CTRL, 0);
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index e346ccafde3..a18815d04a6 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -1078,7 +1078,7 @@ void CURVE_OT_spline_weight_set(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_float_percentage(ot->srna, "weight", 1.0f, 0.0f, 1.0f, "Weight", "", 0.0f, 1.0f);
+ RNA_def_float_factor(ot->srna, "weight", 1.0f, 0.0f, 1.0f, "Weight", "", 0.0f, 1.0f);
}
/******************* set radius operator ******************/
@@ -2546,7 +2546,7 @@ void CURVE_OT_handle_type_set(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_enum(ot->srna, "type", type_items, CU_POLY, "Type", "Spline type");
+ RNA_def_enum(ot->srna, "type", type_items, 1, "Type", "Spline type");
}
/***************** make segment operator **********************/
@@ -4704,6 +4704,7 @@ Nurb *add_nurbs_primitive(bContext *C, int type, int newname)
float *curs, cent[3],vec[3],imat[3][3],mat[3][3];
float fac,cmat[3][3], grid;
int a, b, cutype, stype;
+ int force_3d = ((Curve *)obedit->data)->flag & CU_3D; /* could be adding to an existing 3D curve */
cutype= type & CU_TYPE; // poly, bezier, nurbs, etc
stype= type & CU_PRIMITIVE;
@@ -4727,7 +4728,7 @@ Nurb *add_nurbs_primitive(bContext *C, int type, int newname)
cent[2]-= obedit->obmat[3][2];
if(rv3d) {
- if (!(newname) || U.flag & USER_ADD_VIEWALIGNED)
+ if (!newname && U.flag & USER_ADD_VIEWALIGNED)
Mat3CpyMat4(imat, rv3d->viewmat);
else
Mat3One(imat);
@@ -4760,7 +4761,7 @@ Nurb *add_nurbs_primitive(bContext *C, int type, int newname)
rename_id((ID *)obedit->data, "Curve");
}
if(cutype==CU_BEZIER) {
- nu->flag= CU_2D;
+ if (!force_3d) nu->flag |= CU_2D;
nu->pntsu= 2;
nu->bezt =
(BezTriple*)MEM_callocN(2 * sizeof(BezTriple), "addNurbprim1");
@@ -4869,7 +4870,7 @@ Nurb *add_nurbs_primitive(bContext *C, int type, int newname)
rename_id((ID *)obedit->data, "CurveCircle");
}
if(cutype==CU_BEZIER) {
- nu->flag= CU_2D;
+ if (!force_3d) nu->flag |= CU_2D;
nu->pntsu= 4;
nu->bezt= callocstructN(BezTriple, 4, "addNurbprim1");
nu->flagu= CU_CYCLIC;
diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c
index a9736f3f88d..2be567e1921 100644
--- a/source/blender/editors/curve/editfont.c
+++ b/source/blender/editors/curve/editfont.c
@@ -381,19 +381,19 @@ static int paste_file(bContext *C, ReportList *reports, char *filename)
static int paste_file_exec(bContext *C, wmOperator *op)
{
- char *filename;
+ char *path;
int retval;
- filename= RNA_string_get_alloc(op->ptr, "filename", NULL, 0);
- retval= paste_file(C, op->reports, filename);
- MEM_freeN(filename);
+ path= RNA_string_get_alloc(op->ptr, "path", NULL, 0);
+ retval= paste_file(C, op->reports, path);
+ MEM_freeN(path);
return retval;
}
static int paste_file_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- if(RNA_property_is_set(op->ptr, "filename"))
+ if(RNA_property_is_set(op->ptr, "path"))
return paste_file_exec(C, op);
WM_event_add_fileselect(C, op);
@@ -417,7 +417,7 @@ void FONT_OT_file_paste(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE);
+ WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE, FILE_SPECIAL);
}
/******************* paste buffer operator ********************/