diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2010-06-23 01:11:13 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2010-06-23 01:11:13 +0400 |
commit | e10bf2bc09fa035558f3b7bc67a15e3e1d2b3d18 (patch) | |
tree | 67d5019b5e7043108f0c7fbfa86855ebc4aa4ccd /source/blender/editors/object/object_add.c | |
parent | df76cebb8a27eb1206eebbcfebac9a0ab439ce91 (diff) |
Fix #22642: NURBS surfaces doesnt display
Fix #22587: Invisible Nurbs Suface
There was a small bug with determinating if new object should be created
and for surfeces new OB_CURVE object had been created (instead of OB_SURF).
Removed unused function and enum, which were used by nurbs surface
create old oprator
Diffstat (limited to 'source/blender/editors/object/object_add.c')
-rw-r--r-- | source/blender/editors/object/object_add.c | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index e29c23b1f4d..ee0fd2b47e9 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -490,74 +490,6 @@ void OBJECT_OT_camera_add(wmOperatorType *ot) /* ***************** add primitives *************** */ -static EnumPropertyItem prop_surface_types[]= { - {CU_PRIM_CURVE|CU_NURBS, "NURBS_CURVE", ICON_SURFACE_NCURVE, "NURBS Curve", ""}, - {CU_PRIM_CIRCLE|CU_NURBS, "NURBS_CIRCLE", ICON_SURFACE_NCIRCLE, "NURBS Circle", ""}, - {CU_PRIM_PATCH|CU_NURBS, "NURBS_SURFACE", ICON_SURFACE_NSURFACE, "NURBS Surface", ""}, - {CU_PRIM_TUBE|CU_NURBS, "NURBS_TUBE", ICON_SURFACE_NTUBE, "NURBS Tube", ""}, - {CU_PRIM_SPHERE|CU_NURBS, "NURBS_SPHERE", ICON_SURFACE_NSPHERE, "NURBS Sphere", ""}, - {CU_PRIM_DONUT|CU_NURBS, "NURBS_DONUT", ICON_SURFACE_NDONUT, "NURBS Donut", ""}, - {0, NULL, 0, NULL, NULL} -}; - -static int object_add_surface_exec(bContext *C, wmOperator *op) -{ - Object *obedit= CTX_data_edit_object(C); - ListBase *editnurb; - Nurb *nu; - int newob= 0; - int enter_editmode; - unsigned int layer; - float loc[3], rot[3]; - float mat[4][4]; - - object_add_generic_invoke_options(C, op); // XXX these props don't get set right when only exec() is called - - if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer)) - return OPERATOR_CANCELLED; - - if(obedit==NULL || obedit->type!=OB_SURF) { - obedit= ED_object_add_type(C, OB_SURF, loc, rot, TRUE, layer); - newob = 1; - } - else DAG_id_flush_update(&obedit->id, OB_RECALC_DATA); - - ED_object_new_primitive_matrix(C, obedit, loc, rot, mat); - - nu= add_nurbs_primitive(C, mat, RNA_enum_get(op->ptr, "type"), newob); - editnurb= curve_get_editcurve(obedit); - BLI_addtail(editnurb, nu); - - /* userdef */ - if (newob && !enter_editmode) { - ED_object_exit_editmode(C, EM_FREEDATA); - } - - WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, obedit); - - return OPERATOR_FINISHED; -} - -void OBJECT_OT_surface_add(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Add Surface"; - ot->description = "Add a surface object to the scene"; - ot->idname= "OBJECT_OT_surface_add"; - - /* api callbacks */ - ot->invoke= WM_menu_invoke; - ot->exec= object_add_surface_exec; - - ot->poll= ED_operator_scene_editable; - - /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - - ot->prop= RNA_def_enum(ot->srna, "type", prop_surface_types, 0, "Primitive", ""); - ED_object_add_generic_props(ot, TRUE); -} - static EnumPropertyItem prop_metaball_types[]= { {MB_BALL, "MBALL_BALL", ICON_META_BALL, "Meta Ball", ""}, {MB_TUBE, "MBALL_TUBE", ICON_META_TUBE, "Meta Tube", ""}, |