diff options
Diffstat (limited to 'source/blender/makesrna')
59 files changed, 696 insertions, 697 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 95ea5d75c9f..f03aacf8dbd 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -1411,8 +1411,8 @@ StructRNA *ID_code_to_RNA_type(short idcode); #define RNA_POINTER_INVALIDATE(ptr) \ { \ /* this is checked for validity */ \ - (ptr)->type = /* should not be needed but prevent bad pointer access, just in case */ \ - (ptr)->id.data = NULL; \ + (ptr)->type = NULL; /* should not be needed but prevent bad pointer access, just in case */ \ + (ptr)->owner_id = NULL; \ } \ (void)0 diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 38631d1acf2..2a341249247 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -29,6 +29,7 @@ extern "C" { struct BlenderRNA; struct FunctionRNA; +struct ID; struct Main; struct ParameterList; struct PropertyRNA; @@ -44,10 +45,7 @@ struct bContext; * the properties and validate them. */ typedef struct PointerRNA { - struct { - void *data; - } id; - + struct ID *owner_id; struct StructRNA *type; void *data; } PointerRNA; @@ -534,7 +532,7 @@ typedef struct ParameterDynAlloc { typedef enum FunctionFlag { /** * Pass ID owning 'self' data - * (i.e. ptr->id.data, might be same as self in case data is an ID...). + * (i.e. ptr->owner_id, might be same as self in case data is an ID...). */ FUNC_USE_SELF_ID = (1 << 11), diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 3b9fa40fcae..5aaddc30e07 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -389,7 +389,7 @@ static void rna_print_data_get(FILE *f, PropertyDefRNA *dp) static void rna_print_id_get(FILE *f, PropertyDefRNA *UNUSED(dp)) { - fprintf(f, " ID *id = ptr->id.data;\n"); + fprintf(f, " ID *id = ptr->owner_id;\n"); } static void rna_construct_function_name( @@ -2470,7 +2470,7 @@ static void rna_def_struct_function_call_impl_cpp(FILE *f, StructRNA *srna, Func dsrna = rna_find_struct_def(srna); if (func->flag & FUNC_USE_SELF_ID) { - WRITE_PARAM("(::ID *) ptr.id.data"); + WRITE_PARAM("(::ID *) ptr.owner_id"); } if ((func->flag & FUNC_NO_SELF) == 0) { @@ -2579,7 +2579,7 @@ static void rna_def_struct_function_impl_cpp(FILE *f, StructRNA *srna, FunctionD } else { fprintf(f, - "\t\tRNA_pointer_create((::ID *) ptr.id.data, &RNA_%s, retdata, &result);\n", + "\t\tRNA_pointer_create((::ID *) ptr.owner_id, &RNA_%s, retdata, &result);\n", (const char *)pprop->type); } } @@ -2792,7 +2792,7 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA /* assign self */ if (func->flag & FUNC_USE_SELF_ID) { - fprintf(f, "\t_selfid = (struct ID *)_ptr->id.data;\n"); + fprintf(f, "\t_selfid = (struct ID *)_ptr->owner_id;\n"); } if ((func->flag & FUNC_NO_SELF) == 0) { diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 661a308f20f..5a4b4a3fa3d 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -620,9 +620,9 @@ static int rna_IDPArray_length(PointerRNA *ptr) int rna_IDMaterials_assign_int(PointerRNA *ptr, int key, const PointerRNA *assign_ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; short *totcol = give_totcolp_id(id); - Material *mat_id = assign_ptr->id.data; + Material *mat_id = (Material *)assign_ptr->owner_id; if (totcol && (key >= 0 && key < *totcol)) { BLI_assert(BKE_id_is_in_global_main(id)); BLI_assert(BKE_id_is_in_global_main(&mat_id->id)); @@ -690,7 +690,7 @@ static void rna_Library_filepath_set(PointerRNA *ptr, const char *value) static void rna_ImagePreview_is_custom_set(PointerRNA *ptr, int value, enum eIconSizes size) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; PreviewImage *prv_img = (PreviewImage *)ptr->data; if (id != NULL) { @@ -716,7 +716,7 @@ static void rna_ImagePreview_is_custom_set(PointerRNA *ptr, int value, enum eIco static void rna_ImagePreview_size_get(PointerRNA *ptr, int *values, enum eIconSizes size) { - ID *id = (ID *)ptr->id.data; + ID *id = ptr->owner_id; PreviewImage *prv_img = (PreviewImage *)ptr->data; if (id != NULL) { @@ -731,7 +731,7 @@ static void rna_ImagePreview_size_get(PointerRNA *ptr, int *values, enum eIconSi static void rna_ImagePreview_size_set(PointerRNA *ptr, const int *values, enum eIconSizes size) { - ID *id = (ID *)ptr->id.data; + ID *id = ptr->owner_id; PreviewImage *prv_img = (PreviewImage *)ptr->data; if (id != NULL) { @@ -754,7 +754,7 @@ static int rna_ImagePreview_pixels_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION], enum eIconSizes size) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; PreviewImage *prv_img = (PreviewImage *)ptr->data; if (id != NULL) { @@ -770,7 +770,7 @@ static int rna_ImagePreview_pixels_get_length(PointerRNA *ptr, static void rna_ImagePreview_pixels_get(PointerRNA *ptr, int *values, enum eIconSizes size) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; PreviewImage *prv_img = (PreviewImage *)ptr->data; if (id != NULL) { @@ -784,7 +784,7 @@ static void rna_ImagePreview_pixels_get(PointerRNA *ptr, int *values, enum eIcon static void rna_ImagePreview_pixels_set(PointerRNA *ptr, const int *values, enum eIconSizes size) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; PreviewImage *prv_img = (PreviewImage *)ptr->data; if (id != NULL) { @@ -799,7 +799,7 @@ static int rna_ImagePreview_pixels_float_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION], enum eIconSizes size) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; PreviewImage *prv_img = (PreviewImage *)ptr->data; BLI_assert(sizeof(unsigned int) == 4); @@ -817,7 +817,7 @@ static int rna_ImagePreview_pixels_float_get_length(PointerRNA *ptr, static void rna_ImagePreview_pixels_float_get(PointerRNA *ptr, float *values, enum eIconSizes size) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; PreviewImage *prv_img = (PreviewImage *)ptr->data; unsigned char *data = (unsigned char *)prv_img->rect[size]; @@ -841,7 +841,7 @@ static void rna_ImagePreview_pixels_float_set(PointerRNA *ptr, const float *values, enum eIconSizes size) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; PreviewImage *prv_img = (PreviewImage *)ptr->data; unsigned char *data = (unsigned char *)prv_img->rect[size]; @@ -958,7 +958,7 @@ static int rna_ImagePreview_icon_id_get(PointerRNA *ptr) { /* Using a callback here allows us to only generate icon matching * that preview when icon_id is requested. */ - return BKE_icon_preview_ensure(ptr->id.data, (PreviewImage *)(ptr->data)); + return BKE_icon_preview_ensure(ptr->owner_id, (PreviewImage *)(ptr->data)); } static void rna_ImagePreview_icon_reload(PreviewImage *prv) { diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index c4b0e43fd70..d44020a52a1 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -64,7 +64,7 @@ #include "rna_internal.h" #include "rna_access_internal.h" -const PointerRNA PointerRNA_NULL = {{NULL}}; +const PointerRNA PointerRNA_NULL = {NULL}; /* Init/Exit */ @@ -112,7 +112,7 @@ void RNA_exit(void) void RNA_main_pointer_create(struct Main *main, PointerRNA *r_ptr) { - r_ptr->id.data = NULL; + r_ptr->owner_id = NULL; r_ptr->type = &RNA_BlendData; r_ptr->data = main; } @@ -122,7 +122,7 @@ void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr) StructRNA *type, *idtype = NULL; if (id) { - PointerRNA tmp = {{NULL}}; + PointerRNA tmp = {NULL}; tmp.data = id; idtype = rna_ID_refine(&tmp); @@ -138,7 +138,7 @@ void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr) } } - r_ptr->id.data = id; + r_ptr->owner_id = id; r_ptr->type = idtype; r_ptr->data = id; } @@ -149,13 +149,13 @@ void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr) StructRNA *idtype = NULL; if (id) { - PointerRNA tmp = {{0}}; + PointerRNA tmp = {0}; tmp.data = id; idtype = rna_ID_refine(&tmp); } #endif - r_ptr->id.data = id; + r_ptr->owner_id = id; r_ptr->type = type; r_ptr->data = data; @@ -175,22 +175,22 @@ void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr) bool RNA_pointer_is_null(const PointerRNA *ptr) { - return !((ptr->data != NULL) && (ptr->id.data != NULL) && (ptr->type != NULL)); + return !((ptr->data != NULL) && (ptr->owner_id != NULL) && (ptr->type != NULL)); } static void rna_pointer_inherit_id(StructRNA *type, PointerRNA *parent, PointerRNA *ptr) { if (type && type->flag & STRUCT_ID) { - ptr->id.data = ptr->data; + ptr->owner_id = ptr->data; } else { - ptr->id.data = parent->id.data; + ptr->owner_id = parent->owner_id; } } void RNA_blender_rna_pointer_create(PointerRNA *r_ptr) { - r_ptr->id.data = NULL; + r_ptr->owner_id = NULL; r_ptr->type = &RNA_BlenderRNA; r_ptr->data = &BLENDER_RNA; } @@ -225,7 +225,7 @@ void RNA_pointer_recast(PointerRNA *ptr, PointerRNA *r_ptr) #if 0 /* works but this case if covered by more general code below. */ if (RNA_struct_is_ID(ptr->type)) { /* simple case */ - RNA_id_pointer_create(ptr->id.data, r_ptr); + RNA_id_pointer_create(ptr->owner_id, r_ptr); } else #endif @@ -2058,7 +2058,7 @@ int RNA_property_ui_icon(PropertyRNA *prop) bool RNA_property_editable(PointerRNA *ptr, PropertyRNA *prop) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; int flag; const char *dummy_info; @@ -2076,7 +2076,7 @@ bool RNA_property_editable(PointerRNA *ptr, PropertyRNA *prop) */ bool RNA_property_editable_info(PointerRNA *ptr, PropertyRNA *prop, const char **r_info) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; int flag; prop = rna_ensure_property(prop); @@ -2143,7 +2143,7 @@ bool RNA_property_editable_index(PointerRNA *ptr, PropertyRNA *prop, int index) flag &= prop->itemeditable(ptr, index); } - id = ptr->id.data; + id = ptr->owner_id; return (flag & PROP_EDITABLE) && (!id || !ID_IS_LINKED(id) || (prop->flag & PROP_LIB_EXCEPTION)); } @@ -2151,7 +2151,7 @@ bool RNA_property_editable_index(PointerRNA *ptr, PropertyRNA *prop, int index) bool RNA_property_animateable(PointerRNA *ptr, PropertyRNA *prop) { /* check that base ID-block can support animation data */ - if (!id_can_have_animdata(ptr->id.data)) { + if (!id_can_have_animdata(ptr->owner_id)) { return false; } @@ -2197,7 +2197,7 @@ bool RNA_property_path_from_ID_check(PointerRNA *ptr, PropertyRNA *prop) PointerRNA r_ptr; PropertyRNA *r_prop; - RNA_id_pointer_create(ptr->id.data, &id_ptr); + RNA_id_pointer_create(ptr->owner_id, &id_ptr); if (RNA_path_resolve(&id_ptr, path, &r_ptr, &r_prop) == true) { ret = (prop == r_prop); } @@ -2236,7 +2236,7 @@ static void rna_property_update( /* TODO(campbell): Should eventually be replaced entirely by message bus (below) * for now keep since COW, bugs are hard to track when we have other missing updates. */ if (prop->noteflag) { - WM_main_add_notifier(prop->noteflag, ptr->id.data); + WM_main_add_notifier(prop->noteflag, ptr->owner_id); } #endif @@ -2247,10 +2247,10 @@ static void rna_property_update( /* we could add NULL check, for now don't */ WM_msg_publish_rna(mbus, ptr, prop); } - if (ptr->id.data != NULL && ((prop->flag & PROP_NO_DEG_UPDATE) == 0)) { - const short id_type = GS(((ID *)ptr->id.data)->name); + if (ptr->owner_id != NULL && ((prop->flag & PROP_NO_DEG_UPDATE) == 0)) { + const short id_type = GS(ptr->owner_id->name); if (ID_TYPE_IS_COW(id_type)) { - DEG_id_tag_update(ptr->id.data, ID_RECALC_COPY_ON_WRITE); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_COPY_ON_WRITE); } } /* End message bus. */ @@ -2259,14 +2259,14 @@ static void rna_property_update( if (!is_rna || (prop->flag & PROP_IDPROPERTY)) { /* WARNING! This is so property drivers update the display! * not especially nice */ - DEG_id_tag_update(ptr->id.data, + DEG_id_tag_update(ptr->owner_id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_PARAMETERS); WM_main_add_notifier(NC_WINDOW, NULL); /* Not nice as well, but the only way to make sure material preview * is updated with custom nodes. */ - if ((prop->flag & PROP_IDPROPERTY) != 0 && (ptr->id.data != NULL) && - (GS(((ID *)ptr->id.data)->name) == ID_NT)) { + if ((prop->flag & PROP_IDPROPERTY) != 0 && (ptr->owner_id != NULL) && + (GS(ptr->owner_id->name) == ID_NT)) { WM_main_add_notifier(NC_MATERIAL | ND_SHADING, NULL); } } @@ -2299,7 +2299,7 @@ void RNA_property_update_main(Main *bmain, Scene *scene, PointerRNA *ptr, Proper * property updates to actually work). * * The cache is structured with a dual-layer structure - * - L1 = PointerRNA used as key; id.data is used (it should always be defined, + * - L1 = PointerRNA used as key; owner_id is used (it should always be defined, * and most updates end up using just that anyways) * - L2 = Update functions to be called on those PointerRNA's */ @@ -2343,7 +2343,7 @@ void RNA_property_update_cache_add(PointerRNA *ptr, PropertyRNA *prop) * since most update calls that we'll encounter only really care about this. */ /* TODO: later, the cache might need to have some nesting on L1 to cope better * with these problems + some tagging to indicate we need this */ - if (uce->ptr.id.data == ptr->id.data) { + if (uce->ptr.owner_id == ptr->owner_id) { break; } } @@ -2353,7 +2353,7 @@ void RNA_property_update_cache_add(PointerRNA *ptr, PropertyRNA *prop) BLI_addtail(&rna_updates_cache, uce); /* copy pointer */ - RNA_pointer_create(ptr->id.data, ptr->type, ptr->data, &uce->ptr); + RNA_pointer_create(ptr->owner_id, ptr->type, ptr->data, &uce->ptr); } /* check on the update func */ @@ -3771,7 +3771,7 @@ void RNA_property_pointer_set(PointerRNA *ptr, /* RNA */ if (pprop->set && !((prop->flag & PROP_NEVER_NULL) && ptr_value.data == NULL) && - !((prop->flag & PROP_ID_SELF_CHECK) && ptr->id.data == ptr_value.id.data)) { + !((prop->flag & PROP_ID_SELF_CHECK) && ptr->owner_id == ptr_value.owner_id)) { pprop->set(ptr, ptr_value, reports); } /* IDProperty */ @@ -5734,14 +5734,14 @@ static char *rna_path_from_ID_to_idpgroup(PointerRNA *ptr) IDProperty *haystack; IDProperty *needle; - BLI_assert(ptr->id.data != NULL); + BLI_assert(ptr->owner_id != NULL); /* TODO, Support Bones/PoseBones. no pointers stored to the bones from here, only the ID. * See example in T25746. * Unless this is added only way to find this is to also search * all bones and pose bones of an armature or object. */ - RNA_id_pointer_create(ptr->id.data, &id_ptr); + RNA_id_pointer_create(ptr->owner_id, &id_ptr); haystack = RNA_struct_idprops(&id_ptr, false); if (haystack) { /* can fail when called on bones */ @@ -5757,7 +5757,7 @@ char *RNA_path_from_ID_to_struct(PointerRNA *ptr) { char *ptrpath = NULL; - if (!ptr->id.data || !ptr->data) { + if (!ptr->owner_id || !ptr->data) { return NULL; } @@ -5773,7 +5773,7 @@ char *RNA_path_from_ID_to_struct(PointerRNA *ptr) /* find the property in the struct we're nested in that references this struct, and * use its identifier as the first part of the path used... */ - RNA_id_pointer_create(ptr->id.data, &parentptr); + RNA_id_pointer_create(ptr->owner_id, &parentptr); userprop = RNA_struct_find_nested(&parentptr, ptr->type); if (userprop) { @@ -5849,7 +5849,7 @@ char *RNA_path_from_ID_to_property_index(PointerRNA *ptr, const char *propname; char *ptrpath, *path; - if (!ptr->id.data || !ptr->data) { + if (!ptr->owner_id || !ptr->data) { return NULL; } @@ -5920,7 +5920,7 @@ char *RNA_path_resolve_from_type_to_property(PointerRNA *ptr, return NULL; } - RNA_id_pointer_create(ptr->id.data, &idptr); + RNA_id_pointer_create(ptr->owner_id, &idptr); if (RNA_path_resolve_elements(&idptr, full_path, &path_elems)) { PropertyElemRNA *prop_elem; @@ -5967,12 +5967,12 @@ char *RNA_path_full_struct_py(struct PointerRNA *ptr) char *ret; - if (!ptr->id.data) { + if (!ptr->owner_id) { return NULL; } /* never fails */ - id_path = RNA_path_full_ID_py(ptr->id.data); + id_path = RNA_path_full_ID_py(ptr->owner_id); data_path = RNA_path_from_ID_to_struct(ptr); @@ -6004,12 +6004,12 @@ char *RNA_path_full_property_py_ex(PointerRNA *ptr, char *ret; - if (!ptr->id.data) { + if (!ptr->owner_id) { return NULL; } /* never fails */ - id_path = RNA_path_full_ID_py(ptr->id.data); + id_path = RNA_path_full_ID_py(ptr->owner_id); data_path = RNA_path_from_ID_to_property(ptr, prop); if (data_path) { @@ -6057,7 +6057,7 @@ char *RNA_path_struct_property_py(PointerRNA *ptr, PropertyRNA *prop, int index) char *ret; - if (!ptr->id.data) { + if (!ptr->owner_id) { return NULL; } @@ -6644,11 +6644,11 @@ char *RNA_pointer_as_string_id(bContext *C, PointerRNA *ptr) static char *rna_pointer_as_string__bldata(PointerRNA *ptr) { - if (ptr->type == NULL || ptr->id.data == NULL) { + if (ptr->type == NULL || ptr->owner_id == NULL) { return BLI_strdup("None"); } else if (RNA_struct_is_ID(ptr->type)) { - return RNA_path_full_ID_py(ptr->id.data); + return RNA_path_full_ID_py(ptr->owner_id); } else { return RNA_path_full_struct_py(ptr); diff --git a/source/blender/makesrna/intern/rna_access_compare_override.c b/source/blender/makesrna/intern/rna_access_compare_override.c index 4ee06227090..b0a83ea38c6 100644 --- a/source/blender/makesrna/intern/rna_access_compare_override.c +++ b/source/blender/makesrna/intern/rna_access_compare_override.c @@ -101,7 +101,7 @@ bool RNA_property_overridable_library_set(PointerRNA *UNUSED(ptr), bool RNA_property_overridden(PointerRNA *ptr, PropertyRNA *prop) { char *rna_path = RNA_path_from_ID_to_property(ptr, prop); - ID *id = ptr->id.data; + ID *id = ptr->owner_id; if (rna_path == NULL || id == NULL || id->override_library == NULL) { return false; @@ -558,7 +558,7 @@ bool RNA_struct_override_matches(Main *bmain, bool matching = true; BLI_assert(ptr_local->type == ptr_reference->type); - BLI_assert(ptr_local->id.data && ptr_reference->id.data); + BLI_assert(ptr_local->owner_id && ptr_reference->owner_id); const bool ignore_non_overridable = (flags & RNA_OVERRIDE_COMPARE_IGNORE_NON_OVERRIDABLE) != 0; const bool ignore_overridden = (flags & RNA_OVERRIDE_COMPARE_IGNORE_OVERRIDDEN) != 0; @@ -747,7 +747,7 @@ bool RNA_struct_override_matches(Main *bmain, _num_time_global++; _sum_time_diffing += _delta_time_diffing; _num_time_diffing++; - printf("ID: %s\n", ((ID *)ptr_local->id.data)->name); + printf("ID: %s\n", ((ID *)ptr_local->owner_id)->name); printf("time end (%s): %.6f\n", __func__, _delta_time); printf("time averaged (%s): %.6f (total: %.6f, in %d runs)\n", __func__, @@ -794,7 +794,7 @@ bool RNA_struct_override_store(Main *bmain, /* It is totally OK if this does not success, * only a subset of override operations actually need storage. */ - if (ptr_storage && (ptr_storage->id.data != NULL)) { + if (ptr_storage && (ptr_storage->owner_id != NULL)) { RNA_path_resolve_property(ptr_storage, op->rna_path, &data_storage, &prop_storage); } @@ -959,7 +959,7 @@ void RNA_struct_override_apply(Main *bmain, /* It is totally OK if this does not success, * only a subset of override operations actually need storage. */ - if (ptr_storage && (ptr_storage->id.data != NULL)) { + if (ptr_storage && (ptr_storage->owner_id != NULL)) { RNA_path_resolve_property_and_item_pointer( ptr_storage, op->rna_path, &data_storage, &prop_storage, &data_item_storage); } @@ -982,7 +982,7 @@ void RNA_struct_override_apply(Main *bmain, printf( "Failed to apply library override operation to '%s.%s' " "(could not resolve some properties, local: %d, override: %d)\n", - ((ID *)ptr_src->id.data)->name, + ((ID *)ptr_src->owner_id)->name, op->rna_path, RNA_path_resolve_property(ptr_dst, op->rna_path, &data_dst, &prop_dst), RNA_path_resolve_property(ptr_src, op->rna_path, &data_src, &prop_src)); @@ -997,7 +997,7 @@ void RNA_struct_override_apply(Main *bmain, IDOverrideLibraryProperty *RNA_property_override_property_find(PointerRNA *ptr, PropertyRNA *prop) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; if (!id || !id->override_library) { return NULL; @@ -1017,7 +1017,7 @@ IDOverrideLibraryProperty *RNA_property_override_property_get(PointerRNA *ptr, PropertyRNA *prop, bool *r_created) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; if (!id || !id->override_library) { return NULL; @@ -1075,7 +1075,7 @@ eRNAOverrideStatus RNA_property_override_library_status(PointerRNA *ptr, return override_status; } - if (!ptr || !prop || !ptr->id.data || !((ID *)ptr->id.data)->override_library) { + if (!ptr || !prop || !ptr->owner_id || !(ptr->owner_id)->override_library) { return override_status; } diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c index 4ad2aa55c75..24f8d5c4e3d 100644 --- a/source/blender/makesrna/intern/rna_action.c +++ b/source/blender/makesrna/intern/rna_action.c @@ -249,15 +249,15 @@ static void rna_Action_active_pose_marker_index_range( static void rna_Action_frame_range_get(PointerRNA *ptr, float *values) { /* don't include modifiers because they too easily can have very large * ranges: MINAFRAMEF to MAXFRAMEF. */ - calc_action_range(ptr->id.data, values, values + 1, false); + calc_action_range((bAction *)ptr->owner_id, values, values + 1, false); } /* Used to check if an action (value pointer) * is suitable to be assigned to the ID-block that is ptr. */ bool rna_Action_id_poll(PointerRNA *ptr, PointerRNA value) { - ID *srcId = (ID *)ptr->id.data; - bAction *act = (bAction *)value.id.data; + ID *srcId = ptr->owner_id; + bAction *act = (bAction *)value.owner_id; if (act) { /* there can still be actions that will have undefined id-root @@ -280,7 +280,7 @@ bool rna_Action_id_poll(PointerRNA *ptr, PointerRNA value) bool rna_Action_actedit_assign_poll(PointerRNA *ptr, PointerRNA value) { SpaceAction *saction = (SpaceAction *)ptr->data; - bAction *act = (bAction *)value.id.data; + bAction *act = (bAction *)value.owner_id; if (act) { /* there can still be actions that will have undefined id-root diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index 3d14616bcc9..6157ec41f19 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -128,7 +128,7 @@ const EnumPropertyItem rna_enum_keying_flag_items_api[] = { static void rna_AnimData_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; ANIM_id_update(bmain, id); } @@ -157,7 +157,7 @@ static void rna_AnimData_action_set(PointerRNA *ptr, PointerRNA value, struct ReportList *UNUSED(reports)) { - ID *ownerId = (ID *)ptr->id.data; + ID *ownerId = ptr->owner_id; /* set action */ BKE_animdata_set_action(NULL, ownerId, value.data); @@ -303,7 +303,7 @@ static StructRNA *rna_KeyingSetInfo_register(Main *bmain, { KeyingSetInfo dummyksi = {NULL}; KeyingSetInfo *ksi; - PointerRNA dummyptr = {{NULL}}; + PointerRNA dummyptr = {NULL}; int have_function[3]; /* setup dummy type info to store static properties in */ @@ -727,12 +727,12 @@ bool rna_AnimaData_override_apply(Main *UNUSED(bmain), if (adt_dst == NULL && adt_src != NULL) { /* Copy anim data from reference into final local ID. */ - BKE_animdata_copy_id(NULL, ptr_dst->id.data, ptr_src->id.data, 0); + BKE_animdata_copy_id(NULL, ptr_dst->owner_id, ptr_src->owner_id, 0); return true; } else if (adt_dst != NULL && adt_src == NULL) { /* Override has cleared/removed anim data from its reference. */ - BKE_animdata_free(ptr_dst->id.data, true); + BKE_animdata_free(ptr_dst->owner_id, true); return true; } diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index c0e3404f78c..d3bdcf03d4d 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -50,7 +50,7 @@ static void rna_Armature_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; DEG_id_tag_update(id, 0); WM_main_add_notifier(NC_GEOM | ND_DATA, id); @@ -59,7 +59,7 @@ static void rna_Armature_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), static void rna_Armature_dependency_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; DEG_relations_tag_update(bmain); @@ -73,12 +73,12 @@ static void rna_Armature_act_bone_set(PointerRNA *ptr, { bArmature *arm = (bArmature *)ptr->data; - if (value.id.data == NULL && value.data == NULL) { + if (value.owner_id == NULL && value.data == NULL) { arm->act_bone = NULL; } else { - if (value.id.data != arm) { - Object *ob = (Object *)value.id.data; + if (value.owner_id != &arm->id) { + Object *ob = (Object *)value.owner_id; if (GS(ob->id.name) != ID_OB || (ob->data != arm)) { printf("ERROR: armature set active bone - new active doesn't come from this armature\n"); @@ -97,11 +97,11 @@ static void rna_Armature_act_edit_bone_set(PointerRNA *ptr, { bArmature *arm = (bArmature *)ptr->data; - if (value.id.data == NULL && value.data == NULL) { + if (value.owner_id == NULL && value.data == NULL) { arm->act_edbone = NULL; } else { - if (value.id.data != arm) { + if (value.owner_id != &arm->id) { /* raise an error! */ } else { @@ -151,7 +151,7 @@ static void rna_Armature_edit_bone_remove(bArmature *arm, static void rna_Armature_update_layers(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - bArmature *arm = ptr->id.data; + bArmature *arm = (bArmature *)ptr->owner_id; Object *ob; /* proxy lib exception, store it here so we can restore layers on file @@ -168,7 +168,7 @@ static void rna_Armature_update_layers(Main *bmain, Scene *UNUSED(scene), Pointe static void rna_Armature_redraw_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; DEG_id_tag_update(id, ID_RECALC_COPY_ON_WRITE); WM_main_add_notifier(NC_GEOM | ND_DATA, id); @@ -177,7 +177,7 @@ static void rna_Armature_redraw_data(Main *UNUSED(bmain), Scene *UNUSED(scene), /* called whenever a bone is renamed */ static void rna_Bone_update_renamed(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; /* redraw view */ WM_main_add_notifier(NC_GEOM | ND_DATA, id); @@ -188,7 +188,7 @@ static void rna_Bone_update_renamed(Main *UNUSED(bmain), Scene *UNUSED(scene), P static void rna_Bone_select_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; /* 1) special updates for cases where rigs try to hook into armature drawing stuff * e.g. Mask Modifier - 'Armature' option @@ -225,7 +225,7 @@ static void rna_Bone_select_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Po static char *rna_Bone_path(PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; Bone *bone = (Bone *)ptr->data; char name_esc[sizeof(bone->name) * 2]; @@ -295,7 +295,7 @@ static void rna_bone_layer_set(int *layer, const bool *values) static void rna_Bone_layer_set(PointerRNA *ptr, const bool *values) { - bArmature *arm = (bArmature *)ptr->id.data; + bArmature *arm = (bArmature *)ptr->owner_id; Bone *bone = (Bone *)ptr->data; rna_bone_layer_set(&bone->layer, values); @@ -331,7 +331,7 @@ static void rna_Armature_layer_set(PointerRNA *ptr, const bool *values) static void rna_EditBone_name_set(PointerRNA *ptr, const char *value) { - bArmature *arm = (bArmature *)ptr->id.data; + bArmature *arm = (bArmature *)ptr->owner_id; EditBone *ebone = (EditBone *)ptr->data; char oldname[sizeof(ebone->name)], newname[sizeof(ebone->name)]; @@ -345,7 +345,7 @@ static void rna_EditBone_name_set(PointerRNA *ptr, const char *value) static void rna_Bone_name_set(PointerRNA *ptr, const char *value) { - bArmature *arm = (bArmature *)ptr->id.data; + bArmature *arm = (bArmature *)ptr->owner_id; Bone *bone = (Bone *)ptr->data; char oldname[sizeof(bone->name)], newname[sizeof(bone->name)]; @@ -417,7 +417,7 @@ static void rna_EditBone_parent_set(PointerRNA *ptr, } else { /* within same armature */ - if (value.id.data != ptr->id.data) { + if (value.owner_id != ptr->owner_id) { return; } @@ -451,7 +451,7 @@ static void rna_EditBone_matrix_set(PointerRNA *ptr, const float *values) static void rna_Bone_bbone_handle_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - bArmature *arm = (bArmature *)ptr->id.data; + bArmature *arm = (bArmature *)ptr->owner_id; Bone *bone = (Bone *)ptr->data; /* Update all users of this armature after changing B-Bone handles. */ @@ -483,7 +483,7 @@ static void rna_EditBone_bbone_prev_set(PointerRNA *ptr, EditBone *hbone = (EditBone *)value.data; /* Within the same armature? */ - if (hbone == NULL || value.id.data == ptr->id.data) { + if (hbone == NULL || value.owner_id == ptr->owner_id) { ebone->bbone_prev = hbone; } } @@ -496,7 +496,7 @@ static void rna_Bone_bbone_prev_set(PointerRNA *ptr, Bone *hbone = (Bone *)value.data; /* Within the same armature? */ - if (hbone == NULL || value.id.data == ptr->id.data) { + if (hbone == NULL || value.owner_id == ptr->owner_id) { bone->bbone_prev = hbone; } } @@ -515,7 +515,7 @@ static void rna_EditBone_bbone_next_set(PointerRNA *ptr, EditBone *hbone = (EditBone *)value.data; /* Within the same armature? */ - if (hbone == NULL || value.id.data == ptr->id.data) { + if (hbone == NULL || value.owner_id == ptr->owner_id) { ebone->bbone_next = hbone; } } @@ -528,14 +528,14 @@ static void rna_Bone_bbone_next_set(PointerRNA *ptr, Bone *hbone = (Bone *)value.data; /* Within the same armature? */ - if (hbone == NULL || value.id.data == ptr->id.data) { + if (hbone == NULL || value.owner_id == ptr->owner_id) { bone->bbone_next = hbone; } } static void rna_Armature_editbone_transform_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - bArmature *arm = (bArmature *)ptr->id.data; + bArmature *arm = (bArmature *)ptr->owner_id; EditBone *ebone = (EditBone *)ptr->data; EditBone *child; @@ -590,7 +590,7 @@ static int rna_Armature_bones_lookup_string(PointerRNA *ptr, const char *key, Po bArmature *arm = (bArmature *)ptr->data; Bone *bone = BKE_armature_find_bone_name(arm, key); if (bone) { - RNA_pointer_create(ptr->id.data, &RNA_Bone, bone, r_ptr); + RNA_pointer_create(ptr->owner_id, &RNA_Bone, bone, r_ptr); return true; } else { @@ -600,7 +600,7 @@ static int rna_Armature_bones_lookup_string(PointerRNA *ptr, const char *key, Po static bool rna_Armature_is_editmode_get(PointerRNA *ptr) { - bArmature *arm = (bArmature *)ptr->id.data; + bArmature *arm = (bArmature *)ptr->owner_id; return (arm->edbo != NULL); } diff --git a/source/blender/makesrna/intern/rna_boid.c b/source/blender/makesrna/intern/rna_boid.c index 8f30a7e0a98..722b7b12271 100644 --- a/source/blender/makesrna/intern/rna_boid.c +++ b/source/blender/makesrna/intern/rna_boid.c @@ -130,10 +130,10 @@ static void rna_Boids_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRN psys->recalc = ID_RECALC_PSYS_RESET; - DEG_id_tag_update(ptr->id.data, ID_RECALC_GEOMETRY); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY); } else { - DEG_id_tag_update(ptr->id.data, ID_RECALC_GEOMETRY | ID_RECALC_PSYS_RESET); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY | ID_RECALC_PSYS_RESET); } WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, NULL); @@ -145,10 +145,10 @@ static void rna_Boids_reset_deps(Main *bmain, Scene *UNUSED(scene), PointerRNA * psys->recalc = ID_RECALC_PSYS_RESET; - DEG_id_tag_update(ptr->id.data, ID_RECALC_GEOMETRY); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY); } else { - DEG_id_tag_update(ptr->id.data, ID_RECALC_GEOMETRY | ID_RECALC_PSYS_RESET); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY | ID_RECALC_PSYS_RESET); } DEG_relations_tag_update(bmain); @@ -240,7 +240,7 @@ static void rna_BoidState_active_boid_rule_index_set(struct PointerRNA *ptr, int static int particle_id_check(PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; return (GS(id->name) == ID_PA); } @@ -250,7 +250,7 @@ static char *rna_BoidSettings_path(PointerRNA *ptr) BoidSettings *boids = (BoidSettings *)ptr->data; if (particle_id_check(ptr)) { - ParticleSettings *part = (ParticleSettings *)ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->owner_id; if (part->boids == boids) { return BLI_strdup("boids"); diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 713ddfa0067..15602599e4e 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -434,27 +434,27 @@ static bool rna_BrushCapabilitiesImagePaint_has_radius_get(PointerRNA *ptr) static PointerRNA rna_Sculpt_tool_capabilities_get(PointerRNA *ptr) { - return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilitiesSculpt, ptr->id.data); + return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilitiesSculpt, ptr->owner_id); } static PointerRNA rna_Imapaint_tool_capabilities_get(PointerRNA *ptr) { - return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilitiesImagePaint, ptr->id.data); + return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilitiesImagePaint, ptr->owner_id); } static PointerRNA rna_Vertexpaint_tool_capabilities_get(PointerRNA *ptr) { - return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilitiesVertexPaint, ptr->id.data); + return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilitiesVertexPaint, ptr->owner_id); } static PointerRNA rna_Weightpaint_tool_capabilities_get(PointerRNA *ptr) { - return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilitiesWeightPaint, ptr->id.data); + return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilitiesWeightPaint, ptr->owner_id); } static PointerRNA rna_Brush_capabilities_get(PointerRNA *ptr) { - return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilities, ptr->id.data); + return rna_pointer_inherit_refine(ptr, &RNA_BrushCapabilities, ptr->owner_id); } static void rna_Brush_reset_icon(Brush *br) @@ -764,7 +764,7 @@ static void rna_BrushGpencilSettings_use_material_pin_update(bContext *C, Pointe { ViewLayer *view_layer = CTX_data_view_layer(C); Object *ob = OBACT(view_layer); - Brush *brush = ptr->id.data; + Brush *brush = (Brush *)ptr->owner_id; if (brush->gpencil_settings->flag & GP_BRUSH_MATERIAL_PINNED) { Material *material = give_current_material(ob, ob->actcol); diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c index 71c9b7dbd1f..88083f600f8 100644 --- a/source/blender/makesrna/intern/rna_camera.c +++ b/source/blender/makesrna/intern/rna_camera.c @@ -43,52 +43,52 @@ static float rna_Camera_angle_get(PointerRNA *ptr) { - Camera *cam = ptr->id.data; + Camera *cam = (Camera *)ptr->owner_id; float sensor = BKE_camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y); return focallength_to_fov(cam->lens, sensor); } static void rna_Camera_angle_set(PointerRNA *ptr, float value) { - Camera *cam = ptr->id.data; + Camera *cam = (Camera *)ptr->owner_id; float sensor = BKE_camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y); cam->lens = fov_to_focallength(value, sensor); } static float rna_Camera_angle_x_get(PointerRNA *ptr) { - Camera *cam = ptr->id.data; + Camera *cam = (Camera *)ptr->owner_id; return focallength_to_fov(cam->lens, cam->sensor_x); } static void rna_Camera_angle_x_set(PointerRNA *ptr, float value) { - Camera *cam = ptr->id.data; + Camera *cam = (Camera *)ptr->owner_id; cam->lens = fov_to_focallength(value, cam->sensor_x); } static float rna_Camera_angle_y_get(PointerRNA *ptr) { - Camera *cam = ptr->id.data; + Camera *cam = (Camera *)ptr->owner_id; return focallength_to_fov(cam->lens, cam->sensor_y); } static void rna_Camera_angle_y_set(PointerRNA *ptr, float value) { - Camera *cam = ptr->id.data; + Camera *cam = (Camera *)ptr->owner_id; cam->lens = fov_to_focallength(value, cam->sensor_y); } static void rna_Camera_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Camera *camera = (Camera *)ptr->id.data; + Camera *camera = (Camera *)ptr->owner_id; DEG_id_tag_update(&camera->id, 0); } static void rna_Camera_dependency_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - Camera *camera = (Camera *)ptr->id.data; + Camera *camera = (Camera *)ptr->owner_id; DEG_relations_tag_update(bmain); DEG_id_tag_update(&camera->id, 0); } @@ -136,8 +136,8 @@ char *rna_CameraDOFSettings_path(PointerRNA *ptr) * since the name used is the name of the texture assigned, but the texture * may be used multiple times in the same stack */ - if (ptr->id.data) { - if (GS(((ID *)ptr->id.data)->name) == ID_CA) { + if (ptr->owner_id) { + if (GS(ptr->owner_id->name) == ID_CA) { return BLI_strdup("dof"); } } diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c index ea33a5bc8e4..036aeebda52 100644 --- a/source/blender/makesrna/intern/rna_cloth.c +++ b/source/blender/makesrna/intern/rna_cloth.c @@ -45,7 +45,7 @@ static void rna_cloth_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob); @@ -59,7 +59,7 @@ static void rna_cloth_dependency_update(Main *bmain, Scene *scene, PointerRNA *p static void rna_cloth_pinning_changed(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; /* ClothSimSettings *settings = (ClothSimSettings *)ptr->data; */ ClothModifierData *clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth); @@ -311,7 +311,7 @@ static void rna_CollSettings_selfcol_vgroup_set(PointerRNA *ptr, const char *val static PointerRNA rna_ClothSettings_rest_shape_key_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ClothSimSettings *sim = (ClothSimSettings *)ptr->data; return rna_object_shapekey_index_get(ob->data, sim->shapekey_rest); @@ -321,7 +321,7 @@ static void rna_ClothSettings_rest_shape_key_set(PointerRNA *ptr, PointerRNA value, struct ReportList *UNUSED(reports)) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ClothSimSettings *sim = (ClothSimSettings *)ptr->data; sim->shapekey_rest = rna_object_shapekey_index_set(ob->data, value, sim->shapekey_rest); @@ -347,7 +347,7 @@ static void rna_ClothSettings_gravity_set(PointerRNA *ptr, const float *values) static char *rna_ClothSettings_path(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ModifierData *md = modifiers_findByType(ob, eModifierType_Cloth); if (md) { @@ -362,7 +362,7 @@ static char *rna_ClothSettings_path(PointerRNA *ptr) static char *rna_ClothCollisionSettings_path(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ModifierData *md = modifiers_findByType(ob, eModifierType_Cloth); if (md) { diff --git a/source/blender/makesrna/intern/rna_collection.c b/source/blender/makesrna/intern/rna_collection.c index 15d73aae0ae..fb366422f34 100644 --- a/source/blender/makesrna/intern/rna_collection.c +++ b/source/blender/makesrna/intern/rna_collection.c @@ -134,7 +134,7 @@ static bool rna_Collection_objects_override_apply(Main *bmain, "Unsupported RNA override operation on collections' objects"); UNUSED_VARS_NDEBUG(opop); - Collection *coll_dst = ptr_dst->id.data; + Collection *coll_dst = (Collection *)ptr_dst->owner_id; if (ptr_item_dst->type == NULL || ptr_item_src->type == NULL) { BLI_assert(0 && "invalid source or destination object."); @@ -237,7 +237,7 @@ static bool rna_Collection_children_override_apply(Main *bmain, "Unsupported RNA override operation on collections' children"); UNUSED_VARS_NDEBUG(opop); - Collection *coll_dst = ptr_dst->id.data; + Collection *coll_dst = (Collection *)ptr_dst->owner_id; if (ptr_item_dst->type == NULL || ptr_item_src->type == NULL) { BLI_assert(0 && "invalid source or destination sub-collection."); diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index 6bfd2b9f63b..011e373cc61 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -164,8 +164,8 @@ static char *rna_ColorRamp_path(PointerRNA *ptr) char *path = NULL; /* handle the cases where a single data-block may have 2 ramp types */ - if (ptr->id.data) { - ID *id = ptr->id.data; + if (ptr->owner_id) { + ID *id = ptr->owner_id; switch (GS(id->name)) { case ID_NT: { @@ -237,8 +237,8 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr) /* determine the path from the ID-block to the ramp */ /* FIXME: this is a very slow way to do it, but it will have to suffice... */ - if (ptr->id.data) { - ID *id = ptr->id.data; + if (ptr->owner_id) { + ID *id = ptr->owner_id; switch (GS(id->name)) { case ID_NT: { @@ -286,12 +286,12 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr) static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - if (ptr->id.data) { - ID *id = ptr->id.data; + if (ptr->owner_id) { + ID *id = ptr->owner_id; switch (GS(id->name)) { case ID_MA: { - Material *ma = ptr->id.data; + Material *ma = (Material *)ptr->owner_id; DEG_id_tag_update(&ma->id, 0); WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, ma); @@ -309,20 +309,20 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA * break; } case ID_TE: { - Tex *tex = ptr->id.data; + Tex *tex = (Tex *)ptr->owner_id; DEG_id_tag_update(&tex->id, 0); WM_main_add_notifier(NC_TEXTURE, tex); break; } case ID_LS: { - FreestyleLineStyle *linestyle = ptr->id.data; + FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id; WM_main_add_notifier(NC_LINESTYLE, linestyle); break; } case ID_PA: { - ParticleSettings *part = ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->owner_id; DEG_id_tag_update(&part->id, ID_RECALC_GEOMETRY | ID_RECALC_PSYS_REDO); WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, part); @@ -417,7 +417,7 @@ static void rna_ColorManagedDisplaySettings_display_device_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; if (!id) { return; @@ -582,7 +582,7 @@ static void rna_ColorManagedColorspaceSettings_reload_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; if (GS(id->name) == ID_IM) { Image *ima = (Image *)id; @@ -657,7 +657,7 @@ static char *rna_ColorManagedInputColorspaceSettings_path(PointerRNA *UNUSED(ptr static void rna_ColorManagement_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; if (!id) { return; diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 68a5a01dab8..08d2a03b2a9 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -376,8 +376,8 @@ static void rna_Constraint_name_set(PointerRNA *ptr, const char *value) BLI_strncpy_utf8(con->name, value, sizeof(con->name)); /* make sure name is unique */ - if (ptr->id.data) { - Object *ob = ptr->id.data; + if (ptr->owner_id) { + Object *ob = (Object *)ptr->owner_id; ListBase *list = get_constraint_lb(ob, con, NULL); /* if we have the list, check for unique name, otherwise give up */ @@ -418,7 +418,7 @@ static char *rna_Constraint_do_compute_path(Object *ob, bConstraint *con) static char *rna_Constraint_path(PointerRNA *ptr) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bConstraint *con = ptr->data; return rna_Constraint_do_compute_path(ob, con); @@ -426,7 +426,7 @@ static char *rna_Constraint_path(PointerRNA *ptr) static bConstraint *rna_constraint_from_target(PointerRNA *ptr) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bConstraintTarget *tgt = ptr->data; return BKE_constraint_find_from_target(ob, tgt, NULL); @@ -434,7 +434,7 @@ static bConstraint *rna_constraint_from_target(PointerRNA *ptr) static char *rna_ConstraintTarget_path(PointerRNA *ptr) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bConstraintTarget *tgt = ptr->data; bConstraint *con = rna_constraint_from_target(ptr); int index = -1; @@ -469,29 +469,30 @@ static char *rna_ConstraintTarget_path(PointerRNA *ptr) static void rna_Constraint_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - ED_object_constraint_tag_update(bmain, ptr->id.data, ptr->data); + ED_object_constraint_tag_update(bmain, (Object *)ptr->owner_id, ptr->data); } static void rna_Constraint_dependency_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - ED_object_constraint_dependency_tag_update(bmain, ptr->id.data, ptr->data); + ED_object_constraint_dependency_tag_update(bmain, (Object *)ptr->owner_id, ptr->data); } static void rna_ConstraintTarget_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - ED_object_constraint_tag_update(bmain, ptr->id.data, rna_constraint_from_target(ptr)); + ED_object_constraint_tag_update(bmain, (Object *)ptr->owner_id, rna_constraint_from_target(ptr)); } static void rna_ConstraintTarget_dependency_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - ED_object_constraint_dependency_tag_update(bmain, ptr->id.data, rna_constraint_from_target(ptr)); + ED_object_constraint_dependency_tag_update( + bmain, (Object *)ptr->owner_id, rna_constraint_from_target(ptr)); } static void rna_Constraint_influence_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; if (ob->pose) { ob->pose->flag |= (POSE_LOCKED | POSE_DO_UNLOCK); @@ -523,7 +524,7 @@ static const EnumPropertyItem *rna_Constraint_owner_space_itemf(bContext *UNUSED PropertyRNA *UNUSED(prop), bool *UNUSED(r_free)) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bConstraint *con = (bConstraint *)ptr->data; if (BLI_findindex(&ob->constraints, con) == -1) { @@ -671,7 +672,7 @@ static bool rna_Constraint_cameraObject_poll(PointerRNA *ptr, PointerRNA value) Object *ob = (Object *)value.data; if (ob) { - if (ob->type == OB_CAMERA && ob != (Object *)ptr->id.data) { + if (ob->type == OB_CAMERA && ob != (Object *)ptr->owner_id) { return 1; } } @@ -688,7 +689,7 @@ static void rna_Constraint_followTrack_camera_set(PointerRNA *ptr, Object *ob = (Object *)value.data; if (ob) { - if (ob->type == OB_CAMERA && ob != (Object *)ptr->id.data) { + if (ob->type == OB_CAMERA && ob != (Object *)ptr->owner_id) { data->camera = ob; id_lib_extern((ID *)ob); } @@ -707,7 +708,7 @@ static void rna_Constraint_followTrack_depthObject_set(PointerRNA *ptr, Object *ob = (Object *)value.data; if (ob) { - if (ob->type == OB_MESH && ob != (Object *)ptr->id.data) { + if (ob->type == OB_MESH && ob != (Object *)ptr->owner_id) { data->depth_ob = ob; id_lib_extern((ID *)ob); } @@ -722,7 +723,7 @@ static bool rna_Constraint_followTrack_depthObject_poll(PointerRNA *ptr, Pointer Object *ob = (Object *)value.data; if (ob) { - if (ob->type == OB_MESH && ob != (Object *)ptr->id.data) { + if (ob->type == OB_MESH && ob != (Object *)ptr->owner_id) { return 1; } } @@ -739,7 +740,7 @@ static void rna_Constraint_objectSolver_camera_set(PointerRNA *ptr, Object *ob = (Object *)value.data; if (ob) { - if (ob->type == OB_CAMERA && ob != (Object *)ptr->id.data) { + if (ob->type == OB_CAMERA && ob != (Object *)ptr->owner_id) { data->camera = ob; id_lib_extern((ID *)ob); } diff --git a/source/blender/makesrna/intern/rna_context.c b/source/blender/makesrna/intern/rna_context.c index 735cd1fd923..579dd92b703 100644 --- a/source/blender/makesrna/intern/rna_context.c +++ b/source/blender/makesrna/intern/rna_context.c @@ -178,14 +178,14 @@ static PointerRNA rna_Context_collection_get(PointerRNA *ptr) static PointerRNA rna_Context_layer_collection_get(PointerRNA *ptr) { bContext *C = (bContext *)ptr->data; - ptr->id.data = CTX_data_scene(C); + ptr->owner_id = &CTX_data_scene(C)->id; return rna_pointer_inherit_refine(ptr, &RNA_LayerCollection, CTX_data_layer_collection(C)); } static PointerRNA rna_Context_tool_settings_get(PointerRNA *ptr) { bContext *C = (bContext *)ptr->data; - ptr->id.data = CTX_data_scene(C); + ptr->owner_id = &CTX_data_scene(C)->id; return rna_pointer_inherit_refine(ptr, &RNA_ToolSettings, CTX_data_tool_settings(C)); } diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index c5864c35202..a7dac4100db 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -326,7 +326,7 @@ static void rna_Curve_texspace_size_set(PointerRNA *ptr, const float *values) static void rna_Curve_material_index_range( PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) { - Curve *cu = (Curve *)ptr->id.data; + Curve *cu = (Curve *)ptr->owner_id; *min = 0; *max = max_ii(0, cu->totcol - 1); } @@ -347,14 +347,14 @@ static void rna_ChariInfo_material_index_set(PointerRNA *ptr, int value) static void rna_Curve_active_textbox_index_range( PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) { - Curve *cu = (Curve *)ptr->id.data; + Curve *cu = (Curve *)ptr->owner_id; *min = 0; *max = max_ii(0, cu->totbox - 1); } static void rna_Curve_dimension_set(PointerRNA *ptr, int value) { - Curve *cu = (Curve *)ptr->id.data; + Curve *cu = (Curve *)ptr->owner_id; if (value == CU_3D) { cu->flag |= CU_3D; } @@ -370,7 +370,7 @@ static const EnumPropertyItem *rna_Curve_fill_mode_itemf(bContext *UNUSED(C), PropertyRNA *UNUSED(prop), bool *UNUSED(r_free)) { - Curve *cu = (Curve *)ptr->id.data; + Curve *cu = (Curve *)ptr->owner_id; /* cast to quiet warning it IS a const still */ return (EnumPropertyItem *)((cu->flag & CU_3D) ? curve3d_fill_mode_items : @@ -388,7 +388,7 @@ static int rna_Nurb_length(PointerRNA *ptr) static void rna_Nurb_type_set(PointerRNA *ptr, int value) { - Curve *cu = (Curve *)ptr->id.data; + Curve *cu = (Curve *)ptr->owner_id; Nurb *nu = (Nurb *)ptr->data; const int pntsu_prev = nu->pntsu; @@ -418,7 +418,7 @@ static void rna_Curve_update_data_id(Main *UNUSED(bmain), Scene *UNUSED(scene), static void rna_Curve_update_data(Main *bmain, Scene *scene, PointerRNA *ptr) { - rna_Curve_update_data_id(bmain, scene, ptr->id.data); + rna_Curve_update_data_id(bmain, scene, ptr->owner_id); } static void rna_Curve_update_deps(Main *bmain, Scene *scene, PointerRNA *ptr) @@ -429,7 +429,7 @@ static void rna_Curve_update_deps(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_Curve_update_points(Main *bmain, Scene *scene, PointerRNA *ptr) { - Curve *cu = (Curve *)ptr->id.data; + Curve *cu = (Curve *)ptr->owner_id; Nurb *nu = curve_nurb_from_point(cu, ptr->data, NULL, NULL); if (nu) { @@ -441,7 +441,7 @@ static void rna_Curve_update_points(Main *bmain, Scene *scene, PointerRNA *ptr) static PointerRNA rna_Curve_bevelObject_get(PointerRNA *ptr) { - Curve *cu = (Curve *)ptr->id.data; + Curve *cu = (Curve *)ptr->owner_id; Object *ob = cu->bevobj; if (ob) { @@ -455,7 +455,7 @@ static void rna_Curve_bevelObject_set(PointerRNA *ptr, PointerRNA value, struct ReportList *UNUSED(reports)) { - Curve *cu = (Curve *)ptr->id.data; + Curve *cu = (Curve *)ptr->owner_id; Object *ob = (Object *)value.data; if (ob) { @@ -473,7 +473,7 @@ static void rna_Curve_bevelObject_set(PointerRNA *ptr, static bool rna_Curve_otherObject_poll(PointerRNA *ptr, PointerRNA value) { - Curve *cu = (Curve *)ptr->id.data; + Curve *cu = (Curve *)ptr->owner_id; Object *ob = (Object *)value.data; if (ob) { @@ -487,7 +487,7 @@ static bool rna_Curve_otherObject_poll(PointerRNA *ptr, PointerRNA value) static PointerRNA rna_Curve_taperObject_get(PointerRNA *ptr) { - Curve *cu = (Curve *)ptr->id.data; + Curve *cu = (Curve *)ptr->owner_id; Object *ob = cu->taperobj; if (ob) { @@ -501,7 +501,7 @@ static void rna_Curve_taperObject_set(PointerRNA *ptr, PointerRNA value, struct ReportList *UNUSED(reports)) { - Curve *cu = (Curve *)ptr->id.data; + Curve *cu = (Curve *)ptr->owner_id; Object *ob = (Object *)value.data; if (ob) { @@ -519,7 +519,7 @@ static void rna_Curve_taperObject_set(PointerRNA *ptr, static void rna_Curve_resolution_u_update_data(Main *bmain, Scene *scene, PointerRNA *ptr) { - Curve *cu = (Curve *)ptr->id.data; + Curve *cu = (Curve *)ptr->owner_id; ListBase *nurbs = BKE_curve_nurbs_get(cu); Nurb *nu = nurbs->first; @@ -533,7 +533,7 @@ static void rna_Curve_resolution_u_update_data(Main *bmain, Scene *scene, Pointe static void rna_Curve_resolution_v_update_data(Main *bmain, Scene *scene, PointerRNA *ptr) { - Curve *cu = (Curve *)ptr->id.data; + Curve *cu = (Curve *)ptr->owner_id; ListBase *nurbs = BKE_curve_nurbs_get(cu); Nurb *nu = nurbs->first; @@ -547,26 +547,26 @@ static void rna_Curve_resolution_v_update_data(Main *bmain, Scene *scene, Pointe static float rna_Curve_offset_get(PointerRNA *ptr) { - Curve *cu = (Curve *)ptr->id.data; + Curve *cu = (Curve *)ptr->owner_id; return cu->width - 1.0f; } static void rna_Curve_offset_set(PointerRNA *ptr, float value) { - Curve *cu = (Curve *)ptr->id.data; + Curve *cu = (Curve *)ptr->owner_id; cu->width = 1.0f + value; } static int rna_Curve_body_length(PointerRNA *ptr); static void rna_Curve_body_get(PointerRNA *ptr, char *value) { - Curve *cu = (Curve *)ptr->id.data; + Curve *cu = (Curve *)ptr->owner_id; BLI_strncpy(value, cu->str, rna_Curve_body_length(ptr) + 1); } static int rna_Curve_body_length(PointerRNA *ptr) { - Curve *cu = (Curve *)ptr->id.data; + Curve *cu = (Curve *)ptr->owner_id; return cu->len; } @@ -576,7 +576,7 @@ static void rna_Curve_body_set(PointerRNA *ptr, const char *value) size_t len_bytes; size_t len_chars = BLI_strlen_utf8_ex(value, &len_bytes); - Curve *cu = (Curve *)ptr->id.data; + Curve *cu = (Curve *)ptr->owner_id; cu->len_wchar = len_chars; cu->len = len_bytes; @@ -770,7 +770,7 @@ static void rna_Curve_active_spline_set(PointerRNA *ptr, static char *rna_Curve_spline_path(PointerRNA *ptr) { - Curve *cu = (Curve *)ptr->id.data; + Curve *cu = (Curve *)ptr->owner_id; ListBase *nubase = BKE_curve_nurbs_get(cu); Nurb *nu = ptr->data; int index = BLI_findindex(nubase, nu); @@ -786,7 +786,7 @@ static char *rna_Curve_spline_path(PointerRNA *ptr) /* use for both bezier and nurbs */ static char *rna_Curve_spline_point_path(PointerRNA *ptr) { - Curve *cu = (Curve *)ptr->id.data; + Curve *cu = (Curve *)ptr->owner_id; Nurb *nu; void *point = ptr->data; int nu_index, pt_index; @@ -808,7 +808,7 @@ static char *rna_Curve_spline_point_path(PointerRNA *ptr) static char *rna_TextBox_path(PointerRNA *ptr) { - Curve *cu = (Curve *)ptr->id.data; + Curve *cu = (Curve *)ptr->owner_id; TextBox *tb = ptr->data; int index = (int)(tb - cu->tb); @@ -822,13 +822,13 @@ static char *rna_TextBox_path(PointerRNA *ptr) static void rna_Curve_splines_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Curve *cu = (Curve *)ptr->id.data; + Curve *cu = (Curve *)ptr->owner_id; rna_iterator_listbase_begin(iter, BKE_curve_nurbs_get(cu), NULL); } static bool rna_Curve_is_editmode_get(PointerRNA *ptr) { - Curve *cu = (Curve *)ptr->id.data; + Curve *cu = (Curve *)ptr->owner_id; const short type = BKE_curve_type_get(cu); if (type == OB_FONT) { return (cu->editfont != NULL); diff --git a/source/blender/makesrna/intern/rna_dynamicpaint.c b/source/blender/makesrna/intern/rna_dynamicpaint.c index 792c4450b9c..30a68a4919e 100644 --- a/source/blender/makesrna/intern/rna_dynamicpaint.c +++ b/source/blender/makesrna/intern/rna_dynamicpaint.c @@ -92,7 +92,7 @@ static void rna_DynamicPaint_redoModifier(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - DEG_id_tag_update(ptr->id.data, ID_RECALC_GEOMETRY); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY); } static void rna_DynamicPaintSurfaces_updateFrames(Main *UNUSED(bmain), diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index 222d2fc69da..6c546940e6d 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -183,7 +183,7 @@ static bool rna_ChannelDriver_is_simple_expression_get(PointerRNA *ptr) static void rna_ChannelDriver_update_data(Main *bmain, Scene *scene, PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; ChannelDriver *driver = ptr->data; driver->flag &= ~DRIVER_FLAG_INVALID; @@ -211,7 +211,7 @@ static void rna_DriverTarget_update_data(Main *bmain, Scene *scene, PointerRNA * PointerRNA driverptr; ChannelDriver *driver; FCurve *fcu; - AnimData *adt = BKE_animdata_from_id(ptr->id.data); + AnimData *adt = BKE_animdata_from_id(ptr->owner_id); /* find the driver this belongs to and update it */ for (fcu = adt->drivers.first; fcu; fcu = fcu->next) { @@ -221,7 +221,7 @@ static void rna_DriverTarget_update_data(Main *bmain, Scene *scene, PointerRNA * if (driver) { /* FIXME: need to be able to search targets for required one... */ /*BLI_findindex(&driver->targets, ptr->data) != -1) */ - RNA_pointer_create(ptr->id.data, &RNA_Driver, driver, &driverptr); + RNA_pointer_create(ptr->owner_id, &RNA_Driver, driver, &driverptr); rna_ChannelDriver_update_data(bmain, scene, &driverptr); return; } @@ -466,8 +466,8 @@ static void rna_FCurve_group_set(PointerRNA *ptr, PointerRNA value, struct ReportList *UNUSED(reports)) { - ID *pid = (ID *)ptr->id.data; - ID *vid = (ID *)value.id.data; + ID *pid = ptr->owner_id; + ID *vid = value.owner_id; FCurve *fcu = ptr->data; bAction *act = NULL; @@ -491,7 +491,7 @@ static void rna_FCurve_group_set(PointerRNA *ptr, } else { /* the ID given is the owner of the F-Curve (for drivers) */ - AnimData *adt = BKE_animdata_from_id(ptr->id.data); + AnimData *adt = BKE_animdata_from_id(ptr->owner_id); act = (adt) ? adt->action : NULL; } @@ -572,7 +572,7 @@ static void rna_FCurve_update_data_ex(ID *id, FCurve *fcu, Main *bmain) static void rna_FCurve_update_data(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { BLI_assert(ptr->type == &RNA_FCurve); - rna_FCurve_update_data_ex((ID *)ptr->id.data, (FCurve *)ptr->data, bmain); + rna_FCurve_update_data_ex(ptr->owner_id, (FCurve *)ptr->data, bmain); } static void rna_FCurve_update_data_relations(Main *bmain, @@ -587,7 +587,7 @@ static void rna_FCurve_update_data_relations(Main *bmain, */ static void rna_FCurve_update_eval(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - rna_tag_animation_update(bmain, (ID *)ptr->id.data, true); + rna_tag_animation_update(bmain, ptr->owner_id, true); } static PointerRNA rna_FCurve_active_modifier_get(PointerRNA *ptr) @@ -700,7 +700,7 @@ static void rna_FModifier_blending_range( static void rna_FModifier_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; FModifier *fcm = (FModifier *)ptr->data; if (fcm->curve && fcm->type == FMODIFIER_TYPE_CYCLES) { @@ -1065,7 +1065,7 @@ static void rna_FModifierEnvelope_points_remove( static void rna_Keyframe_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - rna_tag_animation_update(bmain, (ID *)ptr->id.data, true); + rna_tag_animation_update(bmain, ptr->owner_id, true); } #else diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c index 45361702384..5d21e718934 100644 --- a/source/blender/makesrna/intern/rna_fluidsim.c +++ b/source/blender/makesrna/intern/rna_fluidsim.c @@ -75,7 +75,7 @@ static StructRNA *rna_FluidSettings_refine(struct PointerRNA *ptr) static void rna_fluid_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob); @@ -101,7 +101,7 @@ static int fluidsim_find_lastframe(Main *bmain, Object *ob, FluidsimSettings *fs static void rna_fluid_find_enframe(Main *bmain, Scene *scene, PointerRNA *ptr) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType( ob, eModifierType_Fluidsim); @@ -116,7 +116,7 @@ static void rna_fluid_find_enframe(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_FluidSettings_update_type(Main *bmain, Scene *scene, PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; FluidsimModifierData *fluidmd; ParticleSystemModifierData *psmd; ParticleSystem *psys, *next_psys; @@ -177,7 +177,7 @@ static void rna_DomainFluidSettings_memory_estimate_get(PointerRNA *ptr, char *v (void)ptr; value[0] = '\0'; # else - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; FluidsimSettings *fss = (FluidsimSettings *)ptr->data; fluid_estimate_memory(ob, fss, value); diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index 5313607d4ea..bd3321377d3 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -144,13 +144,13 @@ static EnumPropertyItem rna_enum_gpencil_caps_modes_items[] = { static void rna_GPencil_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - DEG_id_tag_update(ptr->id.data, ID_RECALC_GEOMETRY); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY); WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL); } static void rna_GPencil_autolock(Main *bmain, Scene *scene, PointerRNA *ptr) { - bGPdata *gpd = (bGPdata *)ptr->id.data; + bGPdata *gpd = (bGPdata *)ptr->owner_id; bGPDlayer *gpl = NULL; if (gpd->flag & GP_DATA_AUTOLOCK_LAYERS) { @@ -182,7 +182,7 @@ static void rna_GPencil_autolock(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_GPencil_editmode_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - bGPdata *gpd = (bGPdata *)ptr->id.data; + bGPdata *gpd = (bGPdata *)ptr->owner_id; DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); /* Notify all places where GPencil data lives that the editing state is different */ @@ -194,7 +194,7 @@ static void UNUSED_FUNCTION(rna_GPencil_onion_skinning_update)(Main *bmain, Scene *scene, PointerRNA *ptr) { - bGPdata *gpd = (bGPdata *)ptr->id.data; + bGPdata *gpd = (bGPdata *)ptr->owner_id; bGPDlayer *gpl; bool enabled = false; @@ -362,7 +362,7 @@ static bool rna_GPencilLayer_is_parented_get(PointerRNA *ptr) static PointerRNA rna_GPencil_active_layer_get(PointerRNA *ptr) { - bGPdata *gpd = ptr->id.data; + bGPdata *gpd = (bGPdata *)ptr->owner_id; if (GS(gpd->id.name) == ID_GD) { /* why would this ever be not GD */ bGPDlayer *gl; @@ -385,7 +385,7 @@ static void rna_GPencil_active_layer_set(PointerRNA *ptr, PointerRNA value, struct ReportList *UNUSED(reports)) { - bGPdata *gpd = ptr->id.data; + bGPdata *gpd = (bGPdata *)ptr->owner_id; /* Don't allow setting active layer to NULL if layers exist * as this breaks various tools. Tools should be used instead @@ -414,7 +414,7 @@ static void rna_GPencil_active_layer_set(PointerRNA *ptr, static int rna_GPencil_active_layer_index_get(PointerRNA *ptr) { - bGPdata *gpd = (bGPdata *)ptr->id.data; + bGPdata *gpd = (bGPdata *)ptr->owner_id; bGPDlayer *gpl = BKE_gpencil_layer_getactive(gpd); return BLI_findindex(&gpd->layers, gpl); @@ -422,7 +422,7 @@ static int rna_GPencil_active_layer_index_get(PointerRNA *ptr) static void rna_GPencil_active_layer_index_set(PointerRNA *ptr, int value) { - bGPdata *gpd = (bGPdata *)ptr->id.data; + bGPdata *gpd = (bGPdata *)ptr->owner_id; bGPDlayer *gpl = BLI_findlink(&gpd->layers, value); BKE_gpencil_layer_setactive(gpd, gpl); @@ -435,7 +435,7 @@ static void rna_GPencil_active_layer_index_set(PointerRNA *ptr, int value) static void rna_GPencil_active_layer_index_range( PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { - bGPdata *gpd = (bGPdata *)ptr->id.data; + bGPdata *gpd = (bGPdata *)ptr->owner_id; *min = 0; *max = max_ii(0, BLI_listbase_count(&gpd->layers) - 1); @@ -449,7 +449,7 @@ static const EnumPropertyItem *rna_GPencil_active_layer_itemf(bContext *C, PropertyRNA *UNUSED(prop), bool *r_free) { - bGPdata *gpd = (bGPdata *)ptr->id.data; + bGPdata *gpd = (bGPdata *)ptr->owner_id; bGPDlayer *gpl; EnumPropertyItem *item = NULL, item_tmp = {0}; int totitem = 0; @@ -478,7 +478,7 @@ static const EnumPropertyItem *rna_GPencil_active_layer_itemf(bContext *C, static void rna_GPencilLayer_info_set(PointerRNA *ptr, const char *value) { - bGPdata *gpd = ptr->id.data; + bGPdata *gpd = (bGPdata *)ptr->owner_id; bGPDlayer *gpl = ptr->data; char oldname[128] = ""; @@ -539,7 +539,7 @@ static bGPDstroke *rna_GPencil_stroke_point_find_stroke(const bGPdata *gpd, static void rna_GPencil_stroke_point_select_set(PointerRNA *ptr, const bool value) { - bGPdata *gpd = ptr->id.data; + bGPdata *gpd = (bGPdata *)ptr->owner_id; bGPDspoint *pt = ptr->data; bGPDstroke *gps = NULL; diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c index 21eaaf9dd50..0b40cc9f7f9 100644 --- a/source/blender/makesrna/intern/rna_gpencil_modifier.c +++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c @@ -228,8 +228,8 @@ static void rna_GpencilModifier_name_set(PointerRNA *ptr, const char *value) BLI_strncpy_utf8(gmd->name, value, sizeof(gmd->name)); /* make sure the name is truly unique */ - if (ptr->id.data) { - Object *ob = ptr->id.data; + if (ptr->owner_id) { + Object *ob = (Object *)ptr->owner_id; BKE_gpencil_modifier_unique_name(&ob->greasepencil_modifiers, gmd); } @@ -248,8 +248,8 @@ static char *rna_GpencilModifier_path(PointerRNA *ptr) static void rna_GpencilModifier_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - DEG_id_tag_update(ptr->id.data, ID_RECALC_GEOMETRY); - WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ptr->id.data); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY); + WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ptr->owner_id); } static void rna_GpencilModifier_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr) @@ -300,7 +300,7 @@ static void greasepencil_modifier_object_set(Object *self, PointerRNA *ptr, PointerRNA value, struct ReportList *UNUSED(reports)) \ { \ _type##GpencilModifierData *tmd = (_type##GpencilModifierData *)ptr->data; \ - greasepencil_modifier_object_set(ptr->id.data, &tmd->_prop, _obtype, value); \ + greasepencil_modifier_object_set((Object *)ptr->owner_id, &tmd->_prop, _obtype, value); \ } RNA_GP_MOD_OBJECT_SET(Armature, object, OB_ARMATURE); diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index 75867b2fe13..517bd2b7276 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -91,7 +91,7 @@ static bool rna_Image_dirty_get(PointerRNA *ptr) static void rna_Image_source_set(PointerRNA *ptr, int value) { - Image *ima = ptr->id.data; + Image *ima = (Image *)ptr->owner_id; if (value != ima->source) { ima->source = value; @@ -105,7 +105,7 @@ static void rna_Image_source_set(PointerRNA *ptr, int value) static void rna_Image_reload_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - Image *ima = ptr->id.data; + Image *ima = (Image *)ptr->owner_id; BKE_image_signal(bmain, ima, NULL, IMA_SIGNAL_RELOAD); WM_main_add_notifier(NC_IMAGE | NA_EDITED, &ima->id); DEG_id_tag_update(&ima->id, 0); @@ -114,13 +114,13 @@ static void rna_Image_reload_update(Main *bmain, Scene *UNUSED(scene), PointerRN static void rna_Image_generated_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - Image *ima = ptr->id.data; + Image *ima = (Image *)ptr->owner_id; BKE_image_signal(bmain, ima, NULL, IMA_SIGNAL_FREE); } static void rna_Image_colormanage_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - Image *ima = ptr->id.data; + Image *ima = (Image *)ptr->owner_id; BKE_image_signal(bmain, ima, NULL, IMA_SIGNAL_COLORMANAGE); DEG_id_tag_update(&ima->id, 0); DEG_id_tag_update(&ima->id, ID_RECALC_EDITORS); @@ -130,7 +130,7 @@ static void rna_Image_colormanage_update(Main *bmain, Scene *UNUSED(scene), Poin static void rna_Image_views_format_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - Image *ima = ptr->id.data; + Image *ima = (Image *)ptr->owner_id; ImBuf *ibuf; void *lock; @@ -148,7 +148,7 @@ static void rna_Image_views_format_update(Main *bmain, Scene *scene, PointerRNA static void rna_ImageUser_update(Main *bmain, Scene *scene, PointerRNA *ptr) { ImageUser *iuser = ptr->data; - ID *id = ptr->id.data; + ID *id = ptr->owner_id; BKE_image_user_frame_calc(NULL, iuser, scene->r.cfra); @@ -173,10 +173,10 @@ static void rna_ImageUser_relations_update(Main *bmain, Scene *scene, PointerRNA static char *rna_ImageUser_path(PointerRNA *ptr) { - if (ptr->id.data) { + if (ptr->owner_id) { /* ImageUser *iuser = ptr->data; */ - switch (GS(((ID *)ptr->id.data)->name)) { + switch (GS(ptr->owner_id->name)) { case ID_OB: case ID_TE: { return BLI_strdup("image_user"); @@ -331,7 +331,7 @@ static int rna_Image_depth_get(PointerRNA *ptr) static int rna_Image_frame_duration_get(PointerRNA *ptr) { - Image *ima = ptr->id.data; + Image *ima = (Image *)ptr->owner_id; int duration = 1; if (BKE_image_has_anim(ima)) { @@ -352,7 +352,7 @@ static int rna_Image_frame_duration_get(PointerRNA *ptr) static int rna_Image_pixels_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) { - Image *ima = ptr->id.data; + Image *ima = (Image *)ptr->owner_id; ImBuf *ibuf; void *lock; @@ -372,7 +372,7 @@ static int rna_Image_pixels_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY static void rna_Image_pixels_get(PointerRNA *ptr, float *values) { - Image *ima = ptr->id.data; + Image *ima = (Image *)ptr->owner_id; ImBuf *ibuf; void *lock; int i, size; @@ -397,7 +397,7 @@ static void rna_Image_pixels_get(PointerRNA *ptr, float *values) static void rna_Image_pixels_set(PointerRNA *ptr, const float *values) { - Image *ima = ptr->id.data; + Image *ima = (Image *)ptr->owner_id; ImBuf *ibuf; void *lock; int i, size; @@ -463,7 +463,7 @@ static bool rna_Image_is_float_get(PointerRNA *ptr) static PointerRNA rna_Image_packed_file_get(PointerRNA *ptr) { - Image *ima = (Image *)ptr->id.data; + Image *ima = (Image *)ptr->owner_id; if (BKE_image_has_packedfile(ima)) { ImagePackedFile *imapf = ima->packedfiles.first; @@ -485,7 +485,7 @@ static void rna_RenderSlot_clear(ID *id, RenderSlot *slot, ImageUser *iuser) static PointerRNA rna_render_slots_active_get(PointerRNA *ptr) { - Image *image = (Image *)ptr->id.data; + Image *image = (Image *)ptr->owner_id; RenderSlot *render_slot = BKE_image_get_renderslot(image, image->render_slot); return rna_pointer_inherit_refine(ptr, &RNA_RenderSlot, render_slot); @@ -495,8 +495,8 @@ static void rna_render_slots_active_set(PointerRNA *ptr, PointerRNA value, struct ReportList *UNUSED(reports)) { - Image *image = (Image *)ptr->id.data; - if (value.id.data == image) { + Image *image = (Image *)ptr->owner_id; + if (value.owner_id == &image->id) { RenderSlot *slot = (RenderSlot *)value.data; int index = BLI_findindex(&image->renderslots, slot); if (index != -1) { @@ -507,13 +507,13 @@ static void rna_render_slots_active_set(PointerRNA *ptr, static int rna_render_slots_active_index_get(PointerRNA *ptr) { - Image *image = (Image *)ptr->id.data; + Image *image = (Image *)ptr->owner_id; return image->render_slot; } static void rna_render_slots_active_index_set(PointerRNA *ptr, int value) { - Image *image = (Image *)ptr->id.data; + Image *image = (Image *)ptr->owner_id; int num_slots = BLI_listbase_count(&image->renderslots); image->render_slot = value; CLAMP(image->render_slot, 0, num_slots - 1); @@ -522,7 +522,7 @@ static void rna_render_slots_active_index_set(PointerRNA *ptr, int value) static void rna_render_slots_active_index_range( PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) { - Image *image = (Image *)ptr->id.data; + Image *image = (Image *)ptr->owner_id; *min = 0; *max = max_ii(0, BLI_listbase_count(&image->renderslots) - 1); } diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index 43024a29534..46c3adbd6ef 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -87,8 +87,8 @@ static void rna_ShapeKey_name_set(PointerRNA *ptr, const char *value) BLI_strncpy_utf8(kb->name, value, sizeof(kb->name)); /* make sure the name is truly unique */ - if (ptr->id.data) { - Key *key = rna_ShapeKey_find_key(ptr->id.data); + if (ptr->owner_id) { + Key *key = rna_ShapeKey_find_key(ptr->owner_id); BLI_uniquename(&key->block, kb, CTX_DATA_(BLT_I18NCONTEXT_ID_SHAPEKEY, "Key"), @@ -174,7 +174,7 @@ static void rna_ShapeKey_slider_max_set(PointerRNA *ptr, float value) static Mesh *rna_KeyBlock_normals_get_mesh(PointerRNA *ptr, ID *id) { - Key *key = rna_ShapeKey_find_key((id == NULL && ptr != NULL) ? ptr->id.data : id); + Key *key = rna_ShapeKey_find_key((id == NULL && ptr != NULL) ? ptr->owner_id : id); id = key ? key->from : NULL; if (id != NULL) { @@ -315,7 +315,7 @@ static PointerRNA rna_ShapeKey_relative_key_get(PointerRNA *ptr) { KeyBlock *kb = (KeyBlock *)ptr->data; - return rna_object_shapekey_index_get(ptr->id.data, kb->relative); + return rna_object_shapekey_index_get(ptr->owner_id, kb->relative); } static void rna_ShapeKey_relative_key_set(PointerRNA *ptr, @@ -324,7 +324,7 @@ static void rna_ShapeKey_relative_key_set(PointerRNA *ptr, { KeyBlock *kb = (KeyBlock *)ptr->data; - kb->relative = rna_object_shapekey_index_set(ptr->id.data, value, kb->relative); + kb->relative = rna_object_shapekey_index_set(ptr->owner_id, value, kb->relative); } static void rna_ShapeKeyPoint_co_get(PointerRNA *ptr, float *values) @@ -565,7 +565,7 @@ static void rna_ShapeKey_data_begin_mixed(CollectionPropertyIterator *iter, static void rna_ShapeKey_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Key *key = rna_ShapeKey_find_key(ptr->id.data); + Key *key = rna_ShapeKey_find_key(ptr->owner_id); KeyBlock *kb = (KeyBlock *)ptr->data; int tot = kb->totelem, size = key->elemsize; @@ -602,7 +602,7 @@ static void rna_ShapeKey_data_begin(CollectionPropertyIterator *iter, PointerRNA static int rna_ShapeKey_data_length(PointerRNA *ptr) { - Key *key = rna_ShapeKey_find_key(ptr->id.data); + Key *key = rna_ShapeKey_find_key(ptr->owner_id); KeyBlock *kb = (KeyBlock *)ptr->data; int tot = kb->totelem; @@ -615,7 +615,7 @@ static int rna_ShapeKey_data_length(PointerRNA *ptr) static PointerRNA rna_ShapeKey_data_get(CollectionPropertyIterator *iter) { - Key *key = rna_ShapeKey_find_key(iter->parent.id.data); + Key *key = rna_ShapeKey_find_key(iter->parent.owner_id); void *ptr = rna_iterator_array_get(iter); StructRNA *type = &RNA_ShapeKeyPoint; @@ -637,7 +637,7 @@ static PointerRNA rna_ShapeKey_data_get(CollectionPropertyIterator *iter) int rna_ShapeKey_data_lookup_int(PointerRNA *ptr, int index, PointerRNA *r_ptr) { - Key *key = rna_ShapeKey_find_key(ptr->id.data); + Key *key = rna_ShapeKey_find_key(ptr->owner_id); KeyBlock *kb = (KeyBlock *)ptr->data; int elemsize = key->elemsize; char *databuf = kb->data; @@ -672,7 +672,7 @@ int rna_ShapeKey_data_lookup_int(PointerRNA *ptr, int index, PointerRNA *r_ptr) static char *rna_ShapeKey_path(PointerRNA *ptr) { KeyBlock *kb = (KeyBlock *)ptr->data; - ID *id = ptr->id.data; + ID *id = ptr->owner_id; char name_esc[sizeof(kb->name) * 2]; BLI_strescape(name_esc, kb->name, sizeof(name_esc)); @@ -687,7 +687,7 @@ static char *rna_ShapeKey_path(PointerRNA *ptr) static void rna_Key_update_data(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - Key *key = ptr->id.data; + Key *key = (Key *)ptr->owner_id; Object *ob; for (ob = bmain->objects.first; ob; ob = ob->id.next) { @@ -756,8 +756,8 @@ static int rna_ShapeKeyPoint_get_index(Key *key, KeyBlock *kb, float *point) static char *rna_ShapeKeyPoint_path(PointerRNA *ptr) { - ID *id = (ID *)ptr->id.data; - Key *key = rna_ShapeKey_find_key(ptr->id.data); + ID *id = ptr->owner_id; + Key *key = rna_ShapeKey_find_key(ptr->owner_id); KeyBlock *kb; float *point = (float *)ptr->data; diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c index 5a8223af28a..34f5b6caee1 100644 --- a/source/blender/makesrna/intern/rna_lattice.c +++ b/source/blender/makesrna/intern/rna_lattice.c @@ -49,7 +49,7 @@ static void rna_LatticePoint_co_get(PointerRNA *ptr, float *values) { - Lattice *lt = (Lattice *)ptr->id.data; + Lattice *lt = (Lattice *)ptr->owner_id; BPoint *bp = (BPoint *)ptr->data; int index = bp - lt->def; int u, v, w; @@ -63,7 +63,7 @@ static void rna_LatticePoint_co_get(PointerRNA *ptr, float *values) static void rna_LatticePoint_groups_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Lattice *lt = (Lattice *)ptr->id.data; + Lattice *lt = (Lattice *)ptr->owner_id; if (lt->dvert) { BPoint *bp = (BPoint *)ptr->data; @@ -95,7 +95,7 @@ static void rna_Lattice_points_begin(CollectionPropertyIterator *iter, PointerRN static void rna_Lattice_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; DEG_id_tag_update(id, 0); WM_main_add_notifier(NC_GEOM | ND_DATA, id); @@ -109,8 +109,8 @@ static void rna_Lattice_update_data_editlatt(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - ID *id = ptr->id.data; - Lattice *lt = (Lattice *)ptr->id.data; + ID *id = ptr->owner_id; + Lattice *lt = (Lattice *)ptr->owner_id; if (lt->editlatt) { Lattice *lt_em = lt->editlatt->latt; @@ -127,7 +127,7 @@ static void rna_Lattice_update_data_editlatt(Main *UNUSED(bmain), static void rna_Lattice_update_size(Main *bmain, Scene *scene, PointerRNA *ptr) { - Lattice *lt = ptr->id.data; + Lattice *lt = (Lattice *)ptr->owner_id; Object *ob; int newu, newv, neww; @@ -224,7 +224,7 @@ static void rna_Lattice_vg_name_set(PointerRNA *ptr, const char *value) /* annoying, but is a consequence of RNA structures... */ static char *rna_LatticePoint_path(PointerRNA *ptr) { - Lattice *lt = (Lattice *)ptr->id.data; + Lattice *lt = (Lattice *)ptr->owner_id; void *point = ptr->data; BPoint *points = NULL; @@ -251,7 +251,7 @@ static char *rna_LatticePoint_path(PointerRNA *ptr) static bool rna_Lattice_is_editmode_get(PointerRNA *ptr) { - Lattice *lt = (Lattice *)ptr->id.data; + Lattice *lt = (Lattice *)ptr->owner_id; return (lt->editlatt != NULL); } diff --git a/source/blender/makesrna/intern/rna_layer.c b/source/blender/makesrna/intern/rna_layer.c index c9b51707759..1ad006cbc37 100644 --- a/source/blender/makesrna/intern/rna_layer.c +++ b/source/blender/makesrna/intern/rna_layer.c @@ -152,7 +152,7 @@ static int rna_ViewLayer_objects_selected_skip(CollectionPropertyIterator *iter, static PointerRNA rna_ViewLayer_depsgraph_get(PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; if (GS(id->name) == ID_SCE) { Scene *scene = (Scene *)id; ViewLayer *view_layer = (ViewLayer *)ptr->data; @@ -274,7 +274,7 @@ static void rna_LayerCollection_exclude_update_recursive(ListBase *lb, const boo static void rna_LayerCollection_exclude_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; LayerCollection *lc = (LayerCollection *)ptr->data; ViewLayer *view_layer = BKE_view_layer_find_from_collection(scene, lc); @@ -294,7 +294,7 @@ static void rna_LayerCollection_exclude_update(Main *bmain, Scene *UNUSED(scene) static void rna_LayerCollection_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; LayerCollection *lc = (LayerCollection *)ptr->data; ViewLayer *view_layer = BKE_view_layer_find_from_collection(scene, lc); diff --git a/source/blender/makesrna/intern/rna_light.c b/source/blender/makesrna/intern/rna_light.c index 79ba5970007..8640c35f1b8 100644 --- a/source/blender/makesrna/intern/rna_light.c +++ b/source/blender/makesrna/intern/rna_light.c @@ -77,7 +77,7 @@ static StructRNA *rna_Light_refine(struct PointerRNA *ptr) static void rna_Light_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Light *la = ptr->id.data; + Light *la = (Light *)ptr->owner_id; DEG_id_tag_update(&la->id, 0); WM_main_add_notifier(NC_LAMP | ND_LIGHTING, la); @@ -85,7 +85,7 @@ static void rna_Light_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR static void rna_Light_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Light *la = ptr->id.data; + Light *la = (Light *)ptr->owner_id; DEG_id_tag_update(&la->id, 0); WM_main_add_notifier(NC_LAMP | ND_LIGHTING_DRAW, la); diff --git a/source/blender/makesrna/intern/rna_lightprobe.c b/source/blender/makesrna/intern/rna_lightprobe.c index a8b95036e02..463cefdf3f0 100644 --- a/source/blender/makesrna/intern/rna_lightprobe.c +++ b/source/blender/makesrna/intern/rna_lightprobe.c @@ -43,7 +43,7 @@ static void rna_LightProbe_recalc(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - DEG_id_tag_update(ptr->id.data, ID_RECALC_GEOMETRY); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY); } #else diff --git a/source/blender/makesrna/intern/rna_linestyle.c b/source/blender/makesrna/intern/rna_linestyle.c index 936a5e6a53d..f6cfc33c82e 100644 --- a/source/blender/makesrna/intern/rna_linestyle.c +++ b/source/blender/makesrna/intern/rna_linestyle.c @@ -287,7 +287,7 @@ static char *rna_LineStyle_geometry_modifier_path(PointerRNA *ptr) static void rna_LineStyleColorModifier_name_set(PointerRNA *ptr, const char *value) { - FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->id.data; + FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id; LineStyleModifier *m = (LineStyleModifier *)ptr->data; BLI_strncpy_utf8(m->name, value, sizeof(m->name)); @@ -301,7 +301,7 @@ static void rna_LineStyleColorModifier_name_set(PointerRNA *ptr, const char *val static void rna_LineStyleAlphaModifier_name_set(PointerRNA *ptr, const char *value) { - FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->id.data; + FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id; LineStyleModifier *m = (LineStyleModifier *)ptr->data; BLI_strncpy_utf8(m->name, value, sizeof(m->name)); @@ -315,7 +315,7 @@ static void rna_LineStyleAlphaModifier_name_set(PointerRNA *ptr, const char *val static void rna_LineStyleThicknessModifier_name_set(PointerRNA *ptr, const char *value) { - FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->id.data; + FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id; LineStyleModifier *m = (LineStyleModifier *)ptr->data; BLI_strncpy_utf8(m->name, value, sizeof(m->name)); @@ -329,7 +329,7 @@ static void rna_LineStyleThicknessModifier_name_set(PointerRNA *ptr, const char static void rna_LineStyleGeometryModifier_name_set(PointerRNA *ptr, const char *value) { - FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->id.data; + FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id; LineStyleModifier *m = (LineStyleModifier *)ptr->data; BLI_strncpy_utf8(m->name, value, sizeof(m->name)); @@ -343,13 +343,13 @@ static void rna_LineStyleGeometryModifier_name_set(PointerRNA *ptr, const char * static void rna_LineStyle_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->id.data; + FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id; rna_iterator_array_begin(iter, (void *)linestyle->mtex, sizeof(MTex *), MAX_MTEX, 0, NULL); } static PointerRNA rna_LineStyle_active_texture_get(PointerRNA *ptr) { - FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->id.data; + FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id; Tex *tex; tex = give_current_linestyle_texture(linestyle); @@ -360,14 +360,14 @@ static void rna_LineStyle_active_texture_set(PointerRNA *ptr, PointerRNA value, struct ReportList *UNUSED(reports)) { - FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->id.data; + FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id; set_current_linestyle_texture(linestyle, value.data); } static void rna_LineStyle_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - FreestyleLineStyle *linestyle = ptr->id.data; + FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id; DEG_id_tag_update(&linestyle->id, 0); WM_main_add_notifier(NC_LINESTYLE, linestyle); diff --git a/source/blender/makesrna/intern/rna_mask.c b/source/blender/makesrna/intern/rna_mask.c index abbbd04143c..adc041174aa 100644 --- a/source/blender/makesrna/intern/rna_mask.c +++ b/source/blender/makesrna/intern/rna_mask.c @@ -58,7 +58,7 @@ static void rna_Mask_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Mask *mask = ptr->id.data; + Mask *mask = (Mask *)ptr->owner_id; WM_main_add_notifier(NC_MASK | ND_DATA, mask); DEG_id_tag_update(&mask->id, 0); @@ -147,21 +147,21 @@ static void rna_MaskParent_id_type_set(PointerRNA *ptr, int value) static void rna_Mask_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Mask *mask = (Mask *)ptr->id.data; + Mask *mask = (Mask *)ptr->owner_id; rna_iterator_listbase_begin(iter, &mask->masklayers, NULL); } static int rna_Mask_layer_active_index_get(PointerRNA *ptr) { - Mask *mask = (Mask *)ptr->id.data; + Mask *mask = (Mask *)ptr->owner_id; return mask->masklay_act; } static void rna_Mask_layer_active_index_set(PointerRNA *ptr, int value) { - Mask *mask = (Mask *)ptr->id.data; + Mask *mask = (Mask *)ptr->owner_id; mask->masklay_act = value; } @@ -169,7 +169,7 @@ static void rna_Mask_layer_active_index_set(PointerRNA *ptr, int value) static void rna_Mask_layer_active_index_range( PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { - Mask *mask = (Mask *)ptr->id.data; + Mask *mask = (Mask *)ptr->owner_id; *min = 0; *max = max_ii(0, mask->masklay_tot - 1); @@ -188,7 +188,7 @@ static char *rna_MaskLayer_path(PointerRNA *ptr) static PointerRNA rna_Mask_layer_active_get(PointerRNA *ptr) { - Mask *mask = (Mask *)ptr->id.data; + Mask *mask = (Mask *)ptr->owner_id; MaskLayer *masklay = BKE_mask_layer_active(mask); return rna_pointer_inherit_refine(ptr, &RNA_MaskLayer, masklay); @@ -198,7 +198,7 @@ static void rna_Mask_layer_active_set(PointerRNA *ptr, PointerRNA value, struct ReportList *UNUSED(reports)) { - Mask *mask = (Mask *)ptr->id.data; + Mask *mask = (Mask *)ptr->owner_id; MaskLayer *masklay = (MaskLayer *)value.data; BKE_mask_layer_active_set(mask, masklay); @@ -213,7 +213,7 @@ static void rna_MaskLayer_splines_begin(CollectionPropertyIterator *iter, Pointe static void rna_MaskLayer_name_set(PointerRNA *ptr, const char *value) { - Mask *mask = (Mask *)ptr->id.data; + Mask *mask = (Mask *)ptr->owner_id; MaskLayer *masklay = (MaskLayer *)ptr->data; char oldname[sizeof(masklay->name)], newname[sizeof(masklay->name)]; @@ -351,7 +351,7 @@ static void rna_MaskSplinePoint_handle_type_set(PointerRNA *ptr, int value) { MaskSplinePoint *point = (MaskSplinePoint *)ptr->data; BezTriple *bezt = &point->bezt; - MaskSpline *spline = mask_spline_from_point((Mask *)ptr->id.data, point); + MaskSpline *spline = mask_spline_from_point((Mask *)ptr->owner_id, point); bezt->h1 = bezt->h2 = value; mask_point_check_stick(point); @@ -370,7 +370,7 @@ static void rna_MaskSplinePoint_handle_left_type_set(PointerRNA *ptr, int value) { MaskSplinePoint *point = (MaskSplinePoint *)ptr->data; BezTriple *bezt = &point->bezt; - MaskSpline *spline = mask_spline_from_point((Mask *)ptr->id.data, point); + MaskSpline *spline = mask_spline_from_point((Mask *)ptr->owner_id, point); bezt->h1 = value; mask_point_check_stick(point); @@ -389,7 +389,7 @@ static void rna_MaskSplinePoint_handle_right_type_set(PointerRNA *ptr, int value { MaskSplinePoint *point = (MaskSplinePoint *)ptr->data; BezTriple *bezt = &point->bezt; - MaskSpline *spline = mask_spline_from_point((Mask *)ptr->id.data, point); + MaskSpline *spline = mask_spline_from_point((Mask *)ptr->owner_id, point); bezt->h2 = value; mask_point_check_stick(point); diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 845ea9a4aee..c108ce90490 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -89,7 +89,7 @@ const EnumPropertyItem rna_enum_ramp_blend_items[] = { static void rna_Material_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Material *ma = ptr->id.data; + Material *ma = (Material *)ptr->owner_id; DEG_id_tag_update(&ma->id, ID_RECALC_SHADING); WM_main_add_notifier(NC_MATERIAL | ND_SHADING, ma); @@ -99,7 +99,7 @@ static void rna_Material_update_previews(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Material *ma = ptr->id.data; + Material *ma = (Material *)ptr->owner_id; if (ma->nodetree) { BKE_node_preview_clear_tree(ma->nodetree); @@ -110,7 +110,7 @@ static void rna_Material_update_previews(Main *UNUSED(bmain), static void rna_MaterialGpencil_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - Material *ma = ptr->id.data; + Material *ma = (Material *)ptr->owner_id; rna_Material_update(bmain, scene, ptr); WM_main_add_notifier(NC_GPENCIL | ND_DATA, ma); @@ -118,7 +118,7 @@ static void rna_MaterialGpencil_update(Main *bmain, Scene *scene, PointerRNA *pt static void rna_MaterialGpencil_nopreview_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - Material *ma = ptr->id.data; + Material *ma = (Material *)ptr->owner_id; rna_Material_update(bmain, scene, ptr); WM_main_add_notifier(NC_GPENCIL | ND_DATA, ma); @@ -126,7 +126,7 @@ static void rna_MaterialGpencil_nopreview_update(Main *bmain, Scene *scene, Poin static void rna_Material_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Material *ma = ptr->id.data; + Material *ma = (Material *)ptr->owner_id; DEG_id_tag_update(&ma->id, ID_RECALC_SHADING); WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, ma); @@ -144,7 +144,7 @@ static void rna_Material_active_paint_texture_index_update(Main *bmain, PointerRNA *ptr) { bScreen *sc; - Material *ma = ptr->id.data; + Material *ma = (Material *)ptr->owner_id; if (ma->use_nodes && ma->nodetree) { struct bNode *node = BKE_texpaint_slot_material_find_node(ma, ma->paint_active_slot); @@ -303,7 +303,7 @@ static bool rna_is_grease_pencil_get(PointerRNA *ptr) static void rna_gpcolordata_uv_update(Main *bmain, Scene *scene, PointerRNA *ptr) { /* update all uv strokes of this color */ - Material *ma = ptr->id.data; + Material *ma = (Material *)ptr->owner_id; ED_gpencil_update_color_uv(bmain, ma); rna_MaterialGpencil_update(bmain, scene, ptr); diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index e28618414ae..cfffa3bf4e3 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -80,7 +80,7 @@ const EnumPropertyItem rna_enum_mesh_delimit_mode_items[] = { static Mesh *rna_mesh(PointerRNA *ptr) { - Mesh *me = (Mesh *)ptr->id.data; + Mesh *me = (Mesh *)ptr->owner_id; return me; } @@ -146,7 +146,7 @@ static void rna_cd_layer_name_set(CustomData *cdata, CustomDataLayer *cdl, const static CustomData *rna_cd_from_layer(PointerRNA *ptr, CustomDataLayer *cdl) { /* find out where we come from by */ - Mesh *me = ptr->id.data; + Mesh *me = (Mesh *)ptr->owner_id; CustomData *cd; /* rely on negative values wrapping */ @@ -202,7 +202,7 @@ static bool rna_Mesh_has_custom_normals_get(PointerRNA *ptr) static void rna_Mesh_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; /* cheating way for importers to avoid slow updates */ if (id->us > 0) { @@ -226,7 +226,7 @@ static void rna_Mesh_update_data_edit_active_color(Main *bmain, Scene *scene, Po } static void rna_Mesh_update_select(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; /* cheating way for importers to avoid slow updates */ if (id->us > 0) { WM_main_add_notifier(NC_GEOM | ND_SELECT, id); @@ -235,7 +235,7 @@ static void rna_Mesh_update_select(Main *UNUSED(bmain), Scene *UNUSED(scene), Po void rna_Mesh_update_draw(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; /* cheating way for importers to avoid slow updates */ if (id->us > 0) { WM_main_add_notifier(NC_GEOM | ND_DATA, id); @@ -403,7 +403,7 @@ static void rna_MeshPolygon_center_get(PointerRNA *ptr, float *values) static float rna_MeshPolygon_area_get(PointerRNA *ptr) { - Mesh *me = (Mesh *)ptr->id.data; + Mesh *me = (Mesh *)ptr->owner_id; MPoly *mp = (MPoly *)ptr->data; return BKE_mesh_calc_poly_area(mp, me->mloop + mp->loopstart, me->mvert); @@ -571,7 +571,7 @@ static int rna_CustomDataLayer_clone_get(PointerRNA *ptr, CustomData *data, int static void rna_CustomDataLayer_active_set( PointerRNA *ptr, CustomData *data, int value, int type, int render) { - Mesh *me = ptr->id.data; + Mesh *me = (Mesh *)ptr->owner_id; int n = (((CustomDataLayer *)ptr->data) - data->layers) - CustomData_get_layer_index(data, type); if (value == 0) { diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c index 743bac2b709..451bdda45f5 100644 --- a/source/blender/makesrna/intern/rna_meta.c +++ b/source/blender/makesrna/intern/rna_meta.c @@ -89,7 +89,7 @@ static void rna_Meta_texspace_size_set(PointerRNA *ptr, const float *values) static void rna_MetaBall_update_data(Main *bmain, Scene *scene, PointerRNA *ptr) { - MetaBall *mb = ptr->id.data; + MetaBall *mb = (MetaBall *)ptr->owner_id; Object *ob; /* cheating way for importers to avoid slow updates */ @@ -158,13 +158,13 @@ static void rna_MetaBall_elements_clear(MetaBall *mb) static bool rna_Meta_is_editmode_get(PointerRNA *ptr) { - MetaBall *mb = ptr->id.data; + MetaBall *mb = (MetaBall *)ptr->owner_id; return (mb->editelems != NULL); } static char *rna_MetaElement_path(PointerRNA *ptr) { - MetaBall *mb = ptr->id.data; + MetaBall *mb = (MetaBall *)ptr->owner_id; MetaElem *ml = ptr->data; int index = -1; diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 4287a13822e..26bb83fe6e8 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -595,8 +595,8 @@ static void rna_Modifier_name_set(PointerRNA *ptr, const char *value) BLI_strncpy_utf8(md->name, value, sizeof(md->name)); /* make sure the name is truly unique */ - if (ptr->id.data) { - Object *ob = ptr->id.data; + if (ptr->owner_id) { + Object *ob = (Object *)ptr->owner_id; modifier_unique_name(&ob->modifiers, md); } @@ -615,8 +615,8 @@ static char *rna_Modifier_path(PointerRNA *ptr) static void rna_Modifier_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - DEG_id_tag_update(ptr->id.data, ID_RECALC_GEOMETRY); - WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ptr->id.data); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY); + WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ptr->owner_id); } static void rna_Modifier_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr) @@ -723,7 +723,7 @@ static void modifier_object_set(Object *self, Object **ob_p, int type, PointerRN PointerRNA *ptr, PointerRNA value, struct ReportList *UNUSED(reports)) \ { \ _type##ModifierData *tmd = (_type##ModifierData *)ptr->data; \ - modifier_object_set(ptr->id.data, &tmd->_prop, _obtype, value); \ + modifier_object_set((Object *)ptr->owner_id, &tmd->_prop, _obtype, value); \ } RNA_MOD_OBJECT_SET(Armature, object, OB_ARMATURE); @@ -746,7 +746,7 @@ static void rna_HookModifier_object_set(PointerRNA *ptr, PointerRNA value, struct ReportList *UNUSED(reports)) { - Object *owner = (Object *)ptr->id.data; + Object *owner = (Object *)ptr->owner_id; HookModifierData *hmd = ptr->data; Object *ob = (Object *)value.data; @@ -757,7 +757,7 @@ static void rna_HookModifier_object_set(PointerRNA *ptr, static void rna_HookModifier_subtarget_set(PointerRNA *ptr, const char *value) { - Object *owner = (Object *)ptr->id.data; + Object *owner = (Object *)ptr->owner_id; HookModifierData *hmd = ptr->data; BLI_strncpy(hmd->subtarget, value, sizeof(hmd->subtarget)); @@ -844,7 +844,7 @@ static void rna_UVProjector_object_set(PointerRNA *ptr, static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr) { SmokeModifierData *smd = (SmokeModifierData *)ptr->data; - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; /* nothing changed */ if ((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain) { @@ -871,7 +871,7 @@ static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_MultiresModifier_type_set(PointerRNA *ptr, int value) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; MultiresModifierData *mmd = (MultiresModifierData *)ptr->data; multires_force_update(ob); @@ -889,7 +889,7 @@ static void rna_MultiresModifier_level_range( static bool rna_MultiresModifier_external_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; Mesh *me = ob->data; return CustomData_external_test(&me->ldata, CD_MDISPS); @@ -897,7 +897,7 @@ static bool rna_MultiresModifier_external_get(PointerRNA *ptr) static void rna_MultiresModifier_filepath_get(PointerRNA *ptr, char *value) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; CustomDataExternal *external = ((Mesh *)ob->data)->ldata.external; BLI_strncpy(value, (external) ? external->filename : "", sizeof(external->filename)); @@ -905,7 +905,7 @@ static void rna_MultiresModifier_filepath_get(PointerRNA *ptr, char *value) static void rna_MultiresModifier_filepath_set(PointerRNA *ptr, const char *value) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; CustomDataExternal *external = ((Mesh *)ob->data)->ldata.external; if (external && !STREQ(external->filename, value)) { @@ -916,7 +916,7 @@ static void rna_MultiresModifier_filepath_set(PointerRNA *ptr, const char *value static int rna_MultiresModifier_filepath_length(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; CustomDataExternal *external = ((Mesh *)ob->data)->ldata.external; return strlen((external) ? external->filename : ""); @@ -941,19 +941,19 @@ static bool rna_MeshDeformModifier_is_bound_get(PointerRNA *ptr) static PointerRNA rna_SoftBodyModifier_settings_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; return rna_pointer_inherit_refine(ptr, &RNA_SoftBodySettings, ob->soft); } static PointerRNA rna_SoftBodyModifier_point_cache_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; return rna_pointer_inherit_refine(ptr, &RNA_PointCache, ob->soft->shared->pointcache); } static PointerRNA rna_CollisionModifier_settings_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; return rna_pointer_inherit_refine(ptr, &RNA_CollisionSettings, ob->pd); } diff --git a/source/blender/makesrna/intern/rna_movieclip.c b/source/blender/makesrna/intern/rna_movieclip.c index 10e19b92dda..9bfa93ceba5 100644 --- a/source/blender/makesrna/intern/rna_movieclip.c +++ b/source/blender/makesrna/intern/rna_movieclip.c @@ -53,14 +53,14 @@ static void rna_MovieClip_reload_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; DEG_id_tag_update(&clip->id, ID_RECALC_SOURCE); } static void rna_MovieClip_size_get(PointerRNA *ptr, int *values) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; values[0] = clip->lastsize[0]; values[1] = clip->lastsize[1]; @@ -68,13 +68,13 @@ static void rna_MovieClip_size_get(PointerRNA *ptr, int *values) static float rna_MovieClip_fps_get(PointerRNA *ptr) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; return BKE_movieclip_get_fps(clip); } static void rna_MovieClip_use_proxy_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; BKE_movieclip_clear_cache(clip); BKE_sequence_invalidate_movieclip_strips(bmain, clip); } @@ -83,7 +83,7 @@ static void rna_MovieClipUser_proxy_render_settings_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - ID *id = (ID *)ptr->id.data; + ID *id = ptr->owner_id; MovieClipUser *user = (MovieClipUser *)ptr->data; /* when changing render settings of space clip user diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index 6f55fb4e24c..97cab783aed 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -65,8 +65,8 @@ static void rna_NlaStrip_name_set(PointerRNA *ptr, const char *value) BLI_strncpy_utf8(data->name, value, sizeof(data->name)); /* validate if there's enough info to do so */ - if (ptr->id.data) { - AnimData *adt = BKE_animdata_from_id(ptr->id.data); + if (ptr->owner_id) { + AnimData *adt = BKE_animdata_from_id(ptr->owner_id); BKE_nlastrip_validate_name(adt, data); } } @@ -74,7 +74,7 @@ static void rna_NlaStrip_name_set(PointerRNA *ptr, const char *value) static char *rna_NlaStrip_path(PointerRNA *ptr) { NlaStrip *strip = (NlaStrip *)ptr->data; - AnimData *adt = BKE_animdata_from_id(ptr->id.data); + AnimData *adt = BKE_animdata_from_id(ptr->owner_id); /* if we're attached to AnimData, try to resolve path back to AnimData */ if (adt) { @@ -103,7 +103,7 @@ static char *rna_NlaStrip_path(PointerRNA *ptr) static void rna_NlaStrip_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; ANIM_id_update(bmain, id); } @@ -122,9 +122,9 @@ static void rna_NlaStrip_transform_update(Main *bmain, Scene *scene, PointerRNA BKE_nlameta_flush_transforms(strip); /* set the flag */ - if ((strip->flag & NLASTRIP_FLAG_AUTO_BLENDS) && ptr->id.data) { + if ((strip->flag & NLASTRIP_FLAG_AUTO_BLENDS) && ptr->owner_id) { /* validate state to ensure that auto-blend gets applied immediately */ - IdAdtTemplate *iat = (IdAdtTemplate *)ptr->id.data; + IdAdtTemplate *iat = (IdAdtTemplate *)ptr->owner_id; if (iat->adt) { BKE_nla_validate_state(iat->adt); @@ -274,8 +274,8 @@ static void rna_NlaStrip_use_auto_blend_set(PointerRNA *ptr, bool value) data->flag |= NLASTRIP_FLAG_AUTO_BLENDS; /* validate state to ensure that auto-blend gets applied immediately */ - if (ptr->id.data) { - IdAdtTemplate *iat = (IdAdtTemplate *)ptr->id.data; + if (ptr->owner_id) { + IdAdtTemplate *iat = (IdAdtTemplate *)ptr->owner_id; if (iat->adt) { BKE_nla_validate_state(iat->adt); @@ -298,8 +298,8 @@ static int rna_NlaStrip_action_editable(PointerRNA *ptr, const char **UNUSED(r_i NlaStrip *strip = (NlaStrip *)ptr->data; /* strip actions shouldn't be editable if NLA tweakmode is on */ - if (ptr->id.data) { - AnimData *adt = BKE_animdata_from_id(ptr->id.data); + if (ptr->owner_id) { + AnimData *adt = BKE_animdata_from_id(ptr->owner_id); if (adt) { /* active action is only editable when it is not a tweaking strip */ @@ -475,7 +475,7 @@ static void rna_NlaStrip_remove( static void rna_NlaTrack_solo_set(PointerRNA *ptr, bool value) { NlaTrack *data = (NlaTrack *)ptr->data; - AnimData *adt = BKE_animdata_from_id(ptr->id.data); + AnimData *adt = BKE_animdata_from_id(ptr->owner_id); NlaTrack *nt; if (data == NULL) { diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index a3db0a556d6..98bb9df78ae 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -760,7 +760,7 @@ static bool rna_NodeTree_check(bNodeTree *ntree, ReportList *reports) static void rna_NodeTree_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - bNodeTree *ntree = (bNodeTree *)ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; bNode *node = (bNode *)ptr->data; WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); @@ -1241,7 +1241,7 @@ static char *rna_Node_path(PointerRNA *ptr) char *rna_Node_ImageUser_path(PointerRNA *ptr) { - bNodeTree *ntree = (bNodeTree *)ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; bNode *node; char name_esc[sizeof(node->name) * 2]; @@ -1746,7 +1746,7 @@ static bool rna_Node_parent_poll(PointerRNA *ptr, PointerRNA value) static void rna_Node_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - bNodeTree *ntree = (bNodeTree *)ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; bNode *node = (bNode *)ptr->data; ED_node_tag_update_nodetree(bmain, ntree, node); } @@ -1770,7 +1770,7 @@ static void rna_Node_select_set(PointerRNA *ptr, bool value) static void rna_Node_name_set(PointerRNA *ptr, const char *value) { - bNodeTree *ntree = (bNodeTree *)ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; bNode *node = (bNode *)ptr->data; char oldname[sizeof(node->name)]; @@ -2122,7 +2122,7 @@ static StructRNA *rna_NodeSocket_refine(PointerRNA *ptr) static char *rna_NodeSocket_path(PointerRNA *ptr) { - bNodeTree *ntree = (bNodeTree *)ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; bNodeSocket *sock = (bNodeSocket *)ptr->data; bNode *node; int socketindex; @@ -2156,7 +2156,7 @@ static IDProperty *rna_NodeSocket_idprops(PointerRNA *ptr, bool create) static PointerRNA rna_NodeSocket_node_get(PointerRNA *ptr) { - bNodeTree *ntree = (bNodeTree *)ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; bNodeSocket *sock = (bNodeSocket *)ptr->data; bNode *node; PointerRNA r_ptr; @@ -2169,7 +2169,7 @@ static PointerRNA rna_NodeSocket_node_get(PointerRNA *ptr) static void rna_NodeSocket_type_set(PointerRNA *ptr, int value) { - bNodeTree *ntree = (bNodeTree *)ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; bNodeSocket *sock = (bNodeSocket *)ptr->data; bNode *node; nodeFindNode(ntree, sock, &node, NULL); @@ -2178,7 +2178,7 @@ static void rna_NodeSocket_type_set(PointerRNA *ptr, int value) static void rna_NodeSocket_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - bNodeTree *ntree = (bNodeTree *)ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; bNodeSocket *sock = (bNodeSocket *)ptr->data; bNode *node; if (nodeFindNode(ntree, sock, &node, NULL)) { @@ -2438,7 +2438,7 @@ static StructRNA *rna_NodeSocketInterface_refine(PointerRNA *ptr) static char *rna_NodeSocketInterface_path(PointerRNA *ptr) { - bNodeTree *ntree = (bNodeTree *)ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; bNodeSocket *sock = (bNodeSocket *)ptr->data; int socketindex; @@ -2469,7 +2469,7 @@ static IDProperty *rna_NodeSocketInterface_idprops(PointerRNA *ptr, bool create) static void rna_NodeSocketInterface_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - bNodeTree *ntree = ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; bNodeSocket *stemp = ptr->data; if (!stemp->typeinfo) { @@ -2585,7 +2585,7 @@ static void rna_NodeSocketStandard_value_update(struct bContext *C, PointerRNA * /* try to use node from context, faster */ node = CTX_data_pointer_get(C, "node").data; if (!node) { - bNodeTree *ntree = ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; bNodeSocket *sock = ptr->data; /* fall back to searching node in the tree */ @@ -2803,7 +2803,7 @@ static void rna_CompositorNode_tag_need_exec(bNode *node) static void rna_Node_tex_image_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - bNodeTree *ntree = (bNodeTree *)ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; bNode *node = (bNode *)ptr->data; ED_node_tag_update_nodetree(bmain, ntree, node); @@ -2812,7 +2812,7 @@ static void rna_Node_tex_image_update(Main *bmain, Scene *UNUSED(scene), Pointer static void rna_NodeGroup_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - bNodeTree *ntree = (bNodeTree *)ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; bNode *node = (bNode *)ptr->data; if (node->id) { @@ -2826,7 +2826,7 @@ static void rna_NodeGroup_node_tree_set(PointerRNA *ptr, const PointerRNA value, struct ReportList *UNUSED(reports)) { - bNodeTree *ntree = ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; bNode *node = ptr->data; bNodeTree *ngroup = value.data; @@ -2844,7 +2844,7 @@ static void rna_NodeGroup_node_tree_set(PointerRNA *ptr, static bool rna_NodeGroup_node_tree_poll(PointerRNA *ptr, const PointerRNA value) { - bNodeTree *ntree = ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; bNodeTree *ngroup = value.data; /* only allow node trees of the same type as the group node's tree */ @@ -2871,7 +2871,7 @@ static StructRNA *rna_NodeGroup_interface_typef(PointerRNA *ptr) static StructRNA *rna_NodeGroupInputOutput_interface_typef(PointerRNA *ptr) { - bNodeTree *ntree = ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; if (ntree) { StructRNA *srna = ntreeInterfaceTypeGet(ntree, true); @@ -3206,7 +3206,7 @@ static const EnumPropertyItem *rna_Node_channel_itemf(bContext *UNUSED(C), static void rna_Image_Node_update_id(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - bNodeTree *ntree = (bNodeTree *)ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; bNode *node = (bNode *)ptr->data; node->update |= NODE_UPDATE_ID; @@ -3230,19 +3230,19 @@ static PointerRNA rna_NodeOutputFile_slot_file_get(CollectionPropertyIterator *i { PointerRNA ptr; bNodeSocket *sock = rna_iterator_listbase_get(iter); - RNA_pointer_create(iter->parent.id.data, &RNA_NodeOutputFileSlotFile, sock->storage, &ptr); + RNA_pointer_create(iter->parent.owner_id, &RNA_NodeOutputFileSlotFile, sock->storage, &ptr); return ptr; } static void rna_NodeColorBalance_update_lgg(Main *bmain, Scene *scene, PointerRNA *ptr) { - ntreeCompositColorBalanceSyncFromLGG(ptr->id.data, ptr->data); + ntreeCompositColorBalanceSyncFromLGG((bNodeTree *)ptr->owner_id, ptr->data); rna_Node_update(bmain, scene, ptr); } static void rna_NodeColorBalance_update_cdl(Main *bmain, Scene *scene, PointerRNA *ptr) { - ntreeCompositColorBalanceSyncFromCDL(ptr->id.data, ptr->data); + ntreeCompositColorBalanceSyncFromCDL((bNodeTree *)ptr->owner_id, ptr->data); rna_Node_update(bmain, scene, ptr); } @@ -3281,13 +3281,13 @@ static void rna_NodeCryptomatte_matte_set(PointerRNA *ptr, const char *value) static void rna_NodeCryptomatte_update_add(Main *bmain, Scene *scene, PointerRNA *ptr) { - ntreeCompositCryptomatteSyncFromAdd(ptr->id.data, ptr->data); + ntreeCompositCryptomatteSyncFromAdd((bNodeTree *)ptr->owner_id, ptr->data); rna_Node_update(bmain, scene, ptr); } static void rna_NodeCryptomatte_update_remove(Main *bmain, Scene *scene, PointerRNA *ptr) { - ntreeCompositCryptomatteSyncFromRemove(ptr->id.data, ptr->data); + ntreeCompositCryptomatteSyncFromRemove((bNodeTree *)ptr->owner_id, ptr->data); rna_Node_update(bmain, scene, ptr); } @@ -3297,7 +3297,7 @@ static PointerRNA rna_NodeOutputFile_slot_layer_get(CollectionPropertyIterator * { PointerRNA ptr; bNodeSocket *sock = rna_iterator_listbase_get(iter); - RNA_pointer_create(iter->parent.id.data, &RNA_NodeOutputFileSlotLayer, sock->storage, &ptr); + RNA_pointer_create(iter->parent.owner_id, &RNA_NodeOutputFileSlotLayer, sock->storage, &ptr); return ptr; } @@ -3327,7 +3327,7 @@ static int rna_NodeOutputFileSocket_find_node(bNodeTree *ntree, static void rna_NodeOutputFileSlotFile_path_set(PointerRNA *ptr, const char *value) { - bNodeTree *ntree = ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; NodeImageMultiFileSocket *sockdata = ptr->data; bNode *node; bNodeSocket *sock; @@ -3339,7 +3339,7 @@ static void rna_NodeOutputFileSlotFile_path_set(PointerRNA *ptr, const char *val static void rna_NodeOutputFileSlotLayer_name_set(PointerRNA *ptr, const char *value) { - bNodeTree *ntree = ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; NodeImageMultiFileSocket *sockdata = ptr->data; bNode *node; bNodeSocket *sock; @@ -3460,7 +3460,7 @@ static void rna_ShaderNodeScript_bytecode_set(PointerRNA *ptr, const char *value static void rna_ShaderNodeScript_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - bNodeTree *ntree = (bNodeTree *)ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; bNode *node = (bNode *)ptr->data; RenderEngineType *engine_type = RE_engines_find(scene->r.engine); @@ -3476,7 +3476,7 @@ static void rna_ShaderNodeScript_update(Main *bmain, Scene *scene, PointerRNA *p static void rna_ShaderNode_socket_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - bNodeTree *ntree = (bNodeTree *)ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; bNode *node = (bNode *)ptr->data; nodeUpdate(ntree, node); @@ -3485,7 +3485,7 @@ static void rna_ShaderNode_socket_update(Main *bmain, Scene *scene, PointerRNA * static void rna_CompositorNodeScale_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - bNodeTree *ntree = (bNodeTree *)ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; bNode *node = (bNode *)ptr->data; nodeUpdate(ntree, node); @@ -3516,7 +3516,7 @@ static void rna_ShaderNodePointDensity_psys_set(PointerRNA *ptr, NodeShaderTexPointDensity *shader_point_density = node->storage; Object *ob = (Object *)node->id; - if (ob && value.id.data == ob) { + if (ob && value.owner_id == &ob->id) { shader_point_density->particle_system = BLI_findindex(&ob->particlesystem, value.data) + 1; } else { diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 0a4016f3d4a..e43fe912fc3 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -299,27 +299,27 @@ const EnumPropertyItem rna_enum_object_axis_items[] = { static void rna_Object_internal_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - DEG_id_tag_update(ptr->id.data, ID_RECALC_TRANSFORM); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_TRANSFORM); } static void rna_Object_internal_update_draw(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - DEG_id_tag_update(ptr->id.data, ID_RECALC_TRANSFORM); - WM_main_add_notifier(NC_OBJECT | ND_DRAW, ptr->id.data); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_TRANSFORM); + WM_main_add_notifier(NC_OBJECT | ND_DRAW, ptr->owner_id); } static void rna_Object_matrix_world_update(Main *bmain, Scene *scene, PointerRNA *ptr) { /* don't use compat so we get predictable rotation */ - BKE_object_apply_mat4(ptr->id.data, ((Object *)ptr->id.data)->obmat, false, true); + BKE_object_apply_mat4((Object *)ptr->owner_id, ((Object *)ptr->owner_id)->obmat, false, true); rna_Object_internal_update(bmain, scene, ptr); } static void rna_Object_hide_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; BKE_main_collection_sync_remap(bmain); DEG_id_tag_update(&ob->id, ID_RECALC_COPY_ON_WRITE); DEG_relations_tag_update(bmain); @@ -328,7 +328,7 @@ static void rna_Object_hide_update(Main *bmain, Scene *UNUSED(scene), PointerRNA static void rna_MaterialIndex_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; if (ob && ob->type == OB_GPENCIL) { /* notifying material property in topbar */ WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D, NULL); @@ -337,13 +337,13 @@ static void rna_MaterialIndex_update(Main *UNUSED(bmain), Scene *UNUSED(scene), static void rna_Object_matrix_local_get(PointerRNA *ptr, float values[16]) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; BKE_object_matrix_local_get(ob, (float(*)[4])values); } static void rna_Object_matrix_local_set(PointerRNA *ptr, const float values[16]) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; float local_mat[4][4]; /* Localspace matrix is truly relative to the parent, @@ -365,20 +365,20 @@ static void rna_Object_matrix_local_set(PointerRNA *ptr, const float values[16]) static void rna_Object_matrix_basis_get(PointerRNA *ptr, float values[16]) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; BKE_object_to_mat4(ob, (float(*)[4])values); } static void rna_Object_matrix_basis_set(PointerRNA *ptr, const float values[16]) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; BKE_object_apply_mat4(ob, (float(*)[4])values, false, false); } void rna_Object_internal_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - DEG_id_tag_update(ptr->id.data, ID_RECALC_GEOMETRY); - WM_main_add_notifier(NC_OBJECT | ND_DRAW, ptr->id.data); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY); + WM_main_add_notifier(NC_OBJECT | ND_DRAW, ptr->owner_id); } void rna_Object_internal_update_data_dependency(Main *bmain, Scene *scene, PointerRNA *ptr) @@ -389,7 +389,7 @@ void rna_Object_internal_update_data_dependency(Main *bmain, Scene *scene, Point static void rna_Object_active_shape_update(bContext *C, PointerRNA *ptr) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -422,9 +422,9 @@ static void rna_Object_active_shape_update(bContext *C, PointerRNA *ptr) static void rna_Object_dependency_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - DEG_id_tag_update(ptr->id.data, ID_RECALC_TRANSFORM); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_TRANSFORM); DEG_relations_tag_update(bmain); - WM_main_add_notifier(NC_OBJECT | ND_PARENT, ptr->id.data); + WM_main_add_notifier(NC_OBJECT | ND_PARENT, ptr->owner_id); } static void rna_Object_data_set(PointerRNA *ptr, PointerRNA value, struct ReportList *reports) @@ -691,7 +691,7 @@ static void rna_Object_dup_collection_set(PointerRNA *ptr, static void rna_VertexGroup_name_set(PointerRNA *ptr, const char *value) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bDeformGroup *dg = (bDeformGroup *)ptr->data; BLI_strncpy_utf8(dg->name, value, sizeof(dg->name)); defgroup_unique_name(dg, ob); @@ -699,34 +699,34 @@ static void rna_VertexGroup_name_set(PointerRNA *ptr, const char *value) static int rna_VertexGroup_index_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; return BLI_findindex(&ob->defbase, ptr->data); } static PointerRNA rna_Object_active_vertex_group_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; return rna_pointer_inherit_refine( ptr, &RNA_VertexGroup, BLI_findlink(&ob->defbase, ob->actdef - 1)); } static int rna_Object_active_vertex_group_index_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; return ob->actdef - 1; } static void rna_Object_active_vertex_group_index_set(PointerRNA *ptr, int value) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ob->actdef = value + 1; } static void rna_Object_active_vertex_group_index_range( PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; *min = 0; *max = max_ii(0, BLI_listbase_count(&ob->defbase) - 1); @@ -734,7 +734,7 @@ static void rna_Object_active_vertex_group_index_range( void rna_object_vgroup_name_index_get(PointerRNA *ptr, char *value, int index) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bDeformGroup *dg; dg = BLI_findlink(&ob->defbase, index - 1); @@ -749,7 +749,7 @@ void rna_object_vgroup_name_index_get(PointerRNA *ptr, char *value, int index) int rna_object_vgroup_name_index_length(PointerRNA *ptr, int index) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bDeformGroup *dg; dg = BLI_findlink(&ob->defbase, index - 1); @@ -758,13 +758,13 @@ int rna_object_vgroup_name_index_length(PointerRNA *ptr, int index) void rna_object_vgroup_name_index_set(PointerRNA *ptr, const char *value, short *index) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; *index = defgroup_name_index(ob, value) + 1; } void rna_object_vgroup_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bDeformGroup *dg = defgroup_find_name(ob, value); if (dg) { /* No need for BLI_strncpy_utf8, since this matches an existing group. */ @@ -777,7 +777,7 @@ void rna_object_vgroup_name_set(PointerRNA *ptr, const char *value, char *result static void rna_FaceMap_name_set(PointerRNA *ptr, const char *value) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bFaceMap *fmap = (bFaceMap *)ptr->data; BLI_strncpy_utf8(fmap->name, value, sizeof(fmap->name)); BKE_object_facemap_unique_name(ob, fmap); @@ -785,33 +785,33 @@ static void rna_FaceMap_name_set(PointerRNA *ptr, const char *value) static int rna_FaceMap_index_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; return BLI_findindex(&ob->fmaps, ptr->data); } static PointerRNA rna_Object_active_face_map_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; return rna_pointer_inherit_refine(ptr, &RNA_FaceMap, BLI_findlink(&ob->fmaps, ob->actfmap - 1)); } static int rna_Object_active_face_map_index_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; return ob->actfmap - 1; } static void rna_Object_active_face_map_index_set(PointerRNA *ptr, int value) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ob->actfmap = value + 1; } static void rna_Object_active_face_map_index_range( PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; *min = 0; *max = max_ii(0, BLI_listbase_count(&ob->fmaps) - 1); @@ -819,7 +819,7 @@ static void rna_Object_active_face_map_index_range( void rna_object_BKE_object_facemap_name_index_get(PointerRNA *ptr, char *value, int index) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bFaceMap *fmap; fmap = BLI_findlink(&ob->fmaps, index - 1); @@ -834,7 +834,7 @@ void rna_object_BKE_object_facemap_name_index_get(PointerRNA *ptr, char *value, int rna_object_BKE_object_facemap_name_index_length(PointerRNA *ptr, int index) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bFaceMap *fmap; fmap = BLI_findlink(&ob->fmaps, index - 1); @@ -843,13 +843,13 @@ int rna_object_BKE_object_facemap_name_index_length(PointerRNA *ptr, int index) void rna_object_BKE_object_facemap_name_index_set(PointerRNA *ptr, const char *value, short *index) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; *index = BKE_object_facemap_name_index(ob, value) + 1; } void rna_object_fmap_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bFaceMap *fmap = BKE_object_facemap_find_name(ob, value); if (fmap) { /* No need for BLI_strncpy_utf8, since this matches an existing group. */ @@ -862,7 +862,7 @@ void rna_object_fmap_name_set(PointerRNA *ptr, const char *value, char *result, void rna_object_uvlayer_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; Mesh *me; CustomDataLayer *layer; int a; @@ -885,7 +885,7 @@ void rna_object_uvlayer_name_set(PointerRNA *ptr, const char *value, char *resul void rna_object_vcollayer_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; Mesh *me; CustomDataLayer *layer; int a; @@ -908,13 +908,13 @@ void rna_object_vcollayer_name_set(PointerRNA *ptr, const char *value, char *res static int rna_Object_active_material_index_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; return MAX2(ob->actcol - 1, 0); } static void rna_Object_active_material_index_set(PointerRNA *ptr, int value) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ob->actcol = value + 1; if (ob->type == OB_MESH) { @@ -929,7 +929,7 @@ static void rna_Object_active_material_index_set(PointerRNA *ptr, int value) static void rna_Object_active_material_index_range( PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; *min = 0; *max = max_ii(ob->totcol - 1, 0); } @@ -937,7 +937,7 @@ static void rna_Object_active_material_index_range( /* returns active base material */ static PointerRNA rna_Object_active_material_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; Material *ma; ma = (ob->totcol) ? give_current_material(ob, ob->actcol) : NULL; @@ -948,7 +948,7 @@ static void rna_Object_active_material_set(PointerRNA *ptr, PointerRNA value, struct ReportList *UNUSED(reports)) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; DEG_id_tag_update(value.data, 0); BLI_assert(BKE_id_is_in_global_main(&ob->id)); @@ -963,7 +963,7 @@ static void rna_Object_active_material_set(PointerRNA *ptr, static int rna_Object_active_material_editable(PointerRNA *ptr, const char **UNUSED(r_info)) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bool is_editable; if ((ob->matbits == NULL) || (ob->actcol == 0) || ob->matbits[ob->actcol - 1]) { @@ -979,20 +979,20 @@ static int rna_Object_active_material_editable(PointerRNA *ptr, const char **UNU static void rna_Object_active_particle_system_index_range( PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; *min = 0; *max = max_ii(0, BLI_listbase_count(&ob->particlesystem) - 1); } static int rna_Object_active_particle_system_index_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; return psys_get_current_num(ob); } static void rna_Object_active_particle_system_index_set(PointerRNA *ptr, int value) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; psys_set_current_num(ob, value); } @@ -1000,7 +1000,7 @@ static void rna_Object_particle_update(Main *UNUSED(bmain), Scene *scene, Pointe { /* TODO: Disabled for now, because bContext is not available. */ # if 0 - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; PE_current_changed(NULL, scene, ob); # else (void)scene; @@ -1137,7 +1137,7 @@ static int rna_Object_rotation_4d_editable(PointerRNA *ptr, int index) static int rna_MaterialSlot_material_editable(PointerRNA *ptr, const char **UNUSED(r_info)) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; const int index = (Material **)ptr->data - ob->mat; bool is_editable; @@ -1153,7 +1153,7 @@ static int rna_MaterialSlot_material_editable(PointerRNA *ptr, const char **UNUS static PointerRNA rna_MaterialSlot_material_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; Material *ma; const int index = (Material **)ptr->data - ob->mat; @@ -1165,7 +1165,7 @@ static void rna_MaterialSlot_material_set(PointerRNA *ptr, PointerRNA value, struct ReportList *UNUSED(reports)) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; int index = (Material **)ptr->data - ob->mat; BLI_assert(BKE_id_is_in_global_main(&ob->id)); @@ -1175,7 +1175,7 @@ static void rna_MaterialSlot_material_set(PointerRNA *ptr, static bool rna_MaterialSlot_material_poll(PointerRNA *ptr, PointerRNA value) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; Material *ma = (Material *)value.data; if (ob->type == OB_GPENCIL) { @@ -1190,7 +1190,7 @@ static bool rna_MaterialSlot_material_poll(PointerRNA *ptr, PointerRNA value) static int rna_MaterialSlot_link_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; int index = (Material **)ptr->data - ob->mat; return ob->matbits[index] != 0; @@ -1198,7 +1198,7 @@ static int rna_MaterialSlot_link_get(PointerRNA *ptr) static void rna_MaterialSlot_link_set(PointerRNA *ptr, int value) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; int index = (Material **)ptr->data - ob->mat; if (value) { @@ -1213,7 +1213,7 @@ static void rna_MaterialSlot_link_set(PointerRNA *ptr, int value) static int rna_MaterialSlot_name_length(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; Material *ma; int index = (Material **)ptr->data - ob->mat; @@ -1228,7 +1228,7 @@ static int rna_MaterialSlot_name_length(PointerRNA *ptr) static void rna_MaterialSlot_name_get(PointerRNA *ptr, char *str) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; Material *ma; int index = (Material **)ptr->data - ob->mat; @@ -1246,14 +1246,14 @@ static void rna_MaterialSlot_update(Main *bmain, Scene *scene, PointerRNA *ptr) { rna_Object_internal_update(bmain, scene, ptr); - WM_main_add_notifier(NC_OBJECT | ND_OB_SHADING, ptr->id.data); + WM_main_add_notifier(NC_OBJECT | ND_OB_SHADING, ptr->owner_id); WM_main_add_notifier(NC_MATERIAL | ND_SHADING_LINKS, NULL); DEG_relations_tag_update(bmain); } static char *rna_MaterialSlot_path(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; int index = (Material **)ptr->data - ob->mat; return BLI_sprintfN("material_slots[%d]", index); @@ -1271,7 +1271,7 @@ static char *rna_ObjectDisplay_path(PointerRNA *UNUSED(ptr)) static PointerRNA rna_Object_active_particle_system_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ParticleSystem *psys = psys_get_current(ob); return rna_pointer_inherit_refine(ptr, &RNA_ParticleSystem, psys); } @@ -1279,7 +1279,7 @@ static PointerRNA rna_Object_active_particle_system_get(PointerRNA *ptr) static void rna_Object_active_shape_key_index_range( PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; Key *key = BKE_key_from_object(ob); *min = 0; @@ -1296,21 +1296,21 @@ static void rna_Object_active_shape_key_index_range( static int rna_Object_active_shape_key_index_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; return MAX2(ob->shapenr - 1, 0); } static void rna_Object_active_shape_key_index_set(PointerRNA *ptr, int value) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ob->shapenr = value + 1; } static PointerRNA rna_Object_active_shape_key_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; Key *key = BKE_key_from_object(ob); KeyBlock *kb; PointerRNA keyptr; @@ -1326,7 +1326,7 @@ static PointerRNA rna_Object_active_shape_key_get(PointerRNA *ptr) static PointerRNA rna_Object_field_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; /* weak */ if (!ob->pd) { @@ -1338,7 +1338,7 @@ static PointerRNA rna_Object_field_get(PointerRNA *ptr) static PointerRNA rna_Object_collision_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; if (ob->type != OB_MESH) { return PointerRNA_NULL; @@ -1354,7 +1354,7 @@ static PointerRNA rna_Object_collision_get(PointerRNA *ptr) static PointerRNA rna_Object_active_constraint_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bConstraint *con = BKE_constraints_active_get(&ob->constraints); return rna_pointer_inherit_refine(ptr, &RNA_Constraint, con); } @@ -1363,7 +1363,7 @@ static void rna_Object_active_constraint_set(PointerRNA *ptr, PointerRNA value, struct ReportList *UNUSED(reports)) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; BKE_constraints_active_set(&ob->constraints, (bConstraint *)value.data); } @@ -1428,8 +1428,8 @@ bool rna_Object_constraints_override_apply(Main *UNUSED(bmain), BLI_assert(opop->operation == IDOVERRIDE_LIBRARY_OP_INSERT_AFTER && "Unsupported RNA override operation on constraints collection"); - Object *ob_dst = (Object *)ptr_dst->id.data; - Object *ob_src = (Object *)ptr_src->id.data; + Object *ob_dst = (Object *)ptr_dst->owner_id; + Object *ob_src = (Object *)ptr_src->owner_id; /* Remember that insertion operations are defined and stored in correct order, which means that * even if we insert several items in a row, we always insert first one, then second one, etc. @@ -1516,8 +1516,8 @@ bool rna_Object_modifiers_override_apply(Main *UNUSED(bmain), BLI_assert(opop->operation == IDOVERRIDE_LIBRARY_OP_INSERT_AFTER && "Unsupported RNA override operation on modifiers collection"); - Object *ob_dst = (Object *)ptr_dst->id.data; - Object *ob_src = (Object *)ptr_src->id.data; + Object *ob_dst = (Object *)ptr_dst->owner_id; + Object *ob_src = (Object *)ptr_src->owner_id; /* Remember that insertion operations are defined and stored in correct order, which means that * even if we insert several items in a row, we always insert first one, then second one, etc. @@ -1619,7 +1619,7 @@ static void rna_Object_shaderfx_clear(Object *object, bContext *C) static void rna_Object_boundbox_get(PointerRNA *ptr, float *values) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; BoundBox *bb = BKE_object_boundbox_get(ob); if (bb) { memcpy(values, bb->vec, sizeof(bb->vec)); @@ -1791,42 +1791,42 @@ static void rna_FaceMap_face_remove( /* generic poll functions */ bool rna_Lattice_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value) { - return ((Object *)value.id.data)->type == OB_LATTICE; + return ((Object *)value.owner_id)->type == OB_LATTICE; } bool rna_Curve_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value) { - return ((Object *)value.id.data)->type == OB_CURVE; + return ((Object *)value.owner_id)->type == OB_CURVE; } bool rna_Armature_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value) { - return ((Object *)value.id.data)->type == OB_ARMATURE; + return ((Object *)value.owner_id)->type == OB_ARMATURE; } bool rna_Mesh_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value) { - return ((Object *)value.id.data)->type == OB_MESH; + return ((Object *)value.owner_id)->type == OB_MESH; } bool rna_Camera_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value) { - return ((Object *)value.id.data)->type == OB_CAMERA; + return ((Object *)value.owner_id)->type == OB_CAMERA; } bool rna_Light_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value) { - return ((Object *)value.id.data)->type == OB_LAMP; + return ((Object *)value.owner_id)->type == OB_LAMP; } bool rna_GPencil_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value) { - return ((Object *)value.id.data)->type == OB_GPENCIL; + return ((Object *)value.owner_id)->type == OB_GPENCIL; } int rna_Object_use_dynamic_topology_sculpting_get(PointerRNA *ptr) { - SculptSession *ss = ((Object *)ptr->id.data)->sculpt; + SculptSession *ss = ((Object *)ptr->owner_id)->sculpt; return (ss && ss->bm); } diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 9a76885a19d..d3bdfde86ce 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -243,7 +243,7 @@ static Base *rna_Object_local_view_property_helper( static bool rna_Object_local_view_get(Object *ob, ReportList *reports, PointerRNA *v3d_ptr) { - bScreen *sc = v3d_ptr->id.data; + bScreen *sc = (bScreen *)v3d_ptr->owner_id; View3D *v3d = v3d_ptr->data; Base *base = rna_Object_local_view_property_helper(sc, v3d, ob, reports, NULL); if (base == NULL) { @@ -257,7 +257,7 @@ static void rna_Object_local_view_set(Object *ob, PointerRNA *v3d_ptr, bool state) { - bScreen *sc = v3d_ptr->id.data; + bScreen *sc = (bScreen *)v3d_ptr->owner_id; View3D *v3d = v3d_ptr->data; Scene *scene; Base *base = rna_Object_local_view_property_helper(sc, v3d, ob, reports, &scene); diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 4dd46281a42..5460dc6dfa1 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -122,7 +122,7 @@ static const EnumPropertyItem empty_vortex_shape_items[] = { static void rna_Cache_change(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; PointCache *cache = (PointCache *)ptr->data; if (!ob) { @@ -146,7 +146,7 @@ static void rna_Cache_change(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR static void rna_Cache_toggle_disk_cache(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; PointCache *cache = (PointCache *)ptr->data; if (!ob) { @@ -166,7 +166,7 @@ static void rna_Cache_toggle_disk_cache(Main *UNUSED(bmain), Scene *UNUSED(scene static void rna_Cache_idname_change(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; PointCache *cache = (PointCache *)ptr->data; bool use_new_name = true; @@ -240,7 +240,7 @@ static void rna_Cache_list_begin(CollectionPropertyIterator *iter, PointerRNA *p static void rna_Cache_active_point_cache_index_range( PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; PointCache *cache = ptr->data; PTCacheID pid = BKE_ptcache_id_find(ob, NULL, cache); @@ -254,7 +254,7 @@ static void rna_Cache_active_point_cache_index_range( static int rna_Cache_active_point_cache_index_get(PointerRNA *ptr) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; PointCache *cache = ptr->data; PTCacheID pid = BKE_ptcache_id_find(ob, NULL, cache); int num = 0; @@ -268,7 +268,7 @@ static int rna_Cache_active_point_cache_index_get(PointerRNA *ptr) static void rna_Cache_active_point_cache_index_set(struct PointerRNA *ptr, int value) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; PointCache *cache = ptr->data; PTCacheID pid = BKE_ptcache_id_find(ob, NULL, cache); @@ -280,7 +280,7 @@ static void rna_Cache_active_point_cache_index_set(struct PointerRNA *ptr, int v static void rna_PointCache_frame_step_range( PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; PointCache *cache = ptr->data; PTCacheID pid = BKE_ptcache_id_find(ob, NULL, cache); @@ -295,7 +295,7 @@ static void rna_PointCache_frame_step_range( int rna_Cache_info_length(PointerRNA *ptr) { PointCache *cache = (PointCache *)ptr->data; - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; if (!ob) { return 0; @@ -314,7 +314,7 @@ static char *rna_CollisionSettings_path(PointerRNA *UNUSED(ptr)) { /* both methods work ok, but return the shorter path */ # if 0 - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ModifierData *md = (ModifierData *)modifiers_findByType(ob, eModifierType_Collision); if (md) { @@ -334,13 +334,13 @@ static char *rna_CollisionSettings_path(PointerRNA *UNUSED(ptr)) static bool rna_SoftBodySettings_use_edges_get(PointerRNA *ptr) { - Object *data = (Object *)(ptr->id.data); + Object *data = (Object *)(ptr->owner_id); return (((data->softflag) & OB_SB_EDGES) != 0); } static void rna_SoftBodySettings_use_edges_set(PointerRNA *ptr, bool value) { - Object *data = (Object *)(ptr->id.data); + Object *data = (Object *)(ptr->owner_id); if (value) { data->softflag |= OB_SB_EDGES; } @@ -351,13 +351,13 @@ static void rna_SoftBodySettings_use_edges_set(PointerRNA *ptr, bool value) static bool rna_SoftBodySettings_use_goal_get(PointerRNA *ptr) { - Object *data = (Object *)(ptr->id.data); + Object *data = (Object *)(ptr->owner_id); return (((data->softflag) & OB_SB_GOAL) != 0); } static void rna_SoftBodySettings_use_goal_set(PointerRNA *ptr, bool value) { - Object *data = (Object *)(ptr->id.data); + Object *data = (Object *)(ptr->owner_id); if (value) { data->softflag |= OB_SB_GOAL; } @@ -368,13 +368,13 @@ static void rna_SoftBodySettings_use_goal_set(PointerRNA *ptr, bool value) static bool rna_SoftBodySettings_stiff_quads_get(PointerRNA *ptr) { - Object *data = (Object *)(ptr->id.data); + Object *data = (Object *)(ptr->owner_id); return (((data->softflag) & OB_SB_QUADS) != 0); } static void rna_SoftBodySettings_stiff_quads_set(PointerRNA *ptr, bool value) { - Object *data = (Object *)(ptr->id.data); + Object *data = (Object *)(ptr->owner_id); if (value) { data->softflag |= OB_SB_QUADS; } @@ -385,13 +385,13 @@ static void rna_SoftBodySettings_stiff_quads_set(PointerRNA *ptr, bool value) static bool rna_SoftBodySettings_self_collision_get(PointerRNA *ptr) { - Object *data = (Object *)(ptr->id.data); + Object *data = (Object *)(ptr->owner_id); return (((data->softflag) & OB_SB_SELF) != 0); } static void rna_SoftBodySettings_self_collision_set(PointerRNA *ptr, bool value) { - Object *data = (Object *)(ptr->id.data); + Object *data = (Object *)(ptr->owner_id); if (value) { data->softflag |= OB_SB_SELF; } @@ -402,7 +402,7 @@ static void rna_SoftBodySettings_self_collision_set(PointerRNA *ptr, bool value) static int rna_SoftBodySettings_new_aero_get(PointerRNA *ptr) { - Object *data = (Object *)(ptr->id.data); + Object *data = (Object *)(ptr->owner_id); if (data->softflag & OB_SB_AERO_ANGLE) { return 1; } @@ -413,7 +413,7 @@ static int rna_SoftBodySettings_new_aero_get(PointerRNA *ptr) static void rna_SoftBodySettings_new_aero_set(PointerRNA *ptr, int value) { - Object *data = (Object *)(ptr->id.data); + Object *data = (Object *)(ptr->owner_id); if (value == 1) { data->softflag |= OB_SB_AERO_ANGLE; } @@ -424,13 +424,13 @@ static void rna_SoftBodySettings_new_aero_set(PointerRNA *ptr, int value) static bool rna_SoftBodySettings_face_collision_get(PointerRNA *ptr) { - Object *data = (Object *)(ptr->id.data); + Object *data = (Object *)(ptr->owner_id); return (((data->softflag) & OB_SB_FACECOLL) != 0); } static void rna_SoftBodySettings_face_collision_set(PointerRNA *ptr, bool value) { - Object *data = (Object *)(ptr->id.data); + Object *data = (Object *)(ptr->owner_id); if (value) { data->softflag |= OB_SB_FACECOLL; } @@ -441,13 +441,13 @@ static void rna_SoftBodySettings_face_collision_set(PointerRNA *ptr, bool value) static bool rna_SoftBodySettings_edge_collision_get(PointerRNA *ptr) { - Object *data = (Object *)(ptr->id.data); + Object *data = (Object *)(ptr->owner_id); return (((data->softflag) & OB_SB_EDGECOLL) != 0); } static void rna_SoftBodySettings_edge_collision_set(PointerRNA *ptr, bool value) { - Object *data = (Object *)(ptr->id.data); + Object *data = (Object *)(ptr->owner_id); if (value) { data->softflag |= OB_SB_EDGECOLL; } @@ -488,7 +488,7 @@ static void rna_SoftBodySettings_spring_vgroup_set(PointerRNA *ptr, const char * static char *rna_SoftBodySettings_path(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ModifierData *md = (ModifierData *)modifiers_findByType(ob, eModifierType_Softbody); char name_esc[sizeof(md->name) * 2]; @@ -498,7 +498,7 @@ static char *rna_SoftBodySettings_path(PointerRNA *ptr) static int particle_id_check(PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; return (GS(id->name) == ID_PA); } @@ -506,7 +506,7 @@ static int particle_id_check(PointerRNA *ptr) static void rna_FieldSettings_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { if (particle_id_check(ptr)) { - ParticleSettings *part = (ParticleSettings *)ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->owner_id; if (part->pd->forcefield != PFIELD_TEXTURE && part->pd->tex) { id_us_min(&part->pd->tex->id); @@ -524,7 +524,7 @@ static void rna_FieldSettings_update(Main *UNUSED(bmain), Scene *UNUSED(scene), WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL); } else { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; if (ob->pd->forcefield != PFIELD_TEXTURE && ob->pd->tex) { id_us_min(&ob->pd->tex->id); @@ -539,7 +539,7 @@ static void rna_FieldSettings_update(Main *UNUSED(bmain), Scene *UNUSED(scene), static void rna_FieldSettings_shape_update(Main *bmain, Scene *scene, PointerRNA *ptr) { if (!particle_id_check(ptr)) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ED_object_check_force_modifiers(bmain, scene, ob); DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM); @@ -555,7 +555,7 @@ static void rna_FieldSettings_type_set(PointerRNA *ptr, int value) part_deflect->forcefield = value; if (!particle_id_check(ptr)) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ob->pd->forcefield = value; if (ELEM(value, PFIELD_WIND, PFIELD_VORTEX)) { ob->empty_drawtype = OB_SINGLE_ARROW; @@ -571,12 +571,12 @@ static void rna_FieldSettings_dependency_update(Main *bmain, Scene *scene, Point DEG_relations_tag_update(bmain); if (particle_id_check(ptr)) { - DEG_id_tag_update((ID *)ptr->id.data, + DEG_id_tag_update(ptr->owner_id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION | ID_RECALC_PSYS_RESET); } else { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; rna_FieldSettings_shape_update(bmain, scene, ptr); @@ -599,7 +599,7 @@ static char *rna_FieldSettings_path(PointerRNA *ptr) if (particle_id_check(ptr)) { /* particle system force field */ - ParticleSettings *part = (ParticleSettings *)ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->owner_id; if (part->pd == pd) { return BLI_strdup("force_field_1"); @@ -610,7 +610,7 @@ static char *rna_FieldSettings_path(PointerRNA *ptr) } else { /* object force field */ - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; if (ob->pd == pd) { return BLI_strdup("field"); @@ -621,7 +621,7 @@ static char *rna_FieldSettings_path(PointerRNA *ptr) static void rna_EffectorWeight_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; if (id && GS(id->name) == ID_SCE) { Scene *scene = (Scene *)id; @@ -642,7 +642,7 @@ static void rna_EffectorWeight_dependency_update(Main *bmain, { DEG_relations_tag_update(bmain); - DEG_id_tag_update((ID *)ptr->id.data, ID_RECALC_GEOMETRY | ID_RECALC_PSYS_RESET); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY | ID_RECALC_PSYS_RESET); WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL); } @@ -654,14 +654,14 @@ static char *rna_EffectorWeight_path(PointerRNA *ptr) if (particle_id_check(ptr)) { /* particle effector weights */ - ParticleSettings *part = (ParticleSettings *)ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->owner_id; if (part->effector_weights == ew) { return BLI_strdup("effector_weights"); } } else { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ModifierData *md; /* check softbody modifier */ @@ -727,7 +727,7 @@ static char *rna_EffectorWeight_path(PointerRNA *ptr) static void rna_CollisionSettings_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ModifierData *md = modifiers_findByType(ob, eModifierType_Collision); /* add/remove modifier as needed */ @@ -745,7 +745,7 @@ static void rna_CollisionSettings_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION); WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob); @@ -753,7 +753,7 @@ static void rna_CollisionSettings_update(Main *UNUSED(bmain), static void rna_softbody_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob); @@ -776,7 +776,7 @@ static const EnumPropertyItem *rna_Effector_shape_itemf(bContext *UNUSED(C), return empty_shape_items; } - ob = (Object *)ptr->id.data; + ob = (Object *)ptr->owner_id; if (ob->type == OB_CURVE) { if (ob->pd->forcefield == PFIELD_VORTEX) { diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index cadd66d564a..98ecb053641 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -146,7 +146,7 @@ static void rna_ParticleHairKey_location_object_info(PointerRNA *ptr, ParticleData **pa_pt) { HairKey *hkey = (HairKey *)ptr->data; - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ModifierData *md; ParticleSystemModifierData *psmd = NULL; ParticleSystem *psys; @@ -193,7 +193,7 @@ static void rna_ParticleHairKey_location_object_info(PointerRNA *ptr, static void rna_ParticleHairKey_location_object_get(PointerRNA *ptr, float *values) { HairKey *hkey = (HairKey *)ptr->data; - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ParticleSystemModifierData *psmd; ParticleData *pa; @@ -221,7 +221,7 @@ static void rna_ParticleHairKey_location_object_get(PointerRNA *ptr, float *valu static void rna_ParticleHairKey_location_object_set(PointerRNA *ptr, const float *values) { HairKey *hkey = (HairKey *)ptr->data; - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ParticleSystemModifierData *psmd; ParticleData *pa; @@ -618,7 +618,7 @@ static void rna_ParticleSystem_mcol_on_emitter(ParticleSystem *particlesystem, static void particle_recalc(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr, short flag) { if (ptr->type == &RNA_ParticleSystem) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ParticleSystem *psys = (ParticleSystem *)ptr->data; psys->recalc = flag; @@ -626,7 +626,7 @@ static void particle_recalc(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRN DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); } else { - DEG_id_tag_update(ptr->id.data, ID_RECALC_GEOMETRY | flag); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY | flag); } WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, NULL); @@ -663,7 +663,7 @@ static void rna_Particle_reset_dependency(Main *bmain, Scene *scene, PointerRNA static void rna_Particle_change_type(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - ParticleSettings *part = ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->owner_id; /* Iterating over all object is slow, but no better solution exists at the moment. */ for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { @@ -716,7 +716,7 @@ static void rna_Particle_redo_child(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_Particle_cloth_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob); @@ -741,7 +741,7 @@ static ParticleSystem *rna_particle_system_for_target(Object *ob, ParticleTarget static void rna_Particle_target_reset(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { if (ptr->type == &RNA_ParticleTarget) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ParticleTarget *pt = (ParticleTarget *)ptr->data; ParticleSystem *kpsys = NULL, *psys = rna_particle_system_for_target(ob, pt); @@ -780,7 +780,7 @@ static void rna_Particle_target_reset(Main *bmain, Scene *UNUSED(scene), Pointer static void rna_Particle_target_redo(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { if (ptr->type == &RNA_ParticleTarget) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ParticleTarget *pt = (ParticleTarget *)ptr->data; ParticleSystem *psys = rna_particle_system_for_target(ob, pt); @@ -793,7 +793,7 @@ static void rna_Particle_target_redo(Main *UNUSED(bmain), Scene *UNUSED(scene), static void rna_Particle_hair_dynamics_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ParticleSystem *psys = (ParticleSystem *)ptr->data; if (psys && !psys->clmd) { @@ -823,7 +823,7 @@ static void rna_particle_settings_set(PointerRNA *ptr, PointerRNA value, struct ReportList *UNUSED(reports)) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ParticleSystem *psys = (ParticleSystem *)ptr->data; int old_type = 0; @@ -1000,7 +1000,7 @@ static void rna_ParticleSettings_use_twist_curve_update(Main *bmain, Scene *scen static void rna_ParticleSystem_name_set(PointerRNA *ptr, const char *value) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ParticleSystem *part = (ParticleSystem *)ptr->data; /* copy the new name into the name slot */ @@ -1076,7 +1076,7 @@ static void rna_ParticleTarget_name_get(PointerRNA *ptr, char *str) psys = BLI_findlink(&pt->ob->particlesystem, pt->psys - 1); } else { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; psys = BLI_findlink(&ob->particlesystem, pt->psys - 1); } @@ -1108,7 +1108,7 @@ static int rna_ParticleTarget_name_length(PointerRNA *ptr) static int particle_id_check(PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; return (GS(id->name) == ID_PA); } @@ -1118,7 +1118,7 @@ static char *rna_SPHFluidSettings_path(PointerRNA *ptr) SPHFluidSettings *fluid = (SPHFluidSettings *)ptr->data; if (particle_id_check(ptr)) { - ParticleSettings *part = (ParticleSettings *)ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->owner_id; if (part->fluid == fluid) { return BLI_strdup("fluid"); @@ -1152,7 +1152,7 @@ static bool rna_ParticleSystem_edited_get(PointerRNA *ptr) } static PointerRNA rna_ParticleDupliWeight_active_get(PointerRNA *ptr) { - ParticleSettings *part = (ParticleSettings *)ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->owner_id; ParticleDupliWeight *dw = part->instance_weights.first; for (; dw; dw = dw->next) { @@ -1165,14 +1165,14 @@ static PointerRNA rna_ParticleDupliWeight_active_get(PointerRNA *ptr) static void rna_ParticleDupliWeight_active_index_range( PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) { - ParticleSettings *part = (ParticleSettings *)ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->owner_id; *min = 0; *max = max_ii(0, BLI_listbase_count(&part->instance_weights) - 1); } static int rna_ParticleDupliWeight_active_index_get(PointerRNA *ptr) { - ParticleSettings *part = (ParticleSettings *)ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->owner_id; ParticleDupliWeight *dw = part->instance_weights.first; int i = 0; @@ -1187,7 +1187,7 @@ static int rna_ParticleDupliWeight_active_index_get(PointerRNA *ptr) static void rna_ParticleDupliWeight_active_index_set(struct PointerRNA *ptr, int value) { - ParticleSettings *part = (ParticleSettings *)ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->owner_id; ParticleDupliWeight *dw = part->instance_weights.first; int i = 0; @@ -1203,7 +1203,7 @@ static void rna_ParticleDupliWeight_active_index_set(struct PointerRNA *ptr, int static void rna_ParticleDupliWeight_name_get(PointerRNA *ptr, char *str) { - ParticleSettings *part = (ParticleSettings *)ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->owner_id; psys_find_group_weights(part); ParticleDupliWeight *dw = ptr->data; @@ -1241,7 +1241,7 @@ static const EnumPropertyItem *rna_Particle_dist_itemf(bContext *UNUSED(C), PropertyRNA *UNUSED(prop), bool *UNUSED(r_free)) { - ParticleSettings *part = ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->owner_id; if (part->type == PART_HAIR) { return part_hair_dist_items; @@ -1256,7 +1256,7 @@ static const EnumPropertyItem *rna_Particle_draw_as_itemf(bContext *UNUSED(C), PropertyRNA *UNUSED(prop), bool *UNUSED(r_free)) { - ParticleSettings *part = ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->owner_id; if (part->type == PART_HAIR) { return part_hair_draw_as_items; @@ -1271,7 +1271,7 @@ static const EnumPropertyItem *rna_Particle_ren_as_itemf(bContext *UNUSED(C), PropertyRNA *UNUSED(prop), bool *UNUSED(r_free)) { - ParticleSettings *part = ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->owner_id; if (part->type == PART_HAIR) { return part_hair_ren_as_items; @@ -1283,7 +1283,7 @@ static const EnumPropertyItem *rna_Particle_ren_as_itemf(bContext *UNUSED(C), static PointerRNA rna_Particle_field1_get(PointerRNA *ptr) { - ParticleSettings *part = (ParticleSettings *)ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->owner_id; /* weak */ if (!part->pd) { @@ -1295,7 +1295,7 @@ static PointerRNA rna_Particle_field1_get(PointerRNA *ptr) static PointerRNA rna_Particle_field2_get(PointerRNA *ptr) { - ParticleSettings *part = (ParticleSettings *)ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->owner_id; /* weak */ if (!part->pd2) { @@ -1307,7 +1307,7 @@ static PointerRNA rna_Particle_field2_get(PointerRNA *ptr) static void psys_vg_name_get__internal(PointerRNA *ptr, char *value, int index) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ParticleSystem *psys = (ParticleSystem *)ptr->data; if (psys->vgroup[index] > 0) { @@ -1323,7 +1323,7 @@ static void psys_vg_name_get__internal(PointerRNA *ptr, char *value, int index) } static int psys_vg_name_len__internal(PointerRNA *ptr, int index) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ParticleSystem *psys = (ParticleSystem *)ptr->data; if (psys->vgroup[index] > 0) { @@ -1337,7 +1337,7 @@ static int psys_vg_name_len__internal(PointerRNA *ptr, int index) } static void psys_vg_name_set__internal(PointerRNA *ptr, const char *value, int index) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; ParticleSystem *psys = (ParticleSystem *)ptr->data; if (value[0] == '\0') { diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index aaef55a9518..7637930f37f 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -99,25 +99,25 @@ static void rna_Pose_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRN { /* XXX when to use this? ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK); */ - DEG_id_tag_update(ptr->id.data, ID_RECALC_GEOMETRY); - WM_main_add_notifier(NC_OBJECT | ND_POSE, ptr->id.data); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY); + WM_main_add_notifier(NC_OBJECT | ND_POSE, ptr->owner_id); } static void rna_Pose_dependency_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { DEG_relations_tag_update(bmain); - DEG_id_tag_update(ptr->id.data, ID_RECALC_GEOMETRY); - WM_main_add_notifier(NC_OBJECT | ND_POSE, ptr->id.data); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY); + WM_main_add_notifier(NC_OBJECT | ND_POSE, ptr->owner_id); } static void rna_Pose_IK_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { /* XXX when to use this? ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK); */ - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); - WM_main_add_notifier(NC_OBJECT | ND_POSE, ptr->id.data); + WM_main_add_notifier(NC_OBJECT | ND_POSE, ptr->owner_id); BIK_clear_data(ob->pose); } @@ -183,7 +183,7 @@ bool rna_ActionGroup_is_custom_colorset_get(PointerRNA *ptr) static void rna_BoneGroup_name_set(PointerRNA *ptr, const char *value) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bActionGroup *agrp = ptr->data; /* copy the new name into the name slot */ @@ -227,7 +227,7 @@ static void rna_Pose_ik_solver_set(struct PointerRNA *ptr, int value) static void rna_Pose_ik_solver_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bPose *pose = ptr->data; BKE_pose_tag_recalc(bmain, pose); /* checks & sorts pose channels */ @@ -276,7 +276,7 @@ static void rna_PoseChannel_rotation_mode_set(PointerRNA *ptr, int value) static void rna_PoseChannel_name_set(PointerRNA *ptr, const char *value) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bPoseChannel *pchan = (bPoseChannel *)ptr->data; char oldname[sizeof(pchan->name)], newname[sizeof(pchan->name)]; @@ -291,19 +291,19 @@ static void rna_PoseChannel_name_set(PointerRNA *ptr, const char *value) static PointerRNA rna_PoseChannel_bone_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bPoseChannel *pchan = (bPoseChannel *)ptr->data; PointerRNA tmp_ptr = *ptr; /* Replace the id_data pointer with the Armature ID. */ - tmp_ptr.id.data = ob->data; + tmp_ptr.owner_id = ob->data; return rna_pointer_inherit_refine(&tmp_ptr, &RNA_Bone, pchan->bone); } static bool rna_PoseChannel_has_ik_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bPoseChannel *pchan = (bPoseChannel *)ptr->data; return BKE_pose_channel_in_IK_chain(ob, pchan); @@ -341,7 +341,7 @@ static StructRNA *rna_Pose_ikparam_typef(PointerRNA *ptr) static void rna_Itasc_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bItasc *itasc = ptr->data; /* verify values */ @@ -373,7 +373,7 @@ static void rna_Itasc_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR static void rna_Itasc_update_rebuild(Main *bmain, Scene *scene, PointerRNA *ptr) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bPose *pose = ob->pose; BKE_pose_tag_recalc(bmain, pose); /* checks & sorts pose channels */ @@ -398,7 +398,7 @@ static void rna_PoseChannel_bone_custom_set(PointerRNA *ptr, static PointerRNA rna_PoseChannel_bone_group_get(PointerRNA *ptr) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bPose *pose = (ob) ? ob->pose : NULL; bPoseChannel *pchan = (bPoseChannel *)ptr->data; bActionGroup *grp; @@ -417,7 +417,7 @@ static void rna_PoseChannel_bone_group_set(PointerRNA *ptr, PointerRNA value, struct ReportList *UNUSED(reports)) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bPose *pose = (ob) ? ob->pose : NULL; bPoseChannel *pchan = (bPoseChannel *)ptr->data; @@ -444,7 +444,7 @@ static void rna_PoseChannel_bone_group_index_set(PointerRNA *ptr, int value) static void rna_PoseChannel_bone_group_index_range( PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bPose *pose = (ob) ? ob->pose : NULL; *min = 0; @@ -663,7 +663,7 @@ bool rna_PoseChannel_constraints_override_apply(Main *UNUSED(bmain), static int rna_PoseChannel_proxy_editable(PointerRNA *ptr, const char **r_info) { - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; bArmature *arm = ob->data; bPoseChannel *pchan = (bPoseChannel *)ptr->data; @@ -762,7 +762,7 @@ static int rna_PoseBones_lookup_string(PointerRNA *ptr, const char *key, Pointer bPose *pose = (bPose *)ptr->data; bPoseChannel *pchan = BKE_pose_channel_find_name(pose, key); if (pchan) { - RNA_pointer_create(ptr->id.data, &RNA_PoseBone, pchan, r_ptr); + RNA_pointer_create(ptr->owner_id, &RNA_PoseBone, pchan, r_ptr); return true; } else { @@ -785,7 +785,7 @@ static void rna_PoseChannel_matrix_basis_set(PointerRNA *ptr, const float *value static void rna_PoseChannel_matrix_set(PointerRNA *ptr, const float *values) { bPoseChannel *pchan = (bPoseChannel *)ptr->data; - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; float tmat[4][4]; BKE_armature_mat_pose_to_bone_ex(NULL, ob, pchan, (float(*)[4])values, tmat); @@ -812,9 +812,9 @@ static void rna_PoseChannel_custom_shape_transform_set(PointerRNA *ptr, struct ReportList *UNUSED(reports)) { bPoseChannel *pchan = (bPoseChannel *)ptr->data; - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; - pchan->custom_tx = rna_PoseChannel_ensure_own_pchan(ob, value.id.data, value.data); + pchan->custom_tx = rna_PoseChannel_ensure_own_pchan(ob, (Object *)value.owner_id, value.data); } #else diff --git a/source/blender/makesrna/intern/rna_rigidbody.c b/source/blender/makesrna/intern/rna_rigidbody.c index 0a31cb17f82..03937a5434e 100644 --- a/source/blender/makesrna/intern/rna_rigidbody.c +++ b/source/blender/makesrna/intern/rna_rigidbody.c @@ -215,7 +215,7 @@ static void rna_RigidBodyOb_reset(Main *UNUSED(bmain), Scene *scene, PointerRNA static void rna_RigidBodyOb_shape_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - Object *ob = ptr->id.data; + Object *ob = (Object *)ptr->owner_id; rna_RigidBodyOb_reset(bmain, scene, ptr); diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index dc7e861421e..6e21d02c0b3 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -388,10 +388,10 @@ void rna_builtin_properties_begin(CollectionPropertyIterator *iter, PointerRNA * newptr.data = ptr->type; if (ptr->type->flag & STRUCT_ID) { - newptr.id.data = ptr->data; + newptr.owner_id = ptr->data; } else { - newptr.id.data = NULL; + newptr.owner_id = NULL; } iter->parent = newptr; @@ -414,7 +414,7 @@ int rna_builtin_properties_lookup_string(PointerRNA *ptr, const char *key, Point { StructRNA *srna; PropertyRNA *prop; - PointerRNA propptr = {{NULL}}; + PointerRNA propptr = {NULL}; srna = ptr->type; @@ -1229,7 +1229,7 @@ static bool rna_property_override_diff_propptr_validate_diffing(PointerRNA *prop } if (*r_is_id) { - BLI_assert(propptr_a->data == propptr_a->id.data && propptr_b->data == propptr_b->id.data); + BLI_assert(propptr_a->data == propptr_a->owner_id && propptr_b->data == propptr_b->owner_id); } return is_valid_for_diffing; diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index b1661e9a0eb..208bcaab007 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -835,7 +835,7 @@ static void rna_Scene_set_set(PointerRNA *ptr, void rna_Scene_set_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; DEG_relations_tag_update(bmain); DEG_id_tag_update_ex(bmain, &scene->id, 0); @@ -873,7 +873,7 @@ static void rna_Scene_listener_update(Main *UNUSED(bmain), Scene *scene, Pointer static void rna_Scene_volume_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; DEG_id_tag_update(&scene->id, ID_RECALC_AUDIO_VOLUME | ID_RECALC_SEQUENCER_STRIPS); } @@ -997,7 +997,7 @@ static void rna_Scene_show_subframe_update(Main *UNUSED(bmain), Scene *UNUSED(current_scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; scene->r.subframe = 0.0f; } @@ -1005,7 +1005,7 @@ static void rna_Scene_frame_update(Main *UNUSED(bmain), Scene *UNUSED(current_scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; DEG_id_tag_update(&scene->id, ID_RECALC_AUDIO_SEEK); WM_main_add_notifier(NC_SCENE | ND_FRAME, scene); } @@ -1118,7 +1118,7 @@ static char *rna_BakeSettings_path(PointerRNA *UNUSED(ptr)) static char *rna_ImageFormatSettings_path(PointerRNA *ptr) { ImageFormatData *imf = (ImageFormatData *)ptr->data; - ID *id = ptr->id.data; + ID *id = ptr->owner_id; switch (GS(id->name)) { case ID_SCE: { @@ -1189,7 +1189,7 @@ static bool rna_RenderSettings_is_movie_format_get(PointerRNA *ptr) static void rna_ImageFormatSettings_file_format_set(PointerRNA *ptr, int value) { ImageFormatData *imf = (ImageFormatData *)ptr->data; - ID *id = ptr->id.data; + ID *id = ptr->owner_id; imf->imtype = value; const bool is_render = (id && GS(id->name) == ID_SCE); @@ -1230,7 +1230,7 @@ static void rna_ImageFormatSettings_file_format_set(PointerRNA *ptr, int value) } if (id && GS(id->name) == ID_SCE) { - Scene *scene = ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; RenderData *rd = &scene->r; # ifdef WITH_FFMPEG BKE_ffmpeg_image_type_verify(rd, imf); @@ -1244,7 +1244,7 @@ static const EnumPropertyItem *rna_ImageFormatSettings_file_format_itemf(bContex PropertyRNA *UNUSED(prop), bool *UNUSED(r_free)) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; if (id && GS(id->name) == ID_SCE) { return rna_enum_image_type_items; } @@ -1259,7 +1259,7 @@ static const EnumPropertyItem *rna_ImageFormatSettings_color_mode_itemf(bContext bool *r_free) { ImageFormatData *imf = (ImageFormatData *)ptr->data; - ID *id = ptr->id.data; + ID *id = ptr->owner_id; const bool is_render = (id && GS(id->name) == ID_SCE); /* note, we need to act differently for render @@ -1275,7 +1275,7 @@ static const EnumPropertyItem *rna_ImageFormatSettings_color_mode_itemf(bContext * the same MPEG format with QTRLE codec can easily handle alpha channel. * not sure how to deal with such cases in a nicer way (sergey) */ if (is_render) { - Scene *scene = ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; RenderData *rd = &scene->r; if (BKE_ffmpeg_alpha_channel_is_supported(rd)) { @@ -1444,7 +1444,7 @@ static void rna_SceneRender_file_ext_get(PointerRNA *ptr, char *str) # ifdef WITH_FFMPEG static void rna_FFmpegSettings_lossless_output_set(PointerRNA *ptr, bool value) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; RenderData *rd = &scene->r; if (value) { @@ -1461,7 +1461,7 @@ static void rna_FFmpegSettings_codec_settings_update(Main *UNUSED(bmain), Scene *UNUSED(scene_unused), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; RenderData *rd = &scene->r; BKE_ffmpeg_codec_settings_verify(rd); @@ -1560,7 +1560,7 @@ static void rna_RenderSettings_engine_set(PointerRNA *ptr, int value) if (type) { BLI_strncpy_utf8(rd->engine, type->idname, sizeof(rd->engine)); - DEG_id_tag_update(ptr->id.data, ID_RECALC_COPY_ON_WRITE); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_COPY_ON_WRITE); } } @@ -1616,20 +1616,20 @@ static bool rna_RenderSettings_multiple_engines_get(PointerRNA *UNUSED(ptr)) static bool rna_RenderSettings_use_spherical_stereo_get(PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; return BKE_scene_use_spherical_stereo(scene); } void rna_Scene_glsl_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; DEG_id_tag_update(&scene->id, 0); } static void rna_Scene_world_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - Scene *sc = (Scene *)ptr->id.data; + Scene *sc = (Scene *)ptr->owner_id; rna_Scene_glsl_update(bmain, scene, ptr); WM_main_add_notifier(NC_WORLD | ND_WORLD, &sc->id); @@ -1638,7 +1638,7 @@ static void rna_Scene_world_update(Main *bmain, Scene *scene, PointerRNA *ptr) void rna_Scene_freestyle_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; DEG_id_tag_update(&scene->id, 0); } @@ -1654,7 +1654,7 @@ void rna_Scene_use_view_map_cache_update(Main *UNUSED(bmain), void rna_ViewLayer_name_set(PointerRNA *ptr, const char *value) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; ViewLayer *view_layer = (ViewLayer *)ptr->data; BLI_assert(BKE_id_is_in_global_main(&scene->id)); BKE_view_layer_rename(G_MAIN, scene, view_layer, value); @@ -1662,7 +1662,7 @@ void rna_ViewLayer_name_set(PointerRNA *ptr, const char *value) static void rna_SceneRenderView_name_set(PointerRNA *ptr, const char *value) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; SceneRenderView *rv = (SceneRenderView *)ptr->data; BLI_strncpy_utf8(rv->name, value, sizeof(rv->name)); BLI_uniquename(&scene->r.views, @@ -1675,14 +1675,14 @@ static void rna_SceneRenderView_name_set(PointerRNA *ptr, const char *value) void rna_ViewLayer_material_override_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; rna_Scene_glsl_update(bmain, scene, ptr); DEG_relations_tag_update(bmain); } void rna_ViewLayer_pass_update(Main *bmain, Scene *activescene, PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; if (scene->nodetree) { ntreeCompositUpdateRLayers(scene->nodetree); @@ -1715,7 +1715,7 @@ static void rna_Physics_relations_update(Main *bmain, static void rna_Physics_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; FOREACH_SCENE_OBJECT_BEGIN (scene, ob) { BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_DEPSGRAPH); } @@ -1802,7 +1802,7 @@ static void object_simplify_update(Object *ob) static void rna_Scene_use_simplify_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *sce = ptr->id.data; + Scene *sce = (Scene *)ptr->owner_id; Scene *sce_iter; Base *base; @@ -1823,7 +1823,7 @@ static void rna_Scene_use_simplify_update(Main *bmain, Scene *UNUSED(scene), Poi static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - Scene *sce = ptr->id.data; + Scene *sce = (Scene *)ptr->owner_id; if (sce->r.mode & R_SIMPLIFY) { rna_Scene_use_simplify_update(bmain, scene, ptr); @@ -1834,7 +1834,7 @@ static void rna_Scene_use_persistent_data_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *sce = ptr->id.data; + Scene *sce = (Scene *)ptr->owner_id; if (!(sce->r.mode & R_PERSISTENT_DATA)) { RE_FreePersistentData(); @@ -1845,7 +1845,7 @@ static void rna_Scene_use_persistent_data_update(Main *UNUSED(bmain), static void rna_Scene_transform_orientation_slots_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; TransformOrientationSlot *orient_slot = &scene->orientation_slots[0]; rna_iterator_array_begin( iter, orient_slot, sizeof(*orient_slot), ARRAY_SIZE(scene->orientation_slots), 0, NULL); @@ -1853,7 +1853,7 @@ static void rna_Scene_transform_orientation_slots_begin(CollectionPropertyIterat static int rna_Scene_transform_orientation_slots_length(PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; return ARRAY_SIZE(scene->orientation_slots); } @@ -2101,7 +2101,7 @@ static void rna_Scene_update_active_object_data(bContext *C, PointerRNA *UNUSED( static void rna_SceneCamera_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Object *camera = scene->camera; BKE_sequence_invalidate_scene_strips(bmain, scene); @@ -2242,7 +2242,7 @@ void rna_FreestyleSettings_module_remove(ID *id, static void rna_Stereo3dFormat_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; if (id && GS(id->name) == ID_IM) { Image *ima = (Image *)id; @@ -2290,7 +2290,7 @@ static void rna_ViewLayer_remove( static int rna_TransformOrientationSlot_type_get(PointerRNA *ptr) { - Scene *scene = ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; TransformOrientationSlot *orient_slot = ptr->data; if (orient_slot != &scene->orientation_slots[SCE_ORIENT_DEFAULT]) { if ((orient_slot->flag & SELECT) == 0) { @@ -2302,7 +2302,7 @@ static int rna_TransformOrientationSlot_type_get(PointerRNA *ptr) void rna_TransformOrientationSlot_type_set(PointerRNA *ptr, int value) { - Scene *scene = ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; TransformOrientationSlot *orient_slot = ptr->data; if (orient_slot != &scene->orientation_slots[SCE_ORIENT_DEFAULT]) { @@ -2320,7 +2320,7 @@ void rna_TransformOrientationSlot_type_set(PointerRNA *ptr, int value) static PointerRNA rna_TransformOrientationSlot_get(PointerRNA *ptr) { - Scene *scene = ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; TransformOrientationSlot *orient_slot = ptr->data; TransformOrientation *orientation; if (orient_slot->type < V3D_ORIENT_CUSTOM) { @@ -2378,8 +2378,8 @@ const EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, bool *r_free) { Scene *scene; - if (ptr->id.data && (GS(((ID *)ptr->id.data)->name) == ID_SCE)) { - scene = ptr->id.data; + if (ptr->owner_id && (GS(ptr->owner_id->name) == ID_SCE)) { + scene = (Scene *)ptr->owner_id; } else { scene = CTX_data_scene(C); @@ -2392,7 +2392,7 @@ const EnumPropertyItem *rna_TransformOrientation_with_scene_itemf(bContext *UNUS PropertyRNA *UNUSED(prop), bool *r_free) { - Scene *scene = ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; TransformOrientationSlot *orient_slot = ptr->data; bool include_default = (orient_slot != &scene->orientation_slots[SCE_ORIENT_DEFAULT]); return rna_TransformOrientation_impl_itemf(scene, include_default, r_free); @@ -5027,7 +5027,7 @@ static void rna_def_image_format_stereo3d_format(BlenderRNA *brna) /* use for render output and image save operator, * note: there are some cases where the members act differently when this is * used from a scene, video formats can only be selected for render output - * for example, this is checked by seeing if the ptr->id.data is a Scene id */ + * for example, this is checked by seeing if the ptr->owner_id is a Scene id */ static void rna_def_scene_image_format_data(BlenderRNA *brna) { diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c index c868c79e968..728ef3fb706 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -149,7 +149,7 @@ static void rna_Area_type_set(PointerRNA *ptr, int value) static void rna_Area_type_update(bContext *C, PointerRNA *ptr) { - bScreen *sc = (bScreen *)ptr->id.data; + bScreen *sc = (bScreen *)ptr->owner_id; ScrArea *sa = (ScrArea *)ptr->data; /* Running update without having called 'set', see: T64049 */ diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index fab3585797a..2e3f41d656b 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -319,7 +319,7 @@ static char *rna_ParticleEdit_path(PointerRNA *UNUSED(ptr)) static bool rna_Brush_mode_poll(PointerRNA *ptr, PointerRNA value) { const Paint *paint = ptr->data; - Brush *brush = value.id.data; + Brush *brush = (Brush *)value.owner_id; const uint tool_offset = paint->runtime.tool_offset; const eObjectMode ob_mode = paint->runtime.ob_mode; UNUSED_VARS_NDEBUG(tool_offset); @@ -350,10 +350,10 @@ static bool paint_contains_brush_slot(const Paint *paint, const PaintToolSlot *t static bool rna_Brush_mode_with_tool_poll(PointerRNA *ptr, PointerRNA value) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; const PaintToolSlot *tslot = ptr->data; ToolSettings *ts = scene->toolsettings; - Brush *brush = value.id.data; + Brush *brush = (Brush *)value.owner_id; int mode = 0; int slot_index = 0; @@ -438,7 +438,7 @@ static char *rna_Sculpt_path(PointerRNA *UNUSED(ptr)) static char *rna_VertexPaint_path(PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; ToolSettings *ts = scene->toolsettings; if (ptr->data == ts->vpaint) { return BLI_strdup("tool_settings.vertex_paint"); diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 80a4defba00..572cebec6ad 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -100,7 +100,7 @@ static void meta_tmp_ref(Sequence *seq_par, Sequence *seq) static void rna_SequenceElement_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Editing *ed = BKE_sequencer_editing_get(scene, false); if (ed) { @@ -119,7 +119,7 @@ static void rna_Sequence_invalidate_raw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Editing *ed = BKE_sequencer_editing_get(scene, false); if (ed) { @@ -133,7 +133,7 @@ static void rna_Sequence_invalidate_preprocessed_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Editing *ed = BKE_sequencer_editing_get(scene, false); if (ed) { @@ -147,7 +147,7 @@ static void rna_Sequence_invalidate_composite_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Editing *ed = BKE_sequencer_editing_get(scene, false); if (ed) { @@ -179,7 +179,7 @@ static void rna_Sequence_use_sequence(Main *bmain, Scene *scene, PointerRNA *ptr static void rna_SequenceEditor_sequences_all_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Editing *ed = BKE_sequencer_editing_get(scene, false); meta_tmp_ref(NULL, ed->seqbase.first); @@ -281,7 +281,7 @@ static void do_sequence_frame_change_update(Scene *scene, Sequence *seq) */ static void rna_Sequence_frame_change_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; do_sequence_frame_change_update(scene, (Sequence *)ptr->data); rna_Sequence_invalidate_preprocessed_update(bmain, scene, ptr); } @@ -289,7 +289,7 @@ static void rna_Sequence_frame_change_update(Main *bmain, Scene *UNUSED(scene), static void rna_Sequence_start_frame_set(PointerRNA *ptr, int value) { Sequence *seq = (Sequence *)ptr->data; - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; BKE_sequence_translate(scene, seq, value - seq->start); do_sequence_frame_change_update(scene, seq); @@ -298,7 +298,7 @@ static void rna_Sequence_start_frame_set(PointerRNA *ptr, int value) static void rna_Sequence_start_frame_final_set(PointerRNA *ptr, int value) { Sequence *seq = (Sequence *)ptr->data; - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; BKE_sequence_tx_set_final_left(seq, value); BKE_sequence_single_fix(seq); @@ -308,7 +308,7 @@ static void rna_Sequence_start_frame_final_set(PointerRNA *ptr, int value) static void rna_Sequence_end_frame_final_set(PointerRNA *ptr, int value) { Sequence *seq = (Sequence *)ptr->data; - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; BKE_sequence_tx_set_final_right(seq, value); BKE_sequence_single_fix(seq); @@ -318,7 +318,7 @@ static void rna_Sequence_end_frame_final_set(PointerRNA *ptr, int value) static void rna_Sequence_anim_startofs_final_set(PointerRNA *ptr, int value) { Sequence *seq = (Sequence *)ptr->data; - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; seq->anim_startofs = MIN2(value, seq->len + seq->anim_startofs); @@ -329,7 +329,7 @@ static void rna_Sequence_anim_startofs_final_set(PointerRNA *ptr, int value) static void rna_Sequence_anim_endofs_final_set(PointerRNA *ptr, int value) { Sequence *seq = (Sequence *)ptr->data; - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; seq->anim_endofs = MIN2(value, seq->len + seq->anim_endofs); @@ -340,7 +340,7 @@ static void rna_Sequence_anim_endofs_final_set(PointerRNA *ptr, int value) static void rna_Sequence_frame_length_set(PointerRNA *ptr, int value) { Sequence *seq = (Sequence *)ptr->data; - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; BKE_sequence_tx_set_final_right(seq, BKE_sequence_tx_get_final_left(seq, false) + value); do_sequence_frame_change_update(scene, seq); @@ -362,7 +362,7 @@ static int rna_Sequence_frame_editable(PointerRNA *ptr, const char **UNUSED(r_in static void rna_Sequence_channel_set(PointerRNA *ptr, int value) { Sequence *seq = (Sequence *)ptr->data; - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Editing *ed = BKE_sequencer_editing_get(scene, false); ListBase *seqbase = BKE_sequence_seqbase(&ed->seqbase, seq); @@ -445,7 +445,7 @@ static Sequence *sequence_get_by_transform(Editing *ed, StripTransform *transfor static char *rna_SequenceTransform_path(PointerRNA *ptr) { - Scene *scene = ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Editing *ed = BKE_sequencer_editing_get(scene, false); Sequence *seq = sequence_get_by_transform(ed, ptr->data); @@ -464,7 +464,7 @@ static void rna_SequenceTransform_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Editing *ed = BKE_sequencer_editing_get(scene, false); Sequence *seq = sequence_get_by_transform(ed, ptr->data); @@ -497,7 +497,7 @@ static Sequence *sequence_get_by_crop(Editing *ed, StripCrop *crop) static char *rna_SequenceCrop_path(PointerRNA *ptr) { - Scene *scene = ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Editing *ed = BKE_sequencer_editing_get(scene, false); Sequence *seq = sequence_get_by_crop(ed, ptr->data); @@ -514,7 +514,7 @@ static char *rna_SequenceCrop_path(PointerRNA *ptr) static void rna_SequenceCrop_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Editing *ed = BKE_sequencer_editing_get(scene, false); Sequence *seq = sequence_get_by_crop(ed, ptr->data); @@ -551,7 +551,7 @@ static int rna_Sequence_name_length(PointerRNA *ptr) static void rna_Sequence_name_set(PointerRNA *ptr, const char *value) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Sequence *seq = (Sequence *)ptr->data; char oldname[sizeof(seq->name)]; AnimData *adt; @@ -782,7 +782,7 @@ static void rna_SequenceElement_filename_set(PointerRNA *ptr, const char *value) static void rna_Sequence_reopen_files_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Editing *ed = BKE_sequencer_editing_get(scene, false); BKE_sequencer_free_imbuf(scene, &ed->seqbase, false); @@ -795,14 +795,14 @@ static void rna_Sequence_reopen_files_update(Main *bmain, Scene *UNUSED(scene), static void rna_Sequence_mute_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); } static void rna_Sequence_filepath_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Sequence *seq = (Sequence *)(ptr->data); BKE_sequence_reload_new_file(bmain, scene, seq, true); BKE_sequence_calc(scene, seq); @@ -838,7 +838,7 @@ static Sequence *sequence_get_by_proxy(Editing *ed, StripProxy *proxy) static void rna_Sequence_tcindex_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Editing *ed = BKE_sequencer_editing_get(scene, false); Sequence *seq = sequence_get_by_proxy(ed, ptr->data); @@ -848,7 +848,7 @@ static void rna_Sequence_tcindex_update(Main *bmain, Scene *UNUSED(scene), Point static void rna_SequenceProxy_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Editing *ed = BKE_sequencer_editing_get(scene, false); Sequence *seq = sequence_get_by_proxy(ed, ptr->data); @@ -911,7 +911,7 @@ static Sequence *sequence_get_by_colorbalance(Editing *ed, static char *rna_SequenceColorBalance_path(PointerRNA *ptr) { - Scene *scene = ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; SequenceModifierData *smd; Editing *ed = BKE_sequencer_editing_get(scene, false); Sequence *seq = sequence_get_by_colorbalance(ed, ptr->data, &smd); @@ -944,7 +944,7 @@ static void rna_SequenceColorBalance_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Editing *ed = BKE_sequencer_editing_get(scene, false); SequenceModifierData *smd; Sequence *seq = sequence_get_by_colorbalance(ed, ptr->data, &smd); @@ -954,7 +954,7 @@ static void rna_SequenceColorBalance_update(Main *UNUSED(bmain), static void rna_SequenceEditor_overlay_lock_set(PointerRNA *ptr, bool value) { - Scene *scene = ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Editing *ed = BKE_sequencer_editing_get(scene, false); if (ed == NULL) { @@ -974,7 +974,7 @@ static void rna_SequenceEditor_overlay_lock_set(PointerRNA *ptr, bool value) static int rna_SequenceEditor_overlay_frame_get(PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Editing *ed = BKE_sequencer_editing_get(scene, false); if (ed == NULL) { @@ -991,7 +991,7 @@ static int rna_SequenceEditor_overlay_frame_get(PointerRNA *ptr) static void rna_SequenceEditor_overlay_frame_set(PointerRNA *ptr, int value) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Editing *ed = BKE_sequencer_editing_get(scene, false); if (ed == NULL) { @@ -1055,7 +1055,7 @@ static StructRNA *rna_SequenceModifier_refine(struct PointerRNA *ptr) static char *rna_SequenceModifier_path(PointerRNA *ptr) { - Scene *scene = ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Editing *ed = BKE_sequencer_editing_get(scene, false); SequenceModifierData *smd = ptr->data; Sequence *seq = sequence_get_by_modifier(ed, smd); @@ -1077,7 +1077,7 @@ static char *rna_SequenceModifier_path(PointerRNA *ptr) static void rna_SequenceModifier_name_set(PointerRNA *ptr, const char *value) { SequenceModifierData *smd = ptr->data; - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Editing *ed = BKE_sequencer_editing_get(scene, false); Sequence *seq = sequence_get_by_modifier(ed, smd); AnimData *adt; @@ -1106,7 +1106,7 @@ static void rna_SequenceModifier_name_set(PointerRNA *ptr, const char *value) static void rna_SequenceModifier_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { /* strip from other scenes could be modified, so using active scene is not reliable */ - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Editing *ed = BKE_sequencer_editing_get(scene, false); Sequence *seq = sequence_get_by_modifier(ed, ptr->data); @@ -1115,7 +1115,7 @@ static void rna_SequenceModifier_update(Main *UNUSED(bmain), Scene *UNUSED(scene static bool rna_SequenceModifier_otherSequence_poll(PointerRNA *ptr, PointerRNA value) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Editing *ed = BKE_sequencer_editing_get(scene, false); Sequence *seq = sequence_get_by_modifier(ed, ptr->data); Sequence *cur = (Sequence *)value.data; @@ -1181,7 +1181,7 @@ static void rna_Sequence_modifier_clear(Sequence *seq, bContext *C) static float rna_Sequence_fps_get(PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; Sequence *seq = (Sequence *)(ptr->data); return BKE_sequence_get_fps(scene, seq); } diff --git a/source/blender/makesrna/intern/rna_shader_fx.c b/source/blender/makesrna/intern/rna_shader_fx.c index 98c80efee0f..acf525e1788 100644 --- a/source/blender/makesrna/intern/rna_shader_fx.c +++ b/source/blender/makesrna/intern/rna_shader_fx.c @@ -140,8 +140,8 @@ static void rna_ShaderFx_name_set(PointerRNA *ptr, const char *value) BLI_strncpy_utf8(gmd->name, value, sizeof(gmd->name)); /* make sure the name is truly unique */ - if (ptr->id.data) { - Object *ob = ptr->id.data; + if (ptr->owner_id) { + Object *ob = (Object *)ptr->owner_id; BKE_shaderfx_unique_name(&ob->shader_fx, gmd); } @@ -160,8 +160,8 @@ static char *rna_ShaderFx_path(PointerRNA *ptr) static void rna_ShaderFx_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - DEG_id_tag_update(ptr->id.data, ID_RECALC_GEOMETRY); - WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ptr->id.data); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY); + WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ptr->owner_id); } static void rna_ShaderFx_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr) @@ -189,7 +189,7 @@ static void shaderfx_object_set(Object *self, Object **ob_p, int type, PointerRN PointerRNA *ptr, PointerRNA value, struct ReportList *UNUSED(reports)) \ { \ _type##ShaderFxData *tmd = (_type##ShaderFxData *)ptr->data; \ - shaderfx_object_set(ptr->id.data, &tmd->_prop, _obtype, value); \ + shaderfx_object_set((Object *)ptr->owner_id, &tmd->_prop, _obtype, value); \ } RNA_FX_OBJECT_SET(Light, object, OB_EMPTY); diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c index 5c04802ac3c..fa0297ac306 100644 --- a/source/blender/makesrna/intern/rna_smoke.c +++ b/source/blender/makesrna/intern/rna_smoke.c @@ -55,7 +55,7 @@ static void rna_Smoke_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - DEG_id_tag_update(ptr->id.data, ID_RECALC_GEOMETRY); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY); } static void rna_Smoke_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr) @@ -70,13 +70,13 @@ static void rna_Smoke_resetCache(Main *UNUSED(bmain), Scene *UNUSED(scene), Poin if (settings->smd && settings->smd->domain) { settings->point_cache[0]->flag |= PTCACHE_OUTDATED; } - DEG_id_tag_update(ptr->id.data, ID_RECALC_GEOMETRY); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY); } static void rna_Smoke_cachetype_set(struct PointerRNA *ptr, int value) { SmokeDomainSettings *settings = (SmokeDomainSettings *)ptr->data; - Object *ob = (Object *)ptr->id.data; + Object *ob = (Object *)ptr->owner_id; if (value != settings->cache_file_format) { /* Clear old caches. */ diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 9e2034700b8..69f695f0c45 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -522,7 +522,7 @@ static StructRNA *rna_Space_refine(struct PointerRNA *ptr) static ScrArea *rna_area_from_space(PointerRNA *ptr) { - bScreen *sc = (bScreen *)ptr->id.data; + bScreen *sc = (bScreen *)ptr->owner_id; SpaceLink *link = (SpaceLink *)ptr->data; return BKE_screen_find_area_from_space(sc, link); } @@ -551,7 +551,7 @@ static void area_region_from_regiondata(bScreen *sc, static void rna_area_region_from_regiondata(PointerRNA *ptr, ScrArea **r_sa, ARegion **r_ar) { - bScreen *sc = (bScreen *)ptr->id.data; + bScreen *sc = (bScreen *)ptr->owner_id; void *regiondata = ptr->data; area_region_from_regiondata(sc, regiondata, r_sa, r_ar); @@ -769,7 +769,7 @@ static void rna_Space_view2d_sync_update(Main *UNUSED(bmain), ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); if (ar) { - bScreen *sc = (bScreen *)ptr->id.data; + bScreen *sc = (bScreen *)ptr->owner_id; View2D *v2d = &ar->v2d; UI_view2d_sync(sc, sa, v2d, V2D_LOCK_SET); @@ -802,7 +802,7 @@ static void rna_SpaceView3D_camera_update(Main *bmain, Scene *scene, PointerRNA static void rna_SpaceView3D_use_local_camera_set(PointerRNA *ptr, bool value) { View3D *v3d = (View3D *)(ptr->data); - bScreen *sc = (bScreen *)ptr->id.data; + bScreen *sc = (bScreen *)ptr->owner_id; v3d->scenelock = !value; @@ -815,7 +815,7 @@ static void rna_SpaceView3D_use_local_camera_set(PointerRNA *ptr, bool value) static float rna_View3DOverlay_GridScaleUnit_get(PointerRNA *ptr) { View3D *v3d = (View3D *)(ptr->data); - bScreen *screen = ptr->id.data; + bScreen *screen = (bScreen *)ptr->owner_id; Scene *scene = ED_screen_scene_find(screen, G_MAIN->wm.first); return ED_view3d_grid_scale(scene, v3d, NULL); @@ -932,7 +932,7 @@ static bool rna_RegionView3D_is_orthographic_side_view_get(PointerRNA *ptr) static void rna_3DViewShading_type_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; if (GS(id->name) == ID_SCE) { return; } @@ -949,7 +949,7 @@ static void rna_3DViewShading_type_update(Main *bmain, Scene *scene, PointerRNA } } - bScreen *screen = ptr->id.data; + bScreen *screen = (bScreen *)ptr->owner_id; for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -966,12 +966,12 @@ static void rna_3DViewShading_type_update(Main *bmain, Scene *scene, PointerRNA static Scene *rna_3DViewShading_scene(PointerRNA *ptr) { /* Get scene, depends if using 3D view or OpenGL render settings. */ - ID *id = ptr->id.data; + ID *id = ptr->owner_id; if (GS(id->name) == ID_SCE) { return (Scene *)id; } else { - bScreen *screen = ptr->id.data; + bScreen *screen = (bScreen *)ptr->owner_id; return WM_windows_scene_get_from_screen(G_MAIN->wm.first, screen); } } @@ -1294,7 +1294,7 @@ static bool rna_SpaceImageEditor_show_paint_get(PointerRNA *ptr) static bool rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr) { SpaceImage *sima = (SpaceImage *)(ptr->data); - bScreen *sc = (bScreen *)ptr->id.data; + bScreen *sc = (bScreen *)ptr->owner_id; wmWindow *win = ED_screen_window_find(sc, G_MAIN->wm.first); ViewLayer *view_layer = WM_window_get_active_view_layer(win); Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer); @@ -1304,7 +1304,7 @@ static bool rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr) static bool rna_SpaceImageEditor_show_maskedit_get(PointerRNA *ptr) { SpaceImage *sima = (SpaceImage *)(ptr->data); - bScreen *sc = (bScreen *)ptr->id.data; + bScreen *sc = (bScreen *)ptr->owner_id; wmWindow *win = ED_screen_window_find(sc, G_MAIN->wm.first); ViewLayer *view_layer = WM_window_get_active_view_layer(win); return ED_space_image_check_show_maskedit(sima, view_layer); @@ -1315,7 +1315,7 @@ static void rna_SpaceImageEditor_image_set(PointerRNA *ptr, struct ReportList *UNUSED(reports)) { SpaceImage *sima = (SpaceImage *)(ptr->data); - bScreen *sc = (bScreen *)ptr->id.data; + bScreen *sc = (bScreen *)ptr->owner_id; wmWindow *win = ED_screen_window_find(sc, G_MAIN->wm.first); ViewLayer *view_layer = WM_window_get_active_view_layer(win); Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer); @@ -2092,7 +2092,7 @@ static void rna_SpaceClipEditor_clip_set(PointerRNA *ptr, struct ReportList *UNUSED(reports)) { SpaceClip *sc = (SpaceClip *)(ptr->data); - bScreen *screen = (bScreen *)ptr->id.data; + bScreen *screen = (bScreen *)ptr->owner_id; ED_space_clip_set_clip(NULL, screen, sc, (MovieClip *)value.data); } diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index e217db484dd..2ab08c82b63 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -186,10 +186,10 @@ static StructRNA *rna_Texture_refine(struct PointerRNA *ptr) static void rna_Texture_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; if (GS(id->name) == ID_TE) { - Tex *tex = ptr->id.data; + Tex *tex = (Tex *)ptr->owner_id; DEG_id_tag_update(&tex->id, 0); DEG_id_tag_update(&tex->id, ID_RECALC_EDITORS); @@ -197,7 +197,7 @@ static void rna_Texture_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *pt WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, NULL); } else if (GS(id->name) == ID_NT) { - bNodeTree *ntree = ptr->id.data; + bNodeTree *ntree = (bNodeTree *)ptr->owner_id; ED_node_tag_update_nodetree(bmain, ntree, NULL); } } @@ -219,7 +219,7 @@ static void rna_Color_mapping_update(Main *UNUSED(bmain), /* Used for Texture Properties, used (also) for/in Nodes */ static void rna_Texture_nodes_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Tex *tex = ptr->id.data; + Tex *tex = (Tex *)ptr->owner_id; DEG_id_tag_update(&tex->id, 0); DEG_id_tag_update(&tex->id, ID_RECALC_EDITORS); @@ -235,7 +235,7 @@ static void rna_Texture_type_set(PointerRNA *ptr, int value) void rna_TextureSlot_update(bContext *C, PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; DEG_id_tag_update(id, 0); @@ -290,8 +290,8 @@ char *rna_TextureSlot_path(PointerRNA *ptr) * since the name used is the name of the texture assigned, but the texture * may be used multiple times in the same stack */ - if (ptr->id.data) { - if (GS(((ID *)ptr->id.data)->name) == ID_BR) { + if (ptr->owner_id) { + if (GS(ptr->owner_id->name) == ID_BR) { return BLI_strdup("texture_slot"); } else { @@ -299,7 +299,7 @@ char *rna_TextureSlot_path(PointerRNA *ptr) PropertyRNA *prop; /* find the 'textures' property of the ID-struct */ - RNA_id_pointer_create(ptr->id.data, &id_ptr); + RNA_id_pointer_create(ptr->owner_id, &id_ptr); prop = RNA_struct_find_property(&id_ptr, "texture_slots"); /* get an iterator for this property, and try to find the relevant index */ diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c index 84bde91e654..0a824b3c67a 100644 --- a/source/blender/makesrna/intern/rna_tracking.c +++ b/source/blender/makesrna/intern/rna_tracking.c @@ -61,7 +61,7 @@ static void rna_tracking_defaultSettings_patternUpdate(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; MovieTracking *tracking = &clip->tracking; MovieTrackingSettings *settings = &tracking->settings; @@ -74,7 +74,7 @@ static void rna_tracking_defaultSettings_searchUpdate(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; MovieTracking *tracking = &clip->tracking; MovieTrackingSettings *settings = &tracking->settings; @@ -85,7 +85,7 @@ static void rna_tracking_defaultSettings_searchUpdate(Main *UNUSED(bmain), static char *rna_trackingTrack_path(PointerRNA *ptr) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; MovieTrackingTrack *track = (MovieTrackingTrack *)ptr->data; /* Escaped object name, escaped track name, rest of the path. */ char rna_path[MAX_NAME * 4 + 64]; @@ -95,35 +95,35 @@ static char *rna_trackingTrack_path(PointerRNA *ptr) static void rna_trackingTracks_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; rna_iterator_listbase_begin(iter, &clip->tracking.tracks, NULL); } static void rna_trackingPlaneTracks_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; rna_iterator_listbase_begin(iter, &clip->tracking.plane_tracks, NULL); } static void rna_trackingObjects_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; rna_iterator_listbase_begin(iter, &clip->tracking.objects, NULL); } static int rna_tracking_active_object_index_get(PointerRNA *ptr) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; return clip->tracking.objectnr; } static void rna_tracking_active_object_index_set(PointerRNA *ptr, int value) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; clip->tracking.objectnr = value; BKE_tracking_dopesheet_tag_update(&clip->tracking); @@ -132,7 +132,7 @@ static void rna_tracking_active_object_index_set(PointerRNA *ptr, int value) static void rna_tracking_active_object_index_range( PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; *min = 0; *max = max_ii(0, clip->tracking.tot_object - 1); @@ -140,7 +140,7 @@ static void rna_tracking_active_object_index_range( static PointerRNA rna_tracking_active_track_get(PointerRNA *ptr) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; MovieTrackingTrack *act_track = BKE_tracking_track_get_active(&clip->tracking); return rna_pointer_inherit_refine(ptr, &RNA_MovieTrackingTrack, act_track); @@ -150,7 +150,7 @@ static void rna_tracking_active_track_set(PointerRNA *ptr, PointerRNA value, struct ReportList *UNUSED(reports)) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; MovieTrackingTrack *track = (MovieTrackingTrack *)value.data; ListBase *tracksbase = BKE_tracking_get_active_tracks(&clip->tracking); int index = BLI_findindex(tracksbase, track); @@ -165,7 +165,7 @@ static void rna_tracking_active_track_set(PointerRNA *ptr, static PointerRNA rna_tracking_active_plane_track_get(PointerRNA *ptr) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; MovieTrackingPlaneTrack *act_plane_track = BKE_tracking_plane_track_get_active(&clip->tracking); return rna_pointer_inherit_refine(ptr, &RNA_MovieTrackingPlaneTrack, act_plane_track); @@ -175,7 +175,7 @@ static void rna_tracking_active_plane_track_set(PointerRNA *ptr, PointerRNA value, struct ReportList *UNUSED(reports)) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; MovieTrackingPlaneTrack *plane_track = (MovieTrackingPlaneTrack *)value.data; ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(&clip->tracking); int index = BLI_findindex(plane_tracks_base, plane_track); @@ -190,7 +190,7 @@ static void rna_tracking_active_plane_track_set(PointerRNA *ptr, static void rna_trackingTrack_name_set(PointerRNA *ptr, const char *value) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; MovieTrackingTrack *track = (MovieTrackingTrack *)ptr->data; ListBase *tracksbase = BKE_tracking_find_tracks_list_for_track(&clip->tracking, track); /* Store old name, for the animation fix later. */ @@ -233,7 +233,7 @@ static void rna_trackingTrack_select_set(PointerRNA *ptr, bool value) static void rna_trackingPlaneMarker_frame_set(PointerRNA *ptr, int value) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; MovieTracking *tracking = &clip->tracking; MovieTrackingPlaneMarker *plane_marker = (MovieTrackingPlaneMarker *)ptr->data; MovieTrackingObject *tracking_object; @@ -268,7 +268,7 @@ static void rna_trackingPlaneMarker_frame_set(PointerRNA *ptr, int value) static char *rna_trackingPlaneTrack_path(PointerRNA *ptr) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; MovieTrackingPlaneTrack *plane_track = (MovieTrackingPlaneTrack *)ptr->data; /* Escaped object name, escaped track name, rest of the path. */ char rna_path[MAX_NAME * 4 + 64]; @@ -279,7 +279,7 @@ static char *rna_trackingPlaneTrack_path(PointerRNA *ptr) static void rna_trackingPlaneTrack_name_set(PointerRNA *ptr, const char *value) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; MovieTrackingPlaneTrack *plane_track = (MovieTrackingPlaneTrack *)ptr->data; ListBase *plane_tracks_base = BKE_tracking_find_tracks_list_for_plane_track(&clip->tracking, plane_track); @@ -307,7 +307,7 @@ static char *rna_trackingCamera_path(PointerRNA *UNUSED(ptr)) static float rna_trackingCamera_focal_mm_get(PointerRNA *ptr) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; MovieTrackingCamera *camera = &clip->tracking.camera; float val = camera->focal; @@ -320,7 +320,7 @@ static float rna_trackingCamera_focal_mm_get(PointerRNA *ptr) static void rna_trackingCamera_focal_mm_set(PointerRNA *ptr, float value) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; MovieTrackingCamera *camera = &clip->tracking.camera; if (clip->lastsize[0]) { @@ -362,26 +362,26 @@ static int rna_track_2d_stabilization_rotation(CollectionPropertyIterator *UNUSE static void rna_tracking_stabTracks_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; rna_iterator_listbase_begin(iter, &clip->tracking.tracks, rna_track_2d_stabilization); } static int rna_tracking_stabTracks_active_index_get(PointerRNA *ptr) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; return clip->tracking.stabilization.act_track; } static void rna_tracking_stabTracks_active_index_set(PointerRNA *ptr, int value) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; clip->tracking.stabilization.act_track = value; } static void rna_tracking_stabTracks_active_index_range( PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; *min = 0; *max = max_ii(0, clip->tracking.stabilization.tot_track - 1); @@ -389,26 +389,26 @@ static void rna_tracking_stabTracks_active_index_range( static void rna_tracking_stabRotTracks_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; rna_iterator_listbase_begin(iter, &clip->tracking.tracks, rna_track_2d_stabilization_rotation); } static int rna_tracking_stabRotTracks_active_index_get(PointerRNA *ptr) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; return clip->tracking.stabilization.act_rot_track; } static void rna_tracking_stabRotTracks_active_index_set(PointerRNA *ptr, int value) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; clip->tracking.stabilization.act_rot_track = value; } static void rna_tracking_stabRotTracks_active_index_range( PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; *min = 0; *max = max_ii(0, clip->tracking.stabilization.tot_rot_track - 1); @@ -416,7 +416,7 @@ static void rna_tracking_stabRotTracks_active_index_range( static void rna_tracking_flushUpdate(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; nodeUpdateID(scene->nodetree, &clip->id); @@ -429,7 +429,7 @@ static void rna_tracking_resetIntrinsics(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; MovieTracking *tracking = &clip->tracking; if (tracking->camera.intrinsics) { @@ -443,7 +443,7 @@ static void rna_trackingObject_tracks_begin(CollectionPropertyIterator *iter, Po MovieTrackingObject *object = (MovieTrackingObject *)ptr->data; if (object->flag & TRACKING_OBJECT_CAMERA) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; rna_iterator_listbase_begin(iter, &clip->tracking.tracks, NULL); } @@ -458,7 +458,7 @@ static void rna_trackingObject_plane_tracks_begin(CollectionPropertyIterator *it MovieTrackingObject *object = (MovieTrackingObject *)ptr->data; if (object->flag & TRACKING_OBJECT_CAMERA) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; rna_iterator_listbase_begin(iter, &clip->tracking.plane_tracks, NULL); } @@ -472,7 +472,7 @@ static PointerRNA rna_trackingObject_reconstruction_get(PointerRNA *ptr) MovieTrackingObject *object = (MovieTrackingObject *)ptr->data; if (object->flag & TRACKING_OBJECT_CAMERA) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; return rna_pointer_inherit_refine( ptr, &RNA_MovieTrackingReconstruction, &clip->tracking.reconstruction); @@ -485,7 +485,7 @@ static PointerRNA rna_trackingObject_reconstruction_get(PointerRNA *ptr) static PointerRNA rna_tracking_active_object_get(PointerRNA *ptr) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; MovieTrackingObject *object = BLI_findlink(&clip->tracking.objects, clip->tracking.objectnr); return rna_pointer_inherit_refine(ptr, &RNA_MovieTrackingObject, object); @@ -495,7 +495,7 @@ static void rna_tracking_active_object_set(PointerRNA *ptr, PointerRNA value, struct ReportList *UNUSED(reports)) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; MovieTrackingObject *object = (MovieTrackingObject *)value.data; int index = BLI_findindex(&clip->tracking.objects, object); @@ -509,7 +509,7 @@ static void rna_tracking_active_object_set(PointerRNA *ptr, static void rna_trackingObject_name_set(PointerRNA *ptr, const char *value) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; MovieTrackingObject *object = (MovieTrackingObject *)ptr->data; BLI_strncpy(object->name, value, sizeof(object->name)); @@ -521,7 +521,7 @@ static void rna_trackingObject_flushUpdate(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; WM_main_add_notifier(NC_OBJECT | ND_TRANSFORM, NULL); DEG_id_tag_update(&clip->id, 0); @@ -529,7 +529,7 @@ static void rna_trackingObject_flushUpdate(Main *UNUSED(bmain), static void rna_trackingMarker_frame_set(PointerRNA *ptr, int value) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; MovieTracking *tracking = &clip->tracking; MovieTrackingMarker *marker = (MovieTrackingMarker *)ptr->data; MovieTrackingObject *tracking_object; @@ -594,7 +594,7 @@ static void rna_trackingDopesheet_tagUpdate(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - MovieClip *clip = (MovieClip *)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->owner_id; MovieTrackingDopesheet *dopesheet = &clip->tracking.dopesheet; dopesheet->ok = 0; diff --git a/source/blender/makesrna/intern/rna_vfont.c b/source/blender/makesrna/intern/rna_vfont.c index cf61fe07c68..3e96b5816e5 100644 --- a/source/blender/makesrna/intern/rna_vfont.c +++ b/source/blender/makesrna/intern/rna_vfont.c @@ -40,7 +40,7 @@ /* matching fnction in rna_ID.c */ static int rna_VectorFont_filepath_editable(PointerRNA *ptr, const char **UNUSED(r_info)) { - VFont *vfont = ptr->id.data; + VFont *vfont = (VFont *)ptr->owner_id; if (BKE_vfont_is_builtin(vfont)) { return 0; } @@ -51,7 +51,7 @@ static void rna_VectorFont_reload_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - VFont *vf = ptr->id.data; + VFont *vf = (VFont *)ptr->owner_id; BKE_vfont_free_data(vf); /* update */ diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 123ec9634c9..c3ffeaf6f6f 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -530,7 +530,7 @@ const EnumPropertyItem rna_enum_wm_report_items[] = { static wmOperator *rna_OperatorProperties_find_operator(PointerRNA *ptr) { - wmWindowManager *wm = ptr->id.data; + wmWindowManager *wm = (wmWindowManager *)ptr->owner_id; if (wm) { IDProperty *properties = (IDProperty *)ptr->data; @@ -668,7 +668,7 @@ static PointerRNA rna_PopupMenu_layout_get(PointerRNA *ptr) uiLayout *layout = UI_popup_menu_layout(pup); PointerRNA rptr; - RNA_pointer_create(ptr->id.data, &RNA_UILayout, layout, &rptr); + RNA_pointer_create(ptr->owner_id, &RNA_UILayout, layout, &rptr); return rptr; } @@ -679,7 +679,7 @@ static PointerRNA rna_PopoverMenu_layout_get(PointerRNA *ptr) uiLayout *layout = UI_popover_layout(pup); PointerRNA rptr; - RNA_pointer_create(ptr->id.data, &RNA_UILayout, layout, &rptr); + RNA_pointer_create(ptr->owner_id, &RNA_UILayout, layout, &rptr); return rptr; } @@ -690,7 +690,7 @@ static PointerRNA rna_PieMenu_layout_get(PointerRNA *ptr) uiLayout *layout = UI_pie_menu_layout(pie); PointerRNA rptr; - RNA_pointer_create(ptr->id.data, &RNA_UILayout, layout, &rptr); + RNA_pointer_create(ptr->owner_id, &RNA_UILayout, layout, &rptr); return rptr; } @@ -804,7 +804,7 @@ static void rna_Window_screen_set(PointerRNA *ptr, static bool rna_Window_screen_assign_poll(PointerRNA *UNUSED(ptr), PointerRNA value) { - bScreen *screen = value.id.data; + bScreen *screen = (bScreen *)value.owner_id; return !screen->temp; } diff --git a/source/blender/makesrna/intern/rna_wm_gizmo.c b/source/blender/makesrna/intern/rna_wm_gizmo.c index 534e3042768..ba26929d808 100644 --- a/source/blender/makesrna/intern/rna_wm_gizmo.c +++ b/source/blender/makesrna/intern/rna_wm_gizmo.c @@ -252,7 +252,7 @@ static void rna_Gizmo_update_redraw(Main *UNUSED(bmain), Scene *UNUSED(scene), P static wmGizmo *rna_GizmoProperties_find_operator(PointerRNA *ptr) { # if 0 - wmWindowManager *wm = ptr->id.data; + wmWindowManager *wm = (wmWindowManager *)ptr->owner_id; # endif /* We could try workaruond this lookup, but not trivial. */ diff --git a/source/blender/makesrna/intern/rna_workspace.c b/source/blender/makesrna/intern/rna_workspace.c index 6349b5206d6..47138653af1 100644 --- a/source/blender/makesrna/intern/rna_workspace.c +++ b/source/blender/makesrna/intern/rna_workspace.c @@ -58,7 +58,7 @@ static void rna_window_update_all(Main *UNUSED(bmain), void rna_workspace_screens_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - WorkSpace *workspace = ptr->id.data; + WorkSpace *workspace = (WorkSpace *)ptr->owner_id; rna_iterator_listbase_begin(iter, BKE_workspace_layouts_get(workspace), NULL); } diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index 9b5611f30d7..07db2755523 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -48,17 +48,17 @@ static PointerRNA rna_World_lighting_get(PointerRNA *ptr) { - return rna_pointer_inherit_refine(ptr, &RNA_WorldLighting, ptr->id.data); + return rna_pointer_inherit_refine(ptr, &RNA_WorldLighting, ptr->owner_id); } static PointerRNA rna_World_mist_get(PointerRNA *ptr) { - return rna_pointer_inherit_refine(ptr, &RNA_WorldMistSettings, ptr->id.data); + return rna_pointer_inherit_refine(ptr, &RNA_WorldMistSettings, ptr->owner_id); } static void rna_World_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - World *wo = ptr->id.data; + World *wo = (World *)ptr->owner_id; DEG_id_tag_update(&wo->id, 0); WM_main_add_notifier(NC_WORLD | ND_WORLD, wo); @@ -67,7 +67,7 @@ static void rna_World_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR # if 0 static void rna_World_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - World *wo = ptr->id.data; + World *wo = (World *)ptr->owner_id; DEG_id_tag_update(&wo->id, 0); WM_main_add_notifier(NC_WORLD | ND_WORLD_DRAW, wo); @@ -76,7 +76,7 @@ static void rna_World_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Poi static void rna_World_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - World *wo = ptr->id.data; + World *wo = (World *)ptr->owner_id; DEG_id_tag_update(&wo->id, 0); WM_main_add_notifier(NC_WORLD | ND_WORLD_DRAW, wo); |