diff options
-rw-r--r-- | CMakeLists.txt | 20 | ||||
-rw-r--r-- | release/scripts/modules/bpy/__init__.py | 29 | ||||
-rw-r--r-- | release/scripts/modules/console/intellisense.py | 15 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_userpref.py | 79 | ||||
-rw-r--r-- | source/blender/collada/EffectExporter.cpp | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_edit.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_buttons.c | 4 | ||||
-rw-r--r-- | source/blenderplayer/bad_level_call_stubs/stubs.c | 1 |
8 files changed, 118 insertions, 36 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b74bb00260..8c865b701d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,11 +53,6 @@ if(NOT EXECUTABLE_OUTPUT_PATH) set(FIRST_RUN "TRUE") endif() -# set default build type to Release -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release") -endif() - # this starts out unset list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build_files/cmake/Modules") @@ -150,7 +145,7 @@ option(WITH_IMAGE_HDR "Enable HDR Image Support" ON) option(WITH_IMAGE_REDCODE "Enable RedCode Image Support" OFF) # Audio/Video format support -option(WITH_CODEC_FFMPEG "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu)" OFF) +option(WITH_CODEC_FFMPEG "Enable FFMPeg Support (http://ffmpeg.org)" OFF) option(WITH_CODEC_SNDFILE "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF) if(APPLE OR (WIN32 AND NOT UNIX)) option(WITH_CODEC_QUICKTIME "Enable Quicktime Support" OFF) @@ -372,7 +367,7 @@ if(UNIX AND NOT APPLE) endif() if(WITH_CODEC_FFMPEG) - set(FFMPEG /usr CACHE FILEPATH "FFMPEG Directory") + set(FFMPEG /usr CACHE PATH "FFMPEG Directory") mark_as_advanced(FFMPEG) set(FFMPEG_INCLUDE_DIRS ${FFMPEG}/include) set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries") @@ -416,18 +411,18 @@ if(UNIX AND NOT APPLE) endif() if(WITH_OPENCOLLADA) - set(OPENCOLLADA /usr/local/opencollada CACHE FILEPATH "OpenCollada Directory") + set(OPENCOLLADA /usr/local/opencollada CACHE PATH "OpenCollada Directory") mark_as_advanced(OPENCOLLADA) set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib) set(OPENCOLLADA_LIBRARIES OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre ftoa buffer xml2) set(OPENCOLLADA_INCLUDE_DIR ${OPENCOLLADA}) - set(PCRE /usr CACHE FILEPATH "PCRE Directory") + set(PCRE /usr CACHE PATH "PCRE Directory") mark_as_advanced(PCRE) set(PCRE_LIBPATH ${PCRE}/lib) set(PCRE_LIB pcre) - set(EXPAT /usr CACHE FILEPATH "Expat Directory") + set(EXPAT /usr CACHE PATH "Expat Directory") mark_as_advanced(EXPAT) set(EXPAT_LIBPATH ${EXPAT}/lib) set(EXPAT_LIB expat) @@ -624,9 +619,10 @@ elseif(WIN32) set(PTHREADS_INCLUDE_DIRS ${LIBDIR}/pthreads/include) set(PTHREADS_LIBRARIES ${LIBDIR}/pthreads/lib/pthreadVC2.lib) + set(FREETYPE ${LIBDIR}/freetype) set(FREETYPE_INCLUDE_DIRS - ${FREETYPE}/include - ${FREETYPE}/include/freetype2 + ${LIBDIR}/freetype/include + ${LIBDIR}/freetype/include/freetype2 ) set(FREETYPE_LIBRARY ${LIBDIR}/freetype/lib/freetype2ST.lib) diff --git a/release/scripts/modules/bpy/__init__.py b/release/scripts/modules/bpy/__init__.py index 1df8e9e5588..6dcc5d7b285 100644 --- a/release/scripts/modules/bpy/__init__.py +++ b/release/scripts/modules/bpy/__init__.py @@ -22,24 +22,29 @@ Give access to blender data and utility functions. """ -# internal blender C module -import _bpy -from _bpy import types, props, app +__all__ = ( + "app", + "context", + "data", + "ops", + "path", + "props", + "types", + "utils", +) + -data = _bpy.data -context = _bpy.context +# internal blender C module +from _bpy import types, props, app, data, context # python modules -from . import utils, path -from . import ops as _ops_module +from . import utils, path, ops # fake operator module -ops = _ops_module.ops_fake_module - -import sys as _sys - +ops = ops.ops_fake_module def _main(): + import sys as _sys # Possibly temp. addons path from os.path import join, dirname, normpath @@ -59,3 +64,5 @@ def _main(): _main() + +del _main
\ No newline at end of file diff --git a/release/scripts/modules/console/intellisense.py b/release/scripts/modules/console/intellisense.py index 072d467ff86..a177b305fda 100644 --- a/release/scripts/modules/console/intellisense.py +++ b/release/scripts/modules/console/intellisense.py @@ -53,7 +53,7 @@ RE_UNQUOTED_WORD = re.compile( re.UNICODE) -def complete(line, cursor, namespace, private=True): +def complete(line, cursor, namespace, private): """Returns a list of possible completions: * name completion @@ -82,6 +82,9 @@ def complete(line, cursor, namespace, private=True): if RE_MODULE.match(line): from . import complete_import matches = complete_import.complete(line) + if not private: + matches[:] = [m for m in matches if m[:1] != "_"] + matches.sort() else: from . import complete_namespace matches = complete_namespace.complete(word, namespace, private) @@ -130,11 +133,15 @@ def expand(line, cursor, namespace, private=True): else: # causes blender bug [#27495] since string keys may contain '.' # scrollback = ' '.join([m.split('.')[-1] for m in matches]) + + # add white space to align with the cursor + white_space = " " + (" " * (cursor + len(prefix))) word_prefix = word + prefix - scrollback = ' '.join( - [m[len(word_prefix):] + scrollback = '\n'.join( + [white_space + m[len(word_prefix):] if (word_prefix and m.startswith(word_prefix)) - else m.split('.')[-1] + else + white_space + m.split('.')[-1] for m in matches]) no_calltip = True diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index b9ac740eb5b..9c31b172ee9 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -876,6 +876,19 @@ class USERPREF_PT_addons(bpy.types.Panel): def module_get(mod_name): return USERPREF_PT_addons._addons_fake_modules[mod_name] + @staticmethod + def is_user_addon(mod, user_addon_paths): + if not user_addon_paths: + user_script_path = bpy.utils.user_script_path() + if user_script_path is not None: + user_addon_paths.append(os.path.join(user_script_path(), "addons")) + user_addon_paths.append(os.path.join(bpy.utils.resource_path('USER'), "scripts", "addons")) + + for path in user_addon_paths: + if bpy.path.is_subdir(mod.__file__, path): + return True + return False + def draw(self, context): layout = self.layout @@ -900,6 +913,9 @@ class USERPREF_PT_addons(bpy.types.Panel): search = context.window_manager.addon_search.lower() support = context.window_manager.addon_support + # initialized on demand + user_addon_paths = [] + for mod, info in addons: module_name = mod.__name__ @@ -969,19 +985,24 @@ class USERPREF_PT_addons(bpy.types.Panel): split = colsub.row().split(percentage=0.15) split.label(text="Warning:") split.label(text=' ' + info["warning"], icon='ERROR') - if info["wiki_url"] or info["tracker_url"]: + + user_addon = __class__.is_user_addon(mod, user_addon_paths) + tot_row = bool(info["wiki_url"]) + bool(info["tracker_url"]) + bool(user_addon) + + if tot_row: split = colsub.row().split(percentage=0.15) split.label(text="Internet:") if info["wiki_url"]: split.operator("wm.url_open", text="Link to the Wiki", icon='HELP').url = info["wiki_url"] if info["tracker_url"]: split.operator("wm.url_open", text="Report a Bug", icon='URL').url = info["tracker_url"] + if user_addon: + split.operator("wm.addon_remove", text="Remove", icon='CANCEL').module = mod.__name__ - if info["wiki_url"] and info["tracker_url"]: - split.separator() - else: - split.separator() + for i in range(4 - tot_row): split.separator() + + # Append missing scripts # First collect scripts that are used but have no script file. @@ -1186,6 +1207,54 @@ class WM_OT_addon_install(bpy.types.Operator): return {'RUNNING_MODAL'} +class WM_OT_addon_remove(bpy.types.Operator): + "Disable an addon" + bl_idname = "wm.addon_remove" + bl_label = "Remove Add-On" + + module = StringProperty(name="Module", description="Module name of the addon to remove") + + @staticmethod + def path_from_addon(module): + for mod in addon_utils.modules(USERPREF_PT_addons._addons_fake_modules): + if mod.__name__ == module: + filepath = mod.__file__ + if os.path.exists(filepath): + if os.path.splitext(os.path.basename(filepath))[0] == "__init__": + return os.path.dirname(filepath), True + else: + return filepath, False + return None, False + + def execute(self, context): + path, isdir = __class__.path_from_addon(self.module) + if path is None: + self.report('WARNING', "Addon path %r could not be found" % path) + return {'CANCELLED'} + + # incase its enabled + addon_utils.disable(self.module) + + import shutil + if isdir: + shutil.rmtree(path) + else: + os.remove(path) + + context.area.tag_redraw() + return {'FINISHED'} + + # lame confirmation check + def draw(self, context): + self.layout.label(text="Remove Addon: %r?" % self.module) + path, isdir = __class__.path_from_addon(self.module) + self.layout.label(text="Path: %r" % path) + + def invoke(self, context, event): + wm = context.window_manager + return wm.invoke_props_dialog(self, width=600) + + class WM_OT_addon_expand(bpy.types.Operator): "Display more information on this add-on" bl_idname = "wm.addon_expand" diff --git a/source/blender/collada/EffectExporter.cpp b/source/blender/collada/EffectExporter.cpp index 0bbf714137e..74756859d3b 100644 --- a/source/blender/collada/EffectExporter.cpp +++ b/source/blender/collada/EffectExporter.cpp @@ -273,7 +273,7 @@ void EffectsExporter::operator()(Material *ma, Object *ob) std::string uvname = strlen(t->uvname) ? t->uvname : active_uv; // color - if (t->mapto & MAP_COL | MAP_COLSPEC) { + if (t->mapto & (MAP_COL | MAP_COLSPEC)) { ep.setDiffuse(createTexture(ima, uvname, sampler)); } // ambient diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 527b97a6082..2dfb799f1ad 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1689,7 +1689,7 @@ void OBJECT_OT_shade_flat(wmOperatorType *ot) { /* identifiers */ ot->name= "Shade Flat"; - ot->description= "Display faces 'smooth' (using vertext normals)"; + ot->description= "Display faces 'flat'"; ot->idname= "OBJECT_OT_shade_flat"; /* api callbacks */ @@ -1704,7 +1704,7 @@ void OBJECT_OT_shade_smooth(wmOperatorType *ot) { /* identifiers */ ot->name= "Shade Smooth"; - ot->description= "Display faces 'flat'"; + ot->description= "Display faces 'smooth' (using vertext normals)"; ot->idname= "OBJECT_OT_shade_smooth"; /* api callbacks */ diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index 0210b0dd78d..e9ebe78da29 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -792,7 +792,9 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char uiItemR(col, userptr, "frame_offset", 0, NULL, ICON_NONE); col= uiLayoutColumn(split, 0); - uiItemR(col, userptr, "fields_per_frame", 0, "Fields", ICON_NONE); + row= uiLayoutRow(col, 0); + uiLayoutSetActive(row, RNA_boolean_get(&imaptr, "use_fields")); + uiItemR(row, userptr, "fields_per_frame", 0, "Fields", ICON_NONE); uiItemR(col, userptr, "use_auto_refresh", 0, NULL, ICON_NONE); uiItemR(col, userptr, "use_cyclic", 0, NULL, ICON_NONE); } diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index a3bd6d91a63..5629f0d9668 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -379,6 +379,7 @@ void RE_ReleaseResultImage(struct Render *re){} int RE_engine_test_break(struct RenderEngine *engine){return 0;} void RE_engines_init() {} void RE_engines_exit() {} +void RE_engine_report(struct RenderEngine *engine, int type, const char *msg) {} /* python */ struct wmOperatorType *WM_operatortype_find(const char *idname, int quiet){return (struct wmOperatorType *) NULL;} |