~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
        ListBaseIterator *internal = iter->internal;
49
49
 
50
50
        /* we are actually iterating a GroupObject list, so override get */
51
 
        return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((GroupObject*)internal->link)->ob);
 
51
        return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((GroupObject *)internal->link)->ob);
52
52
}
53
53
 
54
54
static void rna_Group_objects_link(Group *group, bContext *C, ReportList *reports, Object *object)
55
55
{
56
56
        if (!add_to_group(group, object, CTX_data_scene(C), NULL)) {
57
 
                BKE_reportf(reports, RPT_ERROR, "Object \"%s\" already in group \"%s\"", object->id.name+2, group->id.name+2);
 
57
                BKE_reportf(reports, RPT_ERROR, "Object '%s' already in group '%s'", object->id.name + 2, group->id.name + 2);
58
58
                return;
59
59
        }
60
60
 
61
 
        WM_main_add_notifier(NC_OBJECT|ND_DRAW, &object->id);
 
61
        WM_main_add_notifier(NC_OBJECT | ND_DRAW, &object->id);
62
62
}
63
63
 
64
64
static void rna_Group_objects_unlink(Group *group, bContext *C, ReportList *reports, Object *object)
65
65
{
66
66
        if (!rem_from_group(group, object, CTX_data_scene(C), NULL)) {
67
 
                BKE_reportf(reports, RPT_ERROR, "Object \"%s\" not in group \"%s\"", object->id.name+2, group->id.name+2);
 
67
                BKE_reportf(reports, RPT_ERROR, "Object '%s' not in group '%s'", object->id.name + 2, group->id.name + 2);
68
68
                return;
69
69
        }
70
70
 
71
 
        WM_main_add_notifier(NC_OBJECT|ND_DRAW, &object->id);
 
71
        WM_main_add_notifier(NC_OBJECT | ND_DRAW, &object->id);
72
72
}
73
73
 
74
74
#else
89
89
 
90
90
        /* add object */
91
91
        func = RNA_def_function(srna, "link", "rna_Group_objects_link");
92
 
        RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
 
92
        RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
93
93
        RNA_def_function_ui_description(func, "Add this object to a group");
94
94
        /* object to add */
95
95
        parm = RNA_def_pointer(func, "object", "Object", "", "Object to add");
96
 
        RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
 
96
        RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
97
97
 
98
98
        /* remove object */
99
99
        func = RNA_def_function(srna, "unlink", "rna_Group_objects_unlink");
100
100
        RNA_def_function_ui_description(func, "Remove this object to a group");
101
 
        RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
 
101
        RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
102
102
        /* object to remove */
103
103
        parm = RNA_def_pointer(func, "object", "Object", "", "Object to remove");
104
104
        RNA_def_property_flag(parm, PROP_REQUIRED);
113
113
        srna = RNA_def_struct(brna, "Group", "ID");
114
114
        RNA_def_struct_ui_text(srna, "Group", "Group of Object datablocks");
115
115
        RNA_def_struct_ui_icon(srna, ICON_GROUP);
116
 
                /* this is done on save/load in readfile.c, removed if no objects are in the group */
 
116
        /* this is done on save/load in readfile.c, removed if no objects are in the group */
117
117
        RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT);
118
118
 
119
119
        prop = RNA_def_property(srna, "dupli_offset", PROP_FLOAT, PROP_TRANSLATION);