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:
authorCampbell Barton <ideasman42@gmail.com>2011-11-08 06:57:28 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-11-08 06:57:28 +0400
commitcb890a49fbd653c71d2fe639265a1a562136113f (patch)
tree10ddd1f7198c85408f83794fe560caa9512e2a2e /source/blender/editors/space_view3d/view3d_select.c
parentaea95c78606a99b0fa9c4c29c9e922e4a03f2a69 (diff)
parentf086201518b85f6dd2ae60ae37dc14f1d1406c01 (diff)
svn merge ^/trunk/blender -r41602:41638 .
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 d719ac188e5..29c7f2cc7fd 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"
@@ -61,6 +62,9 @@
#include "BKE_paint.h"
#include "BKE_armature.h"
#include "BKE_tessmesh.h"
+#include "BKE_movieclip.h"
+#include "BKE_object.h"
+#include "BKE_tracking.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
@@ -1380,6 +1384,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 */
@@ -1390,7 +1395,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 */