Cycles: svn merge -r40358:40411 ^/trunk/blender
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 20 Sep 2011 18:48:28 +0000 (18:48 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 20 Sep 2011 18:48:28 +0000 (18:48 +0000)
53 files changed:
1  2 
release/scripts/startup/bl_ui/properties_data_camera.py
release/scripts/startup/bl_ui/properties_data_modifier.py
release/scripts/startup/bl_ui/properties_particle.py
release/scripts/startup/bl_ui/properties_physics_field.py
release/scripts/startup/bl_ui/properties_texture.py
release/scripts/startup/bl_ui/space_node.py
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/include/UI_interface.h
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_panel.c
source/blender/editors/interface/interface_style.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/mesh/mesh_data.c
source/blender/editors/screen/area.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/space_buttons/CMakeLists.txt
source/blender/editors/space_image/space_image.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_draw.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/node_header.c
source/blender/editors/space_node/node_select.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_toolbar.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/gpu/GPU_material.h
source/blender/gpu/intern/gpu_draw.c
source/blender/gpu/intern/gpu_material.c
source/blender/makesdna/DNA_object_types.h
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_material.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_scene.c
source/blender/python/intern/CMakeLists.txt
source/blender/python/intern/bpy_interface.c
source/blender/render/intern/source/render_texture.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_init_exit.c
source/creator/CMakeLists.txt
source/gameengine/Ketsji/BL_BlenderShader.cpp
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp

index 7787773177762d79f0bd39dab662058e478c7274,0d79ec99789234a096611a064bf663e18684efc3..1b135631f3efa020b5b61ca984f8cbc1da9bf9ed
@@@ -96,27 -96,22 +96,27 @@@ class DATA_PT_camera(CameraButtonsPanel
          col.prop(cam, "shift_y", text="Y")
  
          col = split.column(align=True)
-         col.label(text="Clipping:")
-         col.prop(cam, "clip_start", text="Start")
-         col.prop(cam, "clip_end", text="End")
+         col.label(text=_("Clipping:"))
+         col.prop(cam, "clip_start", text=_("Start"))
+         col.prop(cam, "clip_end", text=_("End"))
  
 -        layout.label(text=_("Depth of Field:"))
 +class DATA_PT_camera_dof(CameraButtonsPanel, Panel):
 +    bl_label = "Depth of Field"
 +    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 +
 +    def draw(self, context):
 +        layout = self.layout
 +
 +        cam = context.camera
  
          split = layout.split()
          split.prop(cam, "dof_object", text="")
  
          col = split.column()
  
 -        if cam.dof_object is not None:
 -            col.enabled = False
 +        col.active = cam.dof_object is None
-         col.prop(cam, "dof_distance", text="Distance")
+         col.prop(cam, "dof_distance", text=_("Distance"))
  
 -
  class DATA_PT_camera_display(CameraButtonsPanel, Panel):
      bl_label = "Display"
      COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
index 67748a39120771c5d61355653689d83cfaf8e82a,3232441166984d2488ed50478e99a84fe7a362da..168a484add2a221ba662bb983ab0b407c4e099b7
@@@ -668,11 -668,11 +668,11 @@@ class DATA_PT_modifiers(ModifierButtons
          # 2 new columns
          split = layout.split()
          col = split.column()
-         col.label(text="Texture:")
+         col.label(text=_("Texture:"))
 -        col.prop(md, "texture", text="")
 +        col.template_ID(md, "texture", new="texture.new")
  
          col = split.column()
-         col.label(text="Texture Coordinates:")
+         col.label(text=_("Texture Coordinates:"))
          col.prop(md, "texture_coords", text="")
  
          if md.texture_coords == 'OBJECT':
index aa0ff4c6c669bcbacb8b13e10d10bc7246d5d386,937df5c0ad953d12f0ddfad7f8dfb02e8ccb4502..d698674fd0add6d8b5825e6d1cea2ba79f34b7c8
@@@ -60,12 -60,8 +60,12 @@@ class PHYSICS_PT_field(PhysicButtonsPan
  
          if field.type not in {'NONE', 'GUIDE', 'TEXTURE'}:
              split = layout.split(percentage=0.2)
-             split.label(text="Shape:")
+             split.label(text=_("Shape:"))
              split.prop(field, "shape", text="")
 +        elif field.type == 'TEXTURE':
 +            split = layout.split(percentage=0.2)
 +            split.label(text="Texture:")
 +            split.row().template_ID(field, "texture", new="texture.new")
  
          split = layout.split()
  
index 30be7b2b4235c94507d870533bcd311bdd95b90f,2e86e875bab8c161051d24fa20742c22fa6e6ccf..658289c7f7b10fee689b9c3d054f7cdaa7f9f2aa
@@@ -2174,15 -2175,16 +2176,15 @@@ class VIEW3D_PT_view3d_display(Panel)
  
          sub = col.column(align=True)
          sub.active = (display_all and view.show_floor)
-         sub.prop(view, "grid_lines", text="Lines")
-         sub.prop(view, "grid_scale", text="Scale")
+         sub.prop(view, "grid_lines", text=_("Lines"))
+         sub.prop(view, "grid_scale", text=_("Scale"))
          subsub = sub.column(align=True)
          subsub.active = scene.unit_settings.system == 'NONE'
-         subsub.prop(view, "grid_subdivisions", text="Subdivisions")
+         subsub.prop(view, "grid_subdivisions", text=_("Subdivisions"))
  
          col = layout.column()
-         col.label(text="Shading:")
+         col.label(text=_("Shading:"))
          col.prop(gs, "material_mode", text="")
 -        col.prop(view, "show_textured_solid")
  
          layout.separator()
  
index abe4e7a3edba732cd7a032b477902104c3995d86,c736270533e3d1773e2fd8b8a0a629d13a74cb70..d6fa12cfaa0e89bfa410f006ca1be0a53f547630
@@@ -7133,20 -7036,33 +7137,41 @@@ static void do_versions_nodetree_clear_
  static void do_versions_nodetree_dynamic_sockets(bNodeTree *ntree)
  {
        bNodeSocket *sock;
 -      for (sock=ntree->inputs.first; sock; sock=sock->next)
 -              sock->flag |= SOCK_DYNAMIC;
 -      for (sock=ntree->outputs.first; sock; sock=sock->next)
 -              sock->flag |= SOCK_DYNAMIC;
 +      for (sock=ntree->inputs.first; sock; sock=sock->next) {
 +              if(sock->flag & SOCK_DYNAMIC)
 +                      sock->flag |= SOCK_COLLAPSED;
 +              else
 +                      sock->flag |= SOCK_DYNAMIC;
 +      }
 +      for (sock=ntree->outputs.first; sock; sock=sock->next) {
 +              if(sock->flag & SOCK_DYNAMIC)
 +                      sock->flag |= SOCK_COLLAPSED;
 +              else
 +                      sock->flag |= SOCK_DYNAMIC;
 +      }
  }
  
+ void convert_tface_mt(FileData *fd, Main *main)
+ {
+       Main *gmain;
+       /* this is a delayed do_version (so it can create new materials) */
+       if (main->versionfile < 259 || (main->versionfile == 259 && main->subversionfile < 3)) {
+               //XXX hack, material.c uses G.main all over the place, instead of main
+               // temporarily set G.main to the current main
+               gmain = G.main;
+               G.main = main;
+               if(!(do_version_tface(main, 1))) {
+                       BKE_report(fd->reports, RPT_ERROR, "Texface conversion problem. Error in console");
+               }
+               //XXX hack, material.c uses G.main allover the place, instead of main
+               G.main = gmain;
+       }
+ }
  static void do_versions(FileData *fd, Library *lib, Main *main)
  {
        /* WATCH IT!!!: pointers from libdata have not been converted */
index b6b9d382eea6d7d1124d5817024092d908bca545,af515bf80618b7ddd2267b6496ec2b80121f26a9..3a3ea4cf0eb5021e30861a0e5912fea17b597c38
@@@ -306,34 -307,34 +307,34 @@@ static const char *template_id_browse_t
  {
        if(type) {
                switch(RNA_type_to_ID_code(type)) {
-                       case ID_SCE: return "Browse Scene to be linked";
-                       case ID_OB: return "Browse Object to be linked";
-                       case ID_ME: return "Browse Mesh Data to be linked";
-                       case ID_CU: return "Browse Curve Data to be linked";
-                       case ID_MB: return "Browse MetaBall Data to be linked";
-                       case ID_MA: return "Browse Material to be linked";
-                       case ID_TE: return "Browse Texture to be linked";
-                       case ID_IM: return "Browse Image to be linked";
-                       case ID_LT: return "Browse Lattice Data to be linked";
-                       case ID_LA: return "Browse Lamp Data to be linked";
-                       case ID_CA: return "Browse Camera Data to be linked";
-                       case ID_WO: return "Browse World Settings to be linked";
-                       case ID_SCR: return "Choose Screen lay-out";
-                       case ID_TXT: return "Browse Text to be linked";
-                       case ID_SPK: return "Browse Speaker Data to be linked";
-                       case ID_SO: return "Browse Sound to be linked";
-                       case ID_AR: return "Browse Armature data to be linked";
-                       case ID_AC: return "Browse Action to be linked";
-                       case ID_NT: return "Browse Node Tree to be linked";
-                       case ID_BR: return "Browse Brush to be linked";
-                       case ID_PA: return "Browse Particle System to be linked";
-                       case ID_GD: return "Browse Grease Pencil Data to be linked";
+                       case ID_SCE: return N_("Browse Scene to be linked");
+                       case ID_OB: return N_("Browse Object to be linked");
+                       case ID_ME: return N_("Browse Mesh Data to be linked");
+                       case ID_CU: return N_("Browse Curve Data to be linked");
+                       case ID_MB: return N_("Browse MetaBall Data to be linked");
+                       case ID_MA: return N_("Browse Material to be linked");
+                       case ID_TE: return N_("Browse Texture to be linked");
+                       case ID_IM: return N_("Browse Image to be linked");
+                       case ID_LT: return N_("Browse Lattice Data to be linked");
+                       case ID_LA: return N_("Browse Lamp Data to be linked");
+                       case ID_CA: return N_("Browse Camera Data to be linked");
+                       case ID_WO: return N_("Browse World Settings to be linked");
+                       case ID_SCR: return N_("Choose Screen lay-out");
+                       case ID_TXT: return N_("Browse Text to be linked");
+                       case ID_SPK: return N_("Browse Speaker Data to be linked");
+                       case ID_SO: return N_("Browse Sound to be linked");
+                       case ID_AR: return N_("Browse Armature data to be linked");
+                       case ID_AC: return N_("Browse Action to be linked");
+                       case ID_NT: return N_("Browse Node Tree to be linked");
+                       case ID_BR: return N_("Browse Brush to be linked");
+                       case ID_PA: return N_("Browse Particle System to be linked");
+                       case ID_GD: return N_("Browse Grease Pencil Data to be linked");
                }
        }
-       return "Browse ID data to be linked";
+       return N_("Browse ID data to be linked");
  }
  
 -static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, StructRNA *type, int flag, const char *newop, const char *openop, const char *unlinkop)
 +static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, StructRNA *type, short idcode, int flag, const char *newop, const char *openop, const char *unlinkop)
  {
        uiBut *but;
        uiBlock *block;
index 6a803214d06ceb1b701562edffb4bda5a4351952,8951df9221e12b75a20144dced2f8413591b8cc7..dd577e3fb2daff0e6869a22b944815dce7fcdb69
@@@ -1340,15 -1449,28 +1343,15 @@@ int ED_area_header_standardbuttons(cons
  
  /************************ standard UI regions ************************/
  
 -void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *context, int contextnr)
 +static void region_panels_layout(const bContext *C, ARegion *ar, int vertical, const char *context, int w, int em, int *r_x, int *r_y)
  {
        ScrArea *sa= CTX_wm_area(C);
+       uiStyle *style= UI_GetStyle();
+       uiBlock *block;
        PanelType *pt;
        Panel *panel;
-       uiBlock *block;
-       uiStyle *style= U.uistyles.first;
 -      View2D *v2d= &ar->v2d;
 -      View2DScrollers *scrollers;
 -      int xco, yco, x, y, miny=0, w, em, header, triangle, open, newcontext= 0;
 -
 -      if(contextnr >= 0)
 -              newcontext= UI_view2d_tab_set(v2d, contextnr);
 -
 -      if(vertical) {
 -              w= v2d->cur.xmax - v2d->cur.xmin;
 -              em= (ar->type->prefsizex)? UI_UNIT_Y/2: UI_UNIT_Y;
 -      }
 -      else {
 -              w= UI_PANEL_WIDTH;
 -              em= (ar->type->prefsizex)? UI_UNIT_Y/2: UI_UNIT_Y;
 -      }
 +      int x, y, miny=0, xco, yco;
 +      int open, header, triangle;
  
        x= 0;
        y= -style->panelouter;
index 3df6e9167ef140055632ebffad0d9b13515536f1,e345caf1359e73ca38d427af59f6eb08070e3bd2..f0709e056ecd3040c53b5fd546039d0097bb3d14
@@@ -592,31 -588,19 +592,31 @@@ static void image_refresh(const bContex
        else if(obedit && obedit->type == OB_MESH) {
                Mesh *me= (Mesh*)obedit->data;
                EditMesh *em= BKE_mesh_get_editmesh(me);
 -              MTFace *tf;
 -              
 -              if(em && EM_texFaceCheck(em)) {
 -                      sima->image= NULL;
 -                      
 -                      tf = EM_get_active_mtface(em, NULL, NULL, 1); /* partially selected face is ok */
 +              int sloppy= 1; /* partially selected face is ok */
 +
 +              if(scene_use_new_shading_system(scene)) {
 +                      /* new shading system, get image from material */
 +                      EditFace *efa= EM_get_actFace(em, sloppy);
 +
 +                      if(efa)
 +                              ED_object_get_active_image(obedit, efa->mat_nr, &sima->image, NULL);
 +              }
 +              else {
 +                      /* old shading system, we set texface */
 +                      MTFace *tf;
                        
 -                      if(tf) {
 -                              /* don't need to check for pin here, see above */
 -                              sima->image= tf->tpage;
 +                      if(em && EM_texFaceCheck(em)) {
 +                              sima->image= NULL;
 +                              
 +                              tf = EM_get_active_mtface(em, NULL, NULL, sloppy);
                                
-                               if(tf && (tf->mode & TF_TEX)) {
 -                              if(sima->flag & SI_EDITTILE);
 -                              else sima->curtile= tf->tile;
++                              if(tf) {
 +                                      /* don't need to check for pin here, see above */
 +                                      sima->image= tf->tpage;
 +                                      
 +                                      if(sima->flag & SI_EDITTILE);
 +                                      else sima->curtile= tf->tile;
 +                              }
                        }
                }
  
index 45671b85d896d7b7570ecde961ad43b99ff339ec,996e05afdefe86d33cb1d261a58f74bf79478128..c51eec4085db9a526e82878c63b514ac6823cb83
  #include "BLI_blenlib.h"
  #include "BLI_utildefines.h"
  
+ #include "BLF_translation.h"
  #include "BKE_context.h"
  #include "BKE_global.h"
 -#include "BKE_screen.h"
 -#include "BKE_node.h"
  #include "BKE_main.h"
 +#include "BKE_node.h"
 +#include "BKE_scene.h"
 +#include "BKE_screen.h"
  
  #include "RNA_access.h"
  
@@@ -217,9 -218,9 +219,10 @@@ static void node_add_menu(bContext *C, 
        }
  }
  
+ #define IFACE_(msgid) UI_translate_do_iface(msgid)
  static void node_menu_add(const bContext *C, Menu *menu)
  {
 +      Scene *scene= CTX_data_scene(C);
        SpaceNode *snode= CTX_wm_space_node(C);
        uiLayout *layout= menu->layout;
  
                uiLayoutSetActive(layout, 0);
  
        if(snode->treetype==NTREE_SHADER) {
-               uiItemMenuF(layout, "Input", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT));
-               uiItemMenuF(layout, "Output", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT));
+               uiItemMenuF(layout, IFACE_(N_("Input")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT));
+               uiItemMenuF(layout, IFACE_(N_("Output")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT));
 +              if(scene_use_new_shading_system(scene)) {
-                       uiItemMenuF(layout, "Shader", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_SHADER));
-                       uiItemMenuF(layout, "Texture", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_TEXTURE));
++                      uiItemMenuF(layout, IFACE_(N_("Shader")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_SHADER));
++                      uiItemMenuF(layout, IFACE_(N_("Texture")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_TEXTURE));
 +              }
-               uiItemMenuF(layout, "Color", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR));
-               uiItemMenuF(layout, "Vector", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_VECTOR));
-               uiItemMenuF(layout, "Convertor", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR));
-               uiItemMenuF(layout, "Group", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP));
-               //uiItemMenuF(layout, "Dynamic", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_DYNAMIC));
-               uiItemMenuF(layout, "Layout", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT));
+               uiItemMenuF(layout, IFACE_(N_("Color")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR));
+               uiItemMenuF(layout, IFACE_(N_("Vector")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_VECTOR));
+               uiItemMenuF(layout, IFACE_(N_("Convertor")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR));
+               uiItemMenuF(layout, IFACE_(N_("Group")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP));
 -              uiItemMenuF(layout, IFACE_(N_("Dynamic")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_DYNAMIC));
++              //uiItemMenuF(layout, IFACE_(N_("Dynamic")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_DYNAMIC));
+               uiItemMenuF(layout, IFACE_(N_("Layout")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT));
        }
        else if(snode->treetype==NTREE_COMPOSIT) {
-               uiItemMenuF(layout, "Input", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT));
-               uiItemMenuF(layout, "Output", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT));
-               uiItemMenuF(layout, "Color", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR));
-               uiItemMenuF(layout, "Vector", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_VECTOR));
-               uiItemMenuF(layout, "Filter", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_FILTER));
-               uiItemMenuF(layout, "Convertor", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR));
-               uiItemMenuF(layout, "Matte", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_MATTE));
-               uiItemMenuF(layout, "Distort", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_DISTORT));
-               uiItemMenuF(layout, "Group", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP));
-               uiItemMenuF(layout, "Layout", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT));
+               uiItemMenuF(layout, IFACE_(N_("Input")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT));
+               uiItemMenuF(layout, IFACE_(N_("Output")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT));
+               uiItemMenuF(layout, IFACE_(N_("Color")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR));
+               uiItemMenuF(layout, IFACE_(N_("Vector")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_VECTOR));
+               uiItemMenuF(layout, IFACE_(N_("Filter")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_FILTER));
+               uiItemMenuF(layout, IFACE_(N_("Convertor")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR));
+               uiItemMenuF(layout, IFACE_(N_("Matte")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_MATTE));
+               uiItemMenuF(layout, IFACE_(N_("Distort")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_DISTORT));
+               uiItemMenuF(layout, IFACE_(N_("Group")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP));
+               uiItemMenuF(layout, IFACE_(N_("Layout")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT));
        }
        else if(snode->treetype==NTREE_TEXTURE) {
-               uiItemMenuF(layout, "Input", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT));
-               uiItemMenuF(layout, "Output", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT));
-               uiItemMenuF(layout, "Color", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR));
-               uiItemMenuF(layout, "Patterns", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_PATTERN));
-               uiItemMenuF(layout, "Textures", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_TEXTURE));
-               uiItemMenuF(layout, "Convertor", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR));
-               uiItemMenuF(layout, "Distort", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_DISTORT));
-               uiItemMenuF(layout, "Group", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP));
-               uiItemMenuF(layout, "Layout", 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT));
+               uiItemMenuF(layout, IFACE_(N_("Input")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT));
+               uiItemMenuF(layout, IFACE_(N_("Output")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT));
+               uiItemMenuF(layout, IFACE_(N_("Color")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR));
+               uiItemMenuF(layout, IFACE_(N_("Patterns")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_PATTERN));
+               uiItemMenuF(layout, IFACE_(N_("Textures")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_TEXTURE));
+               uiItemMenuF(layout, IFACE_(N_("Convertor")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR));
+               uiItemMenuF(layout, IFACE_(N_("Distort")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_DISTORT));
+               uiItemMenuF(layout, IFACE_(N_("Group")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP));
+               uiItemMenuF(layout, IFACE_(N_("Layout")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT));
        }
  }
+ #undef IFACE_
  
  void node_menus_register(void)
  {
index 307e794a5e8efdced41540ac10601563cc664211,b6e76885719b0a95475159189044b205d1a3d8f5..c8c4e6b0a370d6275ddc0942eff4a99a225c1448
  #include "GPU_buffers.h"
  #include "GPU_extensions.h"
  #include "GPU_draw.h"
+ #include "GPU_material.h"
  
  #include "ED_mesh.h"
 +#include "ED_uvedit.h"
  
  #include "view3d_intern.h"    // own include
  
index 74cf97151b45c483abb33c7a45193d7d8c6f4617,61b3a9ca1ca1a07e0b2d1faf155baf7a1dfe4105..17f9382b083407cc588c612a5b85170b39c398f0
@@@ -153,49 -111,35 +153,46 @@@ void ED_uvedit_assign_image(Main *bmain
                BKE_mesh_end_editmesh(obedit->data, em);
                return;
        }
 -      
 -      /* ensure we have a uv layer */
 -      if(!CustomData_has_layer(&em->fdata, CD_MTFACE)) {
 -              EM_add_data_layer(em, &em->fdata, CD_MTFACE, NULL);
 -              update= 1;
 -      }
  
 -      /* now assign to all visible faces */
 -      for(efa= em->faces.first; efa; efa= efa->next) {
 -              tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
 +      if(scene_use_new_shading_system(scene)) {
 +              /* new shading system, assign image in material */
 +              int sloppy= 1;
 +              EditFace *efa= EM_get_actFace(em, sloppy);
  
 -              if(uvedit_face_visible(scene, previma, efa, tf)) {
 -                      if(ima) {
 -                              tf->tpage= ima;
 -                              
 -                              if(ima->id.us==0) id_us_plus(&ima->id);
 -                              else id_lib_extern(&ima->id);
 -                      }
 -                      else {
 -                              tf->tpage= NULL;
 -                      }
 +              if(efa)
 +                      ED_object_assign_active_image(bmain, obedit, efa->mat_nr, ima);
 +      }
 +      else {
 +              /* old shading system, assign image to selected faces */
 +              
 +              /* ensure we have a uv layer */
 +              if(!CustomData_has_layer(&em->fdata, CD_MTFACE)) {
 +                      EM_add_data_layer(em, &em->fdata, CD_MTFACE, NULL);
 +                      update= 1;
 +              }
  
 -                      update = 1;
 +              /* now assign to all visible faces */
 +              for(efa= em->faces.first; efa; efa= efa->next) {
 +                      tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
 +
 +                      if(uvedit_face_visible(scene, previma, efa, tf)) {
 +                              if(ima) {
 +                                      tf->tpage= ima;
-                                       tf->mode |= TF_TEX;
 +                                      
 +                                      if(ima->id.us==0) id_us_plus(&ima->id);
 +                                      else id_lib_extern(&ima->id);
 +                              }
-                               else {
++                              else
 +                                      tf->tpage= NULL;
-                                       tf->mode &= ~TF_TEX;
-                               }
 +
 +                              update = 1;
 +                      }
                }
 -      }
  
 -      /* and update depdency graph */
 -      if(update)
 -              DAG_id_tag_update(obedit->data, 0);
 +              /* and update depdency graph */
 +              if(update)
 +                      DAG_id_tag_update(obedit->data, 0);
 +      }
  
        BKE_mesh_end_editmesh(obedit->data, em);
  }
index 1704a4d0c925286d791fa218e537c2e8ef6d2524,29ad9c9137406a012e7a63ec51700ca71aeda26b..6d34b5f5fabb5c22382f91785497cdf85459f206
@@@ -120,9 -121,8 +121,9 @@@ int GPU_link(GPUMaterial *mat, const ch
  int GPU_stack_link(GPUMaterial *mat, const char *name, GPUNodeStack *in, GPUNodeStack *out, ...);
  
  void GPU_material_output_link(GPUMaterial *material, GPUNodeLink *link);
 +int GPU_material_drawtype(GPUMaterial *material);
  void GPU_material_enable_alpha(GPUMaterial *material);
- GPUBlendMode GPU_material_blend_mode(GPUMaterial *material, float obcol[4]);
+ GPUBlendMode GPU_material_alpha_blend(GPUMaterial *material, float obcol[4]);
  
  /* High level functions to create and use GPU materials */
  
index 5bcf6877b33c9ec2a8c047003ed25bafc17a0881,4f79d577ae5a666d1552352d0c0c397f321073cf..4219183b318b6acadc14281d4fb6f2647861d38f
@@@ -1043,10 -1041,10 +1043,10 @@@ void GPU_begin_object_materials(View3D 
  
                if(glsl) {
                        GMS.gmatbuf[0]= &defmaterial;
 -                      GPU_material_from_blender(GMS.gscene, &defmaterial);
 +                      GPU_material_from_blender(GMS.gscene, &defmaterial, GMS.gdrawtype);
                }
  
-               GMS.blendmode[0]= GPU_BLEND_SOLID;
+               GMS.alphablend[0]= GPU_BLEND_SOLID;
        }
        
        /* setup materials */
Simple merge
Simple merge