Sculpt: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r24257...
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 4 Nov 2009 21:21:30 +0000 (21:21 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 4 Nov 2009 21:21:30 +0000 (21:21 +0000)
1  2 
release/scripts/ui/space_view3d.py
release/scripts/ui/space_view3d_toolbar.py
source/blender/blenkernel/intern/modifier.c

index 2670f6643d3bdab55b95bd382895a8cffded8bb2,1567da12173310dc3d96a4e2b4ef0a342f2e1a56..5d64f9e4779e8610fa940b47465109ac0756a98e
@@@ -4,12 -4,12 +4,12 @@@
  #  modify it under the terms of the GNU General Public License
  #  as published by the Free Software Foundation; either version 2
  #  of the License, or (at your option) any later version.
- # 
+ #
  #  This program is distributed in the hope that it will be useful,
  #  but WITHOUT ANY WARRANTY; without even the implied warranty of
  #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  #  GNU General Public License for more details.
- # 
+ #
  #  You should have received a copy of the GNU General Public License
  #  along with this program; if not, write to the Free Software Foundation,
  #  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
@@@ -90,6 -90,22 +90,22 @@@ class VIEW3D_MT_snap(bpy.types.Menu)
          layout.itemO("view3d.snap_cursor_to_grid", text="Cursor to Grid")
          layout.itemO("view3d.snap_cursor_to_active", text="Cursor to Active")
  
+ class VIEW3D_MT_uv_map(dynamic_menu.DynMenu):
+     bl_label = "UV Mapping"
+     def draw(self, context):
+         layout = self.layout
+         layout.itemO("uv.unwrap")
+         layout.itemO("uv.cube_project")
+         layout.itemO("uv.cylinder_project")
+         layout.itemO("uv.sphere_project")
+         layout.itemO("uv.project_from_view")
+         layout.itemS()
+         layout.itemO("uv.reset")
  # ********** View menus **********
  
  
@@@ -209,9 -225,9 +225,9 @@@ class VIEW3D_MT_select_object(bpy.types
          layout.itemO("object.select_mirror", text="Mirror")
          layout.itemO("object.select_by_layer", text="Select All by Layer")
          layout.item_menu_enumO("object.select_by_type", "type", "", text="Select All by Type...")
-         
          layout.itemS()
-         
          layout.item_menu_enumO("object.select_grouped", "type", text="Grouped")
          layout.item_menu_enumO("object.select_linked", "type", text="Linked")
          layout.itemO("object.select_pattern", text="Select Pattern...")
@@@ -407,7 -423,7 +423,7 @@@ class VIEW3D_MT_select_edit_armature(bp
          layout = self.layout
  
          layout.itemO("view3d.select_border")
-         
  
          layout.itemS()
  
@@@ -463,8 -479,10 +479,10 @@@ class VIEW3D_MT_object(bpy.types.Menu)
          layout.item_booleanO("object.duplicate", "linked", True, text="Duplicate Linked")
          layout.itemO("object.delete", text="Delete...")
          layout.itemO("object.proxy_make", text="Make Proxy...")
+         layout.itemM("VIEW3D_MT_make_links", text="Make Links...")
          layout.item_menu_enumO("object.make_local", "type", text="Make Local...")
          layout.itemM("VIEW3D_MT_make_single_user")
+         layout.itemM("VIEW3D_MT_make_links")
  
          layout.itemS()
  
@@@ -588,6 -606,18 +606,18 @@@ class VIEW3D_MT_make_single_user(bpy.ty
          props = layout.itemO("object.make_single_user", properties=True, text="Animation")
          props.animation = True
  
+ class VIEW3D_MT_make_links(bpy.types.Menu):
+     bl_label = "Make Links"
+     def draw(self, context):
+         layout = self.layout
+         
+         layout.item_menu_enumO("object.make_links_scene", "type", text="Objects to Scene...")
+         layout.items_enumO("object.make_links_data", property="type") # inline
  # ********** Vertex paint menu **********
  
  
@@@ -633,8 -663,7 +663,8 @@@ class VIEW3D_MT_sculpt(bpy.types.Menu)
                  layout.itemR(brush, "use_anchor")
  
              if brush.sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'):
 -                layout.itemR(brush, "flip_direction")
 +                layout.item_enumR(brush, "direction", value="SUBTRACT")
 +                layout.item_enumR(brush, "direction", value="ADD")
  
              if brush.sculpt_tool == 'LAYER':
                  layout.itemR(brush, "use_persistent")
@@@ -832,7 -861,7 +862,7 @@@ class VIEW3D_MT_edit_mesh(bpy.types.Men
  
          layout.itemS()
  
-         layout.itemO("uv.mapping_menu", text="UV Unwrap...")
+         layout.itemM("VIEW3D_MT_uv_map", text="UV Unwrap...")
  
          layout.itemS()
  
@@@ -1359,8 -1388,8 +1389,8 @@@ class VIEW3D_PT_3dview_meshdisplay(bpy.
      bl_label = "Mesh Display"
  
      def poll(self, context):
-         editmesh = context.mode == 'EDIT_MESH'
-         return (editmesh)
+         # The active object check is needed because of localmode
+         return (context.active_object and (context.mode == 'EDIT_MESH'))
  
      def draw(self, context):
          layout = self.layout
@@@ -1585,6 -1614,7 +1615,7 @@@ bpy.types.register(VIEW3D_MT_object_gro
  bpy.types.register(VIEW3D_MT_object_constraints)
  bpy.types.register(VIEW3D_MT_object_showhide)
  bpy.types.register(VIEW3D_MT_make_single_user)
+ bpy.types.register(VIEW3D_MT_make_links)
  
  
  bpy.types.register(VIEW3D_MT_sculpt) # Sculpt Menu
@@@ -1604,6 -1634,7 +1635,7 @@@ bpy.types.register(VIEW3D_MT_pose_const
  bpy.types.register(VIEW3D_MT_pose_showhide)
  
  bpy.types.register(VIEW3D_MT_snap) # Edit Menus
+ bpy.types.register(VIEW3D_MT_uv_map) # Edit Menus
  
  bpy.types.register(VIEW3D_MT_edit_mesh)
  bpy.types.register(VIEW3D_MT_edit_mesh_specials) # Only as a menu for keybindings
index 5b773aac13357345b08a3e2f0ddf64ed01fbac58,12a9417e3194c1c76208348659e8873301eac5c9..0ad694efde11e5704620354361e42fae40a2dbed
@@@ -4,12 -4,12 +4,12 @@@
  #  modify it under the terms of the GNU General Public License
  #  as published by the Free Software Foundation; either version 2
  #  of the License, or (at your option) any later version.
- # 
+ #
  #  This program is distributed in the hope that it will be useful,
  #  but WITHOUT ANY WARRANTY; without even the implied warranty of
  #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  #  GNU General Public License for more details.
- # 
+ #
  #  You should have received a copy of the GNU General Public License
  #  along with this program; if not, write to the Free Software Foundation,
  #  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
@@@ -109,7 -109,8 +109,8 @@@ class VIEW3D_PT_tools_meshedit(View3DPa
  
          col = layout.column(align=True)
          col.itemL(text="UV Mapping:")
-         col.itemO("uv.mapping_menu", text="Unwrap")
+         col.item_stringO("wm.call_menu", "name", "VIEW3D_MT_uv_map", text="Unwrap")
+         
          col.itemO("mesh.uvs_rotate")
          col.itemO("mesh.uvs_mirror")
  
@@@ -133,10 -134,12 +134,12 @@@ class VIEW3D_PT_tools_meshedit_options(
      def draw(self, context):
          layout = self.layout
  
-         mesh = context.active_object.data
+         ob = context.active_object
  
-         col = layout.column(align=True)
-         col.itemR(mesh, "use_mirror_x")
+         if ob:
+             mesh = context.active_object.data
+             col = layout.column(align=True)
+             col.itemR(mesh, "use_mirror_x")
  
  # ********** default tools for editmode_curve ****************
  
@@@ -521,7 -524,7 +524,7 @@@ class VIEW3D_PT_tools_brush(PaintPanel)
                      col.row().itemR(brush, "direction", expand=True)
  
                  if brush.sculpt_tool == 'LAYER':
-                     col.itemR(brush, "persistent")
+                     col.itemR(brush, "use_persistent")
                      col.itemO("sculpt.set_persistent_base")
  
          # Texture Paint Mode #
@@@ -663,6 -666,7 +666,6 @@@ class VIEW3D_PT_sculpt_options(PaintPan
          sculpt = context.tool_settings.sculpt
  
          col = layout.column()
 -        col.itemR(sculpt, "partial_redraw", text="Partial Refresh")
          col.itemR(sculpt, "show_brush")
  
          split = self.layout.split()
index 639797564cc2805cc8eedc8fa939cb4908157adc,3c52dc0af84a63ff792b81f65562b569f41a137f..1193e8247bed014484ce2b1d657e8924517472b1
@@@ -3577,10 -3577,11 +3577,11 @@@ static void get_texture_coords(Displace
  {
        int i;
        int texmapping = dmd->texmapping;
+       float mapob_imat[4][4];
  
        if(texmapping == MOD_DISP_MAP_OBJECT) {
                if(dmd->map_object)
-                       Mat4Invert(dmd->map_object->imat, dmd->map_object->obmat);
+                       Mat4Invert(mapob_imat, dmd->map_object->obmat);
                else /* if there is no map object, default to local */
                        texmapping = MOD_DISP_MAP_LOCAL;
        }
                        case MOD_DISP_MAP_OBJECT:
                                VECCOPY(*texco, *co);
                                Mat4MulVecfl(ob->obmat, *texco);
-                               Mat4MulVecfl(dmd->map_object->imat, *texco);
+                               Mat4MulVecfl(mapob_imat, *texco);
                                break;
                }
        }
@@@ -5695,7 -5696,7 +5696,7 @@@ static void hookModifier_deformVerts
                                /* if DerivedMesh is present and has original index data,
                                * use it
                                */
 -                              if(dm && dm->getVertData(dm, 0, CD_ORIGINDEX)) {
 +                              if(dm && dm->getVertDataArray(dm, CD_ORIGINDEX)) {
                                        int j;
                                        int orig_index;
                                        for(j = 0; j < numVerts; ++j) {