diff options
Diffstat (limited to 'source/blender/editors/object/object_relations.c')
-rw-r--r-- | source/blender/editors/object/object_relations.c | 43 |
1 files changed, 31 insertions, 12 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index f7158e4b4ec..e9418ca9f9f 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -45,6 +45,7 @@ #include "DNA_meta_types.h" #include "DNA_particle_types.h" #include "DNA_scene_types.h" +#include "DNA_speaker_types.h" #include "DNA_world_types.h" #include "DNA_object_types.h" @@ -75,6 +76,7 @@ #include "BKE_report.h" #include "BKE_sca.h" #include "BKE_scene.h" +#include "BKE_speaker.h" #include "BKE_texture.h" #include "WM_api.h" @@ -446,6 +448,7 @@ static int parent_clear_exec(bContext *C, wmOperator *op) DAG_scene_sort(bmain, scene); DAG_ids_flush_update(bmain, 0); WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); + WM_event_add_notifier(C, NC_OBJECT|ND_PARENT, NULL); return OPERATOR_FINISHED; } @@ -970,8 +973,8 @@ static int track_set_exec(bContext *C, wmOperator *op) data->tar = obact; ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME; - /* Lamp and Camera track differently by default */ - if (ob->type == OB_LAMP || ob->type == OB_CAMERA) + /* Lamp, Camera and Speaker track differently by default */ + if (ob->type == OB_LAMP || ob->type == OB_CAMERA || ob->type == OB_SPEAKER) data->trackflag = TRACK_nZ; } } @@ -989,8 +992,8 @@ static int track_set_exec(bContext *C, wmOperator *op) data->tar = obact; ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME; - /* Lamp and Camera track differently by default */ - if (ob->type == OB_LAMP || ob->type == OB_CAMERA) { + /* Lamp, Camera and Speaker track differently by default */ + if (ob->type == OB_LAMP || ob->type == OB_CAMERA || ob->type == OB_SPEAKER) { data->reserved1 = TRACK_nZ; data->reserved2 = UP_Y; } @@ -1010,8 +1013,8 @@ static int track_set_exec(bContext *C, wmOperator *op) data->tar = obact; ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME; - /* Lamp and Camera track differently by default */ - if (ob->type == OB_LAMP || ob->type == OB_CAMERA) { + /* Lamp, Camera and Speaker track differently by default */ + if (ob->type == OB_LAMP || ob->type == OB_CAMERA || ob->type == OB_SPEAKER) { data->trackflag = TRACK_nZ; data->lockflag = LOCK_Y; } @@ -1095,7 +1098,7 @@ static int move_to_layer_exec(bContext *C, wmOperator *op) Scene *scene= CTX_data_scene(C); View3D *v3d= CTX_wm_view3d(C); unsigned int lay, local; - int islamp= 0; + /* int islamp= 0; */ /* UNUSED */ lay= move_to_layer_init(C, op); lay &= 0xFFFFFF; @@ -1111,7 +1114,7 @@ static int move_to_layer_exec(bContext *C, wmOperator *op) base->object->lay= lay; base->object->flag &= ~SELECT; base->flag &= ~SELECT; - if(base->object->type==OB_LAMP) islamp= 1; + /* if(base->object->type==OB_LAMP) islamp= 1; */ } CTX_DATA_END; } @@ -1123,12 +1126,10 @@ static int move_to_layer_exec(bContext *C, wmOperator *op) local= base->lay & 0xFF000000; base->lay= lay + local; base->object->lay= lay; - if(base->object->type==OB_LAMP) islamp= 1; + /* if(base->object->type==OB_LAMP) islamp= 1; */ } CTX_DATA_END; } - - if(islamp) reshadeall_displist(scene); /* only frees */ /* warning, active object may be hidden now */ @@ -1320,7 +1321,7 @@ void OBJECT_OT_make_links_scene(wmOperatorType *ot) /* identifiers */ ot->name= "Link Objects to Scene"; - ot->description = "Make linked data local to each object"; + ot->description = "Link selection to another scene"; ot->idname= "OBJECT_OT_make_links_scene"; /* api callbacks */ @@ -1403,6 +1404,20 @@ static void single_object_users(Scene *scene, View3D *v3d, int flag) set_sca_new_poins(); } +/* not an especially efficient function, only added so the single user + * button can be functional.*/ +void ED_object_single_user(Scene *scene, Object *ob) +{ + Base *base; + + for(base= FIRSTBASE; base; base= base->next) { + if(base->object == ob) base->flag |= OB_DONE; + else base->flag &= ~OB_DONE; + } + + single_object_users(scene, NULL, OB_DONE); +} + static void new_id_matar(Material **matar, int totcol) { ID *id; @@ -1482,6 +1497,9 @@ static void single_obdata_users(Main *bmain, Scene *scene, int flag) ob->data= copy_armature(ob->data); armature_rebuild_pose(ob, ob->data); break; + case OB_SPEAKER: + ob->data= copy_speaker(ob->data); + break; default: if (G.f & G_DEBUG) printf("ERROR single_obdata_users: can't copy %s\n", id->name); @@ -1661,6 +1679,7 @@ void ED_object_single_users(Main *bmain, Scene *scene, int full) if(full) { single_obdata_users(bmain, scene, 0); + single_object_action_users(scene, 0); single_mat_users_expand(bmain); single_tex_users_expand(bmain); } |