Logging: log warnings which had been disabled since 2.4x
authorCampbell Barton <ideasman42@gmail.com>
Thu, 16 Apr 2020 00:46:08 +0000 (10:46 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 16 Apr 2020 00:59:41 +0000 (10:59 +1000)
source/blender/editors/object/CMakeLists.txt
source/blender/editors/object/object_edit.c

index c2c25e479082a8e2313376f9e48df0d9c2f4dee8..de9cc72dfa4c02075c2ee17437147933546eae72 100644 (file)
@@ -34,6 +34,7 @@ set(INC
   ../../shader_fx
   ../../render/extern/include
   ../../windowmanager
+  ../../../../intern/clog
   ../../../../intern/glew-mx
   ../../../../intern/guardedalloc
 )
index 5506895613b582c64626ac7fa48ab9ad792b50c4..871886da4eb8678885993880ea5346a49a1672c6 100644 (file)
 #include "RNA_define.h"
 #include "RNA_enum_types.h"
 
+#include "CLG_log.h"
+
 /* for menu/popup icons etc etc*/
 
 #include "UI_interface.h"
 
 #include "object_intern.h"  // own include
 
+static CLG_LogRef LOG = {"ed.object.edit"};
+
 /* prototypes */
 typedef struct MoveToCollectionData MoveToCollectionData;
 static void move_to_collection_menus_items(struct uiLayout *layout,
                                            struct MoveToCollectionData *menu);
 static ListBase selected_objects_get(bContext *C);
 
-/* ************* XXX **************** */
-static void error(const char *UNUSED(arg))
-{
-}
-
-/* port over here */
-static void error_libdata(void)
-{
-}
-
 Object *ED_object_context(bContext *C)
 {
   return CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
@@ -441,7 +435,11 @@ static bool ED_object_editmode_load_ex(Main *bmain, Object *obedit, const bool f
     }
 
     if (me->edit_mesh->bm->totvert > MESH_MAX_VERTS) {
-      error("Too many vertices");
+      /* This used to be warned int the UI, we could warn again although it's quite rare. */
+      CLOG_WARN(&LOG,
+                "Too many vertices for mesh '%s' (%d)",
+                me->id.name + 2,
+                me->edit_mesh->bm->totvert);
       return false;
     }
 
@@ -600,7 +598,8 @@ bool ED_object_editmode_enter_ex(Main *bmain, Scene *scene, Object *ob, int flag
   }
 
   if (BKE_object_obdata_is_libdata(ob)) {
-    error_libdata();
+    /* Ideally the caller should check this. */
+    CLOG_WARN(&LOG, "Unable to enter edit-mode on library data for object '%s'", ob->id.name + 2);
     return false;
   }