remove -Wnested-externs warning for CMake/unix, since this is used a lot, if we want...
authorCampbell Barton <ideasman42@gmail.com>
Sat, 22 Aug 2009 05:46:03 +0000 (05:46 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 22 Aug 2009 05:46:03 +0000 (05:46 +0000)
fix view3d python errors with no object/edit object.

CMakeLists.txt
release/ui/space_view3d.py

index 749284def285c9e14ee400a25010089f9783d062..8ef4296e2667c10d44c9bcb0f379853c8459c6c8 100644 (file)
@@ -72,6 +72,7 @@ OPTION(WITH_FFTW3         "Enable FFTW3 support" OFF)
 OPTION(WITH_JACK          "Enable Jack Support (http://www.jackaudio.org)" OFF)
 OPTION(WITH_SNDFILE       "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF)
 OPTION(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation" OFF)
+# OPTION(WITH_BUILDINFO     "Include extra build details" ON)
 OPTION(WITH_INSTALL       "Install accompanying scripts and language files needed to run blender" ON)
 
 IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
@@ -212,7 +213,7 @@ IF(UNIX AND NOT APPLE)
   SET(PLATFORM_LINKFLAGS "-pthread")
 
   # Better warnings
-  SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wnested-externs -Wdeclaration-after-statement")
+  SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wdeclaration-after-statement")
   SET(CXX_WARNINGS "-Wall -Wno-invalid-offsetof -Wno-sign-compare")
 
   INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
@@ -511,6 +512,17 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
   SET(BINRELOC_INC ${BINRELOC}/include)
 ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
 
+
+# TODO - buildinfo
+# IF(UNIX)
+#   IF(WITH_BUILDINFO)
+#     EXEC_PROGRAM("date \"+%Y-%m-%d\"" OUTPUT_VARIABLE BUILD_DATE)
+#     EXEC_PROGRAM("date \"+%H:%M:%S\"" OUTPUT_VARIABLE BUILD_TIME)  
+#     EXEC_PROGRAM("svnversion ${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE BUILD_REV)
+#     SET(BUILD_TYPE ${CMAKE_BUILD_TYPE})
+#   ENDIF(WITH_BUILDINFO)
+# ENDIF(UNIX)
+
 #-----------------------------------------------------------------------------
 # Common.
 
index ae04c8875ce3d032d5efa39ee721093be98e5cf9..f9e185f44f22b97651a65ccb3a7ec47bf3bcefac 100644 (file)
@@ -27,15 +27,18 @@ class VIEW3D_HT_header(bpy.types.Header):
                        if mode_string not in ('EDIT_TEXT', 'SCULPT', 'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE', 'PARTICLE'):
                                # XXX: Particle Mode has Select Menu.
                                sub.itemM("VIEW3D_MT_select_%s" % mode_string)
-                               
-                       if object.mode == 'OBJECT':
-                               sub.itemM("VIEW3D_MT_object")
-                       elif object.mode == 'SCULPT':
-                               sub.itemM("VIEW3D_MT_sculpt")
-                       elif object.mode == 'VERTEX_PAINT':
-                               sub.itemM("VIEW3D_MT_vertex_paint")
-                       elif object.mode:
+                       
+                       if edit_object:
                                sub.itemM("VIEW3D_MT_edit_%s" % edit_object.type)
+                       elif object:
+                               ob_mode_string = object.mode
+                               
+                               if ob_mode_string == 'OBJECT':
+                                       sub.itemM("VIEW3D_MT_object")
+                               elif ob_mode_string == 'SCULPT':
+                                       sub.itemM("VIEW3D_MT_sculpt")
+                               elif ob_mode_string == 'VERTEX_PAINT':
+                                       sub.itemM("VIEW3D_MT_vertex_paint")
 
                layout.template_header_3D()