Merged 38822-39182
[blender.git] / source / blender / editors / space_view3d / view3d_header.c
index 75c8d5c..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;
 
@@ -505,17 +512,6 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
                uiItemR(row, &v3dptr, "pivot_point", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
                uiItemR(row, &v3dptr, "use_pivot_point_align", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
 
-               /* NDOF */
-               /* Not implemented yet
-               if (G.ndofdevice ==0 ) {
-                       uiDefIconTextButC(block, ICONTEXTROW,B_NDOF, ICON_NDOF_TURN, ndof_pup(), 0,0,UI_UNIT_X+10,UI_UNIT_Y, &(v3d->ndofmode), 0, 3.0, 0, 0, "Ndof mode");
-
-                       uiDefIconButC(block, TOG, B_NDOF,  ICON_NDOF_DOM,
-                                       0,0,UI_UNIT_X,UI_UNIT_Y,
-                                       &v3d->ndoffilter, 0, 1, 0, 0, "dominant axis");
-               }
-                */
-
                /* Transform widget / manipulators */
                row= uiLayoutRow(layout, 1);
                uiItemR(row, &v3dptr, "show_manipulator", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);