diff options
Diffstat (limited to 'source/blender/editors')
54 files changed, 193 insertions, 191 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 1649744ba8d..d80b96f0d74 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -4847,7 +4847,7 @@ void ANIM_channel_draw_widgets(const bContext *C, /* step 4) draw text - check if renaming widget is in use... */ if (is_being_renamed) { - PointerRNA ptr = {{NULL}}; + PointerRNA ptr = {NULL}; PropertyRNA *prop = NULL; /* draw renaming widget if we can get RNA pointer for it diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c index fad9a1a8e49..5b729c856c0 100644 --- a/source/blender/editors/animation/anim_ipo_utils.c +++ b/source/blender/editors/animation/anim_ipo_utils.c @@ -122,7 +122,7 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu) MEM_freeN(constName); } } - else if (ptr.data != ptr.id.data) { + else if (ptr.data != ptr.owner_id) { PropertyRNA *nameprop = RNA_struct_name_property(ptr.type); if (nameprop) { /* this gets a string which will need to be freed */ diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index e341a16378c..7b9e6a10f44 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -934,7 +934,7 @@ static const EnumPropertyItem *driver_mapping_type_itemsf(bContext *C, EnumPropertyItem *input = prop_driver_create_mapping_types; EnumPropertyItem *item = NULL; - PointerRNA ptr = {{NULL}}; + PointerRNA ptr = {NULL}; PropertyRNA *prop = NULL; int index; @@ -946,7 +946,7 @@ static const EnumPropertyItem *driver_mapping_type_itemsf(bContext *C, UI_context_active_but_prop_get(C, &ptr, &prop, &index); - if (ptr.id.data && ptr.data && prop && RNA_property_animateable(&ptr, prop)) { + if (ptr.owner_id && ptr.data && prop && RNA_property_animateable(&ptr, prop)) { const bool is_array = RNA_property_array_check(prop); while (input->identifier) { @@ -971,7 +971,7 @@ static const EnumPropertyItem *driver_mapping_type_itemsf(bContext *C, static bool add_driver_button_poll(bContext *C) { - PointerRNA ptr = {{NULL}}; + PointerRNA ptr = {NULL}; PropertyRNA *prop = NULL; int index; bool driven, special; @@ -979,7 +979,7 @@ static bool add_driver_button_poll(bContext *C) /* this operator can only run if there's a property button active, and it can be animated */ UI_context_active_but_prop_get(C, &ptr, &prop, &index); - if (!(ptr.id.data && ptr.data && prop)) { + if (!(ptr.owner_id && ptr.data && prop)) { return false; } if (!RNA_property_animateable(&ptr, prop)) { @@ -995,7 +995,7 @@ static bool add_driver_button_poll(bContext *C) * (i.e. "manual/add later"). */ static int add_driver_button_none(bContext *C, wmOperator *op, short mapping_type) { - PointerRNA ptr = {{NULL}}; + PointerRNA ptr = {NULL}; PropertyRNA *prop = NULL; int index; int success = 0; @@ -1006,12 +1006,13 @@ static int add_driver_button_none(bContext *C, wmOperator *op, short mapping_typ index = -1; } - if (ptr.id.data && ptr.data && prop && RNA_property_animateable(&ptr, prop)) { + if (ptr.owner_id && ptr.data && prop && RNA_property_animateable(&ptr, prop)) { char *path = BKE_animdata_driver_path_hack(C, &ptr, prop, NULL); short flags = CREATEDRIVER_WITH_DEFAULT_DVAR; if (path) { - success += ANIM_add_driver(op->reports, ptr.id.data, path, index, flags, DRIVER_TYPE_PYTHON); + success += ANIM_add_driver( + op->reports, ptr.owner_id, path, index, flags, DRIVER_TYPE_PYTHON); MEM_freeN(path); } } @@ -1095,28 +1096,29 @@ static void UNUSED_FUNCTION(ANIM_OT_driver_button_add_menu)(wmOperatorType *ot) static int add_driver_button_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { - PointerRNA ptr = {{NULL}}; + PointerRNA ptr = {NULL}; PropertyRNA *prop = NULL; int index; /* try to find driver using property retrieved from UI */ UI_context_active_but_prop_get(C, &ptr, &prop, &index); - if (ptr.id.data && ptr.data && prop && RNA_property_animateable(&ptr, prop)) { + if (ptr.owner_id && ptr.data && prop && RNA_property_animateable(&ptr, prop)) { /* 1) Create a new "empty" driver for this property */ char *path = BKE_animdata_driver_path_hack(C, &ptr, prop, NULL); short flags = CREATEDRIVER_WITH_DEFAULT_DVAR; short success = 0; if (path) { - success += ANIM_add_driver(op->reports, ptr.id.data, path, index, flags, DRIVER_TYPE_PYTHON); + success += ANIM_add_driver( + op->reports, ptr.owner_id, path, index, flags, DRIVER_TYPE_PYTHON); MEM_freeN(path); } if (success) { /* send updates */ UI_context_update_anim_flag(C); - DEG_id_tag_update(ptr.id.data, ID_RECALC_COPY_ON_WRITE); + DEG_id_tag_update(ptr.owner_id, ID_RECALC_COPY_ON_WRITE); DEG_relations_tag_update(CTX_data_main(C)); WM_event_add_notifier(C, NC_ANIMATION | ND_FCURVES_ORDER, NULL); } @@ -1149,7 +1151,7 @@ void ANIM_OT_driver_button_add(wmOperatorType *ot) static int remove_driver_button_exec(bContext *C, wmOperator *op) { - PointerRNA ptr = {{NULL}}; + PointerRNA ptr = {NULL}; PropertyRNA *prop = NULL; short success = 0; int index; @@ -1162,11 +1164,11 @@ static int remove_driver_button_exec(bContext *C, wmOperator *op) index = -1; } - if (ptr.id.data && ptr.data && prop) { + if (ptr.owner_id && ptr.data && prop) { char *path = BKE_animdata_driver_path_hack(C, &ptr, prop, NULL); if (path) { - success = ANIM_remove_driver(op->reports, ptr.id.data, path, index, 0); + success = ANIM_remove_driver(op->reports, ptr.owner_id, path, index, 0); MEM_freeN(path); } @@ -1205,14 +1207,14 @@ void ANIM_OT_driver_button_remove(wmOperatorType *ot) static int edit_driver_button_exec(bContext *C, wmOperator *op) { - PointerRNA ptr = {{NULL}}; + PointerRNA ptr = {NULL}; PropertyRNA *prop = NULL; int index; /* try to find driver using property retrieved from UI */ UI_context_active_but_prop_get(C, &ptr, &prop, &index); - if (ptr.id.data && ptr.data && prop) { + if (ptr.owner_id && ptr.data && prop) { UI_popover_panel_invoke(C, "GRAPH_PT_drivers_popover", true, op->reports); } @@ -1239,7 +1241,7 @@ void ANIM_OT_driver_button_edit(wmOperatorType *ot) static int copy_driver_button_exec(bContext *C, wmOperator *op) { - PointerRNA ptr = {{NULL}}; + PointerRNA ptr = {NULL}; PropertyRNA *prop = NULL; short success = 0; int index; @@ -1247,12 +1249,12 @@ static int copy_driver_button_exec(bContext *C, wmOperator *op) /* try to create driver using property retrieved from UI */ UI_context_active_but_prop_get(C, &ptr, &prop, &index); - if (ptr.id.data && ptr.data && prop && RNA_property_animateable(&ptr, prop)) { + if (ptr.owner_id && ptr.data && prop && RNA_property_animateable(&ptr, prop)) { char *path = BKE_animdata_driver_path_hack(C, &ptr, prop, NULL); if (path) { /* only copy the driver for the button that this was involved for */ - success = ANIM_copy_driver(op->reports, ptr.id.data, path, index, 0); + success = ANIM_copy_driver(op->reports, ptr.owner_id, path, index, 0); UI_context_update_anim_flag(C); @@ -1283,7 +1285,7 @@ void ANIM_OT_copy_driver_button(wmOperatorType *ot) static int paste_driver_button_exec(bContext *C, wmOperator *op) { - PointerRNA ptr = {{NULL}}; + PointerRNA ptr = {NULL}; PropertyRNA *prop = NULL; short success = 0; int index; @@ -1291,18 +1293,18 @@ static int paste_driver_button_exec(bContext *C, wmOperator *op) /* try to create driver using property retrieved from UI */ UI_context_active_but_prop_get(C, &ptr, &prop, &index); - if (ptr.id.data && ptr.data && prop && RNA_property_animateable(&ptr, prop)) { + if (ptr.owner_id && ptr.data && prop && RNA_property_animateable(&ptr, prop)) { char *path = BKE_animdata_driver_path_hack(C, &ptr, prop, NULL); if (path) { /* only copy the driver for the button that this was involved for */ - success = ANIM_paste_driver(op->reports, ptr.id.data, path, index, 0); + success = ANIM_paste_driver(op->reports, ptr.owner_id, path, index, 0); UI_context_update_anim_flag(C); DEG_relations_tag_update(CTX_data_main(C)); - DEG_id_tag_update(ptr.id.data, ID_RECALC_ANIMATION); + DEG_id_tag_update(ptr.owner_id, ID_RECALC_ANIMATION); WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME_PROP, NULL); // XXX diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 7fd2338dbf3..0f8b8742659 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -222,7 +222,7 @@ FCurve *verify_fcurve(Main *bmain, /* sync bone group colors if applicable */ if (ptr && (ptr->type == &RNA_PoseBone)) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bPoseChannel *pchan = (bPoseChannel *)ptr->data; bPose *pose = ob->pose; bActionGroup *grp; @@ -286,7 +286,7 @@ void update_autoflags_fcurve(FCurve *fcu, bContext *C, ReportList *reports, Poin PropertyRNA *prop; int old_flag = fcu->flag; - if ((ptr->id.data == NULL) && (ptr->data == NULL)) { + if ((ptr->owner_id == NULL) && (ptr->data == NULL)) { BKE_report(reports, RPT_ERROR, "No RNA pointer available to retrieve values for this fcurve"); return; } @@ -294,7 +294,7 @@ void update_autoflags_fcurve(FCurve *fcu, bContext *C, ReportList *reports, Poin /* try to get property we should be affecting */ if (RNA_path_resolve_property(ptr, fcu->rna_path, &tmp_ptr, &prop) == false) { /* property not found... */ - const char *idname = (ptr->id.data) ? ((ID *)ptr->id.data)->name : TIP_("<No ID pointer>"); + const char *idname = (ptr->owner_id) ? ptr->owner_id->name : TIP_("<No ID pointer>"); BKE_reportf(reports, RPT_ERROR, @@ -1203,7 +1203,7 @@ bool insert_keyframe_direct(ReportList *reports, } /* if no property given yet, try to validate from F-Curve info */ - if ((ptr.id.data == NULL) && (ptr.data == NULL)) { + if ((ptr.owner_id == NULL) && (ptr.data == NULL)) { BKE_report( reports, RPT_ERROR, "No RNA pointer available to retrieve values for keyframing from"); return false; @@ -1214,7 +1214,7 @@ bool insert_keyframe_direct(ReportList *reports, /* try to get property we should be affecting */ if (RNA_path_resolve_property(&ptr, fcu->rna_path, &tmp_ptr, &prop) == false) { /* property not found... */ - const char *idname = (ptr.id.data) ? ((ID *)ptr.id.data)->name : TIP_("<No ID pointer>"); + const char *idname = (ptr.owner_id) ? ptr.owner_id->name : TIP_("<No ID pointer>"); BKE_reportf(reports, RPT_ERROR, @@ -2350,7 +2350,7 @@ static int insert_key_button_exec(bContext *C, wmOperator *op) Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); ToolSettings *ts = scene->toolsettings; - PointerRNA ptr = {{NULL}}; + PointerRNA ptr = {NULL}; PropertyRNA *prop = NULL; char *path; uiBut *but; @@ -2369,7 +2369,7 @@ static int insert_key_button_exec(bContext *C, wmOperator *op) return (OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH); } - if ((ptr.id.data && ptr.data && prop) && RNA_property_animateable(&ptr, prop)) { + if ((ptr.owner_id && ptr.data && prop) && RNA_property_animateable(&ptr, prop)) { if (ptr.type == &RNA_NlaStrip) { /* Handle special properties for NLA Strips, whose F-Curves are stored on the * strips themselves. These are stored separately or else the properties will @@ -2435,7 +2435,7 @@ static int insert_key_button_exec(bContext *C, wmOperator *op) success = insert_keyframe(bmain, op->reports, - ptr.id.data, + ptr.owner_id, NULL, group, path, @@ -2473,7 +2473,7 @@ static int insert_key_button_exec(bContext *C, wmOperator *op) } if (success) { - ID *id = ptr.id.data; + ID *id = ptr.owner_id; AnimData *adt = BKE_animdata_from_id(id); if (adt->action != NULL) { DEG_id_tag_update(&adt->action->id, ID_RECALC_ANIMATION_NO_FLUSH); @@ -2513,7 +2513,7 @@ void ANIM_OT_keyframe_insert_button(wmOperatorType *ot) static int delete_key_button_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); - PointerRNA ptr = {{NULL}}; + PointerRNA ptr = {NULL}; PropertyRNA *prop = NULL; Main *bmain = CTX_data_main(C); char *path; @@ -2528,13 +2528,13 @@ static int delete_key_button_exec(bContext *C, wmOperator *op) return (OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH); } - if (ptr.id.data && ptr.data && prop) { + if (ptr.owner_id && ptr.data && prop) { if (BKE_nlastrip_has_curves_for_property(&ptr, prop)) { /* Handle special properties for NLA Strips, whose F-Curves are stored on the * strips themselves. These are stored separately or else the properties will * not have any effect. */ - ID *id = ptr.id.data; + ID *id = ptr.owner_id; NlaStrip *strip = (NlaStrip *)ptr.data; FCurve *fcu = list_find_fcurve(&strip->fcurves, RNA_property_identifier(prop), 0); @@ -2577,7 +2577,7 @@ static int delete_key_button_exec(bContext *C, wmOperator *op) } success = delete_keyframe( - bmain, op->reports, ptr.id.data, NULL, NULL, path, index, cfra, 0); + bmain, op->reports, ptr.owner_id, NULL, NULL, path, index, cfra, 0); MEM_freeN(path); } else if (G.debug & G_DEBUG) { @@ -2622,7 +2622,7 @@ void ANIM_OT_keyframe_delete_button(wmOperatorType *ot) static int clear_key_button_exec(bContext *C, wmOperator *op) { - PointerRNA ptr = {{NULL}}; + PointerRNA ptr = {NULL}; PropertyRNA *prop = NULL; Main *bmain = CTX_data_main(C); char *path; @@ -2636,7 +2636,7 @@ static int clear_key_button_exec(bContext *C, wmOperator *op) return (OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH); } - if (ptr.id.data && ptr.data && prop) { + if (ptr.owner_id && ptr.data && prop) { path = RNA_path_from_ID_to_property(&ptr, prop); if (path) { @@ -2645,7 +2645,7 @@ static int clear_key_button_exec(bContext *C, wmOperator *op) index = -1; } - success += clear_keyframe(bmain, op->reports, ptr.id.data, NULL, NULL, path, index, 0); + success += clear_keyframe(bmain, op->reports, ptr.owner_id, NULL, NULL, path, index, 0); MEM_freeN(path); } else if (G.debug & G_DEBUG) { diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 7d31c6d3e3a..258c0e4f1f6 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -287,7 +287,7 @@ static int add_keyingset_button_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); KeyingSet *ks = NULL; PropertyRNA *prop = NULL; - PointerRNA ptr = {{NULL}}; + PointerRNA ptr = {NULL}; char *path = NULL; short success = 0; int index = 0, pflag = 0; @@ -332,7 +332,7 @@ static int add_keyingset_button_exec(bContext *C, wmOperator *op) } /* check if property is able to be added */ - if (ptr.id.data && ptr.data && prop && RNA_property_animateable(&ptr, prop)) { + if (ptr.owner_id && ptr.data && prop && RNA_property_animateable(&ptr, prop)) { path = RNA_path_from_ID_to_property(&ptr, prop); if (path) { @@ -348,7 +348,7 @@ static int add_keyingset_button_exec(bContext *C, wmOperator *op) } /* add path to this setting */ - BKE_keyingset_add_path(ks, ptr.id.data, NULL, path, index, pflag, KSP_GROUP_KSNAME); + BKE_keyingset_add_path(ks, ptr.owner_id, NULL, path, index, pflag, KSP_GROUP_KSNAME); ks->active_path = BLI_listbase_count(&ks->paths); success = 1; @@ -393,7 +393,7 @@ static int remove_keyingset_button_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); KeyingSet *ks = NULL; PropertyRNA *prop = NULL; - PointerRNA ptr = {{NULL}}; + PointerRNA ptr = {NULL}; char *path = NULL; short success = 0; int index = 0; @@ -420,14 +420,14 @@ static int remove_keyingset_button_exec(bContext *C, wmOperator *op) ks = BLI_findlink(&scene->keyingsets, scene->active_keyingset - 1); } - if (ptr.id.data && ptr.data && prop) { + if (ptr.owner_id && ptr.data && prop) { path = RNA_path_from_ID_to_property(&ptr, prop); if (path) { KS_Path *ksp; /* try to find a path matching this description */ - ksp = BKE_keyingset_find_path(ks, ptr.id.data, ks->name, path, index, KSP_GROUP_KSNAME); + ksp = BKE_keyingset_find_path(ks, ptr.owner_id, ks->name, path, index, KSP_GROUP_KSNAME); if (ksp) { BKE_keyingset_free_path(ks, ksp); diff --git a/source/blender/editors/armature/pose_select.c b/source/blender/editors/armature/pose_select.c index beec2f8358f..a59067e60c1 100644 --- a/source/blender/editors/armature/pose_select.c +++ b/source/blender/editors/armature/pose_select.c @@ -807,7 +807,7 @@ static bool pose_select_same_group(bContext *C, bool extend) group_flags = NULL; ob_index = -1; ob_prev = NULL; - CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, visible_pose_bones, Object, *ob) { + CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, visible_pose_bones, Object *, ob) { if (ob != ob_prev) { ob_index++; group_flags = group_flags_array + (ob_index * groups_len); diff --git a/source/blender/editors/armature/pose_slide.c b/source/blender/editors/armature/pose_slide.c index c8e79b879a4..6274eb549da 100644 --- a/source/blender/editors/armature/pose_slide.c +++ b/source/blender/editors/armature/pose_slide.c @@ -442,7 +442,7 @@ static void pose_slide_apply_props(tPoseSlideOp *pso, tPChanFCurveLink *pfl, const char prop_prefix[]) { - PointerRNA ptr = {{NULL}}; + PointerRNA ptr = {NULL}; LinkData *ld; int len = strlen(pfl->pchan_path); diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index f0c1abff201..9973c50c270 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -2031,7 +2031,7 @@ static int open_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event) if (pprop->prop) { idptr = RNA_property_pointer_get((PointerRNA *)pprop, pprop->prop); - vfont = idptr.id.data; + vfont = (VFont *)idptr.owner_id; } path = (vfont && !BKE_vfont_is_builtin(vfont)) ? vfont->name : U.fontdir; diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c index 696c98c6646..e4d6a3e983d 100644 --- a/source/blender/editors/gpencil/gpencil_data.c +++ b/source/blender/editors/gpencil/gpencil_data.c @@ -105,7 +105,7 @@ static bool gp_data_add_poll(bContext *C) /* add new datablock - wrapper around API */ static int gp_data_add_exec(bContext *C, wmOperator *op) { - PointerRNA gpd_owner = {{NULL}}; + PointerRNA gpd_owner = {NULL}; bGPdata **gpd_ptr = ED_gpencil_data_get_pointers(C, &gpd_owner); bool is_annotation = ED_gpencil_data_owner_is_annotation(&gpd_owner); @@ -231,7 +231,7 @@ void GPENCIL_OT_data_unlink(wmOperatorType *ot) /* add new layer - wrapper around API */ static int gp_layer_add_exec(bContext *C, wmOperator *op) { - PointerRNA gpd_owner = {{NULL}}; + PointerRNA gpd_owner = {NULL}; bGPdata **gpd_ptr = ED_gpencil_data_get_pointers(C, &gpd_owner); bool is_annotation = ED_gpencil_data_owner_is_annotation(&gpd_owner); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 7a123599be5..66c8eadbd74 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -908,12 +908,12 @@ void UI_but_execute(const bContext *C, ARegion *ar, uiBut *but) * returns false if undo needs to be disabled. */ static bool ui_but_is_rna_undo(const uiBut *but) { - if (but->rnapoin.id.data) { + if (but->rnapoin.owner_id) { /* avoid undo push for buttons who's ID are screen or wm level * we could disable undo for buttons with no ID too but may have * unforeseen consequences, so best check for ID's we _know_ are not * handled by undo - campbell */ - ID *id = but->rnapoin.id.data; + ID *id = but->rnapoin.owner_id; if (ID_CHECK_UNDO(id) == false) { return false; } @@ -1226,8 +1226,8 @@ static bool ui_but_event_property_operator_string(const bContext *C, */ char *data_path = NULL; - if (ptr->id.data) { - ID *id = ptr->id.data; + if (ptr->owner_id) { + ID *id = ptr->owner_id; if (GS(id->name) == ID_SCR) { /* screen/editor property @@ -1731,7 +1731,7 @@ static void ui_block_message_subscribe(ARegion *ar, struct wmMsgBus *mbus, uiBlo if ((but_prev && (but_prev->rnaprop == but->rnaprop) && (but_prev->rnapoin.type == but->rnapoin.type) && (but_prev->rnapoin.data == but->rnapoin.data) && - (but_prev->rnapoin.id.data == but->rnapoin.id.data)) == false) { + (but_prev->rnapoin.owner_id == but->rnapoin.owner_id)) == false) { /* TODO: could make this into utility function. */ WM_msg_subscribe_rna(mbus, &but->rnapoin, @@ -2055,7 +2055,7 @@ bool ui_but_is_compatible(const uiBut *but_a, const uiBut *but_b) } if (but_a->rnaprop) { - /* skip 'rnapoin.data', 'rnapoin.id.data' + /* skip 'rnapoin.data', 'rnapoin.owner_id' * allow different data to have the same props edited at once */ if (but_a->rnapoin.type != but_b->rnapoin.type) { return false; @@ -2479,7 +2479,7 @@ void ui_but_string_get_ex(uiBut *but, /* uiBut.custom_data points to data this tab represents (e.g. workspace). * uiBut.rnapoin/prop store an active value (e.g. active workspace). */ - RNA_pointer_create(but->rnapoin.id.data, ptr_type, but->custom_data, &ptr); + RNA_pointer_create(but->rnapoin.owner_id, ptr_type, but->custom_data, &ptr); buf = RNA_struct_name_get_alloc(&ptr, str, maxlen, &buf_len); } else if (type == PROP_STRING) { @@ -2822,7 +2822,7 @@ bool ui_but_string_set(bContext *C, uiBut *but, const char *str) /* uiBut.custom_data points to data this tab represents (e.g. workspace). * uiBut.rnapoin/prop store an active value (e.g. active workspace). */ - RNA_pointer_create(but->rnapoin.id.data, ptr_type, but->custom_data, &ptr); + RNA_pointer_create(but->rnapoin.owner_id, ptr_type, but->custom_data, &ptr); prop = RNA_struct_name_property(ptr_type); if (RNA_property_editable(&ptr, prop)) { RNA_property_string_set(&ptr, prop, str); diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c index 4d87cc22ef2..168c6051327 100644 --- a/source/blender/editors/interface/interface_anim.c +++ b/source/blender/editors/interface/interface_anim.c @@ -228,7 +228,7 @@ bool ui_but_anim_expression_create(uiBut *but, const char *str) /* make sure we have animdata for this */ /* FIXME: until materials can be handled by depsgraph, * don't allow drivers to be created for them */ - id = (ID *)but->rnapoin.id.data; + id = but->rnapoin.owner_id; if ((id == NULL) || (GS(id->name) == ID_MA) || (GS(id->name) == ID_TE)) { if (G.debug & G_DEBUG) { printf("ERROR: create expression failed - invalid data-block for adding drivers (%p)\n", id); @@ -314,7 +314,7 @@ void ui_but_anim_autokey(bContext *C, uiBut *but, Scene *scene, float cfra) } } else { - id = but->rnapoin.id.data; + id = but->rnapoin.owner_id; /* TODO: this should probably respect the keyingset only option for anim */ if (autokeyframe_cfra_can_key(scene, id)) { diff --git a/source/blender/editors/interface/interface_context_menu.c b/source/blender/editors/interface/interface_context_menu.c index 22b75da4968..56d4cab202c 100644 --- a/source/blender/editors/interface/interface_context_menu.c +++ b/source/blender/editors/interface/interface_context_menu.c @@ -904,7 +904,7 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but) ICON_NONE, "UI_OT_copy_data_path_button"); - if (ptr->id.data && !is_whole_array && + if (ptr->owner_id && !is_whole_array && ELEM(type, PROP_BOOLEAN, PROP_INT, PROP_FLOAT, PROP_ENUM)) { uiItemO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Copy As New Driver"), diff --git a/source/blender/editors/interface/interface_eyedropper_datablock.c b/source/blender/editors/interface/interface_eyedropper_datablock.c index efbe5922aa5..336fae45895 100644 --- a/source/blender/editors/interface/interface_eyedropper_datablock.c +++ b/source/blender/editors/interface/interface_eyedropper_datablock.c @@ -118,7 +118,7 @@ static int datadropper_init(bContext *C, wmOperator *op) ddr->idcode_name = TIP_(BKE_idcode_to_name(ddr->idcode)); PointerRNA ptr = RNA_property_pointer_get(&ddr->ptr, ddr->prop); - ddr->init_id = ptr.id.data; + ddr->init_id = ptr.owner_id; return true; } @@ -222,7 +222,7 @@ static bool datadropper_id_set(bContext *C, DataDropper *ddr, ID *id) ptr_value = RNA_property_pointer_get(&ddr->ptr, ddr->prop); - return (ptr_value.id.data == id); + return (ptr_value.owner_id == id); } /* single point sample & set */ diff --git a/source/blender/editors/interface/interface_eyedropper_driver.c b/source/blender/editors/interface/interface_eyedropper_driver.c index c1aee190cd3..e6fc52bc3bc 100644 --- a/source/blender/editors/interface/interface_eyedropper_driver.c +++ b/source/blender/editors/interface/interface_eyedropper_driver.c @@ -116,10 +116,10 @@ static void driverdropper_sample(bContext *C, wmOperator *op, const wmEvent *eve /* Now create driver(s) */ if (target_path && dst_path) { int success = ANIM_add_driver_with_target(op->reports, - ddr->ptr.id.data, + ddr->ptr.owner_id, dst_path, ddr->index, - target_ptr->id.data, + target_ptr->owner_id, target_path, target_index, flag, @@ -130,7 +130,7 @@ static void driverdropper_sample(bContext *C, wmOperator *op, const wmEvent *eve /* send updates */ UI_context_update_anim_flag(C); DEG_relations_tag_update(CTX_data_main(C)); - DEG_id_tag_update(ddr->ptr.id.data, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); + DEG_id_tag_update(ddr->ptr.owner_id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); WM_event_add_notifier(C, NC_ANIMATION | ND_FCURVES_ORDER, NULL); // XXX } } diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 04b91b12027..13bfaa95077 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -757,7 +757,7 @@ static void ui_apply_but_undo(uiBut *but) } /* Optionally override undo when undo system doesn't support storing properties. */ - if (but->rnapoin.id.data) { + if (but->rnapoin.owner_id) { /* Exception for renaming ID data, we always need undo pushes in this case, * because undo systems track data by their ID, see: T67002. */ extern PropertyRNA rna_ID_name; @@ -765,7 +765,7 @@ static void ui_apply_but_undo(uiBut *but) /* pass */ } else { - ID *id = but->rnapoin.id.data; + ID *id = but->rnapoin.owner_id; if (!ED_undo_is_legacy_compatible_for_property(but->block->evil_C, id)) { str = ""; } @@ -1558,7 +1558,7 @@ static bool ui_selectcontext_begin(bContext *C, uiBut *but, uiSelectContextStore if (use_path_from_id) { /* Path relative to ID. */ lprop = NULL; - RNA_id_pointer_create(link->ptr.id.data, &idptr); + RNA_id_pointer_create(link->ptr.owner_id, &idptr); RNA_path_resolve_property(&idptr, path, &lptr, &lprop); } else if (path) { @@ -5488,7 +5488,7 @@ static bool ui_numedit_but_UNITVEC( static void ui_palette_set_active(uiBut *but) { if ((int)(but->a1) == UI_PALETTE_COLOR) { - Palette *palette = but->rnapoin.id.data; + Palette *palette = (Palette *)but->rnapoin.owner_id; PaletteColor *color = but->rnapoin.data; palette->active_color = BLI_findindex(&palette->colors, color); } @@ -5551,7 +5551,7 @@ static int ui_do_but_COLOR(bContext *C, uiBut *but, uiHandleButtonData *data, co } else if ((int)(but->a1) == UI_PALETTE_COLOR && event->type == DELKEY && event->val == KM_PRESS) { - Palette *palette = but->rnapoin.id.data; + Palette *palette = (Palette *)but->rnapoin.owner_id; PaletteColor *color = but->rnapoin.data; BKE_palette_color_remove(palette, color); diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 2a9c5c7352a..1674374396f 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -2137,7 +2137,7 @@ int UI_rnaptr_icon_get(bContext *C, PointerRNA *ptr, int rnaicon, const bool big /* try ID, material, texture or dynapaint slot */ if (RNA_struct_is_ID(ptr->type)) { - id = ptr->id.data; + id = ptr->owner_id; } else if (RNA_struct_is_a(ptr->type, &RNA_MaterialSlot)) { id = RNA_pointer_get(ptr, "material").data; diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index e9b9411e1bd..85c7af26b72 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -1873,7 +1873,7 @@ void uiItemFullR(uiLayout *layout, uiBut *but; } ui_decorate = { .use_prop_decorate = (((layout->item.flag & UI_ITEM_PROP_DECORATE) != 0) && - (use_prop_sep && ptr->id.data && id_can_have_animdata(ptr->id.data))), + (use_prop_sep && ptr->owner_id && id_can_have_animdata(ptr->owner_id))), }; #endif /* UI_PROP_DECORATE */ @@ -2946,7 +2946,7 @@ void uiItemLDrag(uiLayout *layout, PointerRNA *ptr, const char *name, int icon) if (ptr && ptr->type) { if (RNA_struct_is_ID(ptr->type)) { - UI_but_drag_set_id(but, ptr->id.data); + UI_but_drag_set_id(but, ptr->owner_id); } } } diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index c7ce66cfcf6..819ec4fc2d3 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -86,7 +86,7 @@ static bool copy_data_path_button_poll(bContext *C) UI_context_active_but_prop_get(C, &ptr, &prop, &index); - if (ptr.id.data && ptr.data && prop) { + if (ptr.owner_id && ptr.data && prop) { path = RNA_path_from_ID_to_property(&ptr, prop); if (path) { @@ -110,7 +110,7 @@ static int copy_data_path_button_exec(bContext *C, wmOperator *op) /* try to create driver using property retrieved from UI */ UI_context_active_but_prop_get(C, &ptr, &prop, &index); - if (ptr.id.data != NULL) { + if (ptr.owner_id != NULL) { if (full_path) { @@ -171,7 +171,7 @@ static bool copy_as_driver_button_poll(bContext *C) UI_context_active_but_prop_get(C, &ptr, &prop, &index); - if (ptr.id.data && ptr.data && prop && + if (ptr.owner_id && ptr.data && prop && ELEM(RNA_property_type(prop), PROP_BOOLEAN, PROP_INT, PROP_FLOAT, PROP_ENUM) && (index >= 0 || !RNA_property_array_check(prop))) { path = RNA_path_from_ID_to_property(&ptr, prop); @@ -194,12 +194,12 @@ static int copy_as_driver_button_exec(bContext *C, wmOperator *UNUSED(op)) /* try to create driver using property retrieved from UI */ UI_context_active_but_prop_get(C, &ptr, &prop, &index); - if (ptr.id.data && ptr.data && prop) { + if (ptr.owner_id && ptr.data && prop) { int dim = RNA_property_array_dimension(&ptr, prop, NULL); char *path = RNA_path_from_ID_to_property_index(&ptr, prop, dim, index); if (path) { - ANIM_copy_as_driver(ptr.id.data, path, RNA_property_identifier(prop)); + ANIM_copy_as_driver(ptr.owner_id, path, RNA_property_identifier(prop)); MEM_freeN(path); return OPERATOR_FINISHED; } @@ -287,7 +287,7 @@ static void UI_OT_copy_python_command_button(wmOperatorType *ot) static int operator_button_property_finish(bContext *C, PointerRNA *ptr, PropertyRNA *prop) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; /* perform updates required for this property */ RNA_property_update(C, ptr, prop); @@ -542,7 +542,7 @@ static int override_type_set_button_exec(bContext *C, wmOperator *op) /* try to reset the nominated setting to its default value */ UI_context_active_but_prop_get(C, &ptr, &prop, &index); - BLI_assert(ptr.id.data != NULL); + BLI_assert(ptr.owner_id != NULL); if (all) { index = -1; @@ -605,7 +605,7 @@ static bool override_remove_button_poll(bContext *C) const int override_status = RNA_property_override_library_status(&ptr, prop, index); - return (ptr.data && ptr.id.data && prop && (override_status & RNA_OVERRIDE_STATUS_OVERRIDDEN)); + return (ptr.data && ptr.owner_id && prop && (override_status & RNA_OVERRIDE_STATUS_OVERRIDDEN)); } static int override_remove_button_exec(bContext *C, wmOperator *op) @@ -619,7 +619,7 @@ static int override_remove_button_exec(bContext *C, wmOperator *op) /* try to reset the nominated setting to its default value */ UI_context_active_but_prop_get(C, &ptr, &prop, &index); - ID *id = ptr.id.data; + ID *id = ptr.owner_id; IDOverrideLibraryProperty *oprop = RNA_property_override_property_find(&ptr, prop); BLI_assert(oprop != NULL); BLI_assert(id != NULL && id->override_library != NULL); @@ -720,7 +720,7 @@ bool UI_context_copy_to_selected_list(bContext *C, CollectionPointerLink *link; for (link = lb.first; link; link = link->next) { bPoseChannel *pchan = link->ptr.data; - RNA_pointer_create(link->ptr.id.data, &RNA_Bone, pchan->bone, &link->ptr); + RNA_pointer_create(link->ptr.owner_id, &RNA_Bone, pchan->bone, &link->ptr); } } @@ -739,7 +739,7 @@ bool UI_context_copy_to_selected_list(bContext *C, /* Get the node we're editing */ if (RNA_struct_is_a(ptr->type, &RNA_NodeSocket)) { - bNodeTree *ntree = ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; bNodeSocket *sock = ptr->data; if (nodeFindNode(ntree, sock, &node, NULL)) { if ((path = RNA_path_resolve_from_type_to_property(ptr, prop, &RNA_Node)) != NULL) { @@ -773,8 +773,8 @@ bool UI_context_copy_to_selected_list(bContext *C, *r_lb = lb; *r_path = path; } - else if (ptr->id.data) { - ID *id = ptr->id.data; + else if (ptr->owner_id) { + ID *id = ptr->owner_id; if (GS(id->name) == ID_OB) { *r_lb = CTX_data_collection_get(C, "selected_editable_objects"); @@ -792,7 +792,7 @@ bool UI_context_copy_to_selected_list(bContext *C, CollectionPointerLink *link, *link_next; for (link = lb.first; link; link = link->next) { - Object *ob = link->ptr.id.data; + Object *ob = (Object *)link->ptr.owner_id; if (ob->data) { ID *id_data = ob->data; id_data->tag |= LIB_TAG_DOIT; @@ -800,7 +800,7 @@ bool UI_context_copy_to_selected_list(bContext *C, } for (link = lb.first; link; link = link_next) { - Object *ob = link->ptr.id.data; + Object *ob = (Object *)link->ptr.owner_id; ID *id_data = ob->data; link_next = link->next; @@ -872,7 +872,7 @@ static bool copy_to_selected_button(bContext *C, bool all, bool poll) if (use_path_from_id) { /* Path relative to ID. */ lprop = NULL; - RNA_id_pointer_create(link->ptr.id.data, &idptr); + RNA_id_pointer_create(link->ptr.owner_id, &idptr); RNA_path_resolve_property(&idptr, path, &lptr, &lprop); } else if (path) { @@ -982,12 +982,12 @@ static bool jump_to_target_ptr(bContext *C, PointerRNA ptr, const bool poll) /* Find the containing Object. */ ViewLayer *view_layer = CTX_data_view_layer(C); Base *base = NULL; - const short id_type = GS(((ID *)ptr.id.data)->name); + const short id_type = GS(ptr.owner_id->name); if (id_type == ID_OB) { - base = BKE_view_layer_base_find(view_layer, ptr.id.data); + base = BKE_view_layer_base_find(view_layer, (Object *)ptr.owner_id); } else if (OB_DATA_SUPPORT_ID(id_type)) { - base = ED_object_find_first_by_data_id(view_layer, ptr.id.data); + base = ED_object_find_first_by_data_id(view_layer, ptr.owner_id); } bool ok = false; diff --git a/source/blender/editors/interface/interface_region_tooltip.c b/source/blender/editors/interface/interface_region_tooltip.c index 6aad9e41e7d..f2ca9cebf7b 100644 --- a/source/blender/editors/interface/interface_region_tooltip.c +++ b/source/blender/editors/interface/interface_region_tooltip.c @@ -765,8 +765,8 @@ static uiTooltipData *ui_tooltip_data_from_button(bContext *C, uiBut *but) } } - if (but->rnapoin.id.data) { - const ID *id = but->rnapoin.id.data; + if (but->rnapoin.owner_id) { + const ID *id = but->rnapoin.owner_id; if (ID_IS_LINKED(id)) { uiTooltipField *field = text_field_add(data, &(uiTooltipFormat){ @@ -847,7 +847,7 @@ static uiTooltipData *ui_tooltip_data_from_button(bContext *C, uiBut *but) } } - if (but->rnapoin.id.data) { + if (but->rnapoin.owner_id) { uiTooltipField *field = text_field_add(data, &(uiTooltipFormat){ .style = UI_TIP_STYLE_MONO, diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 27e7601a2b8..1c6618bc509 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -121,7 +121,7 @@ static void template_add_button_search_menu(const bContext *C, { PointerRNA active_ptr = RNA_property_pointer_get(ptr, prop); ID *id = (active_ptr.data && RNA_struct_is_ID(active_ptr.type)) ? active_ptr.data : NULL; - const ID *idfrom = ptr->id.data; + const ID *idfrom = ptr->owner_id; const StructRNA *type = active_ptr.type ? active_ptr.type : RNA_property_pointer_type(ptr, prop); uiBut *but; @@ -310,7 +310,7 @@ static bool id_search_add(const bContext *C, uiSearchItems *items, ID *id) { - ID *id_from = template_ui->ptr.id.data; + ID *id_from = template_ui->ptr.owner_id; if (!((flag & PROP_ID_SELF_CHECK) && id == id_from)) { @@ -401,7 +401,7 @@ static void id_search_cb_objects_from_scene(const bContext *C, TemplateID *template_ui = (TemplateID *)arg_template; ListBase *lb = template_ui->idlb; Scene *scene = NULL; - ID *id_from = template_ui->ptr.id.data; + ID *id_from = template_ui->ptr.owner_id; if (id_from && GS(id_from->name) == ID_SCE) { scene = (Scene *)id_from; @@ -667,7 +667,7 @@ static uiBut *template_id_def_new_but(uiBlock *block, const bool use_tab_but, int but_height) { - ID *idfrom = template_ui->ptr.id.data; + ID *idfrom = template_ui->ptr.owner_id; uiBut *but; const int w = id ? UI_UNIT_X : id_open ? UI_UNIT_X * 3 : UI_UNIT_X * 6; const int but_type = use_tab_but ? UI_BTYPE_TAB : UI_BTYPE_BUT; @@ -769,7 +769,7 @@ static void template_ID(bContext *C, idptr = RNA_property_pointer_get(&template_ui->ptr, template_ui->prop); id = idptr.data; - idfrom = template_ui->ptr.id.data; + idfrom = template_ui->ptr.owner_id; // lb = template_ui->idlb; block = uiLayoutGetBlock(layout); @@ -2037,7 +2037,7 @@ uiLayout *uiTemplateModifier(uiLayout *layout, bContext *C, PointerRNA *ptr) return NULL; } - ob = ptr->id.data; + ob = (Object *)ptr->owner_id; md = ptr->data; if (!ob || !(GS(ob->id.name) == ID_OB)) { @@ -2179,7 +2179,7 @@ uiLayout *uiTemplateGpencilModifier(uiLayout *layout, bContext *UNUSED(C), Point return NULL; } - ob = ptr->id.data; + ob = (Object *)ptr->owner_id; md = ptr->data; if (!ob || !(GS(ob->id.name) == ID_OB)) { @@ -2297,7 +2297,7 @@ uiLayout *uiTemplateShaderFx(uiLayout *layout, bContext *UNUSED(C), PointerRNA * return NULL; } - ob = ptr->id.data; + ob = (Object *)ptr->owner_id; fx = ptr->data; if (!ob || !(GS(ob->id.name) == ID_OB)) { @@ -2579,7 +2579,7 @@ uiLayout *uiTemplateConstraint(uiLayout *layout, PointerRNA *ptr) return NULL; } - ob = ptr->id.data; + ob = (Object *)ptr->owner_id; con = ptr->data; if (!ob || !(GS(ob->id.name) == ID_OB)) { @@ -3098,7 +3098,7 @@ static void colorband_buttons_layout(uiLayout *layout, float ys = butr->ymin; PointerRNA ptr; - RNA_pointer_create(cb->ptr.id.data, &RNA_ColorRamp, coba, &ptr); + RNA_pointer_create(cb->ptr.owner_id, &RNA_ColorRamp, coba, &ptr); split = uiLayoutSplit(layout, 0.4f, false); @@ -3190,7 +3190,7 @@ static void colorband_buttons_layout(uiLayout *layout, if (coba->tot) { CBData *cbd = coba->data + coba->cur; - RNA_pointer_create(cb->ptr.id.data, &RNA_ColorRampElement, cbd, &ptr); + RNA_pointer_create(cb->ptr.owner_id, &RNA_ColorRampElement, cbd, &ptr); if (!expand) { split = uiLayoutSplit(layout, 0.3f, false); @@ -3283,7 +3283,7 @@ void uiTemplateColorRamp(uiLayout *layout, PointerRNA *ptr, const char *propname block = uiLayoutAbsoluteBlock(layout); - id = cptr.id.data; + id = cptr.owner_id; UI_block_lock_set(block, (id && ID_IS_LINKED(id)), ERROR_LIBDATA_MESSAGE); colorband_buttons_layout(layout, block, cptr.data, &rect, cb, expand); @@ -4405,7 +4405,7 @@ void uiTemplateCurveMapping(uiLayout *layout, cb->ptr = *ptr; cb->prop = prop; - id = cptr.id.data; + id = cptr.owner_id; UI_block_lock_set(block, (id && ID_IS_LINKED(id)), ERROR_LIBDATA_MESSAGE); curvemap_buttons_layout(layout, &cptr, type, levels, brush, neg_slope, tone, cb); diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index 9c8787d002f..63e382e2280 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -405,7 +405,7 @@ void ui_rna_collection_search_cb(const struct bContext *C, RNA_PROP_BEGIN (&data->search_ptr, itemptr, data->search_prop) { if (flag & PROP_ID_SELF_CHECK) { - if (itemptr.data == data->target_ptr.id.data) { + if (itemptr.data == data->target_ptr.owner_id) { continue; } } @@ -566,7 +566,7 @@ int UI_calc_float_precision(int prec, double value) bool UI_but_online_manual_id(const uiBut *but, char *r_str, size_t maxlength) { - if (but->rnapoin.id.data && but->rnapoin.data && but->rnaprop) { + if (but->rnapoin.owner_id && but->rnapoin.data && but->rnaprop) { BLI_snprintf(r_str, maxlength, "%s.%s", diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 9c4d628cec5..e112169d4da 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -3802,7 +3802,7 @@ static void widget_swatch( widgetbase_draw_ex(&wtb, wcol, show_alpha_checkers); if (but->a1 == UI_PALETTE_COLOR && - ((Palette *)but->rnapoin.id.data)->active_color == (int)but->a2) { + ((Palette *)but->rnapoin.owner_id)->active_color == (int)but->a2) { float width = rect->xmax - rect->xmin; float height = rect->ymax - rect->ymin; /* find color luminance and change it slightly */ diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 7343dba420f..c780ae4cf8c 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -636,7 +636,7 @@ static const EnumPropertyItem constraint_owner_items[] = { static bool edit_constraint_poll_generic(bContext *C, StructRNA *rna_type) { PointerRNA ptr = CTX_data_pointer_get_type(C, "constraint", rna_type); - Object *ob = (ptr.id.data) ? ptr.id.data : ED_object_active_context(C); + Object *ob = (ptr.owner_id) ? (Object *)ptr.owner_id : ED_object_active_context(C); if (!ptr.data) { CTX_wm_operator_poll_msg_set(C, "Context missing 'constraint'"); @@ -648,7 +648,7 @@ static bool edit_constraint_poll_generic(bContext *C, StructRNA *rna_type) return 0; } - if (ID_IS_LINKED(ob) || (ptr.id.data && ID_IS_LINKED(ptr.id.data))) { + if (ID_IS_LINKED(ob) || (ptr.owner_id && ID_IS_LINKED(ptr.owner_id))) { CTX_wm_operator_poll_msg_set(C, "Cannot edit library data"); return 0; } @@ -680,7 +680,7 @@ static void edit_constraint_properties(wmOperatorType *ot) static int edit_constraint_invoke_properties(bContext *C, wmOperator *op) { PointerRNA ptr = CTX_data_pointer_get_type(C, "constraint", &RNA_Constraint); - Object *ob = (ptr.id.data) ? ptr.id.data : ED_object_active_context(C); + Object *ob = (ptr.owner_id) ? (Object *)ptr.owner_id : ED_object_active_context(C); bConstraint *con; ListBase *list; @@ -1422,14 +1422,14 @@ void ED_object_constraint_dependency_tag_update(Main *bmain, Object *ob, bConstr static bool constraint_poll(bContext *C) { PointerRNA ptr = CTX_data_pointer_get_type(C, "constraint", &RNA_Constraint); - return (ptr.id.data && ptr.data); + return (ptr.owner_id && ptr.data); } static int constraint_delete_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain = CTX_data_main(C); PointerRNA ptr = CTX_data_pointer_get_type(C, "constraint", &RNA_Constraint); - Object *ob = ptr.id.data; + Object *ob = (Object *)ptr.owner_id; bConstraint *con = ptr.data; ListBase *lb = get_constraint_lb(ob, con, NULL); diff --git a/source/blender/editors/object/object_gpencil_modifier.c b/source/blender/editors/object/object_gpencil_modifier.c index 075cd5acad6..9138e65dd2f 100644 --- a/source/blender/editors/object/object_gpencil_modifier.c +++ b/source/blender/editors/object/object_gpencil_modifier.c @@ -390,7 +390,7 @@ void OBJECT_OT_gpencil_modifier_add(wmOperatorType *ot) static int gpencil_edit_modifier_poll_generic(bContext *C, StructRNA *rna_type, int obtype_flag) { PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", rna_type); - Object *ob = (ptr.id.data) ? ptr.id.data : ED_object_active_context(C); + Object *ob = (ptr.owner_id) ? (Object *)ptr.owner_id : ED_object_active_context(C); if (!ob || ID_IS_LINKED(ob)) { return 0; @@ -398,7 +398,7 @@ static int gpencil_edit_modifier_poll_generic(bContext *C, StructRNA *rna_type, if (obtype_flag && ((1 << ob->type) & obtype_flag) == 0) { return 0; } - if (ptr.id.data && ID_IS_LINKED(ptr.id.data)) { + if (ptr.owner_id && ID_IS_LINKED(ptr.owner_id)) { return 0; } diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c index 15c5ea40991..1576dc3bbb8 100644 --- a/source/blender/editors/object/object_hook.c +++ b/source/blender/editors/object/object_hook.c @@ -436,7 +436,7 @@ static void object_hook_from_context( HookModifierData *hmd; if (ptr->data) { /* if modifier context is available, use that */ - ob = ptr->id.data; + ob = (Object *)ptr->owner_id; hmd = ptr->data; } else { /* use the provided property */ diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 58a072d9e5f..82af30e32fd 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -918,7 +918,7 @@ bool edit_modifier_poll_generic(bContext *C, const bool is_editmode_allowed) { PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", rna_type); - Object *ob = (ptr.id.data) ? ptr.id.data : ED_object_active_context(C); + Object *ob = (ptr.owner_id) ? (Object *)ptr.owner_id : ED_object_active_context(C); if (!ob || ID_IS_LINKED(ob)) { return 0; @@ -926,7 +926,7 @@ bool edit_modifier_poll_generic(bContext *C, if (obtype_flag && ((1 << ob->type) & obtype_flag) == 0) { return 0; } - if (ptr.id.data && ID_IS_LINKED(ptr.id.data)) { + if (ptr.owner_id && ID_IS_LINKED(ptr.owner_id)) { return 0; } diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 88ef0be3bc6..eb6688b915a 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -2706,7 +2706,7 @@ static int object_unlink_data_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - id = pprop.ptr.id.data; + id = pprop.ptr.owner_id; if (GS(id->name) == ID_OB) { Object *ob = (Object *)id; diff --git a/source/blender/editors/object/object_shader_fx.c b/source/blender/editors/object/object_shader_fx.c index 457d2421253..db0c8c54186 100644 --- a/source/blender/editors/object/object_shader_fx.c +++ b/source/blender/editors/object/object_shader_fx.c @@ -294,7 +294,7 @@ void OBJECT_OT_shaderfx_add(wmOperatorType *ot) static bool edit_shaderfx_poll_generic(bContext *C, StructRNA *rna_type, int obtype_flag) { PointerRNA ptr = CTX_data_pointer_get_type(C, "shaderfx", rna_type); - Object *ob = (ptr.id.data) ? ptr.id.data : ED_object_active_context(C); + Object *ob = (ptr.owner_id) ? (Object *)ptr.owner_id : ED_object_active_context(C); if (!ptr.data) { CTX_wm_operator_poll_msg_set(C, "Context missing 'shaderfx'"); @@ -307,7 +307,7 @@ static bool edit_shaderfx_poll_generic(bContext *C, StructRNA *rna_type, int obt if (obtype_flag && ((1 << ob->type) & obtype_flag) == 0) { return 0; } - if (ptr.id.data && ID_IS_LINKED(ptr.id.data)) { + if (ptr.owner_id && ID_IS_LINKED(ptr.owner_id)) { return 0; } diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c index 0999d1f3588..bb8a31966ef 100644 --- a/source/blender/editors/physics/particle_object.c +++ b/source/blender/editors/physics/particle_object.c @@ -186,7 +186,7 @@ static int new_particle_settings_exec(bContext *C, wmOperator *UNUSED(op)) part = BKE_particlesettings_add(bmain, "ParticleSettings"); } - ob = ptr.id.data; + ob = (Object *)ptr.owner_id; if (psys->part) { id_us_min(&psys->part->id); @@ -226,7 +226,7 @@ static int new_particle_target_exec(bContext *C, wmOperator *UNUSED(op)) Main *bmain = CTX_data_main(C); PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys = ptr.data; - Object *ob = ptr.id.data; + Object *ob = (Object *)ptr.owner_id; ParticleTarget *pt; @@ -273,7 +273,7 @@ static int remove_particle_target_exec(bContext *C, wmOperator *UNUSED(op)) Main *bmain = CTX_data_main(C); PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys = ptr.data; - Object *ob = ptr.id.data; + Object *ob = (Object *)ptr.owner_id; ParticleTarget *pt; @@ -323,7 +323,7 @@ static int target_move_up_exec(bContext *C, wmOperator *UNUSED(op)) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys = ptr.data; - Object *ob = ptr.id.data; + Object *ob = (Object *)ptr.owner_id; ParticleTarget *pt; if (!psys) { @@ -363,7 +363,7 @@ static int target_move_down_exec(bContext *C, wmOperator *UNUSED(op)) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys = ptr.data; - Object *ob = ptr.id.data; + Object *ob = (Object *)ptr.owner_id; ParticleTarget *pt; if (!psys) { diff --git a/source/blender/editors/physics/physics_pointcache.c b/source/blender/editors/physics/physics_pointcache.c index bc2f1d6cef6..700a94e4f93 100644 --- a/source/blender/editors/physics/physics_pointcache.c +++ b/source/blender/editors/physics/physics_pointcache.c @@ -57,7 +57,7 @@ static bool ptcache_bake_all_poll(bContext *C) static bool ptcache_poll(bContext *C) { PointerRNA ptr = CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache); - return (ptr.data && ptr.id.data); + return (ptr.data && ptr.owner_id); } typedef struct PointCacheJob { @@ -165,7 +165,7 @@ static PTCacheBaker *ptcache_baker_create(bContext *C, wmOperator *op, bool all) if (!all) { PointerRNA ptr = CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache); - Object *ob = ptr.id.data; + Object *ob = (Object *)ptr.owner_id; PointCache *cache = ptr.data; baker->pid = BKE_ptcache_id_find(ob, baker->scene, cache); } @@ -300,7 +300,7 @@ static int ptcache_free_bake_exec(bContext *C, wmOperator *UNUSED(op)) { PointerRNA ptr = CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache); PointCache *cache = ptr.data; - Object *ob = ptr.id.data; + Object *ob = (Object *)ptr.owner_id; ptcache_free_bake(cache); @@ -312,7 +312,7 @@ static int ptcache_bake_from_cache_exec(bContext *C, wmOperator *UNUSED(op)) { PointerRNA ptr = CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache); PointCache *cache = ptr.data; - Object *ob = ptr.id.data; + Object *ob = (Object *)ptr.owner_id; cache->flag |= PTCACHE_BAKED; @@ -372,7 +372,7 @@ static int ptcache_add_new_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); PointerRNA ptr = CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache); - Object *ob = ptr.id.data; + Object *ob = (Object *)ptr.owner_id; PointCache *cache = ptr.data; PTCacheID pid = BKE_ptcache_id_find(ob, scene, cache); @@ -392,7 +392,7 @@ static int ptcache_remove_exec(bContext *C, wmOperator *UNUSED(op)) { PointerRNA ptr = CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache); Scene *scene = CTX_data_scene(C); - Object *ob = ptr.id.data; + Object *ob = (Object *)ptr.owner_id; PointCache *cache = ptr.data; PTCacheID pid = BKE_ptcache_id_find(ob, scene, cache); diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 01740c13c9d..9f13431f25a 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -1836,7 +1836,7 @@ void SCENE_OT_freestyle_stroke_material_create(wmOperatorType *ot) static int texture_slot_move_exec(bContext *C, wmOperator *op) { - ID *id = CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).id.data; + ID *id = CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).owner_id; if (id) { MTex **mtex_ar, *mtexswap; @@ -2031,7 +2031,7 @@ static void paste_mtex_copybuf(ID *id) static int copy_mtex_exec(bContext *C, wmOperator *UNUSED(op)) { - ID *id = CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).id.data; + ID *id = CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).owner_id; if (id == NULL) { /* copying empty slot */ @@ -2046,7 +2046,7 @@ static int copy_mtex_exec(bContext *C, wmOperator *UNUSED(op)) static bool copy_mtex_poll(bContext *C) { - ID *id = CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).id.data; + ID *id = CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).owner_id; return (id != NULL); } @@ -2069,7 +2069,7 @@ void TEXTURE_OT_slot_copy(wmOperatorType *ot) static int paste_mtex_exec(bContext *C, wmOperator *UNUSED(op)) { - ID *id = CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).id.data; + ID *id = CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).owner_id; if (id == NULL) { Material *ma = CTX_data_pointer_get_type(C, "material", &RNA_Material).data; diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c index 2eb7f732534..6f8b25f782b 100644 --- a/source/blender/editors/screen/screen_context.c +++ b/source/blender/editors/screen/screen_context.c @@ -533,7 +533,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult gpd_ptr = ED_gpencil_data_get_pointers_direct((ID *)sc, sa, scene, obact, &ptr); if (gpd_ptr) { - CTX_data_pointer_set(result, ptr.id.data, ptr.type, ptr.data); + CTX_data_pointer_set(result, ptr.owner_id, ptr.type, ptr.data); return 1; } } diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 0fccfd19795..625e172017b 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -4806,7 +4806,7 @@ static void SCREEN_OT_userpref_show(struct wmOperatorType *ot) static int drivers_editor_show_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - PointerRNA ptr = {{NULL}}; + PointerRNA ptr = {NULL}; PropertyRNA *prop = NULL; int index = -1; uiBut *but = NULL; diff --git a/source/blender/editors/space_action/action_data.c b/source/blender/editors/space_action/action_data.c index bc7f8a0f79d..5ceaefd6309 100644 --- a/source/blender/editors/space_action/action_data.c +++ b/source/blender/editors/space_action/action_data.c @@ -220,7 +220,7 @@ static int action_new_exec(bContext *C, wmOperator *UNUSED(op)) PointerRNA oldptr; oldptr = RNA_property_pointer_get(&ptr, prop); - oldact = (bAction *)oldptr.id.data; + oldact = (bAction *)oldptr.owner_id; /* stash the old action to prevent it from being lost */ if (ptr.type == &RNA_AnimData) { diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index 3c879b03126..1685852dd02 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -373,7 +373,7 @@ static void saction_channel_region_message_subscribe(const struct bContext *UNUS * so just whitelist the entire structs for updates */ { - wmMsgParams_RNA msg_key_params = {{{0}}}; + wmMsgParams_RNA msg_key_params = {{0}}; StructRNA *type_array[] = { &RNA_DopeSheet, /* dopesheet filters */ diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index bb381e0dd1e..a6584966643 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -76,7 +76,7 @@ static int set_pointer_type(ButsContextPath *path, bContextDataResult *result, S ptr = &path->ptr[a]; if (RNA_struct_is_a(ptr->type, type)) { - CTX_data_pointer_set(result, ptr->id.data, ptr->type, ptr->data); + CTX_data_pointer_set(result, ptr->owner_id, ptr->type, ptr->data); return 1; } } @@ -894,7 +894,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r if (ct->user && ct->user->ptr.data) { ButsTextureUser *user = ct->user; - CTX_data_pointer_set(result, user->ptr.id.data, user->ptr.type, user->ptr.data); + CTX_data_pointer_set(result, user->ptr.owner_id, user->ptr.type, user->ptr.data); } return 1; @@ -982,7 +982,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r PointerRNA *ptr = get_pointer_type(path, &RNA_ParticleSettings); if (ptr && ptr->data) { - CTX_data_pointer_set(result, ptr->id.data, &RNA_ParticleSettings, ptr->data); + CTX_data_pointer_set(result, ptr->owner_id, &RNA_ParticleSettings, ptr->data); return 1; } else { @@ -991,7 +991,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r if (ptr && ptr->data) { ParticleSettings *part = ((ParticleSystem *)ptr->data)->part; - CTX_data_pointer_set(result, ptr->id.data, &RNA_ParticleSettings, part); + CTX_data_pointer_set(result, ptr->owner_id, &RNA_ParticleSettings, part); return 1; } } @@ -1249,8 +1249,8 @@ ID *buttons_context_id_path(const bContext *C) } } - if (ptr->id.data) { - return ptr->id.data; + if (ptr->owner_id) { + return ptr->owner_id; } } } diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 500efe4bb4d..3ea6d183969 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -103,7 +103,7 @@ static int file_browse_exec(bContext *C, wmOperator *op) /* add slash for directories, important for some properties */ if (RNA_property_subtype(fbo->prop) == PROP_DIRPATH) { const bool is_relative = RNA_boolean_get(op->ptr, "relative_path"); - id = fbo->ptr.id.data; + id = fbo->ptr.owner_id; BLI_strncpy(path, str, FILE_MAX); BLI_path_abs(path, id ? ID_BLEND_PATH(bmain, id) : BKE_main_blendfile_path(bmain)); diff --git a/source/blender/editors/space_buttons/buttons_texture.c b/source/blender/editors/space_buttons/buttons_texture.c index 87ea011e0a7..03c8fbb4e66 100644 --- a/source/blender/editors/space_buttons/buttons_texture.c +++ b/source/blender/editors/space_buttons/buttons_texture.c @@ -385,7 +385,7 @@ static void template_texture_select(bContext *C, void *user_p, void *UNUSED(arg) if (user->ptr.type == &RNA_ParticleSettingsTextureSlot) { /* stupid exception for particle systems which still uses influence * from the old texture system, set the active texture slots as well */ - ParticleSettings *part = user->ptr.id.data; + ParticleSettings *part = (ParticleSettings *)user->ptr.owner_id; int a; for (a = 0; a < MAX_MTEX; a++) { diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 129f249d7d0..e3a2a4423f0 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -561,7 +561,7 @@ static void buttons_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id, int i; for (i = 0; i < path->len; i++) { - if (path->ptr[i].id.data == old_id) { + if (path->ptr[i].owner_id == old_id) { break; } } diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index c727c5225c9..b264a5cb260 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -1236,7 +1236,7 @@ static void graph_panel_drivers_popover(const bContext *C, Panel *pa) { uiLayout *layout = pa->layout; - PointerRNA ptr = {{NULL}}; + PointerRNA ptr = {NULL}; PropertyRNA *prop = NULL; int index = -1; uiBut *but = NULL; @@ -1258,7 +1258,7 @@ static void graph_panel_drivers_popover(const bContext *C, Panel *pa) /* Populate Panel - With a combination of the contents of the Driven and Driver panels */ if (fcu && fcu->driver) { - ID *id = ptr.id.data; + ID *id = ptr.owner_id; PointerRNA ptr_fcurve; RNA_pointer_create(id, &RNA_FCurve, fcu, &ptr_fcurve); diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 6c5ebf77bf4..91e5ab61dd9 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -527,7 +527,7 @@ static void graph_region_message_subscribe(const struct bContext *UNUSED(C), * so just whitelist the entire structs for updates */ { - wmMsgParams_RNA msg_key_params = {{{0}}}; + wmMsgParams_RNA msg_key_params = {{0}}; StructRNA *type_array[] = { &RNA_DopeSheet, /* dopesheet filters */ diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index f1a29a1542d..64e1c02590e 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -991,7 +991,7 @@ void uiTemplateImage(uiLayout *layout, void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr, bool color_management) { ImageFormatData *imf = imfptr->data; - ID *id = imfptr->id.data; + ID *id = imfptr->owner_id; PointerRNA display_settings_ptr; PropertyRNA *prop; const int depth_ok = BKE_imtype_valid_depths(imf->imtype); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 05ba82b8bde..7ea693f2fd2 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1431,7 +1431,7 @@ static int image_open_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED( Image *oldima; oldptr = RNA_property_pointer_get(&ptr, prop); - oldima = (Image *)oldptr.id.data; + oldima = (Image *)oldptr.owner_id; /* unlikely to fail but better avoid strange crash */ if (oldima && GS(oldima->id.name) == ID_IM) { ima = oldima; diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index 719efc7eeac..126b20a028e 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -268,8 +268,8 @@ static void nla_panel_animdata(const bContext *C, Panel *pa) /* icon + id-block name of block where AnimData came from to prevent * accidentally changing the properties of the wrong action */ - if (adt_ptr.id.data) { - ID *id = adt_ptr.id.data; + if (adt_ptr.owner_id) { + ID *id = adt_ptr.owner_id; PointerRNA id_ptr; RNA_id_pointer_create(id, &id_ptr); @@ -513,7 +513,7 @@ static void nla_panel_modifiers(const bContext *C, Panel *pa) for (fcm = strip->modifiers.first; fcm; fcm = fcm->next) { col = uiLayoutColumn(pa->layout, true); - ANIM_uiTemplate_fmodifier_draw(col, strip_ptr.id.data, &strip->modifiers, fcm); + ANIM_uiTemplate_fmodifier_draw(col, strip_ptr.owner_id, &strip->modifiers, fcm); } } diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index e5c116e85de..456eb783706 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -446,7 +446,7 @@ static int nlachannels_pushdown_exec(bContext *C, wmOperator *op) /* get anim-channel to use (or more specifically, the animdata block behind it) */ if (channel_index == -1) { - PointerRNA adt_ptr = {{NULL}}; + PointerRNA adt_ptr = {NULL}; /* active animdata block */ if (nla_panel_context(C, &adt_ptr, NULL, NULL) == 0 || (adt_ptr.data == NULL)) { @@ -458,7 +458,7 @@ static int nlachannels_pushdown_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } else { - id = adt_ptr.id.data; + id = adt_ptr.owner_id; adt = adt_ptr.data; } } @@ -581,7 +581,7 @@ static int nla_action_unlink_exec(bContext *C, wmOperator *op) /* do unlinking */ if (adt && adt->action) { bool force_delete = RNA_boolean_get(op->ptr, "force_delete"); - ED_animedit_unlink_action(C, adt_ptr.id.data, adt, adt->action, op->reports, force_delete); + ED_animedit_unlink_action(C, adt_ptr.owner_id, adt, adt->action, op->reports, force_delete); } return OPERATOR_FINISHED; diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index 3bdd2804efc..f274f3c93ec 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -522,7 +522,7 @@ static void nla_channel_region_message_subscribe(const struct bContext *UNUSED(C * so just whitelist the entire struct for updates */ { - wmMsgParams_RNA msg_key_params = {{{0}}}; + wmMsgParams_RNA msg_key_params = {{0}}; StructRNA *type_array[] = { &RNA_DopeSheet, }; diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index cc2fb6e1c2a..a69eb254621 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -90,7 +90,7 @@ static void node_buts_value(uiLayout *layout, bContext *UNUSED(C), PointerRNA *p /* first output stores value */ bNodeSocket *output = node->outputs.first; PointerRNA sockptr; - RNA_pointer_create(ptr->id.data, &RNA_NodeSocket, output, &sockptr); + RNA_pointer_create(ptr->owner_id, &RNA_NodeSocket, output, &sockptr); uiItemR(layout, &sockptr, "default_value", 0, "", ICON_NONE); } @@ -102,7 +102,7 @@ static void node_buts_rgb(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr bNodeSocket *output = node->outputs.first; PointerRNA sockptr; uiLayout *col; - RNA_pointer_create(ptr->id.data, &RNA_NodeSocket, output, &sockptr); + RNA_pointer_create(ptr->owner_id, &RNA_NodeSocket, output, &sockptr); col = uiLayoutColumn(layout, false); uiTemplateColorPicker(col, &sockptr, "default_value", 1, 0, 0, 0); @@ -113,7 +113,7 @@ static void node_buts_mix_rgb(uiLayout *layout, bContext *UNUSED(C), PointerRNA { uiLayout *row, *col; - bNodeTree *ntree = (bNodeTree *)ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; col = uiLayoutColumn(layout, false); row = uiLayoutRow(col, true); @@ -193,7 +193,7 @@ static void node_buts_normal(uiLayout *layout, bContext *UNUSED(C), PointerRNA * /* first output stores normal */ bNodeSocket *output = node->outputs.first; PointerRNA sockptr; - RNA_pointer_create(ptr->id.data, &RNA_NodeSocket, output, &sockptr); + RNA_pointer_create(ptr->owner_id, &RNA_NodeSocket, output, &sockptr); uiItemR(layout, &sockptr, "default_value", 0, "", ICON_NONE); } @@ -1371,7 +1371,7 @@ static void node_composit_buts_image(uiLayout *layout, bContext *C, PointerRNA * bNode *node = ptr->data; PointerRNA imaptr, iuserptr; - RNA_pointer_create((ID *)ptr->id.data, &RNA_ImageUser, node->storage, &iuserptr); + RNA_pointer_create(ptr->owner_id, &RNA_ImageUser, node->storage, &iuserptr); uiLayoutSetContextPointer(layout, "image_user", &iuserptr); uiTemplateID(layout, C, @@ -1398,7 +1398,7 @@ static void node_composit_buts_image_ex(uiLayout *layout, bContext *C, PointerRN bNode *node = ptr->data; PointerRNA iuserptr; - RNA_pointer_create((ID *)ptr->id.data, &RNA_ImageUser, node->storage, &iuserptr); + RNA_pointer_create(ptr->owner_id, &RNA_ImageUser, node->storage, &iuserptr); uiLayoutSetContextPointer(layout, "image_user", &iuserptr); uiTemplateImage(layout, C, ptr, "image", &iuserptr, 0, 1); } @@ -1959,7 +1959,7 @@ static void node_composit_buts_file_output_ex(uiLayout *layout, bContext *C, Poi } /* XXX collection lookup does not return the ID part of the pointer, * setting this manually here */ - active_input_ptr.id.data = ptr->id.data; + active_input_ptr.owner_id = ptr->owner_id; col = uiLayoutColumn(row, true); ot = WM_operatortype_find("NODE_OT_output_file_move_active_socket", false); @@ -2967,7 +2967,7 @@ static void node_texture_buts_proc(uiLayout *layout, bContext *UNUSED(C), Pointe { PointerRNA tex_ptr; bNode *node = ptr->data; - ID *id = ptr->id.data; + ID *id = ptr->owner_id; Tex *tex = (Tex *)node->storage; uiLayout *col, *row; @@ -3061,7 +3061,7 @@ static void node_texture_buts_image_ex(uiLayout *layout, bContext *C, PointerRNA bNode *node = ptr->data; PointerRNA iuserptr; - RNA_pointer_create((ID *)ptr->id.data, &RNA_ImageUser, node->storage, &iuserptr); + RNA_pointer_create(ptr->owner_id, &RNA_ImageUser, node->storage, &iuserptr); uiTemplateImage(layout, C, ptr, "image", &iuserptr, 0, 0); } @@ -3123,7 +3123,7 @@ static void node_texture_set_butfunc(bNodeType *ntype) static void node_property_update_default(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - bNodeTree *ntree = ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; bNode *node = ptr->data; ED_node_tag_update_nodetree(bmain, ntree, node); } @@ -3293,7 +3293,7 @@ static void node_file_output_socket_draw(bContext *C, PointerRNA *ptr, PointerRNA *node_ptr) { - bNodeTree *ntree = ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; bNodeSocket *sock = ptr->data; uiLayout *row; PointerRNA inputptr, imfptr; diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index d31256a1425..dcf901216f5 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -1838,7 +1838,7 @@ static int node_output_file_add_socket_exec(bContext *C, wmOperator *op) if (ptr.data) { node = ptr.data; - ntree = ptr.id.data; + ntree = (bNodeTree *)ptr.owner_id; } else if (snode && snode->edittree) { ntree = snode->edittree; @@ -1886,7 +1886,7 @@ static int node_output_file_remove_active_socket_exec(bContext *C, wmOperator *U if (ptr.data) { node = ptr.data; - ntree = ptr.id.data; + ntree = (bNodeTree *)ptr.owner_id; } else if (snode && snode->edittree) { ntree = snode->edittree; @@ -2535,7 +2535,7 @@ static int node_shader_script_update_exec(bContext *C, wmOperator *op) /* get node */ if (nodeptr.data) { - ntree_base = nodeptr.id.data; + ntree_base = (bNodeTree *)nodeptr.owner_id; node = nodeptr.data; } else if (snode && snode->edittree) { @@ -2734,7 +2734,7 @@ static int node_cryptomatte_add_socket_exec(bContext *C, wmOperator *UNUSED(op)) if (ptr.data) { node = ptr.data; - ntree = ptr.id.data; + ntree = (bNodeTree *)ptr.owner_id; } else if (snode && snode->edittree) { ntree = snode->edittree; @@ -2778,7 +2778,7 @@ static int node_cryptomatte_remove_socket_exec(bContext *C, wmOperator *UNUSED(o if (ptr.data) { node = ptr.data; - ntree = ptr.id.data; + ntree = (bNodeTree *)ptr.owner_id; } else if (snode && snode->edittree) { ntree = snode->edittree; diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 318d90d0dca..943993cb810 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -1780,7 +1780,7 @@ static void tree_element_to_path(TreeElement *te, /* no ID, so check if entry is RNA-struct, * and if that RNA-struct is an ID datablock to extract info from. */ if (tse->type == TSE_RNA_STRUCT) { - /* ptr->data not ptr->id.data seems to be the one we want, + /* ptr->data not ptr->owner_id seems to be the one we want, * since ptr->data is sometimes the owner of this ID? */ if (RNA_struct_is_ID(ptr->type)) { *id = (ID *)ptr->data; diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index 49f6189c17c..2c4a648da65 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -778,7 +778,7 @@ static void singleuser_action_cb(bContext *C, if (id) { IdAdtTemplate *iat = (IdAdtTemplate *)tsep->id; - PointerRNA ptr = {{NULL}}; + PointerRNA ptr = {NULL}; PropertyRNA *prop; RNA_pointer_create(&iat->id, &RNA_AnimData, iat->adt, &ptr); @@ -801,7 +801,7 @@ static void singleuser_world_cb(bContext *C, /* need to use parent scene not just scene, otherwise may end up getting wrong one */ if (id) { Scene *parscene = (Scene *)tsep->id; - PointerRNA ptr = {{NULL}}; + PointerRNA ptr = {NULL}; PropertyRNA *prop; RNA_id_pointer_create(&parscene->id, &ptr); diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 3c693cc5e2b..c3168a7a532 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -766,7 +766,7 @@ static TreeElement *outliner_add_element( ID *id = idv; if (ELEM(type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) { - id = ((PointerRNA *)idv)->id.data; + id = ((PointerRNA *)idv)->owner_id; if (!id) { id = ((PointerRNA *)idv)->data; } diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c index 9aa9d14cbc8..e1cf6d00b90 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.c +++ b/source/blender/editors/space_sequencer/space_sequencer.c @@ -597,7 +597,7 @@ static void sequencer_main_region_message_subscribe(const struct bContext *UNUSE &RNA_SequenceModifier, &RNA_SequenceColorBalanceData, }; - wmMsgParams_RNA msg_key_params = {{{0}}}; + wmMsgParams_RNA msg_key_params = {{0}}; for (int i = 0; i < ARRAY_SIZE(type_array); i++) { msg_key_params.ptr.type = type_array[i]; WM_msg_subscribe_rna_params( diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index d1ea01146bc..5974100b534 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -992,7 +992,7 @@ static void view3d_main_region_message_subscribe(const struct bContext *C, * accepting some redundant redraws. * * For other space types we might try avoid this, keep the 3D view as an exceptional case! */ - wmMsgParams_RNA msg_key_params = {{{0}}}; + wmMsgParams_RNA msg_key_params = {{0}}; /* Only subscribe to types. */ StructRNA *type_array[] = { @@ -1176,7 +1176,7 @@ static void view3d_header_region_message_subscribe(const struct bContext *UNUSED struct ARegion *ar, struct wmMsgBus *mbus) { - wmMsgParams_RNA msg_key_params = {{{0}}}; + wmMsgParams_RNA msg_key_params = {{0}}; /* Only subscribe to types. */ StructRNA *type_array[] = { diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 13001058fed..e76ef2b0458 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -5051,7 +5051,7 @@ void ED_view3d_cursor3d_update(bContext *C, { struct wmMsgBus *mbus = CTX_wm_message_bus(C); - wmMsgParams_RNA msg_key_params = {{{0}}}; + wmMsgParams_RNA msg_key_params = {{0}}; RNA_pointer_create(&scene->id, &RNA_View3DCursor, &scene->cursor, &msg_key_params.ptr); WM_msg_publish_rna_params(mbus, &msg_key_params); } |