diff options
Diffstat (limited to 'source/blender/editors/object/object_edit.c')
-rw-r--r-- | source/blender/editors/object/object_edit.c | 137 |
1 files changed, 21 insertions, 116 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 527b97a6082..79cbfb6574b 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -721,7 +721,7 @@ static void spot_interactive(Object *ob, int mode) } #endif -static void special_editmenu(Scene *scene, View3D *v3d) +static void UNUSED_FUNCTION(special_editmenu)(Scene *scene, View3D *v3d) { // XXX static short numcuts= 2; Object *ob= OBACT; @@ -1049,109 +1049,6 @@ static void copymenu_logicbricks(Scene *scene, View3D *v3d, Object *ob) } } -static void copymenu_modifiers(Main *bmain, Scene *scene, View3D *v3d, Object *ob) -{ - Base *base; - int i, event; - char str[512]; - const char *errorstr= NULL; - - strcpy(str, "Copy Modifiers %t"); - - sprintf(str+strlen(str), "|All%%x%d|%%l", NUM_MODIFIER_TYPES); - - for (i=eModifierType_None+1; i<NUM_MODIFIER_TYPES; i++) { - ModifierTypeInfo *mti = modifierType_getInfo(i); - - if(ELEM3(i, eModifierType_Hook, eModifierType_Softbody, eModifierType_ParticleInstance)) continue; - - if(i == eModifierType_Collision) - continue; - - if ( (mti->flags&eModifierTypeFlag_AcceptsCVs) || - (ob->type==OB_MESH && (mti->flags&eModifierTypeFlag_AcceptsMesh))) { - sprintf(str+strlen(str), "|%s%%x%d", mti->name, i); - } - } - - event = pupmenu(str); - if(event<=0) return; - - for (base= FIRSTBASE; base; base= base->next) { - if(base->object != ob) { - if(TESTBASELIB(v3d, base)) { - - base->object->recalc |= OB_RECALC_OB|OB_RECALC_DATA; - - if (base->object->type==ob->type) { - /* copy all */ - if (event==NUM_MODIFIER_TYPES) { - ModifierData *md; - object_free_modifiers(base->object); - - for (md=ob->modifiers.first; md; md=md->next) { - ModifierData *nmd = NULL; - - if(ELEM3(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_ParticleInstance)) continue; - - if(md->type == eModifierType_Collision) - continue; - - nmd = modifier_new(md->type); - modifier_copyData(md, nmd); - BLI_addtail(&base->object->modifiers, nmd); - modifier_unique_name(&base->object->modifiers, nmd); - } - - copy_object_particlesystems(base->object, ob); - copy_object_softbody(base->object, ob); - } else { - /* copy specific types */ - ModifierData *md, *mdn; - - /* remove all with type 'event' */ - for (md=base->object->modifiers.first; md; md=mdn) { - mdn= md->next; - if(md->type==event) { - BLI_remlink(&base->object->modifiers, md); - modifier_free(md); - } - } - - /* copy all with type 'event' */ - for (md=ob->modifiers.first; md; md=md->next) { - if (md->type==event) { - - mdn = modifier_new(event); - BLI_addtail(&base->object->modifiers, mdn); - modifier_unique_name(&base->object->modifiers, mdn); - - modifier_copyData(md, mdn); - } - } - - if(event == eModifierType_ParticleSystem) { - object_free_particlesystems(base->object); - copy_object_particlesystems(base->object, ob); - } - else if(event == eModifierType_Softbody) { - object_free_softbody(base->object); - copy_object_softbody(base->object, ob); - } - } - } - else - errorstr= "Did not copy modifiers to other Object types"; - } - } - } - -// if(errorstr) notice(errorstr); - - DAG_scene_sort(bmain, scene); - -} - /* both pointers should exist */ static void copy_texture_space(Object *to, Object *ob) { @@ -1196,6 +1093,7 @@ static void copy_texture_space(Object *to, Object *ob) } +/* UNUSED, keep incase we want to copy functionality for use elsewhere */ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event) { Object *ob; @@ -1221,7 +1119,8 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event) return; } else if(event==24) { - copymenu_modifiers(bmain, scene, v3d, ob); + /* moved to object_link_modifiers */ + /* copymenu_modifiers(bmain, scene, v3d, ob); */ return; } @@ -1444,7 +1343,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event) DAG_ids_flush_update(bmain, 0); } -static void copy_attr_menu(Main *bmain, Scene *scene, View3D *v3d) +static void UNUSED_FUNCTION(copy_attr_menu)(Main *bmain, Scene *scene, View3D *v3d) { Object *ob; short event; @@ -1512,6 +1411,8 @@ static int forcefield_toggle_exec(bContext *C, wmOperator *UNUSED(op)) else ob->pd->forcefield = 0; + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, NULL); + return OPERATOR_FINISHED; } @@ -1689,7 +1590,7 @@ void OBJECT_OT_shade_flat(wmOperatorType *ot) { /* identifiers */ ot->name= "Shade Flat"; - ot->description= "Display faces 'smooth' (using vertext normals)"; + ot->description= "Display faces 'flat'"; ot->idname= "OBJECT_OT_shade_flat"; /* api callbacks */ @@ -1704,7 +1605,7 @@ void OBJECT_OT_shade_smooth(wmOperatorType *ot) { /* identifiers */ ot->name= "Shade Smooth"; - ot->description= "Display faces 'flat'"; + ot->description= "Display faces 'smooth' (using vertex normals)"; ot->idname= "OBJECT_OT_shade_smooth"; /* api callbacks */ @@ -1717,7 +1618,7 @@ void OBJECT_OT_shade_smooth(wmOperatorType *ot) /* ********************** */ -static void image_aspect(Scene *scene, View3D *v3d) +static void UNUSED_FUNCTION(image_aspect)(Scene *scene, View3D *v3d) { /* all selected objects with an image map: scale in image aspect */ Base *base; @@ -1792,7 +1693,7 @@ static int vergbaseco(const void *a1, const void *a2) } -static void auto_timeoffs(Scene *scene, View3D *v3d) +static void UNUSED_FUNCTION(auto_timeoffs)(Scene *scene, View3D *v3d) { Base *base, **basesort, **bs; float start, delta; @@ -1833,7 +1734,7 @@ static void auto_timeoffs(Scene *scene, View3D *v3d) } -static void ofs_timeoffs(Scene *scene, View3D *v3d) +static void UNUSED_FUNCTION(ofs_timeoffs)(Scene *scene, View3D *v3d) { float offset=0.0f; @@ -1852,7 +1753,7 @@ static void ofs_timeoffs(Scene *scene, View3D *v3d) } -static void rand_timeoffs(Scene *scene, View3D *v3d) +static void UNUSED_FUNCTION(rand_timeoffs)(Scene *scene, View3D *v3d) { Base *base; float rand_ofs=0.0f; @@ -2162,16 +2063,20 @@ static int game_property_copy_exec(bContext *C, wmOperator *op) } CTX_DATA_END; } } - else if (ELEM(type, COPY_PROPERTIES_REPLACE, COPY_PROPERTIES_MERGE)) { + + else { CTX_DATA_BEGIN(C, Object*, ob_iter, selected_editable_objects) { if (ob != ob_iter) { if (ob->data != ob_iter->data){ - if (type == 2) {/* merge */ + if (type == COPY_PROPERTIES_REPLACE) + copy_properties( &ob_iter->prop, &ob->prop ); + + /* merge - the default when calling with no argument */ + else { for(prop = ob->prop.first; prop; prop= prop->next ) { set_ob_property(ob_iter, prop); } - } else /* replace */ - copy_properties( &ob_iter->prop, &ob->prop ); + } } } } |