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

« back to all changes in this revision

Viewing changes to source/blender/editors/transform/transform_generics.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:
1052
1052
        t->ar = ar;
1053
1053
        t->obedit = obedit;
1054
1054
        t->settings = ts;
 
1055
        t->reports = op ? op->reports : NULL;
1055
1056
 
1056
1057
        if (obedit) {
1057
1058
                copy_m3_m4(t->obedit_mat, obedit->obmat);
1104
1105
                t->options |= CTX_EDGE;
1105
1106
        }
1106
1107
 
 
1108
        t->remove_on_cancel = false;
 
1109
 
 
1110
        if (op && (prop = RNA_struct_find_property(op->ptr, "remove_on_cancel")) && RNA_property_is_set(op->ptr, prop)) {
 
1111
                if (RNA_property_boolean_get(op->ptr, prop)) {
 
1112
                        t->remove_on_cancel = true;
 
1113
                }
 
1114
        }
1107
1115
 
1108
1116
        /* Assign the space type, some exceptions for running in different mode */
1109
1117
        if (sa == NULL) {
1511
1519
        
1512
1520
        if (t->spacetype == SPACE_IMAGE) {
1513
1521
                SpaceImage *sima = (SpaceImage *)t->sa->spacedata.first;
1514
 
                /* only space supported right now but may change */
1515
1522
                if (t->options & CTX_MASK) {
1516
1523
                        ED_space_image_get_aspect(sima, &aspx, &aspy);
1517
1524
                }
1520
1527
                }
1521
1528
                cursor = sima->cursor;
1522
1529
        }
 
1530
        else if (t->spacetype == SPACE_CLIP) {
 
1531
                SpaceClip *space_clip = (SpaceClip *) t->sa->spacedata.first;
 
1532
                if (t->options & CTX_MOVIECLIP) {
 
1533
                        ED_space_clip_get_aspect_dimension_aware(space_clip, &aspx, &aspy);
 
1534
                }
 
1535
                else {
 
1536
                        ED_space_clip_get_aspect(space_clip, &aspx, &aspy);
 
1537
                }
 
1538
                cursor = space_clip->cursor;
 
1539
        }
1523
1540
        
1524
1541
        if (cursor) {
1525
1542
                if (t->options & CTX_MASK) {
1526
1543
                        float co[2];
1527
1544
                        float frame_size[2];
1528
 
                        SpaceImage *sima = (SpaceImage *)t->sa->spacedata.first;
1529
 
                        ED_space_image_get_size_fl(sima, frame_size);
1530
 
 
1531
 
                        BKE_mask_coord_from_frame(co, cursor, frame_size);
1532
 
 
1533
 
                        ED_space_image_get_aspect(sima, &aspx, &aspy);
 
1545
 
 
1546
                        if (t->spacetype == SPACE_IMAGE) {
 
1547
                                SpaceImage *sima = (SpaceImage *)t->sa->spacedata.first;
 
1548
                                ED_space_image_get_size_fl(sima, frame_size);
 
1549
                                BKE_mask_coord_from_frame(co, cursor, frame_size);
 
1550
                                ED_space_image_get_aspect(sima, &aspx, &aspy);
 
1551
                        }
 
1552
                        else if (t->spacetype == SPACE_CLIP) {
 
1553
                                SpaceClip *space_clip = (SpaceClip *) t->sa->spacedata.first;
 
1554
                                ED_space_clip_get_size_fl(space_clip, frame_size);
 
1555
                                BKE_mask_coord_from_frame(co, cursor, frame_size);
 
1556
                                ED_space_clip_get_aspect(space_clip, &aspx, &aspy);
 
1557
                        }
 
1558
                        else {
 
1559
                                BLI_assert(!"Shall not happen");
 
1560
                        }
1534
1561
 
1535
1562
                        t->center[0] = co[0] * aspx;
1536
1563
                        t->center[1] = co[1] * aspy;
1609
1636
                        calculateCenterMedian(t);
1610
1637
                        break;
1611
1638
                case V3D_CURSOR:
1612
 
                        if (t->spacetype == SPACE_IMAGE)
 
1639
                        if (ELEM(t->spacetype, SPACE_IMAGE, SPACE_CLIP))
1613
1640
                                calculateCenterCursor2D(t);
1614
1641
                        else if (t->spacetype == SPACE_IPO)
1615
1642
                                calculateCenterCursorGraph2D(t);
1667
1694
                                        projectIntView(t, t->center, t->center2d);
1668
1695
                                }
1669
1696
                        }
1670
 
                
 
1697
                        break;
1671
1698
                }
1672
1699
        }
1673
1700
        
1803
1830
                                                break;
1804
1831
                                        default:
1805
1832
                                                td->factor = 1;
 
1833
                                                break;
1806
1834
                                }
1807
1835
                        }
1808
1836
                }
1830
1858
                                break;
1831
1859
                        default:
1832
1860
                                t->proptext[0] = '\0';
 
1861
                                break;
1833
1862
                }
1834
1863
        }
1835
1864
        else {