Merging trunk up to r38932.
[blender.git] / source / blender / editors / object / object_relations.c
index 0fb7cf8..ce1f47c 100644 (file)
@@ -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"
 
@@ -971,8 +972,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;
                        }
                }
@@ -990,8 +991,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;
                                }
@@ -1011,8 +1012,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;
                                }
@@ -1481,6 +1482,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);