~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to source/blender/editors/space_outliner/outliner_edit.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:
227
227
                BKE_report(reports, RPT_WARNING, "Cannot edit sequence name");
228
228
        }
229
229
        else if (tselem->id->lib) {
230
 
                // XXX                                          error_libdata();
 
230
                BKE_report(reports, RPT_WARNING, "Cannot edit external libdata");
231
231
        }
232
232
        else if (te->idcode == ID_LI && te->parent) {
233
233
                BKE_report(reports, RPT_WARNING, "Cannot edit the path of an indirectly linked library");
618
618
        te = outliner_find_id(so, &so->tree, (ID *)OBACT);
619
619
        if (te) {
620
620
                /* make te->ys center of view */
621
 
                ytop = (int)(te->ys + BLI_rcti_size_y(&v2d->mask) / 2);
 
621
                ytop = te->ys + BLI_rcti_size_y(&v2d->mask) / 2;
622
622
                if (ytop > 0) ytop = 0;
623
623
                
624
624
                v2d->cur.ymax = (float)ytop;
984
984
 * NOTE: the caller must zero-out all values of the pointers that it passes here first, as
985
985
 * this function does not do that yet 
986
986
 */
987
 
static void tree_element_to_path(SpaceOops *soops, TreeElement *te, TreeStoreElem *tselem, 
 
987
static void tree_element_to_path(TreeElement *te, TreeStoreElem *tselem,
988
988
                                 ID **id, char **path, int *array_index, short *flag, short *UNUSED(groupmode))
989
989
{
990
990
        ListBase hierarchy = {NULL, NULL};
1102
1102
                        /* item is part of an array, so must set the array_index */
1103
1103
                        *array_index = te->index;
1104
1104
                }
1105
 
                else if (RNA_property_array_length(ptr, prop)) {
 
1105
                else if (RNA_property_array_check(prop)) {
1106
1106
                        /* entire array was selected, so keyframe all */
1107
1107
                        *flag |= KSP_FLAG_WHOLE_ARRAY;
1108
1108
                }
1152
1152
                            RNA_property_animateable(&te->rnaptr, te->directdata))
1153
1153
                        {
1154
1154
                                /* get id + path + index info from the selected element */
1155
 
                                tree_element_to_path(soops, te, tselem, 
 
1155
                                tree_element_to_path(te, tselem,
1156
1156
                                                     &id, &path, &array_index, &flag, &groupmode);
1157
1157
                        }
1158
1158
                        
1181
1181
                                                {
1182
1182
                                                        /* add a new driver with the information obtained (only if valid) */
1183
1183
                                                        ANIM_add_driver(reports, id, path, array_index, dflags, DRIVER_TYPE_PYTHON);
 
1184
                                                        break;
1184
1185
                                                }
1185
 
                                                break;
1186
1186
                                                case DRIVERS_EDITMODE_REMOVE:
1187
1187
                                                {
1188
1188
                                                        /* remove driver matching the information obtained (only if valid) */
1189
1189
                                                        ANIM_remove_driver(reports, id, path, array_index, dflags);
 
1190
                                                        break;
1190
1191
                                                }
1191
 
                                                break;
1192
1192
                                        }
1193
1193
                                }
1194
1194
                                
1333
1333
                            RNA_property_animateable(&te->rnaptr, te->directdata))
1334
1334
                        {
1335
1335
                                /* get id + path + index info from the selected element */
1336
 
                                tree_element_to_path(soops, te, tselem, 
 
1336
                                tree_element_to_path(te, tselem,
1337
1337
                                                     &id, &path, &array_index, &flag, &groupmode);
1338
1338
                        }
1339
1339
                        
1469
1469
        RNA_string_get(op->ptr, "child", childname);
1470
1470
        ob = (Object *)BKE_libblock_find_name(ID_OB, childname);
1471
1471
 
1472
 
        ED_object_parent_set(op->reports, bmain, scene, ob, par, partype, FALSE, FALSE);
 
1472
        ED_object_parent_set(op->reports, bmain, scene, ob, par, partype, false, false, NULL);
1473
1473
 
1474
1474
        DAG_relations_tag_update(bmain);
1475
1475
        WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
1525
1525
                }
1526
1526
 
1527
1527
                if ((par->type != OB_ARMATURE) && (par->type != OB_CURVE) && (par->type != OB_LATTICE)) {
1528
 
                        if (ED_object_parent_set(op->reports, bmain, scene, ob, par, partype, FALSE, FALSE)) {
 
1528
                        if (ED_object_parent_set(op->reports, bmain, scene, ob, par, partype, false, false, NULL)) {
1529
1529
                                DAG_relations_tag_update(bmain);
1530
1530
                                WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
1531
1531
                                WM_event_add_notifier(C, NC_OBJECT | ND_PARENT, NULL);
1648
1648
        RNA_def_enum(ot->srna, "type", prop_make_parent_types, 0, "Type", "");
1649
1649
}
1650
1650
 
 
1651
static int outliner_parenting_poll(bContext *C)
 
1652
{
 
1653
        SpaceOops *soops = CTX_wm_space_outliner(C);
 
1654
 
 
1655
        if (soops) {
 
1656
                return ELEM4(soops->outlinevis, SO_ALL_SCENES, SO_CUR_SCENE, SO_VISIBLE, SO_GROUPS);
 
1657
        }
 
1658
 
 
1659
        return FALSE;
 
1660
}
 
1661
 
1651
1662
static int parent_clear_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
1652
1663
{
1653
1664
        Main *bmain = CTX_data_main(C);
1654
 
        Scene *scene = NULL;
1655
1665
        Object *ob = NULL;
1656
1666
        SpaceOops *soops = CTX_wm_space_outliner(C);
1657
 
        TreeElement *te;
1658
1667
        char obname[MAX_ID_NAME];
1659
1668
 
1660
1669
        RNA_string_get(op->ptr, "dragged_obj", obname);
1661
1670
        ob = (Object *)BKE_libblock_find_name(ID_OB, obname);
1662
1671
 
1663
1672
        /* search forwards to find the object */
1664
 
        te = outliner_find_id(soops, &soops->tree, (ID *)ob);
1665
 
        /* then search backwards to get the scene */
1666
 
        scene = (Scene *)outliner_search_back(soops, te, ID_SCE);
1667
 
 
1668
 
        if (scene == NULL) {
1669
 
                return OPERATOR_CANCELLED;
1670
 
        }
 
1673
        outliner_find_id(soops, &soops->tree, (ID *)ob);
1671
1674
 
1672
1675
        ED_object_parent_clear(ob, RNA_enum_get(op->ptr, "type"));
1673
1676
 
1687
1690
        /* api callbacks */
1688
1691
        ot->invoke = parent_clear_invoke;
1689
1692
 
1690
 
        ot->poll = ED_operator_outliner_active;
 
1693
        ot->poll = outliner_parenting_poll;
1691
1694
 
1692
1695
        /* flags */
1693
1696
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;