diff options
47 files changed, 831 insertions, 709 deletions
diff --git a/intern/audaspace/intern/AUD_C-API.cpp b/intern/audaspace/intern/AUD_C-API.cpp index e17389d12cb..609dd5ededa 100644 --- a/intern/audaspace/intern/AUD_C-API.cpp +++ b/intern/audaspace/intern/AUD_C-API.cpp @@ -35,7 +35,7 @@ extern "C" { typedef AUD_IFactory AUD_Sound; -AUD_IDevice* AUD_device = NULL; +static AUD_IDevice* AUD_device = NULL; bool AUD_init() { diff --git a/projectfiles_vc9/blender/editors/ED_editors.vcproj b/projectfiles_vc9/blender/editors/ED_editors.vcproj index da998311b7b..92b6f627a15 100644 --- a/projectfiles_vc9/blender/editors/ED_editors.vcproj +++ b/projectfiles_vc9/blender/editors/ED_editors.vcproj @@ -747,10 +747,6 @@ >
</File>
<File
- RelativePath="..\..\..\source\blender\editors\space_file\file_header.c"
- >
- </File>
- <File
RelativePath="..\..\..\source\blender\editors\space_file\file_intern.h"
>
</File>
diff --git a/release/ui/buttons_data_lamp.py b/release/ui/buttons_data_lamp.py index e56f19b1dec..cf0ede8ec3b 100644 --- a/release/ui/buttons_data_lamp.py +++ b/release/ui/buttons_data_lamp.py @@ -48,7 +48,7 @@ class DATA_PT_lamp(DataButtonsPanel): lamp = context.lamp - layout.itemR(lamp, "type", expand=True) + layout.itemR(lamp, "type") split = layout.split() diff --git a/release/ui/buttons_particle.py b/release/ui/buttons_particle.py index 652f46d9675..ef7ede15d6e 100644 --- a/release/ui/buttons_particle.py +++ b/release/ui/buttons_particle.py @@ -20,7 +20,7 @@ class ParticleButtonsPanel(bpy.types.Panel): class PARTICLE_PT_particles(ParticleButtonsPanel): __idname__= "PARTICLE_PT_particles" - __label__ = " " + __no_header__ = True def poll(self, context): return (context.particle_system or context.object) diff --git a/release/ui/buttons_scene.py b/release/ui/buttons_scene.py index 7e1f05d774e..a774b887df5 100644 --- a/release/ui/buttons_scene.py +++ b/release/ui/buttons_scene.py @@ -35,6 +35,8 @@ class RENDER_PT_output(RenderButtonsPanel): layout = self.layout rd = context.scene.render_data + layout.itemR(rd, "display_mode", text="Display") + layout.itemR(rd, "output_path") split = layout.split() @@ -54,7 +56,6 @@ class RENDER_PT_output(RenderButtonsPanel): col.itemR(rd, "placeholders") col.itemR(rd, "no_overwrite") - layout.itemR(rd, "file_format", text="Format") split = layout.split() diff --git a/source/Makefile b/source/Makefile index de0b144ed71..d7610363a4d 100644 --- a/source/Makefile +++ b/source/Makefile @@ -114,8 +114,6 @@ ifneq ($(NAN_NO_KETSJI),true) COMLIB += $(OCGDIR)/gameengine/ketsji/$(DEBUG_DIR)libketsji.a COMLIB += $(OCGDIR)/gameengine/blconverter/$(DEBUG_DIR)libblconverter.a COMLIB += $(OCGDIR)/gameengine/blconverter/$(DEBUG_DIR)libblconverter.a - COMLIB += $(OCGDIR)/gameengine/blphys/fuzzics/$(DEBUG_DIR)libfuzzics.a - COMLIB += $(NAN_QHULL)/lib/libqhull.a COMLIB += $(OCGDIR)/gameengine/blphys/dummy/$(DEBUG_DIR)libdummy.a COMLIB += $(OCGDIR)/gameengine/blphys/common/$(DEBUG_DIR)libcommon.a COMLIB += $(OCGDIR)/gameengine/blphys/dummy/$(DEBUG_DIR)libdummy.a @@ -368,7 +366,7 @@ else NAN_SND_LIBS += $(DUMMYSOUND) NAN_SND_LIBS += $(OPENALSOUND) NAN_SND_LIBS += $(SDLSOUND) - NAN_SND_LIBS += $(NAN_OPENAL)/lib/libopenal.a + NAN_SND_LIBS += $(NAN_OPENAL)/lib/libopenal.so NAN_SND_LIBS += $(SOUNDSYSTEM) else ifeq ($(OS),windows) diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index ef0984bf93d..754ec06f23f 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -253,6 +253,10 @@ void free_image(Image *ima) if (ima->preview) { BKE_previewimg_free(&ima->preview); } + if (ima->render_text) { + MEM_freeN(ima->render_text); + ima->render_text= NULL; + } } /* only image block itself */ diff --git a/source/blender/blenlib/BLI_util.h b/source/blender/blenlib/BLI_util.h index a138ea780ea..d323f701ba5 100644 --- a/source/blender/blenlib/BLI_util.h +++ b/source/blender/blenlib/BLI_util.h @@ -72,6 +72,9 @@ void BLI_cleanup_dir(const char *relabase, char *dir); /* same as above but adds /* go back one directory */ int BLI_parent_dir(char *path); +/* return whether directory is root and thus has no parent dir */ +int BLI_has_parent(char *path); + /** * Blender's path code replacement function. * Bases @a path strings leading with "//" by the diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index 838648ebfd7..a236defc515 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -494,6 +494,22 @@ void BLI_makestringcode(const char *relfile, char *file) } } +int BLI_has_parent(char *path) +{ + int len; + int slashes = 0; + BLI_clean(path); + BLI_add_slash(path); + + len = strlen(path)-1; + while (len) { + if ((path[len] == '\\') || (path[len] == '/')) + slashes++; + len--; + } + return slashes > 1; +} + int BLI_parent_dir(char *path) { #ifdef WIN32 diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index c36a287b981..460a1dcb2f5 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2641,6 +2641,7 @@ static void direct_link_image(FileData *fd, Image *ima) ima->anim= NULL; ima->rr= NULL; ima->repbind= NULL; + ima->render_text= newdataadr(fd, ima->render_text); ima->packedfile = direct_link_packedfile(fd, ima->packedfile); ima->preview = direct_link_preview_image(fd, ima->preview); diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index c433232d084..9d35967c95d 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1439,7 +1439,10 @@ static void write_images(WriteData *wd, ListBase *idbase) write_previews(wd, ima->preview); - } + /* exception: render text only saved in undo files (wd->current) */ + if (ima->render_text && wd->current) + writedata(wd, DATA, IMA_RW_MAXTEXT, ima->render_text); + } ima= ima->id.next; } /* flush helps the compression for undo-save */ diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index a76fdcbf39d..4fe28c2e457 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2123,7 +2123,9 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1, dynstr= BLI_dynstr_new(); BLI_dynstr_appendf(dynstr, "%s%%t", RNA_property_ui_name(prop)); for(i=0; i<totitem; i++) { - if(item[i].icon) + if(!item[i].identifier[0]) + BLI_dynstr_append(dynstr, "|%l"); + else if(item[i].icon) BLI_dynstr_appendf(dynstr, "|%s %%i%d %%x%d", item[i].name, item[i].icon, item[i].value); else BLI_dynstr_appendf(dynstr, "|%s %%x%d", item[i].name, item[i].value); @@ -2142,7 +2144,7 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1, RNA_property_enum_items(ptr, prop, &item, &totitem); for(i=0; i<totitem; i++) { - if(item[i].value == (int)max) { + if(item[i].identifier[0] && item[i].value == (int)max) { str= (char*)item[i].name; icon= item[i].icon; } @@ -2165,7 +2167,7 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1, RNA_property_enum_items(ptr, prop, &item, &totitem); for(i=0; i<totitem; i++) { - if(item[i].value == (int)max) { + if(item[i].identifier[0] && item[i].value == (int)max) { if(item[i].description[0]) tip= (char*)item[i].description; break; diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index ee86b612332..e0ce6a7a83f 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3434,7 +3434,7 @@ static void button_activate_init(bContext *C, ARegion *ar, uiBut *but, uiButtonA data= MEM_callocN(sizeof(uiHandleButtonData), "uiHandleButtonData"); data->window= CTX_wm_window(C); data->region= ar; - if( ELEM(but->type, BUT_CURVE, SEARCH_MENU) ); // XXX curve is temp + if( ELEM3(but->type, BUT_CURVE, SEARCH_MENU, TEX) ); // XXX curve is temp else data->interactive= 1; data->state = BUTTON_STATE_INIT; diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 0bf64f75552..8e880b10185 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -439,6 +439,9 @@ static void ui_item_enum_row(uiLayout *layout, uiBlock *block, PointerRNA *ptr, uiBlockSetCurLayout(block, ui_item_local_sublayout(layout, layout, 1)); for(a=0; a<totitem; a++) { + if(!item[a].identifier[0]) + continue; + name= (!uiname || uiname[0])? (char*)item[a].name: ""; icon= item[a].icon; value= item[a].value; @@ -556,14 +559,12 @@ static char *ui_menu_enumpropname(char *opname, char *propname, int retval) if(prop) { const EnumPropertyItem *item; - int totitem, i; + int totitem; + const char *name; RNA_property_enum_items(&ptr, prop, &item, &totitem); - - for (i=0; i<totitem; i++) { - if(item[i].value==retval) - return (char*)item[i].name; - } + if(RNA_enum_name(item, retval, &name)) + return (char*)name; } return ""; @@ -603,7 +604,10 @@ void uiItemsEnumO(uiLayout *layout, char *opname, char *propname) RNA_property_enum_items(&ptr, prop, &item, &totitem); for(i=0; i<totitem; i++) - uiItemEnumO(layout, (char*)item[i].name, item[i].icon, opname, propname, item[i].value); + if(item[i].identifier[0]) + uiItemEnumO(layout, (char*)item[i].name, item[i].icon, opname, propname, item[i].value); + else + uiItemS(layout); } } @@ -889,7 +893,10 @@ void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, char *propname) RNA_property_enum_items(ptr, prop, &item, &totitem); for(i=0; i<totitem; i++) - uiItemEnumR(layout, (char*)item[i].name, 0, ptr, propname, item[i].value); + if(item[i].identifier[0]) + uiItemEnumR(layout, (char*)item[i].name, 0, ptr, propname, item[i].value); + else + uiItemS(layout); } } diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 27fb0731d67..e0c6fbd7134 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -1460,11 +1460,10 @@ static void update_picker_hex(uiBlock *block, float *rgb) // this updates button strings, is hackish... but button pointers are on stack of caller function for(bt= block->buttons.first; bt; bt= bt->next) { - if(strcmp(bt->str, "Hex: ")==0) { + if(strcmp(bt->str, "Hex: ")==0) strcpy(bt->poin, col); - ui_check_but(bt); - break; - } + + ui_check_but(bt); } } @@ -1506,6 +1505,8 @@ void ui_update_block_buts_hsv(uiBlock *block, float *hsv) ui_set_but_val(bt, hsv[2]); } } + + ui_check_but(bt); } } @@ -1547,6 +1548,8 @@ static void ui_update_block_buts_hex(uiBlock *block, char *hexcol) ui_set_but_val(bt, v); } } + + ui_check_but(bt); } } @@ -2438,40 +2441,6 @@ typedef struct uiMenuInfo { /************************ Menu Definitions to uiBlocks ***********************/ -const char *ui_menu_enumpropname(char *opname, const char *propname, int retval) -{ - wmOperatorType *ot= WM_operatortype_find(opname); - PointerRNA ptr; - PropertyRNA *prop; - - if(!ot || !ot->srna) - return ""; - - RNA_pointer_create(NULL, ot->srna, NULL, &ptr); - prop= RNA_struct_find_property(&ptr, propname); - - if(prop) { - const EnumPropertyItem *item; - int totitem, i; - - RNA_property_enum_items(&ptr, prop, &item, &totitem); - - for (i=0; i<totitem; i++) { - if(item[i].value==retval) - return item[i].name; - } - } - - return ""; -} - -typedef struct MenuItemLevel { - int opcontext; - char *opname; - char *propname; - PointerRNA rnapoin; -} MenuItemLevel; - static uiBlock *ui_block_func_MENU_ITEM(bContext *C, uiPopupBlockHandle *handle, void *arg_info) { uiBlock *block; diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 5fd84ad3c9f..91fbd24f8a6 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -757,7 +757,7 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con) box= uiLayoutBox(col); row= uiLayoutRow(box, 0); - block= uiLayoutFreeBlock(box); + block= uiLayoutGetBlock(box); subrow= uiLayoutRow(row, 0); uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_LEFT); @@ -772,27 +772,19 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con) uiDefIconButBitS(block, ICONTOG, CONSTRAINT_EXPAND, B_CONSTRAINT_TEST, ICON_TRIA_RIGHT, xco-10, yco, 20, 20, &con->flag, 0.0, 0.0, 0.0, 0.0, "Collapse/Expand Constraint"); /* name */ - if ((con->flag & CONSTRAINT_EXPAND) && (proxy_protected==0)) { - /* XXX if (con->flag & CONSTRAINT_DISABLE) - uiBlockSetCol(block, TH_REDALERT);*/ - - uiBlockSetEmboss(block, UI_EMBOSS); - - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, typestr, xco+10, yco, 100, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - + uiBlockSetEmboss(block, UI_EMBOSS); + + /* XXX if (con->flag & CONSTRAINT_DISABLE) + uiBlockSetCol(block, TH_REDALERT);*/ + + uiDefBut(block, LABEL, B_CONSTRAINT_TEST, typestr, xco+10, yco, 100, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); + + if(proxy_protected == 0) { but = uiDefBut(block, TEX, B_CONSTRAINT_TEST, "", xco+120, yco, 85, 18, con->name, 0.0, 29.0, 0.0, 0.0, "Constraint name"); uiButSetFunc(but, verify_constraint_name_func, con, NULL); - } - else { - uiBlockSetEmboss(block, UI_EMBOSSN); - - /* XXX if (con->flag & CONSTRAINT_DISABLE) - uiBlockSetCol(block, TH_REDALERT);*/ - - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, typestr, xco+10, yco, 100, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, con->name, xco+120, yco-1, 135, 19, NULL, 0.0, 0.0, 0.0, 0.0, ""); } + else + uiDefBut(block, LABEL, B_CONSTRAINT_TEST, con->name, xco+120, yco-1, 135, 19, NULL, 0.0, 0.0, 0.0, 0.0, ""); // XXX uiBlockSetCol(block, TH_AUTO); diff --git a/source/blender/editors/object/editgroup.c b/source/blender/editors/object/editgroup.c index b49e2040b03..5943b36a6b0 100644 --- a/source/blender/editors/object/editgroup.c +++ b/source/blender/editors/object/editgroup.c @@ -161,7 +161,7 @@ void GROUP_OT_objects_remove_active(wmOperatorType *ot) { /* identifiers */ - ot->name= "Remove Selected From active group"; + ot->name= "Remove Selected From Active Group"; ot->description = "Remove the object from an object group that contains the active object."; ot->idname= "GROUP_OT_objects_remove_active"; diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 11f6b443912..0a9ed945c1d 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -243,16 +243,18 @@ void ED_object_base_init_from_view(bContext *C, Base *base) /* ******************* add object operator ****************** */ static EnumPropertyItem prop_object_types[] = { - {OB_EMPTY, "EMPTY", 0, "Empty", ""}, {OB_MESH, "MESH", 0, "Mesh", ""}, {OB_CURVE, "CURVE", 0, "Curve", ""}, {OB_SURF, "SURFACE", 0, "Surface", ""}, - {OB_FONT, "TEXT", 0, "Text", ""}, {OB_MBALL, "META", 0, "Meta", ""}, - {OB_LAMP, "LAMP", 0, "Lamp", ""}, - {OB_CAMERA, "CAMERA", 0, "Camera", ""}, + {OB_FONT, "TEXT", 0, "Text", ""}, + {0, "", 0, NULL, NULL}, {OB_ARMATURE, "ARMATURE", 0, "Armature", ""}, {OB_LATTICE, "LATTICE", 0, "Lattice", ""}, + {OB_EMPTY, "EMPTY", 0, "Empty", ""}, + {0, "", 0, NULL, NULL}, + {OB_CAMERA, "CAMERA", 0, "Camera", ""}, + {OB_LAMP, "LAMP", 0, "Lamp", ""}, {0, NULL, 0, NULL, NULL} }; @@ -327,6 +329,7 @@ static EnumPropertyItem prop_mesh_types[] = { {4, "ICOSPHERE", 0, "Icosphere", ""}, {5, "CYLINDER", 0, "Cylinder", ""}, {6, "CONE", 0, "Cone", ""}, + {0, "", 0, NULL, NULL}, {7, "GRID", 0, "Grid", ""}, {8, "MONKEY", 0, "Monkey", ""}, {0, NULL, 0, NULL, NULL} @@ -619,16 +622,18 @@ static int object_primitive_add_invoke(bContext *C, wmOperator *op, wmEvent *eve uiPopupMenu *pup= uiPupMenuBegin(C, "Add Object", 0); uiLayout *layout= uiPupMenuLayout(pup); - uiItemMenuEnumO(layout, NULL, ICON_OUTLINER_OB_MESH, "OBJECT_OT_mesh_add", "type"); - uiItemMenuEnumO(layout, NULL, ICON_OUTLINER_OB_CURVE, "OBJECT_OT_curve_add", "type"); - uiItemMenuEnumO(layout, NULL, ICON_OUTLINER_OB_SURFACE, "OBJECT_OT_surface_add", "type"); - uiItemO(layout, NULL, ICON_OUTLINER_OB_FONT, "OBJECT_OT_text_add"); + uiItemMenuEnumO(layout, "Mesh", ICON_OUTLINER_OB_MESH, "OBJECT_OT_mesh_add", "type"); + uiItemMenuEnumO(layout, "Curve", ICON_OUTLINER_OB_CURVE, "OBJECT_OT_curve_add", "type"); + uiItemMenuEnumO(layout, "Surface", ICON_OUTLINER_OB_SURFACE, "OBJECT_OT_surface_add", "type"); uiItemEnumO(layout, NULL, ICON_OUTLINER_OB_META, "OBJECT_OT_object_add", "type", OB_MBALL); + uiItemO(layout, "Text", ICON_OUTLINER_OB_FONT, "OBJECT_OT_text_add"); + uiItemS(layout); + uiItemO(layout, "Armature", ICON_OUTLINER_OB_ARMATURE, "OBJECT_OT_armature_add"); + uiItemEnumO(layout, NULL, ICON_OUTLINER_OB_LATTICE, "OBJECT_OT_object_add", "type", OB_LATTICE); + uiItemEnumO(layout, NULL, ICON_OUTLINER_OB_EMPTY, "OBJECT_OT_object_add", "type", OB_EMPTY); + uiItemS(layout); uiItemEnumO(layout, NULL, ICON_OUTLINER_OB_CAMERA, "OBJECT_OT_object_add", "type", OB_CAMERA); uiItemEnumO(layout, NULL, ICON_OUTLINER_OB_LAMP, "OBJECT_OT_object_add", "type", OB_LAMP); - uiItemEnumO(layout, NULL, ICON_OUTLINER_OB_EMPTY, "OBJECT_OT_object_add", "type", OB_EMPTY); - uiItemO(layout, NULL, ICON_OUTLINER_OB_ARMATURE, "OBJECT_OT_armature_add"); - uiItemEnumO(layout, NULL, ICON_OUTLINER_OB_LATTICE, "OBJECT_OT_object_add", "type", OB_LATTICE); uiPupMenuEnd(C, pup); @@ -699,8 +704,8 @@ void OBJECT_OT_delete(wmOperatorType *ot) { /* identifiers */ - ot->name= "Delete Objects"; - ot->description = "Delete the object."; + ot->name= "Delete"; + ot->description = "Delete selected objects."; ot->idname= "OBJECT_OT_delete"; /* api callbacks */ @@ -1402,7 +1407,7 @@ static int parent_clear_exec(bContext *C, wmOperator *op) void OBJECT_OT_parent_clear(wmOperatorType *ot) { /* identifiers */ - ot->name= "Clear parent"; + ot->name= "Clear Parent"; ot->description = "Clear the object's parenting."; ot->idname= "OBJECT_OT_parent_clear"; @@ -1890,7 +1895,7 @@ void OBJECT_OT_location_clear(wmOperatorType *ot) { /* identifiers */ - ot->name= "Clear Object Location"; + ot->name= "Clear Location"; ot->description = "Clear the object's location."; ot->idname= "OBJECT_OT_location_clear"; @@ -1934,7 +1939,7 @@ void OBJECT_OT_rotation_clear(wmOperatorType *ot) { /* identifiers */ - ot->name= "Clear Object Rotation"; + ot->name= "Clear Rotation"; ot->description = "Clear the object's rotation."; ot->idname= "OBJECT_OT_rotation_clear"; @@ -1982,7 +1987,7 @@ void OBJECT_OT_scale_clear(wmOperatorType *ot) { /* identifiers */ - ot->name= "Clear Object Scale"; + ot->name= "Clear Scale"; ot->description = "Clear the object's scale."; ot->idname= "OBJECT_OT_scale_clear"; @@ -2028,7 +2033,7 @@ void OBJECT_OT_origin_clear(wmOperatorType *ot) { /* identifiers */ - ot->name= "Clear Object Origin"; + ot->name= "Clear Origin"; ot->description = "Clear the object's origin."; ot->idname= "OBJECT_OT_origin_clear"; @@ -2071,12 +2076,11 @@ void OBJECT_OT_restrictview_clear(wmOperatorType *ot) { /* identifiers */ - ot->name= "Clear restrict view"; + ot->name= "Clear Restrict View"; ot->description = "Reveal the object by setting the restrictview flag."; ot->idname= "OBJECT_OT_restrictview_clear"; /* api callbacks */ - ot->invoke= WM_operator_confirm; ot->exec= object_restrictview_clear_exec; ot->poll= ED_operator_view3d_active; @@ -2084,19 +2088,14 @@ void OBJECT_OT_restrictview_clear(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static EnumPropertyItem prop_set_restrictview_types[] = { - {0, "SELECTED", 0, "Selected", ""}, - {1, "UNSELECTED", 0, "Unselected ", ""}, - {0, NULL, 0, NULL, NULL} -}; - static int object_restrictview_set_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); short changed = 0; + int unselected= RNA_boolean_get(op->ptr, "unselected"); CTX_DATA_BEGIN(C, Base*, base, visible_bases) { - if(RNA_enum_is_equal(op->ptr, "type", "SELECTED")){ + if(!unselected) { if (base->flag & SELECT){ base->flag &= ~SELECT; base->object->flag = base->flag; @@ -2107,7 +2106,7 @@ static int object_restrictview_set_exec(bContext *C, wmOperator *op) } } } - else if (RNA_enum_is_equal(op->ptr, "type", "UNSELECTED")){ + else { if (!(base->flag & SELECT)){ base->object->restrictflag |= OB_RESTRICT_VIEW; changed = 1; @@ -2129,19 +2128,18 @@ static int object_restrictview_set_exec(bContext *C, wmOperator *op) void OBJECT_OT_restrictview_set(wmOperatorType *ot) { /* identifiers */ - ot->name= "Set restrict view"; + ot->name= "Set Restrict View"; ot->description = "Hide the object by setting the restrictview flag."; ot->idname= "OBJECT_OT_restrictview_set"; /* api callbacks */ - ot->invoke= WM_menu_invoke; ot->exec= object_restrictview_set_exec; ot->poll= ED_operator_view3d_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_enum(ot->srna, "type", prop_set_restrictview_types, 0, "Type", ""); + RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects."); } /* ************* Slow Parent ******************* */ @@ -2638,7 +2636,7 @@ static int parent_set_invoke(bContext *C, wmOperator *op, wmEvent *event) void OBJECT_OT_parent_set(wmOperatorType *ot) { /* identifiers */ - ot->name= "Make parent"; + ot->name= "Make Parent"; ot->description = "Set the object's parenting."; ot->idname= "OBJECT_OT_parent_set"; @@ -2792,7 +2790,7 @@ static void make_object_duplilist_real(Scene *scene, View3D *v3d, Base *base) } -static int object_dupli_set_real_exec(bContext *C, wmOperator *op) +static int object_duplicates_make_real_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); ScrArea *sa= CTX_wm_area(C); @@ -2812,17 +2810,17 @@ static int object_dupli_set_real_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void OBJECT_OT_dupli_set_real(wmOperatorType *ot) +void OBJECT_OT_duplicates_make_real(wmOperatorType *ot) { /* identifiers */ - ot->name= "Make Dupli Real"; + ot->name= "Make Duplicates Real"; ot->description = "Make dupli objects attached to this object real."; - ot->idname= "OBJECT_OT_dupli_set_real"; + ot->idname= "OBJECT_OT_duplicates_make_real"; /* api callbacks */ ot->invoke= WM_operator_confirm; - ot->exec= object_dupli_set_real_exec; + ot->exec= object_duplicates_make_real_exec; ot->poll= ED_operator_scene_editable; @@ -5961,7 +5959,8 @@ static int duplicate_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); View3D *v3d= CTX_wm_view3d(C); - int dupflag= U.dupflag; + int linked= RNA_boolean_get(op->ptr, "linked"); + int dupflag= (linked)? 0: U.dupflag; clear_id_newpoins(); clear_sca_new_poins(); /* sensor/contr/act */ @@ -6003,8 +6002,8 @@ void OBJECT_OT_duplicate(wmOperatorType *ot) { /* identifiers */ - ot->name= "Duplicate Objects"; - ot->description = "Duplicate the objects."; + ot->name= "Duplicate"; + ot->description = "Duplicate selected objects."; ot->idname= "OBJECT_OT_duplicate"; /* api callbacks */ @@ -6017,6 +6016,7 @@ void OBJECT_OT_duplicate(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* to give to transform */ + RNA_def_boolean(ot->srna, "linked", 0, "Linked", "Duplicate object but not object data, linking to the original data."); RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX); } diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index 12776c08d4f..2173e79ac66 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -59,7 +59,7 @@ void OBJECT_OT_restrictview_clear(struct wmOperatorType *ot); void OBJECT_OT_slowparent_set(struct wmOperatorType *ot); void OBJECT_OT_slowparent_clear(struct wmOperatorType *ot); void OBJECT_OT_center_set(struct wmOperatorType *ot); -void OBJECT_OT_dupli_set_real(struct wmOperatorType *ot); +void OBJECT_OT_duplicates_make_real(struct wmOperatorType *ot); void OBJECT_OT_object_add(struct wmOperatorType *ot); void OBJECT_OT_duplicate(struct wmOperatorType *ot); void OBJECT_OT_delete(struct wmOperatorType *ot); diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 3a9973b7ec5..50c14673939 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -83,7 +83,7 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_slowparent_set); WM_operatortype_append(OBJECT_OT_slowparent_clear); WM_operatortype_append(OBJECT_OT_center_set); - WM_operatortype_append(OBJECT_OT_dupli_set_real); + WM_operatortype_append(OBJECT_OT_duplicates_make_real); WM_operatortype_append(OBJECT_OT_duplicate); WM_operatortype_append(GROUP_OT_group_create); WM_operatortype_append(GROUP_OT_objects_remove); @@ -155,12 +155,14 @@ void ED_keymap_object(wmWindowManager *wm) WM_keymap_verify_item(keymap, "OBJECT_OT_scale_clear", SKEY, KM_PRESS, KM_ALT, 0); WM_keymap_verify_item(keymap, "OBJECT_OT_origin_clear", OKEY, KM_PRESS, KM_ALT, 0); - WM_keymap_verify_item(keymap, "OBJECT_OT_restrictview_clear", HKEY, KM_PRESS, KM_ALT, 0); - WM_keymap_verify_item(keymap, "OBJECT_OT_restrictview_set", HKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "OBJECT_OT_restrictview_clear", HKEY, KM_PRESS, KM_ALT, 0); + WM_keymap_add_item(keymap, "OBJECT_OT_restrictview_set", HKEY, KM_PRESS, 0, 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "OBJECT_OT_restrictview_set", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1); WM_keymap_verify_item(keymap, "OBJECT_OT_delete", XKEY, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "OBJECT_OT_primitive_add", AKEY, KM_PRESS, KM_SHIFT, 0); - WM_keymap_verify_item(keymap, "OBJECT_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "OBJECT_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "OBJECT_OT_duplicate", DKEY, KM_PRESS, KM_ALT, 0)->ptr, "linked", 1); // XXX this should probably be in screen instead... here for testing purposes in the meantime... - Aligorith WM_keymap_verify_item(keymap, "ANIM_OT_insert_keyframe_menu", IKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 631ab3cf8cb..01cb4427944 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2286,46 +2286,54 @@ static ScrArea *find_area_showing_r_result(bContext *C) static void screen_set_image_output(bContext *C) { + Scene *scene= CTX_data_scene(C); ScrArea *sa; SpaceImage *sima; - sa= find_area_showing_r_result(C); + if(scene->r.displaymode==R_OUTPUT_SCREEN) { + /* this function returns with changed context */ + ED_screen_full_newspace(C, CTX_wm_area(C), SPACE_IMAGE); + sa= CTX_wm_area(C); + } + else { - if(sa==NULL) { - /* find largest open non-image area */ - sa= biggest_non_image_area(C); - if(sa) { - ED_area_newspace(C, sa, SPACE_IMAGE); - sima= sa->spacedata.first; - - /* makes ESC go back to prev space */ - sima->flag |= SI_PREVSPACE; - } - else { - /* use any area of decent size */ - sa= biggest_area(C); - if(sa->spacetype!=SPACE_IMAGE) { - // XXX newspace(sa, SPACE_IMAGE); + sa= find_area_showing_r_result(C); + + if(sa==NULL) { + /* find largest open non-image area */ + sa= biggest_non_image_area(C); + if(sa) { + ED_area_newspace(C, sa, SPACE_IMAGE); sima= sa->spacedata.first; /* makes ESC go back to prev space */ sima->flag |= SI_PREVSPACE; } + else { + /* use any area of decent size */ + sa= biggest_area(C); + if(sa->spacetype!=SPACE_IMAGE) { + // XXX newspace(sa, SPACE_IMAGE); + sima= sa->spacedata.first; + + /* makes ESC go back to prev space */ + sima->flag |= SI_PREVSPACE; + } + } } - } - + } sima= sa->spacedata.first; /* get the correct image, and scale it */ sima->image= BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result"); - if(G.displaymode==2) { // XXX - if(sa->full==0) { - sima->flag |= SI_FULLWINDOW; +// if(G.displaymode==2) { // XXX + if(sa->full) { + sima->flag |= SI_FULLWINDOW|SI_PREVSPACE; - ed_screen_fullarea(C, sa); +// ed_screen_fullarea(C, sa); } - } +// } } @@ -2371,6 +2379,62 @@ static void render_freejob(void *rjv) MEM_freeN(rj); } +/* str is IMA_RW_MAXTEXT in size */ +static void make_renderinfo_string(RenderStats *rs, Scene *scene, char *str) +{ + char info_time_str[32]; // used to be extern to header_info.c + uintptr_t mem_in_use, mmap_in_use; + float megs_used_memory, mmap_used_memory; + char *spos= str; + + mem_in_use= MEM_get_memory_in_use(); + mmap_in_use= MEM_get_mapped_memory_in_use(); + + megs_used_memory= (mem_in_use-mmap_in_use)/(1024.0*1024.0); + mmap_used_memory= (mmap_in_use)/(1024.0*1024.0); + + if(scene->lay & 0xFF000000) + spos+= sprintf(spos, "Localview | "); + else if(scene->r.scemode & R_SINGLE_LAYER) + spos+= sprintf(spos, "Single Layer | "); + + spos+= sprintf(spos, "Fra:%d Ve:%d Fa:%d ", (scene->r.cfra), rs->totvert, rs->totface); + if(rs->tothalo) spos+= sprintf(spos, "Ha:%d ", rs->tothalo); + if(rs->totstrand) spos+= sprintf(spos, "St:%d ", rs->totstrand); + spos+= sprintf(spos, "La:%d Mem:%.2fM (%.2fM) ", rs->totlamp, megs_used_memory, mmap_used_memory); + + if(rs->curfield) + spos+= sprintf(spos, "Field %d ", rs->curfield); + if(rs->curblur) + spos+= sprintf(spos, "Blur %d ", rs->curblur); + + BLI_timestr(rs->lastframetime, info_time_str); + spos+= sprintf(spos, "Time:%s ", info_time_str); + + if(rs->infostr) + spos+= sprintf(spos, "| %s ", rs->infostr); + + /* very weak... but 512 characters is quite safe */ + if(spos >= str+IMA_RW_MAXTEXT) + printf("WARNING! renderwin text beyond limit \n"); + +} + +static void image_renderinfo_cb(void *rjv, RenderStats *rs) +{ + RenderJob *rj= rjv; + + /* malloc OK here, stats_draw is not in tile threads */ + if(rj->image->render_text==NULL) + rj->image->render_text= MEM_callocN(IMA_RW_MAXTEXT, "rendertext"); + + make_renderinfo_string(rs, rj->scene, rj->image->render_text); + + /* make jobs timer to send notifier */ + *(rj->do_update)= 1; + +} + /* called inside thread! */ static void image_rect_update(void *rjv, RenderResult *rr, volatile rcti *renrect) { @@ -2552,6 +2616,8 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) re= RE_NewRender(scene->id.name); RE_test_break_cb(re, rj, render_breakjob); RE_display_draw_cb(re, rj, image_rect_update); + RE_stats_draw_cb(re, rj, image_renderinfo_cb); + rj->re= re; G.afbreek= 0; @@ -2626,6 +2692,48 @@ void SCREEN_OT_render_view_cancel(struct wmOperatorType *ot) ot->poll= ED_operator_image_active; } +/* *********************** show render viewer *************** */ + +static int render_view_show_exec(bContext *C, wmOperator *unused) +{ + ScrArea *sa= find_area_showing_r_result(C); + + /* determine if render already shows */ + if(sa) { + SpaceImage *sima= sa->spacedata.first; + + if(sima->flag & SI_PREVSPACE) { + sima->flag &= ~SI_PREVSPACE; + + if(sima->flag & SI_FULLWINDOW) { + sima->flag &= ~SI_FULLWINDOW; + ED_screen_full_prevspace(C); + } + else if(sima->next) { + ED_area_newspace(C, sa, sima->next->spacetype); + ED_area_tag_redraw(sa); + } + } + } + else { + screen_set_image_output(C); + } + + return OPERATOR_FINISHED; +} + +void SCREEN_OT_render_view_show(struct wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Show/Hide Render View"; + ot->idname= "SCREEN_OT_render_view_show"; + + /* api callbacks */ + ot->exec= render_view_show_exec; + ot->poll= ED_operator_screenactive; +} + + /* **************** Assigning operatortypes to global list, adding handlers **************** */ @@ -2661,7 +2769,8 @@ void ED_operatortypes_screen(void) /* render */ WM_operatortype_append(SCREEN_OT_render); WM_operatortype_append(SCREEN_OT_render_view_cancel); - + WM_operatortype_append(SCREEN_OT_render_view_show); + /* tools shared by more space types */ WM_operatortype_append(ED_OT_undo); WM_operatortype_append(ED_OT_redo); @@ -2722,6 +2831,7 @@ void ED_keymap_screen(wmWindowManager *wm) /* render */ WM_keymap_add_item(keymap, "SCREEN_OT_render", F12KEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "SCREEN_OT_render_view_cancel", ESCKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "SCREEN_OT_render_view_show", F11KEY, KM_PRESS, 0, 0); /* frame offsets & play */ keymap= WM_keymap_listbase(wm, "Frames", 0, 0); diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 02ee8f508c1..f1f20a36b59 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -90,6 +90,8 @@ enum { B_FS_EXEC, B_FS_CANCEL, B_FS_PARENT, + B_FS_DIRNAME, + B_FS_FILENAME } eFile_ButEvents; @@ -105,68 +107,130 @@ static void do_file_buttons(bContext *C, void *arg, int event) case B_FS_PARENT: file_parent_exec(C, NULL); /* file_ops.c */ break; + case B_FS_FILENAME: + file_filename_exec(C, NULL); + break; + case B_FS_DIRNAME: + file_directory_exec(C, NULL); + break; } } -/* note; this function uses pixelspace (0, 0, winx, winy), not view2d */ +/* Note: This function uses pixelspace (0, 0, winx, winy), not view2d. + * The controls are laid out as follows: + * + * ------------------------------------------- + * | Directory input | execute | + * ------------------------------------------- + * | Filename input | + | - | cancel | + * ------------------------------------------- + * + * The input widgets will stretch to fill any excess space. + * When there isn't enough space for all controls to be shown, they are + * hidden in this order: x/-, execute/cancel, input widgets. + */ void file_draw_buttons(const bContext *C, ARegion *ar) { - SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + /* Button layout. */ + const short min_x = 10; + const short max_x = ar->winx - 10; + const short line2_y = ar->winy - IMASEL_BUTTONS_HEIGHT - 12; + const short line1_y = line2_y + IMASEL_BUTTONS_HEIGHT/2 + 4; + const short input_minw = 20; + const short btn_h = 21; + const short btn_fn_w = 14; + const short btn_minw = 80; + const short btn_margin = 20; + const short separator = 4; + + /* Additional locals. */ + char name[20]; + short loadbutton; + short fnumbuttons; + short available_w = max_x - min_x; + short line1_w = available_w; + short line2_w = available_w; + + uiBut* but; + uiBlock* block; + SpaceFile* sfile = (SpaceFile*) CTX_wm_space_data(C); FileSelectParams* params = ED_fileselect_get_params(sfile); - uiBlock *block; - int loadbutton; - char name[20]; - float slen; - int filebuty1, filebuty2; - - float xmin = 8; - float xmax = ar->winx - 10; - - filebuty1= ar->winy - IMASEL_BUTTONS_HEIGHT - 12; - filebuty2= filebuty1 + IMASEL_BUTTONS_HEIGHT/2 + 4; - - /* HEADER */ + + /* Initialize UI block. */ sprintf(name, "win %p", ar); block = uiBeginBlock(C, ar, name, UI_EMBOSS); uiBlockSetHandleFunc(block, do_file_buttons, NULL); - - /* XXXX - uiSetButLock( filelist_gettype(simasel->files)==FILE_MAIN && simasel->returnfunc, NULL); - */ - - /* space available for load/save buttons? */ - slen = UI_GetStringWidth(sfile->params->title); - loadbutton= slen > 60 ? slen + 20 : MAX2(80, 20+UI_GetStringWidth(params->title)); - if(ar->winx > loadbutton+20) { - if(params->title[0]==0) { - loadbutton= 0; - } + + /* Is there enough space for the execute / cancel buttons? */ + loadbutton = UI_GetStringWidth(sfile->params->title) + btn_margin; + if (loadbutton < btn_minw) { + loadbutton = MAX2(btn_minw, + btn_margin + UI_GetStringWidth(params->title)); } - else { - loadbutton= 0; + + if (available_w <= loadbutton + separator + input_minw + || params->title[0] == 0) { + loadbutton = 0; + } else { + line1_w -= (loadbutton + separator); + line2_w = line1_w; } - uiDefBut(block, TEX, 0 /* XXX B_FS_FILENAME */,"", xmin+2, filebuty1, xmax-xmin-loadbutton-4, 21, params->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, ""); - uiDefBut(block, TEX, 0 /* XXX B_FS_DIRNAME */,"", xmin+2, filebuty2, xmax-xmin-loadbutton-4, 21, params->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, ""); + /* Is there enough space for file number increment/decrement buttons? */ + fnumbuttons = 2 * btn_fn_w; + if (!loadbutton || line2_w <= fnumbuttons + separator + input_minw) { + fnumbuttons = 0; + } else { + line2_w -= (fnumbuttons + separator); + } + + /* Text input fields for directory and file. */ + if (available_w > 0) { + but = uiDefBut(block, TEX, B_FS_DIRNAME, "", + min_x, line1_y, line1_w, btn_h, + params->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, + "File path."); + uiButSetCompleteFunc(but, autocomplete_directory, NULL); + uiDefBut(block, TEX, B_FS_FILENAME, "", + min_x, line2_y, line2_w, btn_h, + params->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, + "File name."); + } + + /* Filename number increment / decrement buttons. */ + if (fnumbuttons) { + uiBlockBeginAlign(block); + but = uiDefButO(block, BUT, "FILE_OT_filenum", 0, "-", + min_x + line2_w + separator, line2_y, + btn_fn_w, btn_h, + "Decrement the filename number."); + RNA_int_set(uiButGetOperatorPtrRNA(but), "increment", -1); + but = uiDefButO(block, BUT, "FILE_OT_filenum", 0, "+", + min_x + line2_w + separator + btn_fn_w, line2_y, + btn_fn_w, btn_h, + "Increment the filename number."); + RNA_int_set(uiButGetOperatorPtrRNA(but), "increment", 1); + uiBlockEndAlign(block); + } + + /* Execute / cancel buttons. */ if(loadbutton) { - uiDefBut(block, BUT, B_FS_EXEC, params->title, xmax-loadbutton, filebuty2, loadbutton, 21, params->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, ""); - uiDefBut(block, BUT, B_FS_CANCEL, "Cancel", xmax-loadbutton, filebuty1, loadbutton, 21, params->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, ""); + uiDefBut(block, BUT, B_FS_EXEC, params->title, + max_x - loadbutton, line1_y, loadbutton, btn_h, + params->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, params->title); + uiDefBut(block, BUT, B_FS_CANCEL, "Cancel", + max_x - loadbutton, line2_y, loadbutton, btn_h, + params->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, "Cancel."); } - + uiEndBlock(C, block); uiDrawBlock(C, block); } static void draw_tile(short sx, short sy, short width, short height, int colorid, int shade) -{ - /* TODO: BIF_ThemeColor seems to need this to show the color, not sure why? - elubie */ - //glEnable(GL_BLEND); - //glColor4ub(0, 0, 0, 100); - //glDisable(GL_BLEND); - /* I think it was a missing glDisable() - ton */ - +{ UI_ThemeColorShade(colorid, shade); uiSetRoundBox(15); uiRoundBox(sx, sy - height, sx + width, sy, 6); diff --git a/source/blender/editors/space_file/file_header.c b/source/blender/editors/space_file/file_header.c deleted file mode 100644 index 4799003d6c7..00000000000 --- a/source/blender/editors/space_file/file_header.c +++ /dev/null @@ -1,187 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2008 Blender Foundation. - * All rights reserved. - * - * - * Contributor(s): Blender Foundation - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include <string.h> -#include <stdio.h> - -#include "DNA_space_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_windowmanager_types.h" - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" - -#include "BKE_context.h" -#include "BKE_screen.h" -#include "BKE_global.h" - -#include "ED_screen.h" -#include "ED_types.h" -#include "ED_util.h" -#include "ED_fileselect.h" - -#include "WM_api.h" -#include "WM_types.h" - -#include "BIF_gl.h" -#include "BIF_glutil.h" - -#include "UI_interface.h" -#include "UI_resources.h" -#include "UI_view2d.h" - -#include "file_intern.h" -#include "filelist.h" - -#define B_SORTIMASELLIST 1 -#define B_RELOADIMASELDIR 2 -#define B_FILTERIMASELDIR 3 -#define B_HIDEDOTFILES 4 - -/* ************************ header area region *********************** */ - -static void do_file_header_buttons(bContext *C, void *arg, int event) -{ - SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); - switch(event) { - case B_SORTIMASELLIST: - filelist_sort(sfile->files, sfile->params->sort); - WM_event_add_notifier(C, NC_WINDOW, NULL); - break; - case B_RELOADIMASELDIR: - WM_event_add_notifier(C, NC_WINDOW, NULL); - break; - case B_FILTERIMASELDIR: - if(sfile->params) { - if (sfile->params->flag & FILE_FILTER) { - filelist_setfilter(sfile->files,sfile->params->filter); - filelist_filter(sfile->files); - } else { - filelist_setfilter(sfile->files,0); - filelist_filter(sfile->files); - } - } - WM_event_add_notifier(C, NC_WINDOW, NULL); - break; - case B_HIDEDOTFILES: - if(sfile->params) { - filelist_free(sfile->files); - filelist_hidedot(sfile->files, sfile->params->flag & FILE_HIDE_DOT); - WM_event_add_notifier(C, NC_WINDOW, NULL); - } - break; - } -} - - -void file_header_buttons(const bContext *C, ARegion *ar) -{ - SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); - FileSelectParams* params = ED_fileselect_get_params(sfile); - - uiBlock *block; - int xco, yco= 3; - int xcotitle; - - block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS); - uiBlockSetHandleFunc(block, do_file_header_buttons, NULL); - - xco= ED_area_header_standardbuttons(C, block, yco); - - /* - if((sa->flag & HEADER_NO_PULLDOWN)==0) { - int xmax; - - xmax= GetButStringLength("View"); - uiDefPulldownBut(block, dummy_viewmenu, CTX_wm_area(C), - "View", xco, yco-2, xmax-3, 24, ""); - xco+=XIC+xmax; - } - */ - - xco += 5; - - uiBlockBeginAlign(block); - uiDefIconButO(block, BUT, "FILE_OT_parent", WM_OP_INVOKE_DEFAULT, ICON_FILE_PARENT, xco+=XIC, yco, 20, 20, "Navigate to Parent Folder"); - uiDefIconButO(block, BUT, "FILE_OT_refresh", WM_OP_INVOKE_DEFAULT, ICON_FILE_REFRESH, xco+=XIC, yco, 20, 20, "Refresh List of Files"); - uiBlockEndAlign(block); - - xco += 5; - - uiBlockBeginAlign(block); - uiDefIconButS(block, ROW, B_RELOADIMASELDIR, ICON_SHORTDISPLAY, xco+=XIC, yco, XIC,YIC, ¶ms->display, 1.0, FILE_SHORTDISPLAY, 0, 0, "Displays short file description"); - uiDefIconButS(block, ROW, B_RELOADIMASELDIR, ICON_LONGDISPLAY, xco+=XIC, yco, XIC,YIC, ¶ms->display, 1.0, FILE_LONGDISPLAY, 0, 0, "Displays long file description"); - uiDefIconButS(block, ROW, B_RELOADIMASELDIR, ICON_IMGDISPLAY, xco+=XIC, yco, XIC,YIC, ¶ms->display, 1.0, FILE_IMGDISPLAY, 0, 0, "Displays files as thumbnails"); - uiBlockEndAlign(block); - - xco+=XIC; - - - uiBlockBeginAlign(block); - uiDefIconButS(block, ROW, B_SORTIMASELLIST, ICON_SORTALPHA, xco+=XIC, yco, XIC,YIC, ¶ms->sort, 1.0, 0.0, 0, 0, "Sorts files alphabetically"); - uiDefIconButS(block, ROW, B_SORTIMASELLIST, ICON_SORTBYEXT, xco+=XIC, yco, XIC,YIC, ¶ms->sort, 1.0, 3.0, 0, 0, "Sorts files by extension"); - uiDefIconButS(block, ROW, B_SORTIMASELLIST, ICON_SORTTIME, xco+=XIC, yco, XIC,YIC, ¶ms->sort, 1.0, 1.0, 0, 0, "Sorts files by time"); - uiDefIconButS(block, ROW, B_SORTIMASELLIST, ICON_SORTSIZE, xco+=XIC, yco, XIC,YIC, ¶ms->sort, 1.0, 2.0, 0, 0, "Sorts files by size"); - uiBlockEndAlign(block); - - xco+=XIC; - uiDefIconButBitS(block, TOG, FILE_HIDE_DOT, B_HIDEDOTFILES, ICON_GHOST,xco+=XIC,yco,XIC,YIC, ¶ms->flag, 0, 0, 0, 0, "Hide dot files"); - xco+=XIC; - uiDefIconButBitS(block, TOG, FILE_FILTER, B_FILTERIMASELDIR, ICON_FILTER,xco+=XIC,yco,XIC,YIC, ¶ms->flag, 0, 0, 0, 0, "Filter files"); - - if (params->flag & FILE_FILTER) { - xco+=4; - uiBlockBeginAlign(block); - uiDefIconButBitS(block, TOG, IMAGEFILE, B_FILTERIMASELDIR, ICON_FILE_IMAGE,xco+=XIC,yco,XIC,YIC, ¶ms->filter, 0, 0, 0, 0, "Show images"); - uiDefIconButBitS(block, TOG, BLENDERFILE, B_FILTERIMASELDIR, ICON_FILE_BLEND,xco+=XIC,yco,XIC,YIC, ¶ms->filter, 0, 0, 0, 0, "Show .blend files"); - uiDefIconButBitS(block, TOG, MOVIEFILE, B_FILTERIMASELDIR, ICON_FILE_MOVIE,xco+=XIC,yco,XIC,YIC, ¶ms->filter, 0, 0, 0, 0, "Show movies"); - uiDefIconButBitS(block, TOG, PYSCRIPTFILE, B_FILTERIMASELDIR, ICON_FILE_SCRIPT,xco+=XIC,yco,XIC,YIC, ¶ms->filter, 0, 0, 0, 0, "Show python scripts"); - uiDefIconButBitS(block, TOG, FTFONTFILE, B_FILTERIMASELDIR, ICON_FILE_FONT,xco+=XIC,yco,XIC,YIC, ¶ms->filter, 0, 0, 0, 0, "Show fonts"); - uiDefIconButBitS(block, TOG, SOUNDFILE, B_FILTERIMASELDIR, ICON_FILE_SOUND,xco+=XIC,yco,XIC,YIC, ¶ms->filter, 0, 0, 0, 0, "Show sound files"); - uiDefIconButBitS(block, TOG, TEXTFILE, B_FILTERIMASELDIR, ICON_FILE_BLANK,xco+=XIC,yco,XIC,YIC, ¶ms->filter, 0, 0, 0, 0, "Show text files"); - uiDefIconButBitS(block, TOG, FOLDERFILE, B_FILTERIMASELDIR, ICON_FILE_FOLDER,xco+=XIC,yco,XIC,YIC, ¶ms->filter, 0, 0, 0, 0, "Show folders"); - uiBlockEndAlign(block); - xco+=XIC; - } - - xcotitle= xco; - xco+= UI_GetStringWidth(params->title); - - uiBlockSetEmboss(block, UI_EMBOSS); - - /* always as last */ - UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin); - - uiEndBlock(C, block); - uiDrawBlock(C, block); -} - - - diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h index 2f3fae47abb..dce56e05d6b 100644 --- a/source/blender/editors/space_file/file_intern.h +++ b/source/blender/editors/space_file/file_intern.h @@ -34,9 +34,6 @@ struct ARegion; struct ARegionType; struct SpaceFile; -/* file_header.c */ -void file_header_buttons(const bContext *C, ARegion *ar); - /* file_ops.c */ struct ARegion *file_buttons_region(struct ScrArea *sa); @@ -65,23 +62,34 @@ void FILE_OT_loadimages(struct wmOperatorType *ot); void FILE_OT_exec(struct wmOperatorType *ot); void FILE_OT_cancel(struct wmOperatorType *ot); void FILE_OT_parent(struct wmOperatorType *ot); +void FILE_OT_directory_new(struct wmOperatorType *ot); +void FILE_OT_filename(struct wmOperatorType *ot); void FILE_OT_previous(struct wmOperatorType *ot); void FILE_OT_next(struct wmOperatorType *ot); void FILE_OT_refresh(struct wmOperatorType *ot); void FILE_OT_bookmark_toggle(struct wmOperatorType *ot); void FILE_OT_filenum(struct wmOperatorType *ot); +void FILE_OT_delete(struct wmOperatorType *ot); int file_exec(bContext *C, struct wmOperator *unused); int file_cancel_exec(bContext *C, struct wmOperator *unused); int file_parent_exec(bContext *C, struct wmOperator *unused); int file_previous_exec(bContext *C, struct wmOperator *unused); int file_next_exec(bContext *C, struct wmOperator *unused); +int file_filename_exec(bContext *C, struct wmOperator *unused); +int file_directory_exec(bContext *C, struct wmOperator *unused); +int file_directory_new_exec(bContext *C,struct wmOperator *unused); +int file_delete_exec(bContext *C, struct wmOperator *unused); + int file_hilight_set(struct SpaceFile *sfile, struct ARegion *ar, int mx, int my); + /* filesel.c */ float file_string_width(const char* str); float file_font_pointsize(); void file_change_dir(struct SpaceFile *sfile); +int file_select_match(struct SpaceFile *sfile, const char *pattern); +void autocomplete_directory(struct bContext *C, char *str, void *arg_v); /* file_panels.c */ void file_panels_register(struct ARegionType *art); diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index c4435e85749..8f1d2598c61 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -142,10 +142,10 @@ static void file_select(SpaceFile* sfile, ARegion* ar, const rcti* rect, short v { // XXX error("Path too long, cannot enter this directory"); } else { + BLI_cleanup_dir(G.sce, params->dir); strcat(params->dir, file->relname); - strcat(params->dir,"/"); + BLI_add_slash(params->dir); params->file[0] = '\0'; - BLI_cleanup_dir(G.sce, params->dir); file_change_dir(sfile); } } @@ -557,11 +557,13 @@ int file_parent_exec(bContext *C, wmOperator *unused) SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); if(sfile->params) { - BLI_parent_dir(sfile->params->dir); - file_change_dir(sfile); + if (BLI_has_parent(sfile->params->dir)) { + BLI_parent_dir(sfile->params->dir); + file_change_dir(sfile); + WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); + } } - WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); - + return OPERATOR_FINISHED; } @@ -652,6 +654,101 @@ int file_next_exec(bContext *C, wmOperator *unused) return OPERATOR_FINISHED; } +int file_directory_new_exec(bContext *C, wmOperator *unused) +{ + char tmpstr[FILE_MAX]; + char tmpdir[FILE_MAXFILE]; + int i = 1; + + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + + if(sfile->params) { + + BLI_strncpy(tmpstr, sfile->params->dir, FILE_MAX); + BLI_join_dirfile(tmpstr, tmpstr, "New Folder"); + while (BLI_exists(tmpstr)) { + BLI_snprintf(tmpdir, FILE_MAXFILE, "New Folder(%d)", i++); + BLI_strncpy(tmpstr, sfile->params->dir, FILE_MAX); + BLI_join_dirfile(tmpstr, tmpstr, tmpdir); + } + BLI_recurdir_fileops(tmpstr); + if (!BLI_exists(tmpstr)) { + filelist_free(sfile->files); + filelist_parent(sfile->files); + BLI_strncpy(sfile->params->dir, filelist_dir(sfile->files), FILE_MAX); + } + } + WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); + + return OPERATOR_FINISHED; +} + + +void FILE_OT_directory_new(struct wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Create New Directory"; + ot->idname= "FILE_OT_directory_new"; + + /* api callbacks */ + ot->invoke= WM_operator_confirm; + ot->exec= file_directory_new_exec; + ot->poll= ED_operator_file_active; /* <- important, handler is on window level */ +} + +int file_directory_exec(bContext *C, wmOperator *unused) +{ + char tmpstr[FILE_MAX]; + + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + + if(sfile->params) { + + if ( sfile->params->dir[0] == '~' ) { + if (sfile->params->dir[1] == '\0') { + BLI_strncpy(sfile->params->dir, BLI_gethome(), sizeof(sfile->params->dir) ); + } else { + /* replace ~ with home */ + char homestr[FILE_MAX]; + char *d = &sfile->params->dir[1]; + + while ( (*d == '\\') || (*d == '/') ) + d++; + BLI_strncpy(homestr, BLI_gethome(), FILE_MAX); + BLI_add_slash(homestr); + BLI_join_dirfile(tmpstr, homestr, d); + BLI_strncpy(sfile->params->dir, tmpstr, sizeof(sfile->params->dir)); + } + } +#ifdef WIN32 + if (sfile->params->dir[0] == '\0') + get_default_root(sfile->params->dir); +#endif + BLI_add_slash(sfile->params->dir); + file_change_dir(sfile); + WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); + } + + + return OPERATOR_FINISHED; +} + +int file_filename_exec(bContext *C, wmOperator *unused) +{ + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + + if(sfile->params) { + if (file_select_match(sfile, sfile->params->file)) + { + sfile->params->file[0] = '\0'; + WM_event_add_notifier(C, NC_FILE|ND_PARAMS, NULL); + } + } + + return OPERATOR_FINISHED; +} + + void FILE_OT_refresh(struct wmOperatorType *ot) { /* identifiers */ @@ -772,3 +869,48 @@ void FILE_OT_filenum(struct wmOperatorType *ot) RNA_def_int(ot->srna, "increment", 1, 0, 100, "Increment", "", 0,100); } +int file_delete_poll(bContext *C) +{ + int poll = ED_operator_file_active(C); + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + struct direntry* file; + + if(!sfile->params ) poll= 0; + + if (sfile->params->active_file < 0) { + poll= 0; + } else { + file = filelist_file(sfile->files, sfile->params->active_file); + if (file && S_ISDIR(file->type)) poll= 0; + } + return poll; +} + +int file_delete_exec(bContext *C, wmOperator *op) +{ + char str[FILE_MAX]; + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + struct direntry* file; + + + file = filelist_file(sfile->files, sfile->params->active_file); + BLI_make_file_string(G.sce, str, sfile->params->dir, file->relname); + BLI_delete(str, 0, 0); + WM_event_add_notifier(C, NC_FILE | ND_FILELIST, NULL); + + return OPERATOR_FINISHED; + +} + +void FILE_OT_delete(struct wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Delete File"; + ot->idname= "FILE_OT_delete"; + + /* api callbacks */ + ot->invoke= WM_operator_confirm; + ot->exec= file_delete_exec; + ot->poll= file_delete_poll; /* <- important, handler is on window level */ +} + diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index c42c83eda98..6c8e84f0db8 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -80,6 +80,17 @@ #include "file_intern.h" #include "filelist.h" +#if defined __BeOS +static int fnmatch(const char *pattern, const char *string, int flags) +{ + return 0; +} +#elif defined WIN32 && !defined _LIBC + /* use fnmatch included in blenlib */ + #include "BLI_fnmatch.h" +#else + #include <fnmatch.h> +#endif FileSelectParams* ED_fileselect_get_params(struct SpaceFile *sfile) { @@ -287,7 +298,7 @@ FileLayout* ED_fileselect_get_layout(struct SpaceFile *sfile, struct ARegion *ar void file_change_dir(struct SpaceFile *sfile) { - if (sfile->params) { + if (sfile->params && BLI_exists(sfile->params->dir)) { filelist_setdir(sfile->files, sfile->params->dir); if(folderlist_clear_next(sfile)) @@ -299,3 +310,46 @@ void file_change_dir(struct SpaceFile *sfile) sfile->params->active_file = -1; } } + +int file_select_match(struct SpaceFile *sfile, const char *pattern) +{ + int match = 0; + if (strchr(pattern, '*') || strchr(pattern, '?') || strchr(pattern, '[')) { + int i; + struct direntry *file; + int n = filelist_numfiles(sfile->files); + + for (i = 0; i < n; i++) { + file = filelist_file(sfile->files, i); + if (fnmatch(pattern, file->relname, 0) == 0) { + file->flags |= ACTIVE; + match = 1; + } + } + } + return match; +} + + +void autocomplete_directory(struct bContext *C, char *str, void *arg_v) +{ + char tmp[FILE_MAX]; + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + + /* search if str matches the beginning of name */ + if(str[0] && sfile->files) { + AutoComplete *autocpl= autocomplete_begin(str, FILE_MAX); + int nentries = filelist_numfiles(sfile->files); + int i; + + for(i= 0; i<nentries; ++i) { + struct direntry* file = filelist_file(sfile->files, i); + char* dir = filelist_dir(sfile->files); + if (file && S_ISDIR(file->type)) { + BLI_make_file_string(G.sce, tmp, dir, file->relname); + autocomplete_do_name(autocpl,tmp); + } + } + autocomplete_end(autocpl, str); + } +}
\ No newline at end of file diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 3167d2809c9..5af79eb2800 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -321,6 +321,8 @@ void file_operatortypes(void) WM_operatortype_append(FILE_OT_delete_bookmark); WM_operatortype_append(FILE_OT_hidedot); WM_operatortype_append(FILE_OT_filenum); + WM_operatortype_append(FILE_OT_directory_new); + WM_operatortype_append(FILE_OT_delete); } /* NOTE: do not add .blend file reading on this level */ @@ -335,6 +337,8 @@ void file_keymap(struct wmWindowManager *wm) WM_keymap_add_item(keymap, "FILE_OT_hidedot", HKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_previous", BACKSPACEKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_next", BACKSPACEKEY, KM_PRESS, KM_SHIFT, 0); + /* WM_keymap_add_item(keymap, "FILE_OT_directory_new", IKEY, KM_PRESS, 0, 0); */ /* XXX needs button */ + WM_keymap_add_item(keymap, "FILE_OT_delete", XKEY, KM_PRESS, 0, 0); /* keys for main area */ keymap= WM_keymap_listbase(wm, "FileMain", SPACE_FILE, 0); diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index e61931f2fad..e5d74e6dddd 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -127,14 +127,13 @@ static void image_verify_buffer_float(SpaceImage *sima, ImBuf *ibuf) } } -static void draw_render_info(SpaceImage *sima, ARegion *ar) +static void draw_render_info(Image *ima, ARegion *ar) { rcti rect; float colf[3]; int showspare= 0; // XXX BIF_show_render_spare(); - char *str= "render text"; // XXX BIF_render_text(); - if(str==NULL) + if(ima->render_text==NULL) return; rect= ar->winrct; @@ -152,10 +151,10 @@ static void draw_render_info(SpaceImage *sima, ARegion *ar) if(showspare) { UI_DrawString(12, rect.ymin + 5, "(Previous)"); - UI_DrawString(72, rect.ymin + 5, str); + UI_DrawString(72, rect.ymin + 5, ima->render_text); } else - UI_DrawString(12, rect.ymin + 5, str); + UI_DrawString(12, rect.ymin + 5, ima->render_text); } void draw_image_info(ARegion *ar, int channels, int x, int y, char *cp, float *fp, int *zp, float *zpf) @@ -685,8 +684,8 @@ void draw_image_main(SpaceImage *sima, ARegion *ar, Scene *scene) draw_image_paint_helpers(sima, ar, scene, zoomx, zoomy); /* render info */ - if(ibuf && show_render) - draw_render_info(sima, ar); + if(ibuf && ima && show_render) + draw_render_info(ima, ar); /* XXX integrate this code */ #if 0 diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 48c14804b13..f58af47a6bd 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -101,7 +101,7 @@ static int text_font_draw_character(SpaceText *st, int x, int y, char c) int text_font_width_character(SpaceText *st) { // XXX need quick BLF function, or cache it somewhere - return (st->lheight == 12)? 7: 8; + return (st->lheight == 12)? 7: 9; } int text_font_width(SpaceText *st, char *str) diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index d23b47092bf..9a03a602ac2 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -1707,6 +1707,7 @@ static uiBlock *view3d_transformmenu(bContext *C, ARegion *ar, void *arg_unused) return block; } +#if 0 void do_view3d_object_mirrormenu(bContext *C, void *arg, int event) { #if 0 @@ -1752,64 +1753,29 @@ static uiBlock *view3d_object_mirrormenu(bContext *C, ARegion *ar, void *arg_unu uiTextBoundsBlock(block, 60); return block; } - -static void do_view3d_edit_object_transformmenu(bContext *C, void *arg, int event) -{ -#if 0 - switch(event) { - case 0: /* clear origin */ - clear_object('o'); - break; - case 1: /* clear scale */ - clear_object('s'); - break; - case 2: /* clear rotation */ - clear_object('r'); - break; - case 3: /* clear location */ - clear_object('g'); - break; - case 4: - if(OBACT) object_apply_deform(OBACT); - break; - case 5: /* make duplis real */ - make_duplilist_real(); - break; - case 6: /* apply scale/rotation or deformation */ - apply_objects_locrot(); - break; - case 7: /* apply visual matrix to objects loc/size/rot */ - apply_objects_visual_tx(); - break; - } #endif -} -static uiBlock *view3d_edit_object_transformmenu(bContext *C, ARegion *ar, void *arg_unused) +static void view3d_edit_object_transformmenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiBeginBlock(C, ar, "view3d_edit_object_transformmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_object_transformmenu, NULL); - +#if 0 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Scale/Rotation to ObData|Ctrl A, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); + apply_objects_locrot(); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Visual Transform|Ctrl A, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); + apply_objects_visual_tx(); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Deformation|Ctrl Shift A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Duplicates Real|Ctrl Shift A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Location|Alt G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Rotation|Alt R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Scale|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Origin|Alt O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; + if(OBACT) object_apply_deform(OBACT); +#endif + uiItemO(layout, NULL, 0, "OBJECT_OT_duplicates_make_real"); + + uiItemS(layout); + + uiItemO(layout, NULL, 0, "OBJECT_OT_location_clear"); + uiItemO(layout, NULL, 0, "OBJECT_OT_rotation_clear"); + uiItemO(layout, NULL, 0, "OBJECT_OT_scale_clear"); + uiItemO(layout, NULL, 0, "OBJECT_OT_origin_clear"); } +#if 0 static void do_view3d_edit_object_makelocalmenu(bContext *C, void *arg, int event) { #if 0 @@ -2046,164 +2012,49 @@ static uiBlock *view3d_edit_object_copyattrmenu(bContext *C, ARegion *ar, void * uiTextBoundsBlock(block, 60); return block; } - - -static void do_view3d_edit_object_parentmenu(bContext *C, void *arg, int event) -{ -#if 0 - switch(event) { - case 0: /* clear parent */ - clear_parent(); - break; - case 1: /* make parent */ - make_parent(); - break; - } #endif -} -static uiBlock *view3d_edit_object_parentmenu(bContext *C, ARegion *ar, void *arg_unused) +static void view3d_edit_object_parentmenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiBeginBlock(C, ar, "view3d_edit_object_parentmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_object_parentmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Parent...|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Parent...|Alt P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; + uiItemO(layout, "Make Parent...", 0, "OBJECT_OT_parent_set"); + uiItemO(layout, "Clear Parent...", 0, "OBJECT_OT_parent_clear"); } -static void do_view3d_edit_object_groupmenu(bContext *C, void *arg, int event) +static void view3d_edit_object_groupmenu(bContext *C, uiLayout *layout, void *arg_unused) { -#if 0 - switch(event) { - case 1: - case 2: - case 3: - group_operation(event); - break; - } -#endif -} + uiItemO(layout, NULL, 0, "GROUP_OT_group_create"); + uiItemO(layout, NULL, 0, "GROUP_OT_objects_remove"); -static uiBlock *view3d_edit_object_groupmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiBeginBlock(C, ar, "view3d_edit_object_groupmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_object_groupmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add to Existing Group|Ctrl G, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add to New Group|Ctrl G, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Remove from All Groups|Ctrl G, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} + uiItemS(layout); -static void do_view3d_edit_object_trackmenu(bContext *C, void *arg, int event) -{ -#if 0 - switch(event) { - case 0: /* clear track */ - clear_track(); - break; - case 1: /* make track */ - make_track(); - break; - } -#endif + uiItemO(layout, NULL, 0, "GROUP_OT_objects_add_active"); + uiItemO(layout, NULL, 0, "GROUP_OT_objects_remove_active"); } -static uiBlock *view3d_edit_object_trackmenu(bContext *C, ARegion *ar, void *arg_unused) +static void view3d_edit_object_trackmenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiBeginBlock(C, ar, "view3d_edit_object_trackmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_object_trackmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Track...|Ctrl T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Track...|Alt T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; + uiItemO(layout, "Make Track...", 0, "OBJECT_OT_track_set"); + uiItemO(layout, "Clear Track...", 0, "OBJECT_OT_track_clear"); } -static void do_view3d_edit_object_constraintsmenu(bContext *C, void *arg, int event) +static void view3d_edit_object_constraintsmenu(bContext *C, uiLayout *layout, void *arg_unused) { #if 0 - switch(event) { - case 1: /* add constraint */ - add_constraint(0); - break; - case 2: /* clear constraint */ - ob_clear_constraints(); - break; - } -#endif -} - -static uiBlock *view3d_edit_object_constraintsmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiBeginBlock(C, ar, "view3d_edit_object_constraintsmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_object_constraintsmenu, NULL); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Constraint...|Ctrl Alt C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + add_constraint(0); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Constraints", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_view3d_edit_object_showhidemenu(bContext *C, void *arg, int event) -{ -#if 0 - - switch(event) { - - case 0: /* show objects */ - show_objects(); - break; - case 1: /* hide selected objects */ - hide_objects(1); - break; - case 2: /* hide deselected objects */ - hide_objects(0); - break; - } + ob_clear_constraints(); #endif } -static uiBlock *view3d_edit_object_showhidemenu(bContext *C, ARegion *ar, void *arg_unused) +static void view3d_edit_object_showhidemenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiBeginBlock(C, ar, "view3d_edit_object_showhidemenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_object_showhidemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Unselected|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; + uiItemO(layout, "Show Hidden", 0, "OBJECT_OT_restrictview_clear"); + uiItemO(layout, "Hide Selected", 0, "OBJECT_OT_restrictview_set"); + uiItemBooleanO(layout, "Hide Unselected", 0, "OBJECT_OT_restrictview_set", "unselected", 1); } +#if 0 #ifndef DISABLE_PYTHON static void do_view3d_edit_object_scriptsmenu(bContext *C, void *arg, int event) { @@ -2233,11 +2084,12 @@ static uiBlock *view3d_edit_object_scriptsmenu(bContext *C, ARegion *ar, void *a return block; } #endif /* DISABLE_PYTHON */ +#endif +#if 0 static void do_view3d_edit_objectmenu(bContext *C, void *arg, int event) { -#if 0 Scene *scene= CTX_data_scene(C); ScrArea *sa= CTX_wm_area(C); View3D *v3d= sa->spacedata.first; @@ -2247,15 +2099,6 @@ static void do_view3d_edit_objectmenu(bContext *C, void *arg, int event) case 0: /* transform properties*/ // XXX mainqenter(NKEY, 1); break; - case 1: /* delete */ - delete_context_selected(); - break; - case 2: /* duplicate */ - duplicate_context_selected(); - break; - case 3: /* duplicate linked */ - adduplicate(0, 0); - break; case 5: /* make single user */ single_user(); break; @@ -2274,9 +2117,6 @@ static void do_view3d_edit_objectmenu(bContext *C, void *arg, int event) case 11: /* insert keyframe */ common_insertkey(); break; - case 15: /* Object Panel */ - add_blockhandler(sa, VIEW3D_HANDLER_OBJECT, UI_PNL_UNSTOW); - break; case 16: /* make proxy object*/ make_proxy(); break; @@ -2284,82 +2124,75 @@ static void do_view3d_edit_objectmenu(bContext *C, void *arg, int event) common_deletekey(); break; } -#endif } +#endif -static uiBlock *view3d_edit_objectmenu(bContext *C, ARegion *ar, void *arg_unused) +static void view3d_edit_objectmenu(bContext *C, uiLayout *layout, void *arg_unused) { - Scene *scene= CTX_data_scene(C); - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "view3d_edit_objectmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_objectmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 15, ""); +#if 0 + Object *ob= CTX_data_active_object(C); + uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_object_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, ""); +#endif - uiDefIconTextBlockBut(block, view3d_edit_object_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Clear/Apply", 0, yco-=20, 120, 19, ""); - // XXX uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - + uiItemMenuF(layout, "Clear/Apply", 0, view3d_edit_object_transformmenu); + uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu); + + uiItemS(layout); + +#if 0 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Keyframe|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Linked|Alt D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + uiItemS(layout); +#endif + uiItemO(layout, NULL, 0, "OBJECT_OT_duplicate"); + uiItemBooleanO(layout, "Duplicate Linked", 0, "OBJECT_OT_duplicate", "linked", 1); + uiItemO(layout, NULL, 0, "OBJECT_OT_delete"); + +#if 0 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Proxy|Ctrl Alt P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); uiDefIconTextBlockBut(block, view3d_edit_object_makelinksmenu, NULL, ICON_RIGHTARROW_THIN, "Make Links", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_edit_object_singleusermenu, NULL, ICON_RIGHTARROW_THIN, "Make Single User", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_edit_object_makelocalmenu, NULL, ICON_RIGHTARROW_THIN, "Make Local", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_edit_object_copyattrmenu, NULL, ICON_RIGHTARROW_THIN, "Copy Attributes", 0, yco-=20, 120, 19, ""); +#endif - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_edit_object_parentmenu, NULL, ICON_RIGHTARROW_THIN, "Parent", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_object_groupmenu, NULL, ICON_RIGHTARROW_THIN, "Group", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_object_trackmenu, NULL, ICON_RIGHTARROW_THIN, "Track", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_object_constraintsmenu, NULL, ICON_RIGHTARROW_THIN, "Constraints", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + uiItemS(layout); - if (OBACT && OBACT->type == OB_MESH) { + uiItemMenuF(layout, "Parent", 0, view3d_edit_object_parentmenu); + uiItemMenuF(layout, "Track", 0, view3d_edit_object_trackmenu); + uiItemMenuF(layout, "Group", 0, view3d_edit_object_groupmenu); + uiItemMenuF(layout, "Constraints", 0, view3d_edit_object_constraintsmenu); + +#if 0 + uiItemS(layout); + + if(ob && ob->type == OB_MESH) { uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Boolean Operation...|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); } uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Join Objects|Ctrl J", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Convert Object Type...|Alt C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); +#endif + + uiItemS(layout); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - +#if 0 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move to Layer...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); - uiDefIconTextBlockBut(block, view3d_edit_object_showhidemenu, NULL, ICON_RIGHTARROW_THIN, "Show/Hide Objects", 0, yco-=20, 120, 19, ""); +#endif + + uiItemMenuF(layout, "Show/Hide", 0, view3d_edit_object_showhidemenu); +#if 0 #ifndef DISABLE_PYTHON uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); uiDefIconTextBlockBut(block, view3d_edit_object_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Scripts", 0, yco-=20, 120, 19, ""); #endif - - if(ar->alignment==RGN_ALIGN_TOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; +#endif } - static void view3d_edit_mesh_verticesmenu(bContext *C, uiLayout *layout, void *arg_unused) { uiItemO(layout, "Merge...", 0, "MESH_OT_merge"); @@ -4612,7 +4445,7 @@ static void view3d_header_pulldowns(const bContext *C, uiBlock *block, Object *o } else { xmax= GetButStringLength("Object"); - uiDefPulldownBut(block, view3d_edit_objectmenu, NULL, "Object", xco,yco, xmax-3, 20, ""); + uiDefMenuBut(block, view3d_edit_objectmenu, NULL, "Object", xco,yco, xmax-3, 20, ""); xco+= xmax; } } diff --git a/source/blender/makesdna/DNA_image_types.h b/source/blender/makesdna/DNA_image_types.h index 371b0d75951..65e4be1173d 100644 --- a/source/blender/makesdna/DNA_image_types.h +++ b/source/blender/makesdna/DNA_image_types.h @@ -87,6 +87,9 @@ typedef struct Image { struct PackedFile * packedfile; struct PreviewImage * preview; + /* not saved in file, statistics for render result */ + char *render_text; + float lastupdate; int lastused; short animspeed; @@ -120,5 +123,9 @@ typedef struct Image { /* ima->type and ima->source moved to BKE_image.h, for API */ +/* render_text maxlen */ +#define IMA_RW_MAXTEXT 512 + + #endif diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 31724bb5665..e9b246a323d 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -218,7 +218,12 @@ typedef struct RenderData { short bufflag; short quality; - short rpad, rpad1, rpad2; + /** + * Render to image editor, fullscreen or to new window. + */ + short displaymode; + + short rpad1, rpad2; /** * Flags for render settings. Use bit-masking to access the settings. @@ -652,6 +657,12 @@ typedef struct Scene { #define R_TOUCH 0x800000 /* touch files before rendering */ #define R_SIMPLIFY 0x1000000 +/* displaymode */ + +#define R_OUTPUT_SCREEN 0 +#define R_OUTPUT_AREA 1 +#define R_OUTPUT_WINDOW 2 +#define R_OUTPUT_FORKED 3 /* filtertype */ #define R_FILTER_BOX 0 diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index e145722428c..3b2520c41b2 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -496,6 +496,7 @@ int RNA_struct_ui_icon(StructRNA *type); PropertyRNA *RNA_struct_name_property(StructRNA *type); PropertyRNA *RNA_struct_iterator_property(StructRNA *type); +StructRNA *RNA_struct_base(StructRNA *type); int RNA_struct_is_ID(StructRNA *type); int RNA_struct_is_a(StructRNA *type, StructRNA *srna); diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 059afad4c70..ec509dbf863 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -119,6 +119,11 @@ static void rna_print_c_string(FILE *f, const char *str) static char *escape[] = {"\''", "\"\"", "\??", "\\\\","\aa", "\bb", "\ff", "\nn", "\rr", "\tt", "\vv", NULL}; int i, j; + if(!str) { + fprintf(f, "NULL"); + return; + } + fprintf(f, "\""); for(i=0; str[i]; i++) { for(j=0; escape[j]; j++) @@ -262,7 +267,8 @@ static int rna_enum_bitmask(PropertyRNA *prop) if(eprop->item) { for(a=0; a<eprop->totitem; a++) - mask |= eprop->item[a].value; + if(eprop->item[a].identifier[0]) + mask |= eprop->item[a].value; } return mask; @@ -971,7 +977,8 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR fprintf(f, "enum {\n"); for(i=0; i<eprop->totitem; i++) - fprintf(f, "\t%s_%s_%s = %d,\n", srna->identifier, prop->identifier, eprop->item[i].identifier, eprop->item[i].value); + if(eprop->item[i].identifier[0]) + fprintf(f, "\t%s_%s_%s = %d,\n", srna->identifier, prop->identifier, eprop->item[i].identifier, eprop->item[i].value); fprintf(f, "};\n\n"); } @@ -1059,7 +1066,8 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property fprintf(f, "\tenum %s_enum {\n", prop->identifier); for(i=0; i<eprop->totitem; i++) - fprintf(f, "\t\t%s_%s = %d,\n", prop->identifier, eprop->item[i].identifier, eprop->item[i].value); + if(eprop->item[i].identifier[0]) + fprintf(f, "\t\t%s_%s = %d,\n", prop->identifier, eprop->item[i].identifier, eprop->item[i].value); fprintf(f, "\t};\n"); } @@ -1577,8 +1585,9 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr rna_print_c_string(f, eprop->item[i].name); fprintf(f, ", "); rna_print_c_string(f, eprop->item[i].description); fprintf(f, "}, "); - if(eprop->defaultvalue == eprop->item[i].value) - defaultfound= 1; + if(eprop->item[i].identifier[0]) + if(eprop->defaultvalue == eprop->item[i].value) + defaultfound= 1; } fprintf(f, "{0, NULL, 0, NULL, NULL}};\n\n"); diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index cc8704dc350..42f6250728f 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -392,6 +392,11 @@ PropertyRNA *RNA_struct_iterator_property(StructRNA *type) return type->iteratorproperty; } +StructRNA *RNA_struct_base(StructRNA *type) +{ + return type->base; +} + int RNA_struct_is_ID(StructRNA *type) { return (type->flag & STRUCT_ID) != 0; @@ -661,7 +666,7 @@ int RNA_property_enum_value(PointerRNA *ptr, PropertyRNA *prop, const char *iden RNA_property_enum_items(ptr, prop, &item, NULL); for(; item->identifier; item++) { - if(strcmp(item->identifier, identifier)==0) { + if(item->identifier[0] && strcmp(item->identifier, identifier)==0) { *value = item->value; return 1; } @@ -673,7 +678,7 @@ int RNA_property_enum_value(PointerRNA *ptr, PropertyRNA *prop, const char *iden int RNA_enum_identifier(const EnumPropertyItem *item, const int value, const char **identifier) { for (; item->identifier; item++) { - if(item->value==value) { + if(item->identifier[0] && item->value==value) { *identifier = item->identifier; return 1; } @@ -684,7 +689,7 @@ int RNA_enum_identifier(const EnumPropertyItem *item, const int value, const cha int RNA_enum_name(const EnumPropertyItem *item, const int value, const char **name) { for (; item->identifier; item++) { - if(item->value==value) { + if(item->identifier[0] && item->value==value) { *name = item->name; return 1; } diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 5c4b6a95524..cda1716f664 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -38,33 +38,33 @@ EnumPropertyItem constraint_type_items[] ={ {CONSTRAINT_TYPE_CHILDOF, "CHILD_OF", 0, "Child Of", ""}, {CONSTRAINT_TYPE_TRANSFORM, "TRANSFORM", 0, "Transformation", ""}, - + {0, "", 0, NULL, NULL}, {CONSTRAINT_TYPE_LOCLIKE, "COPY_LOCATION", 0, "Copy Location", ""}, {CONSTRAINT_TYPE_ROTLIKE, "COPY_ROTATION", 0, "Copy Rotation", ""}, {CONSTRAINT_TYPE_SIZELIKE, "COPY_SCALE", 0, "Copy Scale", ""}, - + {0, "", 0, NULL, NULL}, {CONSTRAINT_TYPE_LOCLIMIT, "LIMIT_LOCATION", 0, "Limit Location", ""}, {CONSTRAINT_TYPE_ROTLIMIT, "LIMIT_ROTATION", 0, "Limit Rotation", ""}, {CONSTRAINT_TYPE_SIZELIMIT, "LIMIT_SCALE", 0, "Limit Scale", ""}, {CONSTRAINT_TYPE_DISTLIMIT, "LIMIT_DISTANCE", 0, "Limit Distance", ""}, - + {0, "", 0, NULL, NULL}, {CONSTRAINT_TYPE_TRACKTO, "TRACK_TO", 0, "Track To", ""}, {CONSTRAINT_TYPE_LOCKTRACK, "LOCKED_TRACK", 0, "Locked Track", ""}, - + {0, "", 0, NULL, NULL}, {CONSTRAINT_TYPE_MINMAX, "FLOOR", 0, "Floor", ""}, {CONSTRAINT_TYPE_SHRINKWRAP, "SHRINKWRAP", 0, "Shrinkwrap", ""}, {CONSTRAINT_TYPE_FOLLOWPATH, "FOLLOW_PATH", 0, "Follow Path", ""}, - + {0, "", 0, NULL, NULL}, {CONSTRAINT_TYPE_CLAMPTO, "CLAMP_TO", 0, "Clamp To", ""}, {CONSTRAINT_TYPE_STRETCHTO, "STRETCH_TO", 0, "Stretch To", ""}, - + {0, "", 0, NULL, NULL}, {CONSTRAINT_TYPE_KINEMATIC, "IK", 0, "IK", ""}, {CONSTRAINT_TYPE_RIGIDBODYJOINT, "RIGID_BODY_JOINT", 0, "Rigid Body Joint", ""}, - + {0, "", 0, NULL, NULL}, {CONSTRAINT_TYPE_ACTION, "ACTION", 0, "Action", ""}, - + {0, "", 0, NULL, NULL}, {CONSTRAINT_TYPE_PYTHON, "SCRIPT", 0, "Script", ""}, - + {0, "", 0, NULL, NULL}, {CONSTRAINT_TYPE_NULL, "NULL", 0, "Null", ""}, {0, NULL, 0, NULL, NULL}}; diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 2916c1bcb6e..2b414adf05b 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -1117,7 +1117,7 @@ void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item for(i=0; item[i].identifier; i++) { eprop->totitem++; - if(item[i].value == eprop->defaultvalue) + if(item[i].identifier[0] && item[i].value == eprop->defaultvalue) defaultfound= 1; } @@ -1280,7 +1280,7 @@ void RNA_def_property_enum_default(PropertyRNA *prop, int value) eprop->defaultvalue= value; for(i=0; i<eprop->totitem; i++) { - if(eprop->item[i].value == eprop->defaultvalue) + if(eprop->item[i].identifier[0] && eprop->item[i].value == eprop->defaultvalue) defaultfound= 1; } diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 557d472afef..0b605db20cf 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -516,6 +516,13 @@ static int rna_StringProperty_max_length_get(PointerRNA *ptr) return ((StringPropertyRNA*)prop)->maxlength; } +static int rna_enum_check_separator(CollectionPropertyIterator *iter, void *data) +{ + EnumPropertyItem *item= (EnumPropertyItem*)data; + + return (item->identifier[0] != 0); +} + static void rna_EnumProperty_items_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { PropertyRNA *prop= (PropertyRNA*)ptr->data; @@ -524,7 +531,7 @@ static void rna_EnumProperty_items_begin(CollectionPropertyIterator *iter, Point rna_idproperty_check(&prop, ptr); eprop= (EnumPropertyRNA*)prop; - rna_iterator_array_begin(iter, (void*)eprop->item, sizeof(eprop->item[0]), eprop->totitem, NULL); + rna_iterator_array_begin(iter, (void*)eprop->item, sizeof(eprop->item[0]), eprop->totitem, rna_enum_check_separator); } static void rna_EnumPropertyItem_identifier_get(PointerRNA *ptr, char *value) diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index b363e55ca75..3cd45bb6dd8 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -283,7 +283,13 @@ void rna_def_scene_render_data(BlenderRNA *brna) {R_PLANES24, "RGB", 0, "RGB", "Images are saved with RGB (color) data"}, {R_PLANES32, "RGBA", 0, "RGBA", "Images are saved with RGB and Alpha data (if supported)"}, {0, NULL, 0, NULL, NULL}}; - + + static EnumPropertyItem display_mode_items[] ={ + {R_OUTPUT_SCREEN, "SCREEN", 0, "Full Screen", "Images are rendered in full Screen"}, + {R_OUTPUT_AREA, "AREA", 0, "Image Editor", "Images are rendered in Image Editor"}, + {R_OUTPUT_WINDOW, "WINDOW", 0, "New Window", "Images are rendered in new Window"}, + {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem octree_resolution_items[] = { {64, "OCTREE_RES_64", 0, "64", ""}, {128, "OCTREE_RES_128", 0, "128", ""}, @@ -841,6 +847,11 @@ void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Back Buffer", "Render backbuffer image"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "displaymode"); + RNA_def_property_enum_items(prop, display_mode_items); + RNA_def_property_ui_text(prop, "Display", "Select where rendered images will be displayed"); + prop= RNA_def_property(srna, "output_path", PROP_STRING, PROP_DIRPATH); RNA_def_property_string_sdna(prop, NULL, "pic"); RNA_def_property_ui_text(prop, "Output Path", "Directory/name to save animations, # characters defines the position and length of frame numbers."); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index fea932ca29a..996e54384e2 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -800,8 +800,8 @@ static void rna_def_space_text(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem font_size_items[] = { - {12, "SCREEN_12", 0, "Screen 12", ""}, - {15, "SCREEN_15", 0, "Screen 15", ""}, + {12, "12", 0, "12", ""}, + {15, "15", 0, "15", ""}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "SpaceTextEditor", "Space"); @@ -813,7 +813,7 @@ static void rna_def_space_text(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Text", "Text displayed and edited in this space."); RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceTextEditor_text_set", NULL); - RNA_def_property_update(prop, NC_TEXT|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL); /* display */ prop= RNA_def_property(srna, "syntax_highlight", PROP_BOOLEAN, PROP_NONE); @@ -893,6 +893,21 @@ static void rna_def_fileselect_params(BlenderRNA *brna) srna= RNA_def_struct(brna, "FileSelectParams", NULL); RNA_def_struct_ui_text(srna, "File Select Parameters", "File Select Parameters."); + prop= RNA_def_property(srna, "title", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "title"); + RNA_def_property_ui_text(prop, "Title", "Title for the file browser."); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + + prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "dir"); + RNA_def_property_ui_text(prop, "Directory", "Directory displayed in the file browser."); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + + prop= RNA_def_property(srna, "file", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "file"); + RNA_def_property_ui_text(prop, "File Name", "Active file in the file browser."); + RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + prop= RNA_def_property(srna, "display", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "display"); RNA_def_property_enum_items(prop, file_display_items); diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index 9da8c8b2df3..b10ca6c5e83 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -170,6 +170,8 @@ static StructRNA *rna_Panel_register(const bContext *C, ReportList *reports, voi if(strcmp(pt->idname, dummypt.idname) == 0) { if(pt->py_srna) rna_Panel_unregister(C, pt->py_srna); + else + BLI_freelinkN(&art->paneltypes, pt); break; } } diff --git a/source/blender/python/generic/Mathutils.h b/source/blender/python/generic/Mathutils.h index 6a4e28d6068..5bdd9d9cfe0 100644 --- a/source/blender/python/generic/Mathutils.h +++ b/source/blender/python/generic/Mathutils.h @@ -85,6 +85,13 @@ int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps); #endif typedef struct Mathutils_Callback Mathutils_Callback; + +typedef int (*BaseMathCheckFunc)(PyObject *); +typedef int (*BaseMathGetFunc)(PyObject *, int, float *); +typedef int (*BaseMathSetFunc)(PyObject *, int, float *); +typedef int (*BaseMathGetIndexFunc)(PyObject *, int, float *, int); +typedef int (*BaseMathSetIndexFunc)(PyObject *, int, float *, int); + struct Mathutils_Callback { int (*check)(PyObject *user); /* checks the user is still valid */ int (*get)(PyObject *user, int subtype, float *from); /* gets the vector from the user */ diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index bf2f41389cc..c6fbda0caef 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -94,13 +94,14 @@ static int mathutils_rna_vector_set_index(BPy_PropertyRNA *self, int subtype, fl } Mathutils_Callback mathutils_rna_array_cb = { - mathutils_rna_generic_check, - mathutils_rna_vector_get, - mathutils_rna_vector_set, - mathutils_rna_vector_get_index, - mathutils_rna_vector_set_index + (BaseMathCheckFunc) mathutils_rna_generic_check, + (BaseMathGetFunc) mathutils_rna_vector_get, + (BaseMathSetFunc) mathutils_rna_vector_set, + (BaseMathGetIndexFunc) mathutils_rna_vector_get_index, + (BaseMathSetIndexFunc) mathutils_rna_vector_set_index }; + /* bpyrna matrix callbacks */ static int mathutils_rna_matrix_cb_index= -1; /* index for our callbacks */ @@ -123,11 +124,11 @@ static int mathutils_rna_matrix_set(BPy_PropertyRNA *self, int subtype, float *m } Mathutils_Callback mathutils_rna_matrix_cb = { - mathutils_rna_generic_check, - mathutils_rna_matrix_get, - mathutils_rna_matrix_set, - NULL, - NULL + (BaseMathCheckFunc) mathutils_rna_generic_check, + (BaseMathGetFunc) mathutils_rna_matrix_get, + (BaseMathSetFunc) mathutils_rna_matrix_set, + (BaseMathGetIndexFunc) NULL, + (BaseMathSetIndexFunc) NULL }; #endif @@ -2172,43 +2173,52 @@ static void pyrna_subtype_set_rna(PyObject *newclass, StructRNA *srna) /* done with rna instance */ } -PyObject* pyrna_struct_Subtype(PointerRNA *ptr) +PyObject* pyrna_srna_Subtype(StructRNA *srna) { PyObject *newclass = NULL; - PropertyRNA *nameprop; - if (ptr->type==NULL) { + if (srna == NULL) { newclass= NULL; /* Nothing to do */ - } else if ((newclass= RNA_struct_py_type_get(ptr->data))) { + } else if ((newclass= RNA_struct_py_type_get(srna))) { Py_INCREF(newclass); - } else if ((nameprop = RNA_struct_name_property(ptr->type))) { + } else { + StructRNA *base; + /* for now, return the base RNA type rather then a real module */ - /* Assume RNA_struct_py_type_get(ptr->data) was alredy checked */ + /* Assume RNA_struct_py_type_get(srna) was alredy checked */ /* subclass equivelents - class myClass(myBase): some='value' # or ... - - myClass = type(name='myClass', bases=(myBase,), dict={'some':'value'}) + - myClass = type(name='myClass', bases=(myBase,), dict={'__module__':'bpy.types'}) */ - char name[256], *nameptr; - const char *descr= RNA_struct_ui_description(ptr->type); + const char *descr= RNA_struct_ui_description(srna); PyObject *args = PyTuple_New(3); PyObject *bases = PyTuple_New(1); + PyObject *py_base= NULL; PyObject *dict = PyDict_New(); PyObject *item; - - - nameptr= RNA_property_string_get_alloc(ptr, nameprop, name, sizeof(name)); + // arg 1 //PyTuple_SET_ITEM(args, 0, PyUnicode_FromString(tp_name)); - PyTuple_SET_ITEM(args, 0, PyUnicode_FromString(nameptr)); + PyTuple_SET_ITEM(args, 0, PyUnicode_FromString(RNA_struct_identifier(srna))); // arg 2 - PyTuple_SET_ITEM(bases, 0, (PyObject *)&pyrna_struct_Type); - Py_INCREF(&pyrna_struct_Type); + base= RNA_struct_base(srna); + if(base && base != srna) { + /*/printf("debug subtype %s %p\n", RNA_struct_identifier(srna), srna); */ + py_base= pyrna_srna_Subtype(base); + } + + if(py_base==NULL) { + py_base= (PyObject *)&pyrna_struct_Type; + Py_INCREF(py_base); + } + + PyTuple_SET_ITEM(bases, 0, py_base); PyTuple_SET_ITEM(args, 1, bases); @@ -2219,6 +2229,13 @@ PyObject* pyrna_struct_Subtype(PointerRNA *ptr) Py_DECREF(item); } + /* this isnt needed however its confusing if we get python script names in blender types, + * because the __module__ is used when printing the class */ + item= PyUnicode_FromString("bpy.types"); /* just to know its an internal type */ + PyDict_SetItemString(dict, "__module__", item); + Py_DECREF(item); + + PyTuple_SET_ITEM(args, 2, dict); // fill with useful subclass things! if (PyErr_Occurred()) { @@ -2229,16 +2246,25 @@ PyObject* pyrna_struct_Subtype(PointerRNA *ptr) newclass = PyObject_CallObject((PyObject *)&PyType_Type, args); Py_DECREF(args); - if (newclass) - pyrna_subtype_set_rna(newclass, ptr->data); - - if (name != nameptr) - MEM_freeN(nameptr); + if (newclass) { + pyrna_subtype_set_rna(newclass, srna); + // PyObSpit("NewStructRNA Type: ", (PyObject *)newclass); + } + else { + /* this should not happen */ + PyErr_Print(); + PyErr_Clear(); + } } return newclass; } +PyObject* pyrna_struct_Subtype(PointerRNA *ptr) +{ + return pyrna_srna_Subtype((ptr->type == &RNA_Struct) ? ptr->data : ptr->type); +} + /*-----------------------CreatePyObject---------------------------------*/ PyObject *pyrna_struct_CreatePyObject( PointerRNA *ptr ) { @@ -2247,8 +2273,7 @@ PyObject *pyrna_struct_CreatePyObject( PointerRNA *ptr ) if (ptr->data==NULL && ptr->type==NULL) { /* Operator RNA has NULL data */ Py_RETURN_NONE; } - - if (ptr->type == &RNA_Struct) { /* always return a python subtype from rna struct types */ + else { PyTypeObject *tp = (PyTypeObject *)pyrna_struct_Subtype(ptr); if (tp) { @@ -2259,10 +2284,7 @@ PyObject *pyrna_struct_CreatePyObject( PointerRNA *ptr ) pyrna = ( BPy_StructRNA * ) PyObject_NEW( BPy_StructRNA, &pyrna_struct_Type ); } } - else { - pyrna = ( BPy_StructRNA * ) PyObject_NEW( BPy_StructRNA, &pyrna_struct_Type ); - } - + if( !pyrna ) { PyErr_SetString( PyExc_MemoryError, "couldn't create BPy_StructRNA object" ); return NULL; @@ -2270,6 +2292,9 @@ PyObject *pyrna_struct_CreatePyObject( PointerRNA *ptr ) pyrna->ptr= *ptr; pyrna->freeptr= 0; + + // PyObSpit("NewStructRNA: ", (PyObject *)pyrna); + return ( PyObject * ) pyrna; } diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c index 5ddd8f5a1a9..79830aca12f 100644 --- a/source/blender/windowmanager/intern/wm_cursors.c +++ b/source/blender/windowmanager/intern/wm_cursors.c @@ -158,7 +158,8 @@ void WM_cursor_wait(int val) void WM_cursor_grab(wmWindow *win, int val) { - GHOST_SetCursorGrab(win->ghostwin, val); + if(win) + GHOST_SetCursorGrab(win->ghostwin, val); } /* afer this you can call restore too */ diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 29ec58befd9..51389ef890c 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -334,8 +334,8 @@ int WM_read_homefile(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_WM|ND_FILEREAD, NULL); CTX_wm_window_set(C, NULL); /* exits queues */ - - return success; + + return OPERATOR_FINISHED; } diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 9cec463193e..330196a7a73 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1554,7 +1554,7 @@ void wm_window_keymap(wmWindowManager *wm) WM_keymap_verify_item(keymap, "WM_OT_open_mainfile", F1KEY, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "WM_OT_save_mainfile", WKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_verify_item(keymap, "WM_OT_save_as_mainfile", F2KEY, KM_PRESS, 0, 0); - WM_keymap_verify_item(keymap, "WM_OT_window_fullscreen_toggle", F11KEY, KM_PRESS, 0, 0); + WM_keymap_verify_item(keymap, "WM_OT_window_fullscreen_toggle", F11KEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_verify_item(keymap, "WM_OT_exit_blender", QKEY, KM_PRESS, KM_CTRL, 0); /* debug/testing */ diff --git a/source/nan_definitions.mk b/source/nan_definitions.mk index 0f0179bf459..f9b8e98b902 100644 --- a/source/nan_definitions.mk +++ b/source/nan_definitions.mk @@ -73,7 +73,7 @@ ifndef CONFIG_GUESS export WITH_BF_DYNAMICOPENGL ?= true export WITH_BF_STATICOPENGL ?= false export WITH_BF_BLENDERGAMEENGINE ?= true - export WITH_BF_BLENDERPLAYER ?= true + export WITH_BF_BLENDERPLAYER ?= false ifeq ($(NAN_NO_PLUGIN), true) export WITH_BF_WEBPLUGIN = false else @@ -310,7 +310,7 @@ endif export NAN_PYTHON ?= /usr export NAN_PYTHON_VERSION ?= 2.5 export NAN_PYTHON_BINARY ?= $(NAN_PYTHON)/bin/python$(NAN_PYTHON_VERSION) - export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/python$(NAN_PYTHON_VERSION)/config/libpython$(NAN_PYTHON_VERSION).a + export NAN_PYTHON_LIB ?= $(NAN_PYTHON)/lib/libpython$(NAN_PYTHON_VERSION).a export NAN_OPENAL ?= /usr export NAN_JPEG ?= /usr export NAN_PNG ?= /usr |