rename RNA_property_is_set() --> RNA_struct_property_is_set() in preperation to add a second version of the function which takes the property rather then its name.

This commit is contained in:
Campbell Barton 2012-01-11 16:32:12 +00:00
parent e26cd10b7a
commit f66f33cefc
34 changed files with 121 additions and 121 deletions

@ -4636,7 +4636,7 @@ static int add_vertex_invoke(bContext *C, wmOperator *op, wmEvent *event)
{ {
RegionView3D *rv3d= CTX_wm_region_view3d(C); RegionView3D *rv3d= CTX_wm_region_view3d(C);
if(rv3d && !RNA_property_is_set(op->ptr, "location")) { if(rv3d && !RNA_struct_property_is_set(op->ptr, "location")) {
Curve *cu; Curve *cu;
ViewContext vc; ViewContext vc;
float location[3]; float location[3];

@ -398,7 +398,7 @@ static int paste_file_exec(bContext *C, wmOperator *op)
static int paste_file_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) static int paste_file_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{ {
if(RNA_property_is_set(op->ptr, "filepath")) if(RNA_struct_property_is_set(op->ptr, "filepath"))
return paste_file_exec(C, op); return paste_file_exec(C, op);
WM_event_add_fileselect(C, op); WM_event_add_fileselect(C, op);
@ -1190,7 +1190,7 @@ static int insert_text_exec(bContext *C, wmOperator *op)
wchar_t *inserted_text; wchar_t *inserted_text;
int a, len; int a, len;
if(!RNA_property_is_set(op->ptr, "text")) if(!RNA_struct_property_is_set(op->ptr, "text"))
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
inserted_utf8= RNA_string_get_alloc(op->ptr, "text", NULL, 0); inserted_utf8= RNA_string_get_alloc(op->ptr, "text", NULL, 0);
@ -1223,10 +1223,10 @@ static int insert_text_invoke(bContext *C, wmOperator *op, wmEvent *evt)
int event= evt->type, val= evt->val; int event= evt->type, val= evt->val;
wchar_t inserted_text[2]= {0}; wchar_t inserted_text[2]= {0};
if(RNA_property_is_set(op->ptr, "text")) if(RNA_struct_property_is_set(op->ptr, "text"))
return insert_text_exec(C, op); return insert_text_exec(C, op);
if(RNA_property_is_set(op->ptr, "accent")) { if(RNA_struct_property_is_set(op->ptr, "accent")) {
if(cu->len!=0 && cu->pos>0) if(cu->len!=0 && cu->pos>0)
accentcode= 1; accentcode= 1;
return OPERATOR_FINISHED; return OPERATOR_FINISHED;
@ -1673,7 +1673,7 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
path = (font && strcmp(font->name, FO_BUILTIN_NAME) != 0)? font->name: U.fontdir; path = (font && strcmp(font->name, FO_BUILTIN_NAME) != 0)? font->name: U.fontdir;
if(RNA_property_is_set(op->ptr, "filepath")) if(RNA_struct_property_is_set(op->ptr, "filepath"))
return font_open_exec(C, op); return font_open_exec(C, op);
RNA_string_set(op->ptr, "filepath", path); RNA_string_set(op->ptr, "filepath", path);

@ -2458,7 +2458,7 @@ static int select_linked_limited_invoke(ViewContext *vc, short all, short sel)
static void linked_limit_default(bContext *C, wmOperator *op) static void linked_limit_default(bContext *C, wmOperator *op)
{ {
if(!RNA_property_is_set(op->ptr, "limit")) { if(!RNA_struct_property_is_set(op->ptr, "limit")) {
Object *obedit= CTX_data_edit_object(C); Object *obedit= CTX_data_edit_object(C);
EditMesh *em= BKE_mesh_get_editmesh(obedit->data); EditMesh *em= BKE_mesh_get_editmesh(obedit->data);
if(em->selectmode == SCE_SELECT_FACE) if(em->selectmode == SCE_SELECT_FACE)

@ -368,7 +368,7 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event)
} }
/* check input variables */ /* check input variables */
if(RNA_property_is_set(op->ptr, "filepath")) { if(RNA_struct_property_is_set(op->ptr, "filepath")) {
char path[FILE_MAX]; char path[FILE_MAX];
RNA_string_get(op->ptr, "filepath", path); RNA_string_get(op->ptr, "filepath", path);

@ -207,17 +207,17 @@ void ED_object_add_generic_props(wmOperatorType *ot, int do_editmode)
static void object_add_generic_invoke_options(bContext *C, wmOperator *op) static void object_add_generic_invoke_options(bContext *C, wmOperator *op)
{ {
if(RNA_struct_find_property(op->ptr, "enter_editmode")) /* optional */ if(RNA_struct_find_property(op->ptr, "enter_editmode")) /* optional */
if (!RNA_property_is_set(op->ptr, "enter_editmode")) if (!RNA_struct_property_is_set(op->ptr, "enter_editmode"))
RNA_boolean_set(op->ptr, "enter_editmode", U.flag & USER_ADD_EDITMODE); RNA_boolean_set(op->ptr, "enter_editmode", U.flag & USER_ADD_EDITMODE);
if(!RNA_property_is_set(op->ptr, "location")) { if(!RNA_struct_property_is_set(op->ptr, "location")) {
float loc[3]; float loc[3];
ED_object_location_from_view(C, loc); ED_object_location_from_view(C, loc);
RNA_float_set_array(op->ptr, "location", loc); RNA_float_set_array(op->ptr, "location", loc);
} }
if(!RNA_property_is_set(op->ptr, "layers")) { if(!RNA_struct_property_is_set(op->ptr, "layers")) {
View3D *v3d = CTX_wm_view3d(C); View3D *v3d = CTX_wm_view3d(C);
Scene *scene = CTX_data_scene(C); Scene *scene = CTX_data_scene(C);
int a, values[20], layer; int a, values[20], layer;
@ -257,7 +257,7 @@ int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc,
*enter_editmode = TRUE; *enter_editmode = TRUE;
} }
if(RNA_property_is_set(op->ptr, "layers")) { if(RNA_struct_property_is_set(op->ptr, "layers")) {
RNA_boolean_get_array(op->ptr, "layers", layer_values); RNA_boolean_get_array(op->ptr, "layers", layer_values);
*layer= 0; *layer= 0;
for(a=0; a<20; a++) { for(a=0; a<20; a++) {
@ -278,9 +278,9 @@ int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc,
if(v3d && v3d->localvd) if(v3d && v3d->localvd)
*layer |= v3d->lay; *layer |= v3d->lay;
if(RNA_property_is_set(op->ptr, "rotation")) if(RNA_struct_property_is_set(op->ptr, "rotation"))
view_align = FALSE; view_align = FALSE;
else if (RNA_property_is_set(op->ptr, "view_align")) else if (RNA_struct_property_is_set(op->ptr, "view_align"))
view_align = RNA_boolean_get(op->ptr, "view_align"); view_align = RNA_boolean_get(op->ptr, "view_align");
else { else {
view_align = U.flag & USER_ADD_VIEWALIGNED; view_align = U.flag & USER_ADD_VIEWALIGNED;

@ -553,7 +553,7 @@ static int edit_constraint_invoke_properties(bContext *C, wmOperator *op)
bConstraint *con; bConstraint *con;
ListBase *list; ListBase *list;
if (RNA_property_is_set(op->ptr, "constraint") && RNA_property_is_set(op->ptr, "owner")) if (RNA_struct_property_is_set(op->ptr, "constraint") && RNA_struct_property_is_set(op->ptr, "owner"))
return 1; return 1;
if (ptr.data) { if (ptr.data) {

@ -736,7 +736,7 @@ static int edit_modifier_invoke_properties(bContext *C, wmOperator *op)
PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier); PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier);
ModifierData *md; ModifierData *md;
if (RNA_property_is_set(op->ptr, "modifier")) if (RNA_struct_property_is_set(op->ptr, "modifier"))
return 1; return 1;
if (ptr.data) { if (ptr.data) {
@ -1209,7 +1209,7 @@ static int multires_external_save_invoke(bContext *C, wmOperator *op, wmEvent *U
if(CustomData_external_test(&me->fdata, CD_MDISPS)) if(CustomData_external_test(&me->fdata, CD_MDISPS))
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
if(RNA_property_is_set(op->ptr, "filepath")) if(RNA_struct_property_is_set(op->ptr, "filepath"))
return multires_external_save_exec(C, op); return multires_external_save_exec(C, op);
op->customdata= me; op->customdata= me;

@ -1056,7 +1056,7 @@ static unsigned int move_to_layer_init(bContext *C, wmOperator *op)
int values[20], a; int values[20], a;
unsigned int lay= 0; unsigned int lay= 0;
if(!RNA_property_is_set(op->ptr, "layers")) { if(!RNA_struct_property_is_set(op->ptr, "layers")) {
/* note: layers are set in bases, library objects work for this */ /* note: layers are set in bases, library objects work for this */
CTX_DATA_BEGIN(C, Base*, base, selected_bases) { CTX_DATA_BEGIN(C, Base*, base, selected_bases) {
lay |= base->lay; lay |= base->lay;

@ -645,7 +645,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
/* get the view settings if 'around' isnt set and the view is available */ /* get the view settings if 'around' isnt set and the view is available */
View3D *v3d= CTX_wm_view3d(C); View3D *v3d= CTX_wm_view3d(C);
copy_v3_v3(cursor, give_cursor(scene, v3d)); copy_v3_v3(cursor, give_cursor(scene, v3d));
if(v3d && !RNA_property_is_set(op->ptr, "center")) if(v3d && !RNA_struct_property_is_set(op->ptr, "center"))
around= v3d->around; around= v3d->around;
} }

@ -160,7 +160,7 @@ void image_buffer_rect_update(Scene *scene, RenderResult *rr, ImBuf *ibuf, volat
static void screen_render_scene_layer_set(wmOperator *op, Main *mainp, Scene **scene, SceneRenderLayer **srl) static void screen_render_scene_layer_set(wmOperator *op, Main *mainp, Scene **scene, SceneRenderLayer **srl)
{ {
/* single layer re-render */ /* single layer re-render */
if(RNA_property_is_set(op->ptr, "scene")) { if(RNA_struct_property_is_set(op->ptr, "scene")) {
Scene *scn; Scene *scn;
char scene_name[MAX_ID_NAME-2]; char scene_name[MAX_ID_NAME-2];
@ -176,7 +176,7 @@ static void screen_render_scene_layer_set(wmOperator *op, Main *mainp, Scene **s
} }
} }
if(RNA_property_is_set(op->ptr, "layer")) { if(RNA_struct_property_is_set(op->ptr, "layer")) {
SceneRenderLayer *rl; SceneRenderLayer *rl;
char rl_name[RE_MAXNAME]; char rl_name[RE_MAXNAME];
@ -537,7 +537,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* custom scene and single layer re-render */ /* custom scene and single layer re-render */
screen_render_scene_layer_set(op, mainp, &scene, &srl); screen_render_scene_layer_set(op, mainp, &scene, &srl);
if(RNA_property_is_set(op->ptr, "layer")) if(RNA_struct_property_is_set(op->ptr, "layer"))
jobflag |= WM_JOB_SUSPEND; jobflag |= WM_JOB_SUSPEND;
/* job custom data */ /* job custom data */

@ -705,7 +705,7 @@ static int envmap_save_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event
{ {
//Scene *scene= CTX_data_scene(C); //Scene *scene= CTX_data_scene(C);
if(RNA_property_is_set(op->ptr, "filepath")) if(RNA_struct_property_is_set(op->ptr, "filepath"))
return envmap_save_exec(C, op); return envmap_save_exec(C, op);
//RNA_enum_set(op->ptr, "file_type", scene->r.im_format.imtype); //RNA_enum_set(op->ptr, "file_type", scene->r.im_format.imtype);

@ -1348,12 +1348,12 @@ static int area_split_invoke(bContext *C, wmOperator *op, wmEvent *event)
int x, y; int x, y;
/* retrieve initial mouse coord, so we can find the active edge */ /* retrieve initial mouse coord, so we can find the active edge */
if(RNA_property_is_set(op->ptr, "mouse_x")) if(RNA_struct_property_is_set(op->ptr, "mouse_x"))
x= RNA_int_get(op->ptr, "mouse_x"); x= RNA_int_get(op->ptr, "mouse_x");
else else
x= event->x; x= event->x;
if(RNA_property_is_set(op->ptr, "mouse_y")) if(RNA_struct_property_is_set(op->ptr, "mouse_y"))
y= RNA_int_get(op->ptr, "mouse_y"); y= RNA_int_get(op->ptr, "mouse_y");
else else
y= event->x; y= event->x;
@ -3062,7 +3062,7 @@ static int screen_animation_play_exec(bContext *C, wmOperator *op)
int mode= (RNA_boolean_get(op->ptr, "reverse")) ? -1 : 1; int mode= (RNA_boolean_get(op->ptr, "reverse")) ? -1 : 1;
int sync= -1; int sync= -1;
if (RNA_property_is_set(op->ptr, "sync")) if (RNA_struct_property_is_set(op->ptr, "sync"))
sync= (RNA_boolean_get(op->ptr, "sync")); sync= (RNA_boolean_get(op->ptr, "sync"));
return ED_screen_animation_play(C, sync, mode); return ED_screen_animation_play(C, sync, mode);

@ -198,7 +198,7 @@ static int screenshot_exec(bContext *C, wmOperator *op)
static int screenshot_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) static int screenshot_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{ {
if(screenshot_data_create(C, op)) { if(screenshot_data_create(C, op)) {
if(RNA_property_is_set(op->ptr, "filepath")) if(RNA_struct_property_is_set(op->ptr, "filepath"))
return screenshot_exec(C, op); return screenshot_exec(C, op);
RNA_string_set(op->ptr, "filepath", G.ima); RNA_string_set(op->ptr, "filepath", G.ima);

@ -162,7 +162,7 @@ static int sound_open_exec(bContext *UNUSED(C), wmOperator *op)
static int sound_open_invoke(bContext *C, wmOperator *op, wmEvent *event) static int sound_open_invoke(bContext *C, wmOperator *op, wmEvent *event)
{ {
if(RNA_property_is_set(op->ptr, "filepath")) if(RNA_struct_property_is_set(op->ptr, "filepath"))
return sound_open_exec(C, op); return sound_open_exec(C, op);
sound_open_init(C, op); sound_open_init(C, op);
@ -359,7 +359,7 @@ static int sound_mixdown_exec(bContext *C, wmOperator *op)
static int sound_mixdown_invoke(bContext *C, wmOperator *op, wmEvent *event) static int sound_mixdown_invoke(bContext *C, wmOperator *op, wmEvent *event)
{ {
if(RNA_property_is_set(op->ptr, "filepath")) if(RNA_struct_property_is_set(op->ptr, "filepath"))
return sound_mixdown_exec(C, op); return sound_mixdown_exec(C, op);
return WM_operator_filesel(C, op, event); return WM_operator_filesel(C, op, event);
@ -653,7 +653,7 @@ static int sound_unpack_exec(bContext *C, wmOperator *op)
bSound* sound= NULL; bSound* sound= NULL;
/* find the suppplied image by name */ /* find the suppplied image by name */
if (RNA_property_is_set(op->ptr, "id")) { if (RNA_struct_property_is_set(op->ptr, "id")) {
char sndname[MAX_ID_NAME-2]; char sndname[MAX_ID_NAME-2];
RNA_string_get(op->ptr, "id", sndname); RNA_string_get(op->ptr, "id", sndname);
sound = BLI_findstring(&CTX_data_main(C)->sound, sndname, offsetof(ID, name) + 2); sound = BLI_findstring(&CTX_data_main(C)->sound, sndname, offsetof(ID, name) + 2);
@ -675,7 +675,7 @@ static int sound_unpack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
Editing* ed = CTX_data_scene(C)->ed; Editing* ed = CTX_data_scene(C)->ed;
bSound* sound; bSound* sound;
if(RNA_property_is_set(op->ptr, "id")) if(RNA_struct_property_is_set(op->ptr, "id"))
return sound_unpack_exec(C, op); return sound_unpack_exec(C, op);
if(!ed || !ed->act_seq || ed->act_seq->type != SEQ_SOUND) if(!ed || !ed->act_seq || ed->act_seq->type != SEQ_SOUND)

@ -103,7 +103,7 @@ static int file_browse_exec(bContext *C, wmOperator *op)
char *str, path[FILE_MAX]; char *str, path[FILE_MAX];
const char *path_prop= RNA_struct_find_property(op->ptr, "directory") ? "directory" : "filepath"; const char *path_prop= RNA_struct_find_property(op->ptr, "directory") ? "directory" : "filepath";
if (RNA_property_is_set(op->ptr, path_prop)==0 || fbo==NULL) if (RNA_struct_property_is_set(op->ptr, path_prop)==0 || fbo==NULL)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
str= RNA_string_get_alloc(op->ptr, path_prop, NULL, 0); str= RNA_string_get_alloc(op->ptr, path_prop, NULL, 0);
@ -200,7 +200,7 @@ static int file_browse_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* normally ED_fileselect_get_params would handle this but we need to because of stupid /* normally ED_fileselect_get_params would handle this but we need to because of stupid
* user-prefs exception - campbell */ * user-prefs exception - campbell */
if(RNA_struct_find_property(op->ptr, "relative_path")) { if(RNA_struct_find_property(op->ptr, "relative_path")) {
if(!RNA_property_is_set(op->ptr, "relative_path")) { if(!RNA_struct_property_is_set(op->ptr, "relative_path")) {
/* annoying exception!, if were dealign with the user prefs, default relative to be off */ /* annoying exception!, if were dealign with the user prefs, default relative to be off */
RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS && (ptr.data != &U)); RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS && (ptr.data != &U));
} }

@ -184,10 +184,10 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
if(clip) if(clip)
path= clip->name; path= clip->name;
if(!RNA_property_is_set(op->ptr, "relative_path")) if(!RNA_struct_property_is_set(op->ptr, "relative_path"))
RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS); RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
if(RNA_property_is_set(op->ptr, "filepath")) if(RNA_struct_property_is_set(op->ptr, "filepath"))
return open_exec(C, op); return open_exec(C, op);
open_init(C, op); open_init(C, op);

@ -410,7 +410,7 @@ static int console_insert_exec(bContext *C, wmOperator *op)
static int console_insert_invoke(bContext *C, wmOperator *op, wmEvent *event) static int console_insert_invoke(bContext *C, wmOperator *op, wmEvent *event)
{ {
// if(!RNA_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */ // if(!RNA_struct_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */
if(!RNA_string_length(op->ptr, "text")) { if(!RNA_string_length(op->ptr, "text")) {
/* if alt/ctrl/super are pressed pass through */ /* if alt/ctrl/super are pressed pass through */
if(event->ctrl || event->oskey) { if(event->ctrl || event->oskey) {

@ -130,7 +130,7 @@ short ED_fileselect_set_params(SpaceFile *sfile)
else else
params->type = FILE_SPECIAL; params->type = FILE_SPECIAL;
if (is_filepath && RNA_property_is_set(op->ptr, "filepath")) { if (is_filepath && RNA_struct_property_is_set(op->ptr, "filepath")) {
char name[FILE_MAX]; char name[FILE_MAX];
RNA_string_get(op->ptr, "filepath", name); RNA_string_get(op->ptr, "filepath", name);
if (params->type == FILE_LOADLIB) { if (params->type == FILE_LOADLIB) {
@ -142,12 +142,12 @@ short ED_fileselect_set_params(SpaceFile *sfile)
} }
} }
else { else {
if (is_directory && RNA_property_is_set(op->ptr, "directory")) { if (is_directory && RNA_struct_property_is_set(op->ptr, "directory")) {
RNA_string_get(op->ptr, "directory", params->dir); RNA_string_get(op->ptr, "directory", params->dir);
sfile->params->file[0]= '\0'; sfile->params->file[0]= '\0';
} }
if (is_filename && RNA_property_is_set(op->ptr, "filename")) { if (is_filename && RNA_struct_property_is_set(op->ptr, "filename")) {
RNA_string_get(op->ptr, "filename", params->file); RNA_string_get(op->ptr, "filename", params->file);
} }
} }
@ -226,7 +226,7 @@ short ED_fileselect_set_params(SpaceFile *sfile)
} }
if (is_relative_path) { if (is_relative_path) {
if (!RNA_property_is_set(op->ptr, "relative_path")) { if (!RNA_struct_property_is_set(op->ptr, "relative_path")) {
RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS); RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
} }
} }

@ -817,7 +817,7 @@ static int image_open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)
if(ima) if(ima)
path= ima->name; path= ima->name;
if(RNA_property_is_set(op->ptr, "filepath")) if(RNA_struct_property_is_set(op->ptr, "filepath"))
return image_open_exec(C, op); return image_open_exec(C, op);
image_open_init(C, op); image_open_init(C, op);
@ -876,10 +876,10 @@ static int image_replace_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(eve
if(!sima->image) if(!sima->image)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
if(RNA_property_is_set(op->ptr, "filepath")) if(RNA_struct_property_is_set(op->ptr, "filepath"))
return image_replace_exec(C, op); return image_replace_exec(C, op);
if(!RNA_property_is_set(op->ptr, "relative_path")) if(!RNA_struct_property_is_set(op->ptr, "relative_path"))
RNA_boolean_set(op->ptr, "relative_path", (strncmp(sima->image->name, "//", 2))==0); RNA_boolean_set(op->ptr, "relative_path", (strncmp(sima->image->name, "//", 2))==0);
image_filesel(C, op, sima->image->name); image_filesel(C, op, sima->image->name);
@ -1011,7 +1011,7 @@ static void save_image_options_from_op(SaveImageOptions *simopts, wmOperator *op
simopts->im_format= *(ImageFormatData *)op->customdata; simopts->im_format= *(ImageFormatData *)op->customdata;
} }
if (RNA_property_is_set(op->ptr, "filepath")) { if (RNA_struct_property_is_set(op->ptr, "filepath")) {
RNA_string_get(op->ptr, "filepath", simopts->filepath); RNA_string_get(op->ptr, "filepath", simopts->filepath);
BLI_path_abs(simopts->filepath, G.main->name); BLI_path_abs(simopts->filepath, G.main->name);
} }
@ -1176,7 +1176,7 @@ static int image_save_as_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(eve
Scene *scene= CTX_data_scene(C); Scene *scene= CTX_data_scene(C);
SaveImageOptions simopts; SaveImageOptions simopts;
if(RNA_property_is_set(op->ptr, "filepath")) if(RNA_struct_property_is_set(op->ptr, "filepath"))
return image_save_as_exec(C, op); return image_save_as_exec(C, op);
if (save_image_options_init(&simopts, sima, scene, TRUE) == 0) if (save_image_options_init(&simopts, sima, scene, TRUE) == 0)
@ -1184,7 +1184,7 @@ static int image_save_as_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(eve
save_image_options_to_op(&simopts, op); save_image_options_to_op(&simopts, op);
/* enable save_copy by default for render results */ /* enable save_copy by default for render results */
if(ELEM(ima->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE) && !RNA_property_is_set(op->ptr, "copy")) { if(ELEM(ima->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE) && !RNA_struct_property_is_set(op->ptr, "copy")) {
RNA_boolean_set(op->ptr, "copy", TRUE); RNA_boolean_set(op->ptr, "copy", TRUE);
} }
@ -1676,7 +1676,7 @@ static int image_unpack_exec(bContext *C, wmOperator *op)
int method= RNA_enum_get(op->ptr, "method"); int method= RNA_enum_get(op->ptr, "method");
/* find the suppplied image by name */ /* find the suppplied image by name */
if (RNA_property_is_set(op->ptr, "id")) { if (RNA_struct_property_is_set(op->ptr, "id")) {
char imaname[MAX_ID_NAME-2]; char imaname[MAX_ID_NAME-2];
RNA_string_get(op->ptr, "id", imaname); RNA_string_get(op->ptr, "id", imaname);
ima = BLI_findstring(&CTX_data_main(C)->image, imaname, offsetof(ID, name) + 2); ima = BLI_findstring(&CTX_data_main(C)->image, imaname, offsetof(ID, name) + 2);
@ -1708,7 +1708,7 @@ static int image_unpack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
{ {
Image *ima= CTX_data_edit_image(C); Image *ima= CTX_data_edit_image(C);
if(RNA_property_is_set(op->ptr, "id")) if(RNA_struct_property_is_set(op->ptr, "id"))
return image_unpack_exec(C, op); return image_unpack_exec(C, op);
if(!ima || !ima->packedfile) if(!ima || !ima->packedfile)

@ -96,7 +96,7 @@ static int edit_sensor_invoke_properties(bContext *C, wmOperator *op)
{ {
PointerRNA ptr= CTX_data_pointer_get_type(C, "sensor", &RNA_Sensor); PointerRNA ptr= CTX_data_pointer_get_type(C, "sensor", &RNA_Sensor);
if (RNA_property_is_set(op->ptr, "sensor") && RNA_property_is_set(op->ptr, "object") ) if (RNA_struct_property_is_set(op->ptr, "sensor") && RNA_struct_property_is_set(op->ptr, "object") )
return 1; return 1;
if (ptr.data) { if (ptr.data) {
@ -152,7 +152,7 @@ static int edit_controller_invoke_properties(bContext *C, wmOperator *op)
{ {
PointerRNA ptr= CTX_data_pointer_get_type(C, "controller", &RNA_Controller); PointerRNA ptr= CTX_data_pointer_get_type(C, "controller", &RNA_Controller);
if (RNA_property_is_set(op->ptr, "controller") && RNA_property_is_set(op->ptr, "object") ) if (RNA_struct_property_is_set(op->ptr, "controller") && RNA_struct_property_is_set(op->ptr, "object") )
return 1; return 1;
if (ptr.data) { if (ptr.data) {
@ -191,7 +191,7 @@ static int edit_actuator_invoke_properties(bContext *C, wmOperator *op)
{ {
PointerRNA ptr= CTX_data_pointer_get_type(C, "actuator", &RNA_Actuator); PointerRNA ptr= CTX_data_pointer_get_type(C, "actuator", &RNA_Actuator);
if (RNA_property_is_set(op->ptr, "actuator") && RNA_property_is_set(op->ptr, "object") ) if (RNA_struct_property_is_set(op->ptr, "actuator") && RNA_struct_property_is_set(op->ptr, "object") )
return 1; return 1;
if (ptr.data) { if (ptr.data) {

@ -758,7 +758,7 @@ static void edit_node_properties(wmOperatorType *ot)
static int edit_node_invoke_properties(bContext *C, wmOperator *op) static int edit_node_invoke_properties(bContext *C, wmOperator *op)
{ {
if (!RNA_property_is_set(op->ptr, "node")) { if (!RNA_struct_property_is_set(op->ptr, "node")) {
bNode *node= CTX_data_pointer_get_type(C, "node", &RNA_Node).data; bNode *node= CTX_data_pointer_get_type(C, "node", &RNA_Node).data;
if (!node) if (!node)
return 0; return 0;
@ -766,10 +766,10 @@ static int edit_node_invoke_properties(bContext *C, wmOperator *op)
RNA_string_set(op->ptr, "node", node->name); RNA_string_set(op->ptr, "node", node->name);
} }
if (!RNA_property_is_set(op->ptr, "in_out")) if (!RNA_struct_property_is_set(op->ptr, "in_out"))
RNA_enum_set(op->ptr, "in_out", SOCK_IN); RNA_enum_set(op->ptr, "in_out", SOCK_IN);
if (!RNA_property_is_set(op->ptr, "socket")) if (!RNA_struct_property_is_set(op->ptr, "socket"))
RNA_int_set(op->ptr, "socket", 0); RNA_int_set(op->ptr, "socket", 0);
return 1; return 1;
@ -896,13 +896,13 @@ static int node_group_socket_add_exec(bContext *C, wmOperator *op)
ED_preview_kill_jobs(C); ED_preview_kill_jobs(C);
if (RNA_property_is_set(op->ptr, "name")) if (RNA_struct_property_is_set(op->ptr, "name"))
RNA_string_get(op->ptr, "name", name); RNA_string_get(op->ptr, "name", name);
if (RNA_property_is_set(op->ptr, "type")) if (RNA_struct_property_is_set(op->ptr, "type"))
type = RNA_enum_get(op->ptr, "type"); type = RNA_enum_get(op->ptr, "type");
if (RNA_property_is_set(op->ptr, "in_out")) if (RNA_struct_property_is_set(op->ptr, "in_out"))
in_out = RNA_enum_get(op->ptr, "in_out"); in_out = RNA_enum_get(op->ptr, "in_out");
else else
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
@ -948,12 +948,12 @@ static int node_group_socket_remove_exec(bContext *C, wmOperator *op)
ED_preview_kill_jobs(C); ED_preview_kill_jobs(C);
if (RNA_property_is_set(op->ptr, "index")) if (RNA_struct_property_is_set(op->ptr, "index"))
index = RNA_int_get(op->ptr, "index"); index = RNA_int_get(op->ptr, "index");
else else
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
if (RNA_property_is_set(op->ptr, "in_out")) if (RNA_struct_property_is_set(op->ptr, "in_out"))
in_out = RNA_enum_get(op->ptr, "in_out"); in_out = RNA_enum_get(op->ptr, "in_out");
else else
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
@ -999,12 +999,12 @@ static int node_group_socket_move_up_exec(bContext *C, wmOperator *op)
ED_preview_kill_jobs(C); ED_preview_kill_jobs(C);
if (RNA_property_is_set(op->ptr, "index")) if (RNA_struct_property_is_set(op->ptr, "index"))
index = RNA_int_get(op->ptr, "index"); index = RNA_int_get(op->ptr, "index");
else else
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
if (RNA_property_is_set(op->ptr, "in_out")) if (RNA_struct_property_is_set(op->ptr, "in_out"))
in_out = RNA_enum_get(op->ptr, "in_out"); in_out = RNA_enum_get(op->ptr, "in_out");
else else
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
@ -1069,12 +1069,12 @@ static int node_group_socket_move_down_exec(bContext *C, wmOperator *op)
ED_preview_kill_jobs(C); ED_preview_kill_jobs(C);
if (RNA_property_is_set(op->ptr, "index")) if (RNA_struct_property_is_set(op->ptr, "index"))
index = RNA_int_get(op->ptr, "index"); index = RNA_int_get(op->ptr, "index");
else else
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
if (RNA_property_is_set(op->ptr, "in_out")) if (RNA_struct_property_is_set(op->ptr, "in_out"))
in_out = RNA_enum_get(op->ptr, "in_out"); in_out = RNA_enum_get(op->ptr, "in_out");
else else
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
@ -3435,7 +3435,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op)
ntemp.type = -1; ntemp.type = -1;
/* check input variables */ /* check input variables */
if (RNA_property_is_set(op->ptr, "filepath")) if (RNA_struct_property_is_set(op->ptr, "filepath"))
{ {
char path[FILE_MAX]; char path[FILE_MAX];
RNA_string_get(op->ptr, "filepath", path); RNA_string_get(op->ptr, "filepath", path);
@ -3449,7 +3449,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
} }
else if(RNA_property_is_set(op->ptr, "name")) else if(RNA_struct_property_is_set(op->ptr, "name"))
{ {
char name[MAX_ID_NAME-2]; char name[MAX_ID_NAME-2];
RNA_string_get(op->ptr, "name", name); RNA_string_get(op->ptr, "name", name);
@ -3495,7 +3495,7 @@ static int node_add_file_invoke(bContext *C, wmOperator *op, wmEvent *event)
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1],
&snode->mx, &snode->my); &snode->mx, &snode->my);
if (RNA_property_is_set(op->ptr, "filepath") || RNA_property_is_set(op->ptr, "name")) if (RNA_struct_property_is_set(op->ptr, "filepath") || RNA_struct_property_is_set(op->ptr, "name"))
return node_add_file_exec(C, op); return node_add_file_exec(C, op);
else else
return WM_operator_filesel(C, op, event); return WM_operator_filesel(C, op, event);
@ -3534,12 +3534,12 @@ static int new_node_tree_exec(bContext *C, wmOperator *op)
/* retrieve state */ /* retrieve state */
snode= CTX_wm_space_node(C); snode= CTX_wm_space_node(C);
if (RNA_property_is_set(op->ptr, "type")) if (RNA_struct_property_is_set(op->ptr, "type"))
treetype = RNA_enum_get(op->ptr, "type"); treetype = RNA_enum_get(op->ptr, "type");
else else
treetype = snode->treetype; treetype = snode->treetype;
if (RNA_property_is_set(op->ptr, "name")) if (RNA_struct_property_is_set(op->ptr, "name"))
RNA_string_get(op->ptr, "name", treename); RNA_string_get(op->ptr, "name", treename);
ntree = ntreeAddTree(treename, treetype, 0); ntree = ntreeAddTree(treename, treetype, 0);

@ -130,7 +130,7 @@ static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, w
RNA_int_set(op->ptr, "frame_start", (int)mval_v2d[0]); RNA_int_set(op->ptr, "frame_start", (int)mval_v2d[0]);
if ((flag & SEQPROP_ENDFRAME) && RNA_property_is_set(op->ptr, "frame_end")==0) if ((flag & SEQPROP_ENDFRAME) && RNA_struct_property_is_set(op->ptr, "frame_end")==0)
RNA_int_set(op->ptr, "frame_end", (int)mval_v2d[0] + 25); // XXX arbitary but ok for now. RNA_int_set(op->ptr, "frame_end", (int)mval_v2d[0] + 25); // XXX arbitary but ok for now.
if (!(flag & SEQPROP_NOPATHS)) { if (!(flag & SEQPROP_NOPATHS)) {
@ -264,7 +264,7 @@ static int sequencer_add_scene_strip_invoke(bContext *C, wmOperator *op, wmEvent
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
if(!RNA_property_is_set(op->ptr, "scene")) if(!RNA_struct_property_is_set(op->ptr, "scene"))
return WM_enum_search_invoke(C, op, event); return WM_enum_search_invoke(C, op, event);
sequencer_generic_invoke_xy__internal(C, op, event, 0); sequencer_generic_invoke_xy__internal(C, op, event, 0);
@ -371,7 +371,7 @@ static int sequencer_add_movie_strip_invoke(bContext *C, wmOperator *op, wmEvent
} }
/* This is for drag and drop */ /* This is for drag and drop */
if(RNA_collection_length(op->ptr, "files") || RNA_property_is_set(op->ptr, "filepath")) { if(RNA_collection_length(op->ptr, "files") || RNA_struct_property_is_set(op->ptr, "filepath")) {
sequencer_generic_invoke_xy__internal(C, op, event, SEQPROP_NOPATHS); sequencer_generic_invoke_xy__internal(C, op, event, SEQPROP_NOPATHS);
return sequencer_add_movie_strip_exec(C, op); return sequencer_add_movie_strip_exec(C, op);
} }
@ -423,7 +423,7 @@ static int sequencer_add_sound_strip_invoke(bContext *C, wmOperator *op, wmEvent
} }
/* This is for drag and drop */ /* This is for drag and drop */
if(RNA_collection_length(op->ptr, "files") || RNA_property_is_set(op->ptr, "filepath")) { if(RNA_collection_length(op->ptr, "files") || RNA_struct_property_is_set(op->ptr, "filepath")) {
sequencer_generic_invoke_xy__internal(C, op, event, SEQPROP_NOPATHS); sequencer_generic_invoke_xy__internal(C, op, event, SEQPROP_NOPATHS);
return sequencer_add_sound_strip_exec(C, op); return sequencer_add_sound_strip_exec(C, op);
} }
@ -650,7 +650,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
/* an unset channel is a special case where we automatically go above /* an unset channel is a special case where we automatically go above
* the other strips. */ * the other strips. */
if(!RNA_property_is_set(op->ptr, "channel")) { if(!RNA_struct_property_is_set(op->ptr, "channel")) {
if(seq->seq1) { if(seq->seq1) {
int chan= MAX3( seq->seq1 ? seq->seq1->machine : 0, int chan= MAX3( seq->seq1 ? seq->seq1->machine : 0,
seq->seq2 ? seq->seq2->machine : 0, seq->seq2 ? seq->seq2->machine : 0,
@ -686,7 +686,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
/* add color */ /* add color */
static int sequencer_add_effect_strip_invoke(bContext *C, wmOperator *op, wmEvent *event) static int sequencer_add_effect_strip_invoke(bContext *C, wmOperator *op, wmEvent *event)
{ {
short is_type_set= RNA_property_is_set(op->ptr, "type"); short is_type_set= RNA_struct_property_is_set(op->ptr, "type");
int type= -1; int type= -1;
int prop_flag= SEQPROP_ENDFRAME; int prop_flag= SEQPROP_ENDFRAME;

@ -276,7 +276,7 @@ static int text_open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
Text *text= CTX_data_edit_text(C); Text *text= CTX_data_edit_text(C);
char *path= (text && text->name)? text->name: G.main->name; char *path= (text && text->name)? text->name: G.main->name;
if(RNA_property_is_set(op->ptr, "filepath")) if(RNA_struct_property_is_set(op->ptr, "filepath"))
return text_open_exec(C, op); return text_open_exec(C, op);
text_open_init(C, op); text_open_init(C, op);
@ -534,7 +534,7 @@ static int text_save_as_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
Text *text= CTX_data_edit_text(C); Text *text= CTX_data_edit_text(C);
char *str; char *str;
if(RNA_property_is_set(op->ptr, "filepath")) if(RNA_struct_property_is_set(op->ptr, "filepath"))
return text_save_as_exec(C, op); return text_save_as_exec(C, op);
if(text->name) if(text->name)
@ -2209,7 +2209,7 @@ static int text_scroll_invoke(bContext *C, wmOperator *op, wmEvent *event)
SpaceText *st= CTX_wm_space_text(C); SpaceText *st= CTX_wm_space_text(C);
TextScroll *tsc; TextScroll *tsc;
if(RNA_property_is_set(op->ptr, "lines")) if(RNA_struct_property_is_set(op->ptr, "lines"))
return text_scroll_exec(C, op); return text_scroll_exec(C, op);
tsc= MEM_callocN(sizeof(TextScroll), "TextScroll"); tsc= MEM_callocN(sizeof(TextScroll), "TextScroll");
@ -2289,7 +2289,7 @@ static int text_scroll_bar_invoke(bContext *C, wmOperator *op, wmEvent *event)
const int *mval= event->mval; const int *mval= event->mval;
int zone= -1; int zone= -1;
if(RNA_property_is_set(op->ptr, "lines")) if(RNA_struct_property_is_set(op->ptr, "lines"))
return text_scroll_exec(C, op); return text_scroll_exec(C, op);
/* verify we are in the right zone */ /* verify we are in the right zone */
@ -2784,7 +2784,7 @@ static int text_insert_invoke(bContext *C, wmOperator *op, wmEvent *event)
{ {
int ret; int ret;
// if(!RNA_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */ // if(!RNA_struct_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */
if(!RNA_string_length(op->ptr, "text")) { if(!RNA_string_length(op->ptr, "text")) {
/* if alt/ctrl/super are pressed pass through */ /* if alt/ctrl/super are pressed pass through */
if(event->ctrl || event->oskey) { if(event->ctrl || event->oskey) {

@ -1585,8 +1585,8 @@ static int viewzoom_exec(bContext *C, wmOperator *op)
v3d= sa->spacedata.first; v3d= sa->spacedata.first;
rv3d= ar->regiondata; rv3d= ar->regiondata;
mx= RNA_property_is_set(op->ptr, "mx") ? RNA_int_get(op->ptr, "mx") : ar->winx / 2; mx= RNA_struct_property_is_set(op->ptr, "mx") ? RNA_int_get(op->ptr, "mx") : ar->winx / 2;
my= RNA_property_is_set(op->ptr, "my") ? RNA_int_get(op->ptr, "my") : ar->winy / 2; my= RNA_struct_property_is_set(op->ptr, "my") ? RNA_int_get(op->ptr, "my") : ar->winy / 2;
use_cam_zoom= (rv3d->persp==RV3D_CAMOB) && !(rv3d->is_persp && ED_view3d_camera_lock_check(v3d, rv3d)); use_cam_zoom= (rv3d->persp==RV3D_CAMOB) && !(rv3d->is_persp && ED_view3d_camera_lock_check(v3d, rv3d));
@ -1667,12 +1667,12 @@ static int viewzoom_invoke(bContext *C, wmOperator *op, wmEvent *event)
vod= op->customdata; vod= op->customdata;
/* if one or the other zoom position aren't set, set from event */ /* if one or the other zoom position aren't set, set from event */
if (!RNA_property_is_set(op->ptr, "mx") || !RNA_property_is_set(op->ptr, "my")) { if (!RNA_struct_property_is_set(op->ptr, "mx") || !RNA_struct_property_is_set(op->ptr, "my")) {
RNA_int_set(op->ptr, "mx", event->x); RNA_int_set(op->ptr, "mx", event->x);
RNA_int_set(op->ptr, "my", event->y); RNA_int_set(op->ptr, "my", event->y);
} }
if(RNA_property_is_set(op->ptr, "delta")) { if(RNA_struct_property_is_set(op->ptr, "delta")) {
viewzoom_exec(C, op); viewzoom_exec(C, op);
} }
else { else {
@ -1880,12 +1880,12 @@ static int viewdolly_invoke(bContext *C, wmOperator *op, wmEvent *event)
vod= op->customdata; vod= op->customdata;
/* if one or the other zoom position aren't set, set from event */ /* if one or the other zoom position aren't set, set from event */
if (!RNA_property_is_set(op->ptr, "mx") || !RNA_property_is_set(op->ptr, "my")) { if (!RNA_struct_property_is_set(op->ptr, "mx") || !RNA_struct_property_is_set(op->ptr, "my")) {
RNA_int_set(op->ptr, "mx", event->x); RNA_int_set(op->ptr, "mx", event->x);
RNA_int_set(op->ptr, "my", event->y); RNA_int_set(op->ptr, "my", event->y);
} }
if(RNA_property_is_set(op->ptr, "delta")) { if(RNA_struct_property_is_set(op->ptr, "delta")) {
viewdolly_exec(C, op); viewdolly_exec(C, op);
} }
else { else {
@ -2963,13 +2963,13 @@ static int background_image_add_invoke(bContext *C, wmOperator *op, wmEvent *UNU
char name[MAX_ID_NAME-2]; char name[MAX_ID_NAME-2];
/* check input variables */ /* check input variables */
if(RNA_property_is_set(op->ptr, "filepath")) { if(RNA_struct_property_is_set(op->ptr, "filepath")) {
char path[FILE_MAX]; char path[FILE_MAX];
RNA_string_get(op->ptr, "filepath", path); RNA_string_get(op->ptr, "filepath", path);
ima= BKE_add_image_file(path); ima= BKE_add_image_file(path);
} }
else if(RNA_property_is_set(op->ptr, "name")) { else if(RNA_struct_property_is_set(op->ptr, "name")) {
RNA_string_get(op->ptr, "name", name); RNA_string_get(op->ptr, "name", name);
ima= (Image *)find_id("IM", name); ima= (Image *)find_id("IM", name);
} }

@ -1406,18 +1406,18 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
if (t->flag & T_MODAL) { if (t->flag & T_MODAL) {
/* save settings if not set in operator */ /* save settings if not set in operator */
if (RNA_struct_find_property(op->ptr, "proportional") && !RNA_property_is_set(op->ptr, "proportional")) { if (RNA_struct_find_property(op->ptr, "proportional") && !RNA_struct_property_is_set(op->ptr, "proportional")) {
if (t->obedit) if (t->obedit)
ts->proportional = proportional; ts->proportional = proportional;
else else
ts->proportional_objects = (proportional != PROP_EDIT_OFF); ts->proportional_objects = (proportional != PROP_EDIT_OFF);
} }
if (RNA_struct_find_property(op->ptr, "proportional_size") && !RNA_property_is_set(op->ptr, "proportional_size")) { if (RNA_struct_find_property(op->ptr, "proportional_size") && !RNA_struct_property_is_set(op->ptr, "proportional_size")) {
ts->proportional_size = t->prop_size; ts->proportional_size = t->prop_size;
} }
if (RNA_struct_find_property(op->ptr, "proportional_edit_falloff") && !RNA_property_is_set(op->ptr, "proportional_edit_falloff")) { if (RNA_struct_find_property(op->ptr, "proportional_edit_falloff") && !RNA_struct_property_is_set(op->ptr, "proportional_edit_falloff")) {
ts->prop_mode = t->prop_mode; ts->prop_mode = t->prop_mode;
} }
@ -1429,7 +1429,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
} }
if(t->spacetype == SPACE_VIEW3D) { if(t->spacetype == SPACE_VIEW3D) {
if (RNA_struct_find_property(op->ptr, "constraint_orientation") && !RNA_property_is_set(op->ptr, "constraint_orientation")) { if (RNA_struct_find_property(op->ptr, "constraint_orientation") && !RNA_struct_property_is_set(op->ptr, "constraint_orientation")) {
View3D *v3d = t->view; View3D *v3d = t->view;
v3d->twmode = t->current_orientation; v3d->twmode = t->current_orientation;
@ -1702,7 +1702,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
/* overwrite initial values if operator supplied a non-null vector */ /* overwrite initial values if operator supplied a non-null vector */
if (RNA_property_is_set(op->ptr, "value")) if (RNA_struct_property_is_set(op->ptr, "value"))
{ {
float values[4]= {0}; /* incase value isn't length 4, avoid uninitialized memory */ float values[4]= {0}; /* incase value isn't length 4, avoid uninitialized memory */
PropertyRNA *prop= RNA_struct_find_property(op->ptr, "value"); PropertyRNA *prop= RNA_struct_find_property(op->ptr, "value");
@ -1719,7 +1719,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
} }
/* Transformation axis from operator */ /* Transformation axis from operator */
if (RNA_struct_find_property(op->ptr, "axis") && RNA_property_is_set(op->ptr, "axis")) if (RNA_struct_find_property(op->ptr, "axis") && RNA_struct_property_is_set(op->ptr, "axis"))
{ {
RNA_float_get_array(op->ptr, "axis", t->axis); RNA_float_get_array(op->ptr, "axis", t->axis);
normalize_v3(t->axis); normalize_v3(t->axis);
@ -1727,7 +1727,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
} }
/* Constraint init from operator */ /* Constraint init from operator */
if (RNA_struct_find_property(op->ptr, "constraint_axis") && RNA_property_is_set(op->ptr, "constraint_axis")) if (RNA_struct_find_property(op->ptr, "constraint_axis") && RNA_struct_property_is_set(op->ptr, "constraint_axis"))
{ {
int constraint_axis[3]; int constraint_axis[3];

@ -1077,7 +1077,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
if(v3d->flag & V3D_ALIGN) t->flag |= T_V3D_ALIGN; if(v3d->flag & V3D_ALIGN) t->flag |= T_V3D_ALIGN;
t->around = v3d->around; t->around = v3d->around;
if (op && RNA_struct_find_property(op->ptr, "constraint_orientation") && RNA_property_is_set(op->ptr, "constraint_orientation")) if (op && RNA_struct_find_property(op->ptr, "constraint_orientation") && RNA_struct_property_is_set(op->ptr, "constraint_orientation"))
{ {
t->current_orientation = RNA_enum_get(op->ptr, "constraint_orientation"); t->current_orientation = RNA_enum_get(op->ptr, "constraint_orientation");
@ -1100,7 +1100,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
/* initialize UV transform from */ /* initialize UV transform from */
if (op && RNA_struct_find_property(op->ptr, "correct_uv")) { if (op && RNA_struct_find_property(op->ptr, "correct_uv")) {
if(RNA_property_is_set(op->ptr, "correct_uv")) { if(RNA_struct_property_is_set(op->ptr, "correct_uv")) {
if(RNA_boolean_get(op->ptr, "correct_uv")) { if(RNA_boolean_get(op->ptr, "correct_uv")) {
t->settings->uvcalc_flag |= UVCALC_TRANSFORM_CORRECT; t->settings->uvcalc_flag |= UVCALC_TRANSFORM_CORRECT;
} }
@ -1146,7 +1146,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
t->around = V3D_CENTER; t->around = V3D_CENTER;
} }
if (op && RNA_property_is_set(op->ptr, "release_confirm")) if (op && RNA_struct_property_is_set(op->ptr, "release_confirm"))
{ {
if (RNA_boolean_get(op->ptr, "release_confirm")) if (RNA_boolean_get(op->ptr, "release_confirm"))
{ {
@ -1161,7 +1161,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
} }
} }
if (op && RNA_struct_find_property(op->ptr, "mirror") && RNA_property_is_set(op->ptr, "mirror")) if (op && RNA_struct_find_property(op->ptr, "mirror") && RNA_struct_property_is_set(op->ptr, "mirror"))
{ {
if (RNA_boolean_get(op->ptr, "mirror")) if (RNA_boolean_get(op->ptr, "mirror"))
{ {
@ -1182,7 +1182,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
/* setting PET flag only if property exist in operator. Otherwise, assume it's not supported */ /* setting PET flag only if property exist in operator. Otherwise, assume it's not supported */
if (op && RNA_struct_find_property(op->ptr, "proportional")) if (op && RNA_struct_find_property(op->ptr, "proportional"))
{ {
if (RNA_property_is_set(op->ptr, "proportional")) if (RNA_struct_property_is_set(op->ptr, "proportional"))
{ {
switch(RNA_enum_get(op->ptr, "proportional")) switch(RNA_enum_get(op->ptr, "proportional"))
{ {
@ -1215,7 +1215,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
} }
} }
if (op && RNA_struct_find_property(op->ptr, "proportional_size") && RNA_property_is_set(op->ptr, "proportional_size")) if (op && RNA_struct_find_property(op->ptr, "proportional_size") && RNA_struct_property_is_set(op->ptr, "proportional_size"))
{ {
t->prop_size = RNA_float_get(op->ptr, "proportional_size"); t->prop_size = RNA_float_get(op->ptr, "proportional_size");
} }
@ -1232,7 +1232,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
t->prop_size = 1.0f; t->prop_size = 1.0f;
} }
if (op && RNA_struct_find_property(op->ptr, "proportional_edit_falloff") && RNA_property_is_set(op->ptr, "proportional_edit_falloff")) if (op && RNA_struct_find_property(op->ptr, "proportional_edit_falloff") && RNA_struct_property_is_set(op->ptr, "proportional_edit_falloff"))
{ {
t->prop_mode = RNA_enum_get(op->ptr, "proportional_edit_falloff"); t->prop_mode = RNA_enum_get(op->ptr, "proportional_edit_falloff");
} }

@ -429,7 +429,7 @@ static int transform_invoke(bContext *C, wmOperator *op, wmEvent *event)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
if(RNA_property_is_set(op->ptr, "value")) { if(RNA_struct_property_is_set(op->ptr, "value")) {
return transform_exec(C, op); return transform_exec(C, op);
} }
else { else {

@ -445,18 +445,18 @@ void initSnapping(TransInfo *t, wmOperator *op)
resetSnapping(t); resetSnapping(t);
/* if snap property exists */ /* if snap property exists */
if (op && RNA_struct_find_property(op->ptr, "snap") && RNA_property_is_set(op->ptr, "snap")) if (op && RNA_struct_find_property(op->ptr, "snap") && RNA_struct_property_is_set(op->ptr, "snap"))
{ {
if (RNA_boolean_get(op->ptr, "snap")) if (RNA_boolean_get(op->ptr, "snap"))
{ {
t->modifiers |= MOD_SNAP; t->modifiers |= MOD_SNAP;
if (RNA_property_is_set(op->ptr, "snap_target")) if (RNA_struct_property_is_set(op->ptr, "snap_target"))
{ {
snap_target = RNA_enum_get(op->ptr, "snap_target"); snap_target = RNA_enum_get(op->ptr, "snap_target");
} }
if (RNA_property_is_set(op->ptr, "snap_point")) if (RNA_struct_property_is_set(op->ptr, "snap_point"))
{ {
RNA_float_get_array(op->ptr, "snap_point", t->tsnap.snapPoint); RNA_float_get_array(op->ptr, "snap_point", t->tsnap.snapPoint);
t->tsnap.status |= SNAP_FORCED|POINT_INIT; t->tsnap.status |= SNAP_FORCED|POINT_INIT;

@ -509,7 +509,7 @@ static int undo_history_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
/* note: also check ed_undo_step() in top if you change notifiers */ /* note: also check ed_undo_step() in top if you change notifiers */
static int undo_history_exec(bContext *C, wmOperator *op) static int undo_history_exec(bContext *C, wmOperator *op)
{ {
if(RNA_property_is_set(op->ptr, "item")) { if(RNA_struct_property_is_set(op->ptr, "item")) {
int undosys= get_undo_system(C); int undosys= get_undo_system(C);
int item= RNA_int_get(op->ptr, "item"); int item= RNA_int_get(op->ptr, "item");

@ -499,7 +499,7 @@ static int pack_islands_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
if(RNA_property_is_set(op->ptr, "margin")) { if(RNA_struct_property_is_set(op->ptr, "margin")) {
scene->toolsettings->uvcalc_margin= RNA_float_get(op->ptr, "margin"); scene->toolsettings->uvcalc_margin= RNA_float_get(op->ptr, "margin");
} }
else { else {

@ -933,7 +933,7 @@ void RNA_collection_clear(PointerRNA *ptr, const char *name);
} }
/* check if the idproperty exists, for operators */ /* check if the idproperty exists, for operators */
int RNA_property_is_set(PointerRNA *ptr, const char *name); int RNA_struct_property_is_set(PointerRNA *ptr, const char *name);
int RNA_property_is_idprop(PropertyRNA *prop); int RNA_property_is_idprop(PropertyRNA *prop);
/* python compatible string representation of this property, (must be freed!) */ /* python compatible string representation of this property, (must be freed!) */

@ -4412,7 +4412,7 @@ int RNA_collection_length(PointerRNA *ptr, const char *name)
} }
} }
int RNA_property_is_set(PointerRNA *ptr, const char *name) int RNA_struct_property_is_set(PointerRNA *ptr, const char *name)
{ {
PropertyRNA *prop= RNA_struct_find_property(ptr, name); PropertyRNA *prop= RNA_struct_find_property(ptr, name);

@ -3070,7 +3070,7 @@ static PyObject *pyrna_struct_is_property_set(BPy_StructRNA *self, PyObject *arg
} }
/* double property lookup, could speed up */ /* double property lookup, could speed up */
/* return PyBool_FromLong(RNA_property_is_set(&self->ptr, name)); */ /* return PyBool_FromLong(RNA_struct_property_is_set(&self->ptr, name)); */
if (RNA_property_flag(prop) & PROP_IDPROPERTY) { if (RNA_property_flag(prop) & PROP_IDPROPERTY) {
IDProperty *group = RNA_struct_idprops(&self->ptr, 0); IDProperty *group = RNA_struct_idprops(&self->ptr, 0);
if (group) { if (group) {

@ -665,7 +665,7 @@ int WM_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
printf("%s: %s \"%s\" is not an enum property\n", printf("%s: %s \"%s\" is not an enum property\n",
__func__, op->type->idname, RNA_property_identifier(prop)); __func__, op->type->idname, RNA_property_identifier(prop));
} }
else if (RNA_property_is_set(op->ptr, RNA_property_identifier(prop))) { else if (RNA_struct_property_is_set(op->ptr, RNA_property_identifier(prop))) {
const int retval= op->type->exec(C, op); const int retval= op->type->exec(C, op);
OPERATOR_RETVAL_CHECK(retval); OPERATOR_RETVAL_CHECK(retval);
return retval; return retval;
@ -802,7 +802,7 @@ int WM_operator_confirm(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
/* op->invoke, opens fileselect if path property not set, otherwise executes */ /* op->invoke, opens fileselect if path property not set, otherwise executes */
int WM_operator_filesel(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) int WM_operator_filesel(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{ {
if (RNA_property_is_set(op->ptr, "filepath")) { if (RNA_struct_property_is_set(op->ptr, "filepath")) {
return WM_operator_call_notest(C, op); /* call exec direct */ return WM_operator_call_notest(C, op); /* call exec direct */
} }
else { else {
@ -1550,13 +1550,13 @@ static void WM_OT_read_factory_settings(wmOperatorType *ot)
static void open_set_load_ui(wmOperator *op) static void open_set_load_ui(wmOperator *op)
{ {
if(!RNA_property_is_set(op->ptr, "load_ui")) if(!RNA_struct_property_is_set(op->ptr, "load_ui"))
RNA_boolean_set(op->ptr, "load_ui", !(U.flag & USER_FILENOUI)); RNA_boolean_set(op->ptr, "load_ui", !(U.flag & USER_FILENOUI));
} }
static void open_set_use_scripts(wmOperator *op) static void open_set_use_scripts(wmOperator *op)
{ {
if(!RNA_property_is_set(op->ptr, "use_scripts")) { if(!RNA_struct_property_is_set(op->ptr, "use_scripts")) {
/* use G_SCRIPT_AUTOEXEC rather than the userpref because this means if /* use G_SCRIPT_AUTOEXEC rather than the userpref because this means if
* the flag has been disabled from the command line, then opening * the flag has been disabled from the command line, then opening
* from the menu wont enable this setting. */ * from the menu wont enable this setting. */
@ -1654,7 +1654,7 @@ int wm_link_append_poll(bContext *C)
static int wm_link_append_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) static int wm_link_append_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{ {
if(RNA_property_is_set(op->ptr, "filepath")) { if(RNA_struct_property_is_set(op->ptr, "filepath")) {
return WM_operator_call_notest(C, op); return WM_operator_call_notest(C, op);
} }
else { else {
@ -1918,7 +1918,7 @@ static void untitled(char *name)
static void save_set_compress(wmOperator *op) static void save_set_compress(wmOperator *op)
{ {
if(!RNA_property_is_set(op->ptr, "compress")) { if(!RNA_struct_property_is_set(op->ptr, "compress")) {
if(G.save_over) /* keep flag for existing file */ if(G.save_over) /* keep flag for existing file */
RNA_boolean_set(op->ptr, "compress", G.fileflags & G_FILE_COMPRESS); RNA_boolean_set(op->ptr, "compress", G.fileflags & G_FILE_COMPRESS);
else /* use userdef for new file */ else /* use userdef for new file */
@ -1957,14 +1957,14 @@ static int wm_save_as_mainfile_exec(bContext *C, wmOperator *op)
save_set_compress(op); save_set_compress(op);
if(RNA_property_is_set(op->ptr, "filepath")) if(RNA_struct_property_is_set(op->ptr, "filepath"))
RNA_string_get(op->ptr, "filepath", path); RNA_string_get(op->ptr, "filepath", path);
else { else {
BLI_strncpy(path, G.main->name, FILE_MAX); BLI_strncpy(path, G.main->name, FILE_MAX);
untitled(path); untitled(path);
} }
if(RNA_property_is_set(op->ptr, "copy")) if(RNA_struct_property_is_set(op->ptr, "copy"))
copy = RNA_boolean_get(op->ptr, "copy"); copy = RNA_boolean_get(op->ptr, "copy");
fileflags= G.fileflags; fileflags= G.fileflags;
@ -2092,7 +2092,7 @@ static void WM_OT_save_mainfile(wmOperatorType *ot)
static int wm_collada_export_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) static int wm_collada_export_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{ {
if(!RNA_property_is_set(op->ptr, "filepath")) { if(!RNA_struct_property_is_set(op->ptr, "filepath")) {
char filepath[FILE_MAX]; char filepath[FILE_MAX];
BLI_strncpy(filepath, G.main->name, sizeof(filepath)); BLI_strncpy(filepath, G.main->name, sizeof(filepath));
BLI_replace_extension(filepath, sizeof(filepath), ".dae"); BLI_replace_extension(filepath, sizeof(filepath), ".dae");
@ -2110,7 +2110,7 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
char filename[FILE_MAX]; char filename[FILE_MAX];
int selected; int selected;
if(!RNA_property_is_set(op->ptr, "filepath")) { if(!RNA_struct_property_is_set(op->ptr, "filepath")) {
BKE_report(op->reports, RPT_ERROR, "No filename given"); BKE_report(op->reports, RPT_ERROR, "No filename given");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -2144,7 +2144,7 @@ static int wm_collada_import_exec(bContext *C, wmOperator *op)
{ {
char filename[FILE_MAX]; char filename[FILE_MAX];
if(!RNA_property_is_set(op->ptr, "filepath")) { if(!RNA_struct_property_is_set(op->ptr, "filepath")) {
BKE_report(op->reports, RPT_ERROR, "No filename given"); BKE_report(op->reports, RPT_ERROR, "No filename given");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }