Merged 38822-39182
[blender.git] / source / blender / editors / space_view3d / view3d_header.c
index ae80a55..993c28f 100644 (file)
@@ -280,7 +280,8 @@ static char *view3d_modeselect_pup(Scene *scene)
        
        str += sprintf(str, formatstr, "Object Mode", OB_MODE_OBJECT, ICON_OBJECT_DATA);
        
-       if(ob==NULL) return string;
+       if(ob==NULL || ob->data==NULL) return string;
+       if(ob->id.lib || ((ID *)ob->data)->lib) return string;
        
        /* if active object is editable */
        if ( ((ob->type == OB_MESH)
@@ -495,9 +496,15 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
                /* Manipulators aren't used in weight paint mode */
                
                PointerRNA meshptr;
-
                RNA_pointer_create(&ob->id, &RNA_Mesh, ob->data, &meshptr);
-               uiItemR(layout, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+               if(ob->mode & (OB_MODE_TEXTURE_PAINT|OB_MODE_VERTEX_PAINT)) {
+                       uiItemR(layout, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+               } else {
+                       // Jason
+                       row= uiLayoutRow(layout, 1);
+                       uiItemR(row, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+                       uiItemR(row, &meshptr, "wp_vert_sel", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+               }
        } else {
                const char *str_menu;