~ubuntu-branches/ubuntu/utopic/blender/utopic-proposed

« back to all changes in this revision

Viewing changes to source/blender/makesrna/intern/rna_mask.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-02-19 11:24:23 UTC
  • mfrom: (14.2.23 sid)
  • Revision ID: package-import@ubuntu.com-20140219112423-rkmaz2m7ha06d4tk
Tags: 2.69-3ubuntu1
* Merge with Debian; remaining changes:
  - Configure without OpenImageIO on armhf, as it is not available on
    Ubuntu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
                        MovieTrackingObject *object = BKE_tracking_object_get_named(tracking, parent->parent);
85
85
 
86
86
                        if (object) {
87
 
                                MovieTrackingTrack *track = BKE_tracking_track_get_named(tracking, object, parent->sub_parent);
88
 
 
89
 
                                if (track) {
90
 
                                        int clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, scene->r.cfra);
91
 
                                        MovieTrackingMarker *marker = BKE_tracking_marker_get(track, clip_framenr);
92
 
                                        float marker_pos_ofs[2], parmask_pos[2];
93
 
                                        MovieClipUser user = {0};
94
 
 
95
 
                                        BKE_movieclip_user_set_frame(&user, scene->r.cfra);
96
 
 
97
 
                                        add_v2_v2v2(marker_pos_ofs, marker->pos, track->offset);
98
 
 
99
 
                                        BKE_mask_coord_from_movieclip(clip, &user, parmask_pos, marker_pos_ofs);
100
 
 
101
 
                                        copy_v2_v2(parent->parent_orig, parmask_pos);
 
87
                                int clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, scene->r.cfra);
 
88
 
 
89
                                if (parent->type == MASK_PARENT_POINT_TRACK) {
 
90
                                        MovieTrackingTrack *track = BKE_tracking_track_get_named(tracking, object, parent->sub_parent);
 
91
 
 
92
                                        if (track) {
 
93
                                                MovieTrackingMarker *marker = BKE_tracking_marker_get(track, clip_framenr);
 
94
                                                float marker_pos_ofs[2], parmask_pos[2];
 
95
                                                MovieClipUser user = {0};
 
96
 
 
97
                                                BKE_movieclip_user_set_frame(&user, scene->r.cfra);
 
98
 
 
99
                                                add_v2_v2v2(marker_pos_ofs, marker->pos, track->offset);
 
100
 
 
101
                                                BKE_mask_coord_from_movieclip(clip, &user, parmask_pos, marker_pos_ofs);
 
102
 
 
103
                                                copy_v2_v2(parent->parent_orig, parmask_pos);
 
104
                                        }
 
105
                                }
 
106
                                else /* if (parent->type == MASK_PARENT_PLANE_TRACK) */ {
 
107
                                        MovieTrackingPlaneTrack *plane_track = BKE_tracking_plane_track_get_named(tracking, object, parent->sub_parent);
 
108
                                        if (plane_track) {
 
109
                                                MovieTrackingPlaneMarker *plane_marker = BKE_tracking_plane_marker_get(plane_track, clip_framenr);
 
110
 
 
111
                                                memcpy(parent->parent_corners_orig, plane_marker->corners, sizeof(parent->parent_corners_orig));
 
112
                                                zero_v2(parent->parent_orig);
 
113
                                        }
102
114
                                }
103
115
                        }
104
116
                }
504
516
}
505
517
 
506
518
#else
507
 
 void rna_def_maskParent(BlenderRNA *brna)
 
519
static void rna_def_maskParent(BlenderRNA *brna)
508
520
{
509
521
        StructRNA *srna;
510
522
        PropertyRNA *prop;
513
525
                {ID_MC, "MOVIECLIP", ICON_SEQUENCE, "Movie Clip", ""},
514
526
                {0, NULL, 0, NULL, NULL}};
515
527
 
 
528
        static EnumPropertyItem parent_type_items[] = {
 
529
                {MASK_PARENT_POINT_TRACK, "POINT_TRACK", 0, "Point Track", ""},
 
530
                {MASK_PARENT_PLANE_TRACK, "PLANE_TRACK", 0, "Plane Track", ""},
 
531
                {0, NULL, 0, NULL, NULL}};
 
532
 
516
533
        srna = RNA_def_struct(brna, "MaskParent", NULL);
517
534
        RNA_def_struct_ui_text(srna, "Mask Parent", "Parenting settings for masking element");
518
535
 
535
552
        RNA_def_property_ui_text(prop, "ID Type", "Type of ID-block that can be used");
536
553
        RNA_def_property_update(prop, 0, "rna_Mask_update_parent");
537
554
 
 
555
        /* type */
 
556
        prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
 
557
        RNA_def_property_enum_items(prop, parent_type_items);
 
558
        RNA_def_property_ui_text(prop, "Parent Type", "Parent Type");
 
559
        RNA_def_property_update(prop, 0, "rna_Mask_update_parent");
 
560
 
538
561
        /* parent */
539
562
        prop = RNA_def_property(srna, "parent", PROP_STRING, PROP_NONE);
540
563
        RNA_def_property_ui_text(prop, "Parent", "Name of parent object in specified data block to which parenting happens");
804
827
 
805
828
        /* splines */
806
829
        prop = RNA_def_property(srna, "splines", PROP_COLLECTION, PROP_NONE);
807
 
        RNA_def_property_collection_funcs(prop, "rna_MaskLayer_splines_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0);
 
830
        RNA_def_property_collection_funcs(prop, "rna_MaskLayer_splines_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
808
831
        RNA_def_property_struct_type(prop, "MaskSpline");
809
832
        RNA_def_property_ui_text(prop, "Splines", "Collection of splines which defines this layer");
810
833
        RNA_def_property_srna(prop, "MaskSplines");
914
937
 
915
938
        /* mask layers */
916
939
        prop = RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
917
 
        RNA_def_property_collection_funcs(prop, "rna_Mask_layers_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0);
 
940
        RNA_def_property_collection_funcs(prop, "rna_Mask_layers_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL);
918
941
        RNA_def_property_struct_type(prop, "MaskLayer");
919
942
        RNA_def_property_ui_text(prop, "Layers", "Collection of layers which defines this mask");
920
943
        rna_def_masklayers(brna, prop);