diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-03-30 16:15:16 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-03-30 16:15:16 +0400 |
commit | 71446eea573db3ac6bac5f297c0655acbeada67c (patch) | |
tree | 6bac99531e7c4ce7cc9d8b512920a037e444be32 /source/blender/editors | |
parent | 253de0ed86f273d0032acbbd0b8237a358b35cbd (diff) |
* Multiply for panorama cameras
* Some cases of struct name being set where it shouldnt have been.
* Spelling: wich --> which
* Copy and initialize uv modifier scale, remove unneeded enum.
* Ability to pin any object into the context.
* Update uv window while transforming (useful when used with UVProject modifier)
* Patch by Wahooney, so new template's are internal text and dont get saved over
by mistake.
* Fix for https://bugzilla.redhat.com/show_bug.cgi?id=572186
Bug 572186 - [abrt] crash in blender-2.49b-5.fc12: Process
/usr/bin/blender.bin was killed by signal 6 (SIGABRT). Original fix submitted
by Jochen Schmitt.
* [#21816] bpy.data.add_image has stopped working on Windows. moved to
bpy.data.images.load(), missed this call.
(commits 27726,27825,27828,27831,27832,27833,27834,27836,27837,27838,27839,27858 by Campbell from render25 branch)
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_hook.c | 16 | ||||
-rw-r--r-- | source/blender/editors/space_buttons/buttons_context.c | 35 | ||||
-rw-r--r-- | source/blender/editors/space_buttons/buttons_intern.h | 2 | ||||
-rw-r--r-- | source/blender/editors/space_file/filelist.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_image/space_image.c | 9 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_ops.c | 9 |
8 files changed, 52 insertions, 25 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 5e3a976446d..1267a1c1737 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2693,7 +2693,7 @@ void autocomplete_end(AutoComplete *autocpl, char *autoname) static void autocomplete_id(bContext *C, char *str, void *arg_v) { int blocktype= (intptr_t)arg_v; - ListBase *listb= wich_libbase(CTX_data_main(C), blocktype); + ListBase *listb= which_libbase(CTX_data_main(C), blocktype); if(listb==NULL) return; diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index c3e691a0864..73ac123f964 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -497,7 +497,7 @@ static void ui_template_id(uiLayout *layout, bContext *C, PointerRNA *ptr, char flag |= UI_ID_OPEN; type= RNA_property_pointer_type(ptr, prop); - template->idlb= wich_libbase(CTX_data_main(C), RNA_type_to_ID_code(type)); + template->idlb= which_libbase(CTX_data_main(C), RNA_type_to_ID_code(type)); /* create UI elements for this template * - template_ID makes a copy of the template data and assigns it to the relevant buttons diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c index 37a04471ec5..624b4985f97 100644 --- a/source/blender/editors/object/object_hook.c +++ b/source/blender/editors/object/object_hook.c @@ -54,6 +54,7 @@ #include "RNA_define.h" #include "RNA_access.h" +#include "RNA_enum_types.h" #include "ED_curve.h" #include "ED_mesh.h" @@ -529,9 +530,6 @@ void OBJECT_OT_hook_add_newobj(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static EnumPropertyItem hook_mod_items[]= { -{0, NULL, 0, NULL, NULL}}; - static int object_hook_remove_exec(bContext *C, wmOperator *op) { int num= RNA_enum_get(op->ptr, "modifier"); @@ -566,7 +564,7 @@ static EnumPropertyItem *hook_mod_itemf(bContext *C, PointerRNA *ptr, int *free) int a, totitem= 0; if(!ob) - return hook_mod_items; + return DummyRNA_NULL_items; for(a=0, md=ob->modifiers.first; md; md= md->next, a++) { if (md->type==eModifierType_Hook) { @@ -602,7 +600,7 @@ void OBJECT_OT_hook_remove(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - prop= RNA_def_enum(ot->srna, "modifier", hook_mod_items, 0, "Modifier", "Modifier number to remove."); + prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to remove."); RNA_def_enum_funcs(prop, hook_mod_itemf); ot->prop= prop; } @@ -669,7 +667,7 @@ void OBJECT_OT_hook_reset(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - prop= RNA_def_enum(ot->srna, "modifier", hook_mod_items, 0, "Modifier", "Modifier number to assign to."); + prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to."); RNA_def_enum_funcs(prop, hook_mod_itemf); } @@ -725,7 +723,7 @@ void OBJECT_OT_hook_recenter(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - prop= RNA_def_enum(ot->srna, "modifier", hook_mod_items, 0, "Modifier", "Modifier number to assign to."); + prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to."); RNA_def_enum_funcs(prop, hook_mod_itemf); } @@ -788,7 +786,7 @@ void OBJECT_OT_hook_assign(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - prop= RNA_def_enum(ot->srna, "modifier", hook_mod_items, 0, "Modifier", "Modifier number to assign to."); + prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to assign to."); RNA_def_enum_funcs(prop, hook_mod_itemf); } @@ -837,7 +835,7 @@ void OBJECT_OT_hook_select(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - prop= RNA_def_enum(ot->srna, "modifier", hook_mod_items, 0, "Modifier", "Modifier number to remove."); + prop= RNA_def_enum(ot->srna, "modifier", DummyRNA_NULL_items, 0, "Modifier", "Modifier number to remove."); RNA_def_enum_funcs(prop, hook_mod_itemf); } diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index e1df3b9f18f..961c3cf17ce 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -816,21 +816,9 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r static void pin_cb(bContext *C, void *arg1, void *arg2) { SpaceButs *sbuts= CTX_wm_space_buts(C); - ButsContextPath *path= sbuts->path; - PointerRNA *ptr; - int a; if(sbuts->flag & SB_PIN_CONTEXT) { - if(path->len) { - for(a=path->len-1; a>=0; a--) { - ptr= &path->ptr[a]; - - if(ptr->id.data) { - sbuts->pinid= ptr->id.data; - break; - } - } - } + sbuts->pinid= buttons_context_id_path(C); } else sbuts->pinid= NULL; @@ -901,3 +889,24 @@ void buttons_context_register(ARegionType *art) pt->flag= PNL_NO_HEADER; BLI_addtail(&art->paneltypes, pt); } + +ID *buttons_context_id_path(const bContext *C) +{ + SpaceButs *sbuts= CTX_wm_space_buts(C); + ButsContextPath *path= sbuts->path; + PointerRNA *ptr; + int a; + + if(path->len) { + for(a=path->len-1; a>=0; a--) { + ptr= &path->ptr[a]; + + if(ptr->id.data) { + return ptr->id.data; + break; + } + } + } + + return NULL; +} diff --git a/source/blender/editors/space_buttons/buttons_intern.h b/source/blender/editors/space_buttons/buttons_intern.h index f28d77159a5..9478168f35a 100644 --- a/source/blender/editors/space_buttons/buttons_intern.h +++ b/source/blender/editors/space_buttons/buttons_intern.h @@ -35,6 +35,7 @@ struct bContextDataResult; struct SpaceButs; struct uiLayout; struct wmOperatorType; +struct ID; /* buts->scaflag */ #define BUTS_SENS_SEL 1 @@ -62,6 +63,7 @@ void buttons_context_compute(const struct bContext *C, struct SpaceButs *sbuts); int buttons_context(const struct bContext *C, const char *member, struct bContextDataResult *result); void buttons_context_draw(const struct bContext *C, struct uiLayout *layout); void buttons_context_register(struct ARegionType *art); +struct ID *buttons_context_id_path(const struct bContext *C); /* buttons_ops.c */ void BUTTONS_OT_file_browse(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index dc818bb9172..9dd16586946 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -1172,7 +1172,7 @@ void filelist_from_main(struct FileList *filelist) /* make files */ idcode= groupname_to_code(filelist->dir); - lb= wich_libbase(G.main, idcode ); + lb= which_libbase(G.main, idcode ); if(lb==0) return; id= lb->first; diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 26275434c84..e641f720054 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -625,6 +625,15 @@ static void image_listener(ScrArea *sa, wmNotifier *wmn) ED_area_tag_redraw(sa); break; } + case NC_OBJECT: + switch(wmn->data) { + case ND_TRANSFORM: + if(sima->lock && (sima->flag & SI_DRAWSHADOW)) { + ED_area_tag_refresh(sa); + ED_area_tag_redraw(sa); + } + break; + } } } diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 0f3b54a7b4b..ce7db83d6d8 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -215,6 +215,7 @@ static int open_exec(bContext *C, wmOperator *op) PropertyPointerRNA *pprop; PointerRNA idptr; char str[FILE_MAX]; + short internal = RNA_int_get(op->ptr, "internal"); RNA_string_get(op->ptr, "path", str); @@ -244,6 +245,13 @@ static int open_exec(bContext *C, wmOperator *op) st->text= text; st->top= 0; } + + if (internal) { + if(text->name) + MEM_freeN(text->name); + + text->name = NULL; + } WM_event_add_notifier(C, NC_TEXT|NA_ADDED, text); @@ -282,6 +290,7 @@ void TEXT_OT_open(wmOperatorType *ot) /* properties */ WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE|PYSCRIPTFILE, FILE_SPECIAL, FILE_OPENFILE); + RNA_def_boolean(ot->srna, "internal", 0, "Make internal", "Make text file internal after loading"); } /******************* reload operator *********************/ |