disallow identifiers with spaces 'cap end' wasn't working with the python api and...
authorCampbell Barton <ideasman42@gmail.com>
Thu, 15 Jan 2009 05:41:25 +0000 (05:41 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 15 Jan 2009 05:41:25 +0000 (05:41 +0000)
source/blender/editors/mesh/editmesh_add.c
source/blender/editors/mesh/mesh_ops.c
source/blender/makesrna/intern/rna_define.c

index b1af1221cf3907b87d6721d0cdb103f7101b54f2..b4459201f5ad4d9f1a86ee7f120d1c84b32952c3 100644 (file)
@@ -1604,7 +1604,7 @@ static int add_primitive_cone_exec(bContext *C, wmOperator *op)
        
        dia = RNA_float_get(op->ptr,"radius");
        
-       make_prim(obedit, PRIM_CONE, mat, RNA_int_get(op->ptr,"vertices"), 32, 2, dia, RNA_float_get(op->ptr,"depth")/2, 1, RNA_int_get(op->ptr,"cap end"));
+       make_prim(obedit, PRIM_CONE, mat, RNA_int_get(op->ptr,"vertices"), 32, 2, dia, RNA_float_get(op->ptr,"depth")/2, 1, RNA_int_get(op->ptr,"cap_end"));
        
        ED_undo_push(C, "Add Cone");    // Note this will become depricated 
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
@@ -1630,7 +1630,7 @@ void MESH_OT_add_primitive_cone(wmOperatorType *ot)
        RNA_def_property(ot->srna, "vertices", PROP_INT, PROP_NONE);
        RNA_def_property(ot->srna, "radius", PROP_FLOAT, PROP_NONE);
        RNA_def_property(ot->srna, "depth", PROP_FLOAT, PROP_NONE);
-       RNA_def_property(ot->srna, "cap end",PROP_INT, PROP_NONE);
+       RNA_def_property(ot->srna, "cap_end",PROP_INT, PROP_NONE);
 }
 
 static int add_primitive_grid_exec(bContext *C, wmOperator *op)
@@ -1687,4 +1687,4 @@ void MESH_OT_add_primitive_monkey(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= add_primitive_monkey_exec;
        ot->poll= ED_operator_editmesh;
-}
\ No newline at end of file
+}
index b052f2ee4b5c6a37350091a610570a616b8af43e..1b1dca86ce2bc877ceafed4b83d228a1bf21f158 100644 (file)
@@ -136,7 +136,7 @@ void ED_keymap_mesh(wmWindowManager *wm)
        RNA_int_set(cone->ptr,"vertices",32);
        RNA_float_set(cone->ptr,"radius",2);
        RNA_float_set(cone->ptr,"depth",-3);
-       RNA_float_set(cone->ptr,"cap end",0);
+       RNA_float_set(cone->ptr,"cap_end",0);
 
        WM_keymap_add_item(keymap, "MESH_OT_add_primitive_grid", NINEKEY, KM_PRESS, KM_CTRL, 0);
        
index cd852a39538d868f2b235495e8d9d88d531296fa..844f3ea54514a87a2a350a39c95ca93f12354172 100644 (file)
@@ -200,6 +200,11 @@ static int rna_validate_identifier(const char *identifier, char *error, int prop
                        continue;
                }
 
+               if (identifier[a]==' ') {
+                       strcpy(error, "spaces are not ok in identifier names");
+                       return 0;
+               }
+
                if (isalnum(identifier[a])==0) {
                        strcpy(error, "one of the characters failed an isalnum() check and is not an underscore");
                        return 0;