Revision: 38367
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38367
Author:   nazgul
Date:     2011-07-13 17:12:49 +0000 (Wed, 13 Jul 2011)
Log Message:
-----------
Merging r38344 through r38366 from soc-2011-tomato into soc-2011-salad

Revision Links:
--------------
    
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38344
    
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38366

Modified Paths:
--------------
    branches/soc-2011-salad/release/scripts/startup/bl_ui/space_clip.py
    branches/soc-2011-salad/source/blender/blenkernel/BKE_object.h
    branches/soc-2011-salad/source/blender/blenkernel/intern/depsgraph.c
    branches/soc-2011-salad/source/blender/blenkernel/intern/object.c
    branches/soc-2011-salad/source/blender/blenkernel/intern/tracking.c
    branches/soc-2011-salad/source/blender/editors/CMakeLists.txt
    branches/soc-2011-salad/source/blender/editors/space_clip/clip_intern.h
    branches/soc-2011-salad/source/blender/editors/space_clip/space_clip.c
    branches/soc-2011-salad/source/blender/editors/space_clip/tracking_ops.c

Property Changed:
----------------
    branches/soc-2011-salad/


Property changes on: branches/soc-2011-salad
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-30783,30792-30793,30797-30798,30815
/branches/soc-2011-carrot:36854,37548,37564,37602,37622,37848,38043,38064,38226,38231,38282
/branches/soc-2011-cucumber:36829-36994
/branches/soc-2011-onion:36833-38309
/branches/soc-2011-pepper:36830-38208
/branches/soc-2011-tomato:36831-38343
/trunk/blender:36834-38365
   + /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-30783,30792-30793,30797-30798,30815
/branches/soc-2011-carrot:36854,37548,37564,37602,37622,37848,38043,38064,38226,38231,38282
/branches/soc-2011-cucumber:36829-36994
/branches/soc-2011-onion:36833-38309
/branches/soc-2011-pepper:36830-38208
/branches/soc-2011-tomato:36831-38366
/trunk/blender:36834-38365

Modified: branches/soc-2011-salad/release/scripts/startup/bl_ui/space_clip.py
===================================================================
--- branches/soc-2011-salad/release/scripts/startup/bl_ui/space_clip.py 
2011-07-13 16:55:57 UTC (rev 38366)
+++ branches/soc-2011-salad/release/scripts/startup/bl_ui/space_clip.py 
2011-07-13 17:12:49 UTC (rev 38367)
@@ -84,12 +84,6 @@
 
         ob = bpy.data.objects.new(name="Bundles", object_data=mesh)
 
-        camera = bpy.context.scene.camera
-        if camera:
-            ob.location = camera.location
-            ob.rotation_quaternion = camera.rotation_quaternion
-            ob.rotation_euler = camera.rotation_euler
-
         bpy.context.scene.objects.link(ob)
 
         return {'FINISHED'}
@@ -183,7 +177,12 @@
 
             col = layout.column(align=True)
             col.label(text="Scene Orientation:")
+            col.operator("clip.set_floor")
             col.operator("clip.set_origin")
+
+            row = col.row()
+            row.operator("clip.set_axis", text="Set X Axis").axis = 'X'
+            row.operator("clip.set_axis", text="Set Y Axis").axis = 'Y'
         else:
             layout.operator('clip.open')
 
@@ -244,7 +243,6 @@
         row.prop(settings, "frames_limit")
 
 
-
 class CLIP_PT_tracking_camera(bpy.types.Panel):
     bl_space_type = 'CLIP_EDITOR'
     bl_region_type = 'UI'

Modified: branches/soc-2011-salad/source/blender/blenkernel/BKE_object.h
===================================================================
--- branches/soc-2011-salad/source/blender/blenkernel/BKE_object.h      
2011-07-13 16:55:57 UTC (rev 38366)
+++ branches/soc-2011-salad/source/blender/blenkernel/BKE_object.h      
2011-07-13 17:12:49 UTC (rev 38367)
@@ -112,6 +112,7 @@
 void where_is_object_time(struct Scene *scene, struct Object *ob, float ctime);
 void where_is_object(struct Scene *scene, struct Object *ob);
 void where_is_object_simul(struct Scene *scene, struct Object *ob);
+void where_is_object_mat(struct Scene *scene, struct Object *ob, float 
obmat[4][4]);
 
 struct BoundBox *unit_boundbox(void);
 void boundbox_set_from_min_max(struct BoundBox *bb, float min[3], float 
max[3]);

Modified: branches/soc-2011-salad/source/blender/blenkernel/intern/depsgraph.c
===================================================================
--- branches/soc-2011-salad/source/blender/blenkernel/intern/depsgraph.c        
2011-07-13 16:55:57 UTC (rev 38366)
+++ branches/soc-2011-salad/source/blender/blenkernel/intern/depsgraph.c        
2011-07-13 17:12:49 UTC (rev 38367)
@@ -645,6 +645,17 @@
 
                /* special case for FollowTrack -- it doesn't use targets to 
define relations */
                if(ELEM(cti->type, CONSTRAINT_TYPE_FOLLOWTRACK, 
CONSTRAINT_TYPE_CAMERASOLVER)) {
+                       if(cti->type==CONSTRAINT_TYPE_FOLLOWTRACK) {
+                               bFollowTrackConstraint *data= 
(bFollowTrackConstraint *)con->data;
+
+                               if(data->reference==FOLLOWTRACK_BUNDLE) {
+                                       if((data->clip || 
data->flag&FOLLOWTRACK_DEFAULTCLIP) && data->track[0]) {
+                                               node2 = dag_get_node(dag, 
scene->camera);
+                                               dag_add_relation(dag, node2, 
node, DAG_RL_DATA_OB|DAG_RL_OB_OB, cti->name);
+                                       }
+                               }
+                       }
+
                        dag_add_relation(dag,scenenode,node,DAG_RL_SCENE, 
"Scene Relation");
                        addtoroot = 0;
                }

Modified: branches/soc-2011-salad/source/blender/blenkernel/intern/object.c
===================================================================
--- branches/soc-2011-salad/source/blender/blenkernel/intern/object.c   
2011-07-13 16:55:57 UTC (rev 38366)
+++ branches/soc-2011-salad/source/blender/blenkernel/intern/object.c   
2011-07-13 17:12:49 UTC (rev 38367)
@@ -2114,6 +2114,39 @@
        else                                                    ob->transflag 
&= ~OB_NEG_SCALE;
 }
 
+/* get object transformation matrix without recalculating dependencies and
+   constraints -- assume dependencies are already solved by depsgraph.
+   no changes to object and it's parent would be done.
+   used for bundles orientation in 3d space relative to parented blender 
camera */
+void where_is_object_mat(Scene *scene, Object *ob, float obmat[4][4])
+{
+       float *fp1, *fp2, slowmat[4][4] = MAT4_UNITY;
+       float fac1, fac2;
+       int a;
+
+       if(ob->parent) {
+               Object *par= ob->parent;
+
+               solve_parenting(scene, ob, par, obmat, slowmat, 1);
+
+               if(ob->partype & PARSLOW) {
+                       // include framerate
+                       fac1= ( 1.0f / (1.0f + 
(float)fabs(give_timeoffset(ob))) );
+                       if(fac1 >= 1.0f) return;
+                       fac2= 1.0f-fac1;
+
+                       fp1= obmat[0];
+                       fp2= slowmat[0];
+                       for(a=0; a<16; a++, fp1++, fp2++) {
+                               fp1[0]= fac1*fp1[0] + fac2*fp2[0];
+                       }
+               }
+       }
+       else {
+               object_to_mat4(ob, obmat);
+       }
+}
+
 static void solve_parenting (Scene *scene, Object *ob, Object *par, float 
obmat[][4], float slowmat[][4], int simul)
 {
        float totmat[4][4];

Modified: branches/soc-2011-salad/source/blender/blenkernel/intern/tracking.c
===================================================================
--- branches/soc-2011-salad/source/blender/blenkernel/intern/tracking.c 
2011-07-13 16:55:57 UTC (rev 38366)
+++ branches/soc-2011-salad/source/blender/blenkernel/intern/tracking.c 
2011-07-13 17:12:49 UTC (rev 38367)
@@ -873,17 +873,13 @@
 
 void BKE_get_tracking_mat(Scene *scene, float mat[4][4])
 {
-       float obmat[4][4];
-
-       unit_m4(obmat);
-
        if(!scene->camera)
                scene->camera= scene_find_camera(scene);
 
        if(scene->camera)
-               object_to_mat4(scene->camera, obmat);
-
-       copy_m4_m4(mat, obmat);
+               where_is_object_mat(scene, scene->camera, mat);
+       else
+               unit_m4(mat);
 }
 
 void BKE_tracking_projection_matrix(MovieTracking *tracking, int framenr, int 
winx, int winy, float mat[4][4])

Modified: branches/soc-2011-salad/source/blender/editors/CMakeLists.txt
===================================================================
--- branches/soc-2011-salad/source/blender/editors/CMakeLists.txt       
2011-07-13 16:55:57 UTC (rev 38366)
+++ branches/soc-2011-salad/source/blender/editors/CMakeLists.txt       
2011-07-13 17:12:49 UTC (rev 38367)
@@ -36,6 +36,7 @@
        add_subdirectory(space_action)
        add_subdirectory(space_api)
        add_subdirectory(space_buttons)
+       add_subdirectory(space_clip)
        add_subdirectory(space_console)
        add_subdirectory(space_file)
        add_subdirectory(space_graph)

Modified: 
branches/soc-2011-salad/source/blender/editors/space_clip/clip_intern.h
===================================================================
--- branches/soc-2011-salad/source/blender/editors/space_clip/clip_intern.h     
2011-07-13 16:55:57 UTC (rev 38366)
+++ branches/soc-2011-salad/source/blender/editors/space_clip/clip_intern.h     
2011-07-13 17:12:49 UTC (rev 38367)
@@ -78,6 +78,8 @@
 void CLIP_OT_hide_tracks_clear(struct wmOperatorType *ot);
 
 void CLIP_OT_set_origin(struct wmOperatorType *ot);
+void CLIP_OT_set_floor(struct wmOperatorType *ot);
+void CLIP_OT_set_axis(struct wmOperatorType *ot);
 
 void CLIP_OT_slide_marker(struct wmOperatorType *ot);
 

Modified: branches/soc-2011-salad/source/blender/editors/space_clip/space_clip.c
===================================================================
--- branches/soc-2011-salad/source/blender/editors/space_clip/space_clip.c      
2011-07-13 16:55:57 UTC (rev 38366)
+++ branches/soc-2011-salad/source/blender/editors/space_clip/space_clip.c      
2011-07-13 17:12:49 UTC (rev 38367)
@@ -212,7 +212,10 @@
        WM_operatortype_append(CLIP_OT_disable_markers);
        WM_operatortype_append(CLIP_OT_hide_tracks);
        WM_operatortype_append(CLIP_OT_hide_tracks_clear);
+
        WM_operatortype_append(CLIP_OT_set_origin);
+       WM_operatortype_append(CLIP_OT_set_floor);
+       WM_operatortype_append(CLIP_OT_set_axis);
 
        WM_operatortype_append(CLIP_OT_clear_track_path);
 

Modified: 
branches/soc-2011-salad/source/blender/editors/space_clip/tracking_ops.c
===================================================================
--- branches/soc-2011-salad/source/blender/editors/space_clip/tracking_ops.c    
2011-07-13 16:55:57 UTC (rev 38366)
+++ branches/soc-2011-salad/source/blender/editors/space_clip/tracking_ops.c    
2011-07-13 17:12:49 UTC (rev 38367)
@@ -46,6 +46,7 @@
 #include "BKE_tracking.h"
 #include "BKE_global.h"
 #include "BKE_depsgraph.h"
+#include "BKE_object.h"
 #include "BKE_report.h"
 #include "BKE_scene.h"
 
@@ -97,25 +98,25 @@
        return 0;
 }
 
-static int space_clip_frame_act_bundle_poll(bContext *C)
+static int space_clip_frame_camera_poll(bContext *C)
 {
-       SpaceClip *sc= CTX_wm_space_clip(C);
+       Scene *scene= CTX_data_scene(C);
 
-       if(sc) {
-               MovieClip *clip= ED_space_clip(sc);
+       if(space_clip_frame_poll(C)) {
+               return scene->camera != NULL;
+       }
 
-               if(clip) {
-                       if (BKE_movieclip_has_frame(clip, &sc->user)) {
-                               int sel_type;
-                               MovieTrackingTrack *sel;
-                               BKE_movieclip_last_selection(clip, &sel_type, 
(void**)&sel);
+       return 0;
+}
 
-                               if(sel_type == MCLIP_SEL_TRACK)
-                                       return sel->flag&TRACK_HAS_BUNDLE;
-                       }
-               }
-       }
+static int space_clip_camera_poll(bContext *C)
+{
+       SpaceClip *sc= CTX_wm_space_clip(C);
+       Scene *scene= CTX_data_scene(C);
 
+       if(sc && sc->clip && scene->camera)
+               return 1;
+
        return 0;
 }
 
@@ -1156,6 +1157,7 @@
        /* flags */
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 
+       /* proeprties */
        RNA_def_enum(ot->srna, "action", clear_path_actions, 
TRACK_CLEAR_REMAINED, "Action", "Clear action to execute");
 
 }
@@ -1216,29 +1218,56 @@
 
 /********************** set origin operator *********************/
 
-static int set_origin_exec(bContext *C, wmOperator *UNUSED(op))
+static int count_selected_bundles(bContext *C)
 {
        SpaceClip *sc= CTX_wm_space_clip(C);
        MovieClip *clip= ED_space_clip(sc);
-       MovieTrackingTrack *sel;
+       MovieTrackingTrack *track;
+       int tot= 0;
+
+       track= clip->tracking.tracks.first;
+       while(track) {
+               if(TRACK_SELECTED(track))

@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to