Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_select.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c45
1 files changed, 44 insertions, 1 deletions
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index 94d3469dc8c..0163c29c9aa 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -42,6 +42,7 @@
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
+#include "DNA_tracking_types.h"
#include "MEM_guardedalloc.h"
@@ -60,6 +61,9 @@
#include "BKE_context.h"
#include "BKE_paint.h"
#include "BKE_armature.h"
+#include "BKE_movieclip.h"
+#include "BKE_object.h"
+#include "BKE_tracking.h"
#include "BIF_gl.h"
@@ -1373,6 +1377,7 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short obce
if(hits>0) {
int has_bones= 0;
+ /* note: bundles are handling in the same way as bones */
for(a=0; a<hits; a++) if(buffer[4*a+3] & 0xFFFF0000) has_bones= 1;
/* note; shift+alt goes to group-flush-selecting */
@@ -1383,7 +1388,45 @@ static int mouse_select(bContext *C, const int mval[2], short extend, short obce
}
if(has_bones && basact) {
- if(ED_do_pose_selectbuffer(scene, basact, buffer, hits, extend) ) { /* then bone is found */
+ if(basact->object->type==OB_CAMERA) {
+ if(BASACT==basact) {
+ int i, hitresult;
+ MovieTrackingTrack *track;
+
+ for (i=0; i< hits; i++) {
+ hitresult= buffer[3+(i*4)];
+
+ /* if there's bundles in buffer select bundles first,
+ so non-camera elements should be ignored in buffer */
+ if(basact->selcol != (hitresult & 0xFFFF))
+ continue;
+
+ /* index of bundle is 1<<16-based. if there's no "bone" index
+ in hight word, this buffer value belongs to camera,. not to bundle */
+ if(buffer[4*i+3] & 0xFFFF0000) {
+ MovieClip *clip= object_get_movieclip(scene, basact->object, 0);
+ int selected;
+ track= BKE_tracking_indexed_track(&clip->tracking, hitresult >> 16);
+
+ selected= (track->flag&SELECT) || (track->pat_flag&SELECT) || (track->search_flag&SELECT);
+
+ if(selected && extend) BKE_tracking_deselect_track(track, TRACK_AREA_ALL);
+ else BKE_tracking_select_track(&clip->tracking, track, TRACK_AREA_ALL, extend);
+
+ basact->flag|= SELECT;
+ basact->object->flag= basact->flag;
+
+ retval= 1;
+
+ WM_event_add_notifier(C, NC_MOVIECLIP|ND_SELECT, track);
+ WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
+
+ break;
+ }
+ }
+ }
+ }
+ else if(ED_do_pose_selectbuffer(scene, basact, buffer, hits, extend) ) { /* then bone is found */
/* we make the armature selected:
not-selected active object in posemode won't work well for tools */