[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37952] branches/soc-2011-tomato: Merging r37946 through r37951 from trunk into soc-2011-tomato

Sergey Sharybin g.ulairi at gmail.com
Wed Jun 29 20:03:03 CEST 2011


Revision: 37952
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37952
Author:   nazgul
Date:     2011-06-29 18:03:03 +0000 (Wed, 29 Jun 2011)
Log Message:
-----------
Merging r37946 through r37951 from trunk into soc-2011-tomato

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37946
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37951

Modified Paths:
--------------
    branches/soc-2011-tomato/CMakeLists.txt
    branches/soc-2011-tomato/release/scripts/modules/console/intellisense.py
    branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_userpref.py
    branches/soc-2011-tomato/source/blender/collada/EffectExporter.cpp

Property Changed:
----------------
    branches/soc-2011-tomato/


Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/blender:36831-37945
   + /trunk/blender:36831-37951

Modified: branches/soc-2011-tomato/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/CMakeLists.txt	2011-06-29 17:56:32 UTC (rev 37951)
+++ branches/soc-2011-tomato/CMakeLists.txt	2011-06-29 18:03:03 UTC (rev 37952)
@@ -365,7 +365,7 @@
 	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")
@@ -409,18 +409,18 @@
 	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)
@@ -617,6 +617,7 @@
 		set(PTHREADS_INCLUDE_DIRS ${LIBDIR}/pthreads/include)
 		set(PTHREADS_LIBRARIES ${LIBDIR}/pthreads/lib/pthreadVC2.lib)
 
+		set(FREETYPE ${LIBDIR}/freetype)
 		set(FREETYPE_INCLUDE_DIRS
 			${LIBDIR}/freetype/include
 			${LIBDIR}/freetype/include/freetype2

Modified: branches/soc-2011-tomato/release/scripts/modules/console/intellisense.py
===================================================================
--- branches/soc-2011-tomato/release/scripts/modules/console/intellisense.py	2011-06-29 17:56:32 UTC (rev 37951)
+++ branches/soc-2011-tomato/release/scripts/modules/console/intellisense.py	2011-06-29 18:03:03 UTC (rev 37952)
@@ -82,7 +82,6 @@
         if RE_MODULE.match(line):
             from . import complete_import
             matches = complete_import.complete(line)
-            print(private)
             if not private:
                 matches[:] = [m for m in matches if m[:1] != "_"]
             matches.sort()

Modified: branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_userpref.py
===================================================================
--- branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_userpref.py	2011-06-29 17:56:32 UTC (rev 37951)
+++ branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_userpref.py	2011-06-29 18:03:03 UTC (rev 37952)
@@ -876,6 +876,19 @@
     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 @@
         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 @@
                         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"]:
+                        for i in range(4 - tot_row):
                             split.separator()
-                        else:
-                            split.separator()
-                            split.separator()
+                        
+                        
 
         # Append missing scripts
         # First collect scripts that are used but have no script file.
@@ -1186,6 +1207,54 @@
         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"

Modified: branches/soc-2011-tomato/source/blender/collada/EffectExporter.cpp
===================================================================
--- branches/soc-2011-tomato/source/blender/collada/EffectExporter.cpp	2011-06-29 17:56:32 UTC (rev 37951)
+++ branches/soc-2011-tomato/source/blender/collada/EffectExporter.cpp	2011-06-29 18:03:03 UTC (rev 37952)
@@ -273,7 +273,7 @@
 		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




More information about the Bf-blender-cvs mailing list