Fix for bl_info blender versions, many addons used (2, 6, x) instead of (2, 6x, x...
authorCoDEmanX <codemanx@gmx.de>
Tue, 19 Nov 2013 14:53:20 +0000 (15:53 +0100)
committerCoDEmanX <codemanx@gmx.de>
Tue, 19 Nov 2013 14:53:20 +0000 (15:53 +0100)
22 files changed:
chromoly_ruler/__init__.py
ewoc_projects_tools/__init__.py
ewoc_projects_tools/mesh_deathguppie.py
ewoc_projects_tools/mesh_edgegrow.py
ewoc_projects_tools/mesh_edgetune.py
ewoc_projects_tools/mesh_fanconnect.py
ewoc_projects_tools/mesh_floodsel.py
ewoc_projects_tools/mesh_innerweld.py
ewoc_projects_tools/mesh_laprelax.py
ewoc_projects_tools/mesh_paredge.py
ewoc_projects_tools/mesh_quadder.py
ewoc_projects_tools/mesh_selproject.py
ewoc_projects_tools/mesh_straightenplus.py
ewoc_projects_tools/object_decouple.py
ewoc_projects_tools/object_fastorigin.py
ewoc_projects_tools/object_keeptrans.py
io_import_BrushSet.py
object_booleans.py
oscurart_mesh_cache_tools.py
oscurart_worn_edges_map.py
scene_amaranth_toolset.py
space_view3d_paint_bprojection.py

index de8478d..40b9d3f 100644 (file)
@@ -21,7 +21,8 @@
 bl_info = {
        'name': 'Ruler',
        'author': 'chromoly - adapted for 2.63 by Gert De Roost',
-       'version': (2, 3, 0),   'blender': (2, 6, 3),
+       'version': (2, 3, 0),
+       'blender': (2, 63, 0),
        'location': 'View3D > Properties > Ruler',
        'category': '3D View'}
 
@@ -55,7 +56,7 @@ from .va.view import check_view, check_view_context, \
 from .va.utils import get_matrix_element_square
 from .va.gl import draw_box, draw_triangles, draw_triangle_relative, \
                                  draw_circle, draw_arc12
-                                 
+
 import copy
 # from va.utils import print_mat
 
@@ -76,18 +77,18 @@ class TmpClass():
 default_config = d = OrderedDict()     # OrderedDict  Il y avait pas de besoin d'utiliser particulier
 d['color_background'] = [0, 0, 0, 1]
 d['scale_size'] = [5, 4, 4]     # (10 Mémoire, le nombre pair, l'impair) de la taille de la mémoire
-d['number_min_px'] = [18, 40]  
-# 36 # Affiche un nombre dans la position de la (ou grille minimum) de grille minimum de 5 * 
+d['number_min_px'] = [18, 40]
+# 36 # Affiche un nombre dans la position de la (ou grille minimum) de grille minimum de 5 *
 # devient plus grande que cette valeur (.) taille minimale de la grille.
-d['draw_mouse_coordinate'] = 1 # 0:off, 1:on Patched pour afficher les coordonnées de la souris. 
+d['draw_mouse_coordinate'] = 1 # 0:off, 1:on Patched pour afficher les coordonnées de la souris.
 d['autohide_mouse_coordinate'] = 1
-d['autohide_MC_threthold'] = 2 # -1:off, Comme valeur de seuil: supérieur ou égal à 0. 
+d['autohide_MC_threthold'] = 2 # -1:off, Comme valeur de seuil: supérieur ou égal à 0.
 # masquer l'affichage des coordonnées lors des approches de la souris.
 #d['font_main'] = [0, 10, 72, 3]  #(id, size, dpi, offset)
 d['font_main'] = TmpClass({'id':0, 'size':10, 'dpi':72, 'offset':3})
 d['font_mc'] = TmpClass({'id':0, 'size':12, 'dpi':72, 'offset':3})     # mouse coordinate box
 d['font_measure'] = TmpClass({'id':0, 'size':10, 'dpi':72, 'offset':3}) # measure mode
-d['cursor_type'] = 'cross_scale'  # enum['none', 'cross', 'cross_scale']0 Patched pour 
+d['cursor_type'] = 'cross_scale'  # enum['none', 'cross', 'cross_scale']0 Patched pour
 d['cursor_scale_size'] = [12, 6, 2]     # La taille de la mémoire (main, sub1, sub2)
 d['measure_cursor_scale_size'] = [16, 6, 6]     # La taille de la mémoire (main, sub1, sub2)
 d['measure_scale_size'] = [14, 5, 5]  # draw measure.rulers
@@ -375,9 +376,9 @@ class RulerConfigPanel(bpy.types.Panel):
        bl_default_closed = True
 
        def draw(self, context):
-               
+
                global rulerconfig
-               
+
                layout = self.layout
 
                scn = context.scene
@@ -584,7 +585,7 @@ class Measure():
        ctrl = 0 # hold
        alt = 0 # hold
        snapon = 0
-       snap_point = MeasurePoint(Vector([0, 0, 0])) # Maj coordonnées du monde, shift+clic commutation 2DSnap, 3DSnap. 
+       snap_point = MeasurePoint(Vector([0, 0, 0])) # Maj coordonnées du monde, shift+clic commutation 2DSnap, 3DSnap.
        snap_find = 0 # 0:None, 2:snap2D, 3:snap3D
        snap_X = 0
        snap_Y = 0
@@ -767,7 +768,7 @@ class Data():
        offset = [0, 0, 0] # origine des coordonnées de la fenêtre
        offset_3d = Vector([0, 0, 0]) # ou utiliser local_grid_origin, center_ofs,  pour l'origine des coordonnées 3d
        view = 'top'
-       center_ofs = Vector([0,0,0]) # Coordonnées 3D position zéro de la règle 
+       center_ofs = Vector([0,0,0]) # Coordonnées 3D position zéro de la règle
 
        # Echelle du dessin
        draw_offset_x = draw_offset_y = 0.0 # distance des bords de la fenêtre pour les cotes extérieures
@@ -1293,9 +1294,9 @@ def draw_mouse_coordinate(data, config):
 #              vec[0] = -vec[0]
 #      if data.unit_y < 0.0:
 #              vec[1] = -vec[1]
-       
+
        # overrides all the preceding
-       vec = [0, 0]    
+       vec = [0, 0]
        vec[0] = (mouseco[0] - data.sx/2) / data.dot_per_blender_unit
        vec[1] = (mouseco[1] - data.sy/2) / data.dot_per_blender_unit
 
@@ -1759,7 +1760,7 @@ def draw_measure_scale(data, config, measure, font):
                                d1 = (cross_vs[0] - v1).length
                                d2 = (cross_vs[1] - v1).length
                                f = d1 / d12 if d12 else 0.0
-                               start_point = MeasurePoint(vec1 + vec12 * f) # Si son intersection coupe le bord de l'écran 
+                               start_point = MeasurePoint(vec1 + vec12 * f) # Si son intersection coupe le bord de l'écran
                                f = d2 / d12 if d12 else 0.0
                                end_point = MeasurePoint(vec1 + vec12 * f) # Si son intersection coupe le bord de l'écran
                                if d1 > d2:
@@ -1783,7 +1784,7 @@ def draw_measure_scale(data, config, measure, font):
                        else:
                                total_length += l12
                                continue
-                       #if d12 == 0.0 or l12 == 0.0: # Doivent être tirées de la direction du vecteur 
+                       #if d12 == 0.0 or l12 == 0.0: # Doivent être tirées de la direction du vecteur
                        # si vous voulez voir le  vecteur en trois dimensions
                        #        continue
 
@@ -1809,7 +1810,7 @@ def draw_measure_scale(data, config, measure, font):
 
                        # start
                        v = start_point.vec_window.to_2d() # échelle de position de début de dessin
-                       if start_point.offset > 1E-8: # Le mode total est sur le côté gauche quand l'échelle supplémentaire est attirée 
+                       if start_point.offset > 1E-8: # Le mode total est sur le côté gauche quand l'échelle supplémentaire est attirée
                                cnt_start = int(start_point.offset / unit) + 1
                        else:
                                cnt_start = int(start_point.offset / unit)
@@ -2163,7 +2164,7 @@ def draw_measure(data, config, measure):
                return
        rulers = measure.rulers
        if not rulers and measure.snap_find:
-               # Etablissement seul du snap 
+               # Etablissement seul du snap
                measure.update_points_vec_window(data)
                draw_measure_snap(measure)
                return
@@ -2495,9 +2496,9 @@ class VIEW3D_OT_display_ruler(bpy.types.Operator):
 
 
        def add_handler(self, context):
-               
+
                global _handle, started
-               
+
                if context.area.type == 'VIEW_3D':
                        #if not self.bl_label in context.window_manager.operators.keys(): # Ne sont pas ajoutés, Si vous ne retournez pas FINISHED dans invoke
                        # Add the region OpenGL drawing callback
@@ -2509,19 +2510,19 @@ class VIEW3D_OT_display_ruler(bpy.types.Operator):
                                '''
                                Lors du démarrage à exécuter une seule fois exactement.
                                Draw_callback_px est appelé à quelques minutes seulement ajouté.
-                               
+
                                REGION de cible est également appelée en référence dans Bpy.data.screens
                                self.__class__.region.callback_remove(handle)
                                '''
                                context.window_manager.modal_handler_add(self)
-                               
+
                                bpy.app.handlers.scene_update_post.append(scenechange)
-                               
+
                                if eval(str(bpy.app.build_revision)[2:7]) >= 53207:
                                        _handle = bpy.types.SpaceView3D.draw_handler_add(draw_callback_px, (self, context), 'WINDOW', 'POST_PIXEL')
                                else:
                                        _handle = context.region.callback_add(draw_callback_px, (self, context), 'POST_PIXEL')
-                                       
+
                        print("Ruler display callback added")
                        context.area.tag_redraw()
 
@@ -2532,14 +2533,14 @@ class VIEW3D_OT_display_ruler(bpy.types.Operator):
                        return {'CANCELLED'}
 
        def modal(self, context, event):
-               
+
                global globmx, globmy, cursorstate, snapon, snapon3d, viewchange
-               
+
                scn = bpy.context.scene
-               
+
                if not(started):
                        return {"FINISHED"}
-               
+
                measure = measure_
                globmx = event.mouse_region_x
                globmy = event.mouse_region_y
@@ -2565,7 +2566,7 @@ class VIEW3D_OT_display_ruler(bpy.types.Operator):
                                        measure.on ^= 1
                                        redraw_area_by_regionid(event)
                                        return {'RUNNING_MODAL'}
-                                       
+
                if not(scn.Active):
                        return {'PASS_THROUGH'}
 
@@ -2603,11 +2604,11 @@ class VIEW3D_OT_display_ruler(bpy.types.Operator):
                        cursor = Vector(context.scene.cursor_location)
                        #mouseco = data.mouseco # window co (3D) valeur de z est toujours 0
 
-                       measure.update_mouse_point(data) # Ce n'est pas nécessaire lorsque measure.update_points_vec_window() 
+                       measure.update_mouse_point(data) # Ce n'est pas nécessaire lorsque measure.update_points_vec_window()
                        mouseco = measure.mouse_point.vec_window
 
                        measure.snap_find = 0
-                       
+
                        if event.type == "S":
                                if event.value == "RELEASE":
                                        measure.snapon = 0
@@ -2674,8 +2675,8 @@ class VIEW3D_OT_display_ruler(bpy.types.Operator):
                                                snap_vec_3d = snap_vecw
                                                measure.snap_point.vec_world[:] = snap_vec_3d[:]
                                                measure.snap_find = 3
-                                       
-                                               
+
+
                                if measure.snapon == 0:
                                        measure.snapon = 1
                                        self.mousemove(measure)
@@ -2964,7 +2965,7 @@ class VIEW3D_OT_display_ruler(bpy.types.Operator):
                                                        self.__class__.draw_mc = 0
                                                        bpy.context.region.tag_redraw()
                                                return {'RUNNING_MODAL'}
-                                       
+
                        if event.type in ('MOUSEMOVE',):
                                if context.area and \
                                   (self.__class__.draw_cursor or self.__class__.draw_mc):
@@ -2980,12 +2981,12 @@ class VIEW3D_OT_display_ruler(bpy.types.Operator):
                        return {'PASS_THROUGH'}
 
        def invoke(self, context, event):
-               
+
                global started, color_background, default_config
-                               
+
                scn = bpy.context.scene
 #              started = 1
-               
+
                color_background = bpy.context.user_preferences.themes['Default'].user_preferences.space.back
                default_config['color_background'] = list(color_background) + [1.0]     # alpha
                bpy.types.Scene.ruler_config = PointerProperty(name='Ruler Config',
@@ -2994,7 +2995,7 @@ class VIEW3D_OT_display_ruler(bpy.types.Operator):
 #              scn.ruler_config.color_background = d['color_background']
                print (scn.ruler_config.color_background)
                print ("BACKGROUND")
-                       
+
                if bpy.context.space_data.viewport_shade == "WIREFRAME":
                        scn.Wire = True
                else:
@@ -3071,53 +3072,53 @@ class VIEW3D_OT_display_ruler(bpy.types.Operator):
 
 
 bpy.types.Scene.Active = bpy.props.BoolProperty(
-               name = "Active", 
+               name = "Active",
                description = "Measuring active or normal Blender operation?",
                default = True)
 
 bpy.types.Scene.Follow = bpy.props.BoolProperty(
-               name = "Follow Origin", 
+               name = "Follow Origin",
                description = "Does the ruler stick to same origin or to screen?",
                default = True)
 
 bpy.types.Scene.oriX = bpy.props.FloatProperty(
-               name = "OriginX", 
+               name = "OriginX",
                description = "Ruler origin X coordinate",
                default = 0,
                min = -100,
                max = 100)
 
 bpy.types.Scene.oriY = bpy.props.FloatProperty(
-               name = "OriginY", 
+               name = "OriginY",
                description = "Ruler origin Y coordinate",
                default = 0,
                min = -100,
                max = 100)
 
 bpy.types.Scene.oriZ = bpy.props.FloatProperty(
-               name = "OriginZ", 
+               name = "OriginZ",
                description = "Ruler origin Z coordinate",
                default = 0,
                min = -100,
                max = 100)
 
 bpy.types.Scene.Wire = bpy.props.BoolProperty(
-               name = "Wire", 
+               name = "Wire",
                description = "Turn to wireframe for non-occlusion.",
                default = True)
 
 bpy.types.Scene.Verts = bpy.props.BoolProperty(
-               name = "Verts", 
+               name = "Verts",
                description = "Snap to verts",
                default = True)
 
 bpy.types.Scene.Edges = bpy.props.BoolProperty(
-               name = "Edges", 
+               name = "Edges",
                description = "Snap to edges",
                default = True)
 
 bpy.types.Scene.Faces = bpy.props.BoolProperty(
-               name = "Faces", 
+               name = "Faces",
                description = "Snap to faces",
                default = True)
 
@@ -3172,17 +3173,17 @@ class RulerToOrig(bpy.types.Operator):
        bl_label = "Ruler->Orig"
        bl_description = "Snap rulers to custom origin."
        bl_options = {"REGISTER"}
-       
+
        def invoke(self, context, event):
                global data_
-               
+
                data = data_
                rv3d = bpy.context.space_data.region_3d
                offset = convert_world_to_window(data.rulerorigin, None, 0, 0)
                offset[2] = 0
-               
+
                data.center_ofs = offset
-               
+
                return {'FINISHED'}
 
 
index 989e8a8..04b407b 100644 (file)
@@ -22,7 +22,7 @@ bl_info = {
        "name": "EWOCprojects tools",
        "author": "Gert De Roost - paleajed",
        "version": (1, 3, 1),
-       "blender": (2, 6, 3),
+       "blender": (2, 63, 0),
        "location": "View3D > Toolbar and View3D > Specials (W-key)",
        "description": "Edit mode tools - contrib version",
        "warning": "",
@@ -80,7 +80,7 @@ class VIEW3D_MT_edit_mesh_paleajed(bpy.types.Menu):
                layout.operator("mesh.edgetune",
                        text="EdgeTune")
                layout.operator("mesh.quadder",
-                       text="Quadder") 
+                       text="Quadder")
                layout.operator("mesh.paredge",
                        text="ParEdge")
                layout.operator("mesh.edgegrow",
@@ -121,7 +121,7 @@ class PaleajedPanel(bpy.types.Panel):
                layout = self.layout
                layout.operator("mesh.edgetune")
                layout.operator("mesh.quadder")
-               
+
                layout.operator("mesh.paredge")
                if mesh_paredge.started:
                        layout.prop(mesh_paredge.mainop, "Distance")
@@ -134,7 +134,7 @@ class PaleajedPanel(bpy.types.Panel):
                layout.operator("object.fastorigin")
                layout.operator("mesh.laprelax")
                layout.operator("mesh.innerweld")
-               
+
                if not(mesh_straightenplus.started):
                        layout.operator("mesh.straightenplus")
                else:
@@ -145,18 +145,18 @@ class PaleajedPanel(bpy.types.Panel):
                                msop.do_straighten()
                                msop.oldperc = msop.Percentage
                        layout.prop(msop, "CancelAxis")
-               
+
                layout.operator("mesh.floodsel", text="Flood Sel")
                if mesh_floodsel.started:
                        layout.prop(mesh_floodsel.mainop, "SelectMode")
                        layout.prop(mesh_floodsel.mainop, "Multiple")
                        layout.prop(mesh_floodsel.mainop, "Preselection")
                        layout.prop(mesh_floodsel.mainop, "Diagonal")
-               
+
                layout.operator("mesh.deathguppie")
                layout.prop(scn, "Smooth")
                layout.prop(scn, "Inner")
-               
+
                if not(mesh_selproject.started):
                        self.layout.operator("mesh.selproject", text="SelProject")
                        if context.mode == 'EDIT_MESH':
@@ -178,7 +178,7 @@ class PaleajedPanel(bpy.types.Panel):
                else:
                        layout.operator("object.recouple",
                                text="ReCouple")
-                               
+
                layout.operator("object.keeptrans")
 
 # Register all operators and panels
@@ -190,7 +190,7 @@ def menu_func(self, context):
 
 def register():
 
-       bpy.app.handlers.scene_update_post.append(sceneupdate_handler)  
+       bpy.app.handlers.scene_update_post.append(sceneupdate_handler)
 
        bpy.utils.register_module(__name__)
 
@@ -200,7 +200,7 @@ def register():
 
 def unregister():
        bpy.app.handlers.scene_update_post.remove(sceneupdate_handler)
-       
+
        bpy.utils.unregister_module(__name__)
 
        # Remove "Extras" menu from the "Add Mesh" menu.
@@ -208,10 +208,10 @@ def unregister():
 
 if __name__ == "__main__":
        register()
-       
-       
-       
-       
+
+
+
+
 @persistent
 def sceneupdate_handler(dummy):
 
@@ -225,11 +225,11 @@ def sceneupdate_handler(dummy):
                                itemlist.append((ob.name, ob.name, "Set From:"))
                bpy.types.Scene.FromObject = bpy.props.EnumProperty(
                                items = itemlist,
-                               name = "From", 
+                               name = "From",
                                description = "Object to project")
                bpy.types.Scene.ToObject = bpy.props.EnumProperty(
                                items = itemlist,
-                               name = "To", 
+                               name = "To",
                                description = "Object to project onto")
                mesh_selproject.oldobjs = list(scn.objects)
-       
+
index 9b7a41c..849e66b 100644 (file)
@@ -45,7 +45,7 @@ bl_info = {
        "name": "DeathGuppie",
        "author": "Gert De Roost",
        "version": (0, 3, 0),
-       "blender": (2, 6, 3),
+       "blender": (2, 63, 0),
        "location": "View3D > Tools",
        "description": "Deathguppie subdivision operation",
        "warning": "",
@@ -60,12 +60,12 @@ import bmesh
 
 
 bpy.types.Scene.Smooth = bpy.props.BoolProperty(
-               name = "Smoothing", 
+               name = "Smoothing",
                description = "Subdivide smooth",
                default = True)
 
 bpy.types.Scene.Inner = bpy.props.BoolProperty(
-               name = "Select inner only", 
+               name = "Select inner only",
                description = "After operation only inner verts selected",
                default = True)
 
@@ -75,7 +75,7 @@ class DeathGuppie(bpy.types.Operator):
        bl_label = "DeathGuppie"
        bl_description = "Deathguppie subdivision operation"
        bl_options = {'REGISTER', 'UNDO'}
-       
+
 
        @classmethod
        def poll(cls, context):
@@ -83,17 +83,17 @@ class DeathGuppie(bpy.types.Operator):
                return (obj and obj.type == 'MESH' and context.mode == 'EDIT_MESH')
 
        def invoke(self, context, event):
-               
+
                self.do_deathguppie(context)
-               
+
                return {'FINISHED'}
 
 
        def do_deathguppie(self, context):
-                       
+
                scn = context.scene
                selobj = context.active_object
-       
+
                bpy.ops.object.editmode_toggle()
                bpy.ops.object.duplicate()
                projobj = bpy.context.active_object
@@ -103,11 +103,11 @@ class DeathGuppie(bpy.types.Operator):
                projobj.hide = 1
                context.scene.objects.active = selobj
                bpy.ops.object.editmode_toggle()
-       
+
                mesh = selobj.data
                bm = bmesh.from_edit_mesh(mesh)
                bmkeep = bm.copy()
-       
+
                facelist = []
                for f1 in bm.faces:
                        if f1.select:
@@ -121,16 +121,16 @@ class DeathGuppie(bpy.types.Operator):
                                facelist.insert(0, [])
                                facelist[0].append(f1)
                                facelist[0].append(linked)
-               
-       
+
+
                transfer = {}
-               holdlist = []   
+               holdlist = []
                for [f, linked] in facelist:
                        bpy.ops.mesh.select_all(action = 'DESELECT')
                        f.select = 1
                        transfer[f.calc_center_median()[:]] = [f.index, linked]
                        bpy.ops.mesh.split()
-                                       
+
                bpy.ops.object.editmode_toggle()
                bpy.ops.object.editmode_toggle()
                bm = bmesh.from_edit_mesh(mesh)
@@ -146,10 +146,10 @@ class DeathGuppie(bpy.types.Operator):
                                        facelist.insert(0, [])
                                        facelist[0].append(f)
                                        facelist[0].append(transfer[f.calc_center_median()[:]])
-                                       
-       
+
+
                def createinnerlists(f):
-               
+
                        for l in f.loops:
                                self.cornerlist.append(l.vert)
                                self.vselset.add(l.vert)
@@ -163,7 +163,7 @@ class DeathGuppie(bpy.types.Operator):
                                vert = bm.verts.new(tempco1 + ((tempco2 - tempco1) / 3))
                                self.innerlist.append(vert)
                                self.smoothset.add(vert)
-               
+
                self.vselset = set([])
                fselset = set([])
                self.smoothset = set([])
@@ -177,7 +177,7 @@ class DeathGuppie(bpy.types.Operator):
                        if len(linked) == 4:
                                createinnerlists(f)
                                for e in f.edges:
-                                       ne, vert1 = bmesh.utils.edge_split(e, e.verts[0], 0.66)         
+                                       ne, vert1 = bmesh.utils.edge_split(e, e.verts[0], 0.66)
                                        ne, vert2 = bmesh.utils.edge_split(ne, vert1, 0.5)
                                        self.vselset.add(vert1)
                                        self.vselset.add(vert2)
@@ -203,7 +203,7 @@ class DeathGuppie(bpy.types.Operator):
                                createinnerlists(f)
                                for e in f.edges:
                                        if e != edge:
-                                               ne, vert1 = bmesh.utils.edge_split(e, e.verts[0], 0.66)         
+                                               ne, vert1 = bmesh.utils.edge_split(e, e.verts[0], 0.66)
                                                ne, vert2 = bmesh.utils.edge_split(ne, vert1, 0.5)
                                                self.vselset.add(vert1)
                                                self.vselset.add(vert2)
@@ -272,10 +272,10 @@ class DeathGuppie(bpy.types.Operator):
                                                        if l.edge == edges[1] and l.link_loop_next.edge == edges[0]:
                                                                edges.reverse()
                                                                break
-                                       createinnerlists(f)                     
+                                       createinnerlists(f)
                                        for e in f.edges:
                                                if not(e in edges):
-                                                       ne, vert1 = bmesh.utils.edge_split(e, e.verts[0], 0.66)         
+                                                       ne, vert1 = bmesh.utils.edge_split(e, e.verts[0], 0.66)
                                                        ne, vert2 = bmesh.utils.edge_split(ne, vert1, 0.5)
                                                        self.vselset.add(vert1)
                                                        self.vselset.add(vert2)
@@ -303,7 +303,7 @@ class DeathGuppie(bpy.types.Operator):
                                                                                        sidev1 = bm.verts.new(co1)
                                                                                        sidev2 = bm.verts.new(co2)
                                                                                        sidev3 = bm.verts.new(self.innerlist[idx-2].co + ((self.innerlist[idx-2].co - self.innerlist[idx-1].co) / 2))
-                                                                                       
+
                                                                                        fs = bm.faces.new((v1, vnext, sidev2, sidev1))
                                                                                        if not(scn.Inner):
                                                                                                fselset.add(fs)
@@ -343,10 +343,10 @@ class DeathGuppie(bpy.types.Operator):
                                                for f1 in e1.link_faces:
                                                        if len(e1.link_faces) == 1 or (f1 != fold and not(f1 in linked2)):
                                                                edges.append(f.edges[fedges.index(e1)])
-                                       createinnerlists(f)                     
+                                       createinnerlists(f)
                                        for e in f.edges:
                                                if not(e in edges):
-                                                       ne, vert1 = bmesh.utils.edge_split(e, e.verts[0], 0.66)         
+                                                       ne, vert1 = bmesh.utils.edge_split(e, e.verts[0], 0.66)
                                                        ne, vert2 = bmesh.utils.edge_split(ne, vert1, 0.5)
                                                        self.vselset.add(vert1)
                                                        self.vselset.add(vert2)
@@ -405,7 +405,7 @@ class DeathGuppie(bpy.types.Operator):
                                                                        fselset.add(fs)
                                                                        fs = bm.faces.new((vnextnext, vnnn, self.innerlist[idx-2], self.innerlist[idx-3]))
                                                                        fselset.add(fs)
-                                                                       
+
                                        fs = bm.faces.new((self.innerlist[0], self.innerlist[1], self.innerlist[2], self.innerlist[3]))
                                        fselset.add(fs)
                                        bm.faces.remove(f)
@@ -413,8 +413,8 @@ class DeathGuppie(bpy.types.Operator):
                                        self.smoothset.add(sidev2)
                                        self.smoothset.add(sidev3)
                                        self.smoothset.add(sidev4)
-                                       
-                                       
+
+
                        elif len(linked) == 1:
                                fedges = fold.edges[:]
                                edges = []
@@ -425,10 +425,10 @@ class DeathGuppie(bpy.types.Operator):
                                for l in f.loops:
                                        if not(l.edge in edges):
                                                edges = [l.link_loop_next.edge, l.link_loop_next.link_loop_next.edge, l.link_loop_next.link_loop_next.link_loop_next.edge]
-                               createinnerlists(f)                     
+                               createinnerlists(f)
                                for e in f.edges:
                                        if not(e in edges):
-                                               ne, vert1 = bmesh.utils.edge_split(e, e.verts[0], 0.66)         
+                                               ne, vert1 = bmesh.utils.edge_split(e, e.verts[0], 0.66)
                                                ne, vert2 = bmesh.utils.edge_split(ne, vert1, 0.5)
                                                self.vselset.add(vert1)
                                                self.vselset.add(vert2)
@@ -493,9 +493,9 @@ class DeathGuppie(bpy.types.Operator):
                                self.smoothset.add(sidev2)
                                self.smoothset.add(sidev3)
                                self.smoothset.add(sidev4)
-                                       
+
                        elif len(linked) == 0:
-                               createinnerlists(f)                     
+                               createinnerlists(f)
                                l = f.loops[0]
                                v1 = l.vert
                                vnext = l.link_loop_next.vert
@@ -538,12 +538,12 @@ class DeathGuppie(bpy.types.Operator):
                                self.smoothset.add(sidev2)
                                self.smoothset.add(sidev3)
                                self.smoothset.add(sidev4)
-               
-               
+
+
                if scn.Smooth:
                        for v in self.smoothset:
                                v.co = projobj.closest_point_on_mesh(v.co)[0]
-                       
+
                bpy.ops.mesh.select_all(action ='SELECT')
                bm.normal_update()
                bpy.ops.mesh.normals_make_consistent()
@@ -564,7 +564,7 @@ class DeathGuppie(bpy.types.Operator):
                                e.verts[0].select = 0
                                e.verts[1].select = 0
                                e.select = 0
-                                               
+
                mesh.update()
                bm.free()
                bmkeep.free()
@@ -582,7 +582,7 @@ class DeathGuppie(bpy.types.Operator):
 
 
 def panel_func(self, context):
-       
+
        scn = bpy.context.scene
        self.layout.label(text="DeathGuppie:")
        self.layout.operator("mesh.deathguppie", text="Subdivide DG")
@@ -606,4 +606,4 @@ if __name__ == "__main__":
 
 
 
-       
+
index 450b3dd..d7f200c 100644 (file)
@@ -27,7 +27,7 @@ Invoke it (button in the Mesh Tools panel).
 Go to EditMode, select one or more edges or connected edge-snakes (you can grow several at the same time, a bmesh mesh has a certain
 spin direction to it, so in most general non-complex situations multiple edges will grow together
 in the desired direction).  Use the left and right arrow keys to grow / ungrow the edgeloop in any direction.
-The addon will show the edges you can grow next in light blue, with the active edge(will be selected 
+The addon will show the edges you can grow next in light blue, with the active edge(will be selected
 when using arrow keys) highlighted in red.  Use up and down arrow keys to activate the other light blue
 edges, this way you can route your edge-snake in every possible direction; defsult is the middle one.
 You can grow multiple slices at the same time.
@@ -44,7 +44,7 @@ bl_info = {
        "name": "EdgeGrow",
        "author": "Gert De Roost",
        "version": (0, 4, 0),
-       "blender": (2, 6, 8),
+       "blender": (2, 68, 0),
        "location": "View3D > Tools",
        "description": "Growing edgeloops with arrowkeys",
        "warning": "",
@@ -69,29 +69,29 @@ class EdgeGrow(bpy.types.Operator):
        bl_label = "EdgeGrow"
        bl_description = "Growing edgeloops with arrowkeys"
        bl_options = {"REGISTER", "UNDO"}
-       
+
        @classmethod
        def poll(cls, context):
                obj = context.active_object
                return (obj and obj.type == 'MESH' and context.mode == 'EDIT_MESH')
 
        def invoke(self, context, event):
-               
+
                self.init_edgegrow(context)
-               
+
                context.window_manager.modal_handler_add(self)
 
                self._handle = bpy.types.SpaceView3D.draw_handler_add(self.redraw, (), 'WINDOW', 'POST_PIXEL')
-               
+
                return {'RUNNING_MODAL'}
 
 
        def modal(self, context, event):
-               
+
                if event.type in {'MIDDLEMOUSE', 'WHEELDOWNMOUSE', 'WHEELUPMOUSE'}:
                        # User transforms view
                        return {'PASS_THROUGH'}
-               
+
                elif event.type in {'RET', 'NUMPAD_ENTER'}:
                        # Consolidate changes if ENTER pressed.
                        # Free the bmesh.
@@ -100,7 +100,7 @@ class EdgeGrow(bpy.types.Operator):
                        bpy.ops.object.editmode_toggle()
                        bpy.ops.object.editmode_toggle()
                        return {'FINISHED'}
-                       
+
                elif event.type == 'LEFT_ARROW':
                        # REINIT: when user returns to begin position: display self.cursor edges on both sides
                        # START: add to beginning of lists
@@ -129,20 +129,20 @@ class EdgeGrow(bpy.types.Operator):
                                                                        self.cursor[posn] = self.endcur[posn]
                                                                else:
                                                                        self.cursor[posn] = self.startcur[posn]
-                                               self.activedir[posn] = 'LEFT'                                           
-                                       if self.state[posn] == 'INIT':                  
+                                               self.activedir[posn] = 'LEFT'
+                                       if self.state[posn] == 'INIT':
                                                self.activedir[posn] = 'LEFT'
                                                self.check[posn] = True
                                                self.state[posn] = 'START'
                                                self.cursor[posn] = self.startcur[posn]
-                                                       
+
                                        # activedir: left or right absolute -> movement in x direction (when in INIT state)
                                        if self.activedir[posn] == 'LEFT':
                                                self.addedge(posn)
                                        else:
                                                self.removeedge(posn)
                        return {'RUNNING_MODAL'}
-                       
+
                elif event.type == 'RIGHT_ARROW':
                        # check LEFT_ARROW
                        if event.value == 'PRESS':
@@ -186,25 +186,25 @@ class EdgeGrow(bpy.types.Operator):
                                        else:
                                                self.removeedge(posn)
                        return {'RUNNING_MODAL'}
-                       
+
                elif event.type == 'UP_ARROW':
                        # next cursor possibility
                        if event.value == 'PRESS':
                                self.counter += 1
                                self.mesh.update()
                        return {'RUNNING_MODAL'}
-                       
+
                elif event.type == 'DOWN_ARROW':
                        # previous cursor possibility
                        if event.value == 'PRESS':
                                self.counter -= 1
                                self.mesh.update()
                        return {'RUNNING_MODAL'}
-               
+
                return {'RUNNING_MODAL'}
 
        def addedge(self, posn):
-               
+
                # add edge to edgelist
                self.change = True
                if self.state[posn] == 'START':
@@ -213,11 +213,11 @@ class EdgeGrow(bpy.types.Operator):
                        self.edgelist[posn].append(self.cursor[posn])
                self.cursor[posn].verts[0].select = True
                self.cursor[posn].verts[1].select = True
-               self.cursor[posn].select = True 
+               self.cursor[posn].select = True
                self.mesh.update()
-       
+
        def removeedge(self, posn):
-               
+
                # remove edge from edgelist
                self.change = True
                if self.state[posn] == 'START':
@@ -235,21 +235,21 @@ class EdgeGrow(bpy.types.Operator):
                self.cursor[posn].select = False
                self.mesh.update()
 
-       
+
        def init_edgegrow(self, context):
-       
+
                self.change = True
-       
+
                self.area = context.area
-               self.region = context.region  
-               self.rv3d = context.space_data.region_3d        
+               self.region = context.region
+               self.rv3d = context.space_data.region_3d
                self.selobj = context.active_object
                self.mesh = self.selobj.data
                self.bm = bmesh.from_edit_mesh(self.mesh)
                self.actedge = self.bm.select_history.active
                # get transf matrix
                self.getmatrix()
-       
+
                # vsellist, essellist: remember selection for reselecting later
                self.selset = set([])
                self.vsellist = []
@@ -257,14 +257,14 @@ class EdgeGrow(bpy.types.Operator):
                for edge in self.bm.edges:
                        if edge.select:
                                self.selset.add(edge)
-                               self.esellist.append(edge)              
+                               self.esellist.append(edge)
                for vert in self.bm.verts:
                        if vert.select:
-                               self.vsellist.append(vert)              
-       
-       
+                               self.vsellist.append(vert)
+
+
                def addstart(vert):
-                       
+
                        # recursive: adds to initial edgelist at start
                        for e in vert.link_edges:
                                if e in self.selset:
@@ -273,9 +273,9 @@ class EdgeGrow(bpy.types.Operator):
                                        self.edgelist[posn].insert(0, e)
                                        addstart(v)
                                        break
-               
+
                def addend(vert):
-                       
+
                        # recursive: adds to initial edgelist at end
                        for e in vert.link_edges:
                                if e in self.selset:
@@ -284,7 +284,7 @@ class EdgeGrow(bpy.types.Operator):
                                        self.edgelist[posn].append(e)
                                        addend(v)
                                        break
-               
+
                self.state = []
                self.oldstate = []
                self.cursor = []
@@ -306,7 +306,7 @@ class EdgeGrow(bpy.types.Operator):
                        self.endcur.append(None)
                        self.check.append(0)
                        self.activedir.append("")
-                       
+
                        self.edgelist.append([])
                        elem = self.selset.pop()
                        vert = elem.verts[0]
@@ -325,15 +325,15 @@ class EdgeGrow(bpy.types.Operator):
                                        self.singledir[0] = self.edgelist[0][0].verts[0]
                                else:
                                        self.singledir[0] = self.edgelist[0][0].verts[1]
-               
+
                # orient first edgesnake from left(start) to right(end)
                x1, y = self.getscreencoords(self.edgelist[0][0].verts[0].co)
                x2, y = self.getscreencoords(self.edgelist[0][len(self.edgelist[0]) - 1].verts[0].co)
                if x1 > x2:
-                       self.edgelist[0].reverse()                              
-                       
-               
-               # 
+                       self.edgelist[0].reverse()
+
+
+               #
                # orient edge and vertlists parallel - reverse if necessary
                for i in range(len(self.edgelist) - 1):
                        bpy.ops.mesh.select_all(action='DESELECT')
@@ -347,7 +347,7 @@ class EdgeGrow(bpy.types.Operator):
                                                        self.singledir[0] = v
                                                else:
                                                        self.singledir[0] = self.edgelist[i][0].other_vert(v)
-                                       vt = self.singledir[i]  
+                                       vt = self.singledir[i]
                                        vt.select = True
                                        self.bm.select_history.add(vt)
                                        v1 = vt
@@ -374,11 +374,11 @@ class EdgeGrow(bpy.types.Operator):
                        self.bm.select_history.validate()
                        # get path between startverts for checking orientation
                        bpy.ops.mesh.shortest_path_select()
-                       
+
                        for e in self.bm.edges:
                                if e.verts[0].select and e.verts[1].select:
                                        e.select = True
-                       
+
                        # correct selected path when not connected neatly to vert from left or right(cant know direction)
                        def correctsel(e1, v1, lst):
                                found = False
@@ -402,7 +402,7 @@ class EdgeGrow(bpy.types.Operator):
                                                                                v1 = e1.other_vert(v1)
                                                                                e1 = edge
                                                        found = False
-                                                                               
+
                                # check situation where left/right connection is on vert thats outside slice
                                found = False
                                while not(found):
@@ -419,10 +419,10 @@ class EdgeGrow(bpy.types.Operator):
                                                                e1 = edge
                                                                found = False
                                return e1, v1
-                                                               
+
                        e1, v1 = correctsel(e1, v1, self.edgelist[i])
-                       e2, v2 = correctsel(e2, v2, self.edgelist[i+1])                                 
-                       
+                       e2, v2 = correctsel(e2, v2, self.edgelist[i+1])
+
                        # do all the checking to see if the checked lists must be reversed
                        brk = False
                        for face1 in e1.link_faces:
@@ -480,25 +480,25 @@ class EdgeGrow(bpy.types.Operator):
                                                                                        break
                                                                break
                                                break
-                                               
+
                for posn in range(len(self.edgelist)):
                        if self.edgelist[posn][0] == self.actedge:
                                for posn in range(len(self.edgelist)):
                                        self.edgelist[posn].reverse()
-                                               
+
                bpy.ops.mesh.select_all(action='DESELECT')
                for v in self.vsellist:
                        v.select = True
                for e in self.esellist:
                        e.select = True
-       
-       
+
+
                self.region.tag_redraw()
-       
-       
-       
+
+
+
        def getmatrix(self):
-               
+
                # Rotating / panning / zooming 3D view is handled here.
                # Get matrix.
                if self.selobj.rotation_mode == 'AXIS_ANGLE':
@@ -532,27 +532,27 @@ class EdgeGrow(bpy.types.Operator):
                        self.matrix = mat_rotZ * mat_rotX * mat_rotY
                elif self.selobj.rotation_mode == 'ZYX':
                        self.matrix = mat_rotZ * mat_rotY * mat_rotX
-       
+
                # handle object scaling
                sx, sy, sz = self.selobj.scale
                mat_scX = Matrix.Scale(sx, 4, Vector([1, 0, 0]))
                mat_scY = Matrix.Scale(sy, 4, Vector([0, 1, 0]))
                mat_scZ = Matrix.Scale(sz, 4, Vector([0, 0, 1]))
                self.matrix = mat_scX * mat_scY * mat_scZ * self.matrix
-       
-       
+
+
        def getscreencoords(self, vector):
-               
+
                # calculate screen coords for given Vector
                vector = vector * self.matrix
                vector = vector + self.selobj.location
                return bpy_extras.view3d_utils.location_3d_to_region_2d(self.region, self.rv3d, vector)
-       
-       
+
+
        def drawedges(self, vert, edge):
-               
+
                def getedge(vert, edge):
-                       
+
                        # get the next edge in list of edges rotating from/around vert at seelection END (for cursor choice)
                        for loop in vert.link_loops:
                                if loop.edge == edge:
@@ -562,7 +562,7 @@ class EdgeGrow(bpy.types.Operator):
                                        self.sortlist.append(edge)
                                        getedge(vert, edge)
                                        break
-       
+
                # get sorted list of possible cursor choices
                self.sortlist = []
                self.startedge = edge
@@ -572,7 +572,7 @@ class EdgeGrow(bpy.types.Operator):
                                if e != self.startedge:
                                        if not(e in self.sortlist):
                                                self.sortlist.append(e)
-               # calculate new cursor position in sortlist if changed                  
+               # calculate new cursor position in sortlist if changed
                if self.change:
                        if len(self.sortlist) == 2 and (len(self.sortlist[0].link_faces) == 1 or len(self.sortlist[1].link_faces) == 1):
                                for f in self.startedge.link_faces:
@@ -616,10 +616,10 @@ class EdgeGrow(bpy.types.Operator):
                        x, y = self.getscreencoords(edge.verts[1].co)
                        glVertex2f(x, y)
                        glEnd()
-       
-       
+
+
        def setcursors(self, v):
-               
+
                # what it says
                if self.oldstate[posn] == 'START':
                        if v in self.cursor[posn].verts:
@@ -631,10 +631,10 @@ class EdgeGrow(bpy.types.Operator):
                                self.endcur[posn] = self.tempcur
                        else:
                                self.startcur[posn] = self.tempcur
-       
-       
+
+
        def redraw(self):
-               
+
                # Reinit if returning to initial state
                for lst in self.edgelist:
                        posn = self.edgelist.index(lst)
@@ -644,10 +644,10 @@ class EdgeGrow(bpy.types.Operator):
                                        self.state[posn] = 'REINIT'
                        else:
                                self.check[posn] = True
-               
+
                for lst in self.edgelist:
                        posn = self.edgelist.index(lst)
-                       
+
                        if self.state[posn] == 'INIT' or self.state[posn] == 'REINIT':
                                if len(lst) == 1:
                                        # if snake is one edge, use singledir vert for orientation
@@ -699,9 +699,9 @@ class EdgeGrow(bpy.types.Operator):
                                e.verts[0].select = True
                                e.verts[1].select = True
                                e.select = True
-                               
+
                self.change = False
-       
+
 
 
 
index 8c31e28..80df420 100644 (file)
@@ -24,20 +24,20 @@ This script is an implementation of the concept of sliding vertices around
    see how it can impact your modeling habits.
    You are able to tune vertices by sliding by freehand-redrawing them on the
    edges they are part of.
-   
+
 
 
    Documentation
-   
-   
+
+
    First install the addon by going to User Preferences-> AddOns and choosing
    "Install from file". Locate the downloaded file and install it.
    Enable the script in User Preferences->AddOns->Mesh.
 
-   
-   The addon will work on any vertice/edge/face-selection. 
+
+   The addon will work on any vertice/edge/face-selection.
    Make a selection, click the EdgeTune button on the Mesh Tools panel.
-   (addon only accessible when in EditMode).   
+   (addon only accessible when in EditMode).
 
    The selection will be visualized in yellow.
    EdgeTune will abide by the limited visibility setting.
@@ -62,7 +62,7 @@ bl_info = {
        "name": "EdgeTune",
        "author": "Gert De Roost",
        "version": (3, 5, 0),
-       "blender": (2, 6, 3),
+       "blender": (2, 63, 0),
        "location": "View3D > Tools",
        "description": "Tuning edgeloops by redrawing them manually, sliding verts.",
        "warning": "",
@@ -91,29 +91,29 @@ class EdgeTune(bpy.types.Operator):
        bl_label = "Tune Edge"
        bl_description = "Tuning edgeloops by redrawing them manually, sliding verts"
        bl_options = {"REGISTER", "UNDO"}
-       
+
        @classmethod
        def poll(cls, context):
                obj = context.active_object
                return (obj and obj.type == 'MESH' and context.mode == 'EDIT_MESH')
 
        def invoke(self, context, event):
-               
+
                self.scn = context.scene
                self.screen = context.screen
                self.area = context.area
-               self.region = context.region  
+               self.region = context.region
                self.selobj = context.active_object
                self.init_edgetune()
-               
+
                context.window_manager.modal_handler_add(self)
                self._handle = bpy.types.SpaceView3D.draw_handler_add(self.redraw, (), 'WINDOW', 'POST_PIXEL')
-               
+
                return {'RUNNING_MODAL'}
 
 
        def modal(self, context, event):
-       
+
                self.viewchange = False
                if event.type == 'LEFTMOUSE':
                        if event.value == 'PRESS':
@@ -136,7 +136,7 @@ class EdgeTune(bpy.types.Operator):
                        return {'PASS_THROUGH'}
                elif event.type in {'WHEELDOWNMOUSE', 'WHEELUPMOUSE'}:
                        # recalculate view parameters
-                       self.viewchange = True          
+                       self.viewchange = True
                        return {'PASS_THROUGH'}
                elif event.type == 'Z':
                        if event.value == 'PRESS':
@@ -151,7 +151,7 @@ class EdgeTune(bpy.types.Operator):
                                                self.undocolist.pop(0)
                                                self.mesh.update()
                        return {'RUNNING_MODAL'}
-                       
+
                elif event.type == 'RET':
                        # Consolidate changes.
                        # Free the bmesh.
@@ -159,7 +159,7 @@ class EdgeTune(bpy.types.Operator):
                        self.bmundo.free()
                        bpy.types.SpaceView3D.draw_handler_remove(self._handle, 'WINDOW')
                        return {'FINISHED'}
-                       
+
                elif event.type == 'MOUSEMOVE':
                        mxa = event.mouse_x
                        mya = event.mouse_y
@@ -173,14 +173,14 @@ class EdgeTune(bpy.types.Operator):
                                        if mxa > r.x and mya > r.y and mxa < r.x + r.width and mya < r.y + r.height:
                                                self.region = r
                                                break
-                                       
+
                        if not(self.region):
                                return {'RUNNING_MODAL'}
                        mx = mxa - self.region.x
                        my = mya - self.region.y
 
                        hoveredge = None
-       
+
                        # First check mouse is in bounding box edge of which edges.
                        testscrl = []
                        for edge in self.slideedges[self.region]:
@@ -197,12 +197,12 @@ class EdgeTune(bpy.types.Operator):
                                        uppy = y2 + 5
                                else:
                                        lwpy = y2 - 5
-                                       uppy = y1 + 5           
+                                       uppy = y1 + 5
                                if (((x1 < mx < x2) or (x2 < mx < x1)) and (lwpy < my < uppy)) or (((y1 < my < y2) or (y2 < my < y1)) and (lwpx < mx < uppx)):
                                        testscrl.append(edge)
                                if self.contedge != None:
                                        testscrl.append(self.contedge)
-       
+
                        # Then check these edges to see if mouse is on one of them.
                        allhoveredges = []
                        hovering = False
@@ -211,12 +211,12 @@ class EdgeTune(bpy.types.Operator):
                                for edge in testscrl:
                                        x1, y1, z1 = self.getscreencoords(edge.verts[0].co, self.region)
                                        x2, y2, z2 = self.getscreencoords(edge.verts[1].co, self.region)
-       
+
                                        if x1 == x2 and y1 == y2:
                                                dist = math.sqrt((mx - x1)**2 + (my - y1)**2)
                                        else:
                                                dist = ((mx - x1)*(y2 - y1) - (my - y1)*(x2 - x1)) / math.sqrt((x2 - x1)**2 + (y2 - y1)**2)
-       
+
                                        if -5 < dist < 5:
                                                if self.movedoff or (not(self.movedoff) and edge == self.contedge):
                                                        allhoveredges.append(edge)
@@ -234,20 +234,20 @@ class EdgeTune(bpy.types.Operator):
                                                                        self.bx2[r], self.by2[r], dummy = self.getscreencoords(hoveredge.verts[1].co, r)
                                                                self.region.tag_redraw()
                                                                break
-                                                               
+
                        if hovering == False:
                                self.movedoff = True
                                if self.mouseover == True:
                                        self.highoff = True
                                        self.region.tag_redraw()
                                self.mouseover = False
-                               self.bx1[self.region] = -1 
+                               self.bx1[self.region] = -1
                                self.bx2[self.region] = -1
                                self.by1[self.region] = -1
                                self.by2[self.region] = -1, -1, -1, -1
-                       
-       
-       
+
+
+
                        if hoveredge != None and self.mbns == True:
                                self.contedge = edge
                                self.movedoff = False
@@ -265,7 +265,7 @@ class EdgeTune(bpy.types.Operator):
                                else:
                                        vert = hoveredge.verts[1]
                                        vert2 = hoveredge.verts[0]
-                                       
+
                                # Update local undo info.
                                if self.undolist == []:
                                        self.undolist.insert(0, hoveredge)
@@ -280,11 +280,11 @@ class EdgeTune(bpy.types.Operator):
                                for verts in self.selverts[self.region]:
                                        if vert == verts[0]:
                                                self.selcoords[self.region][self.selverts[self.region].index(verts)][0] = coords
-                                       elif vert == verts[1]:  
+                                       elif vert == verts[1]:
                                                self.selcoords[self.region][self.selverts[self.region].index(verts)][1] = coords
                                if vert in self.singles:
                                        self.boxes[self.region][self.singles.index(vert)] = coords
-                               # Calculate new vert 3D coordinates.            
+                               # Calculate new vert 3D coordinates.
                                vx1, vy1, vz1 = hoveredge.verts[0].co[:]
                                vx2, vy2, vz2 = hoveredge.verts[1].co[:]
                                self.vertd[vert] = [((vx2 - vx1) * div ) + vx1, ((vy2 - vy1) * div ) + vy1, ((vz2 - vz1) * div ) + vz1]
@@ -293,15 +293,15 @@ class EdgeTune(bpy.types.Operator):
                                vert.co[1] = ((vy2 - vy1) * div ) + vy1
                                vert.co[2] = ((vz2 - vz1) * div ) + vz1
                                self.mesh.update()
-                               
+
                return {'RUNNING_MODAL'}
 
-       
-       
+
+
        def adapt(self):
-               
+
                self.firstrun = False
-                       
+
                self.regions = []
                self.spaces = []
                self.halfheight = {}
@@ -320,7 +320,7 @@ class EdgeTune(bpy.types.Operator):
                                        if sp.type == 'VIEW_3D':
                                                self.spaces.append(sp)
                                                self.perspm[r] = sp.region_3d.perspective_matrix
-                                               
+
                self.selcoords = {}
                self.slidecoords = {}
                self.boxes = {}
@@ -338,11 +338,11 @@ class EdgeTune(bpy.types.Operator):
                        self.seledges[r] = []
                        self.slideverts[r] = []
                        self.slideedges[r] = []
-                       
+
                for r in self.regions:
 
                        self.getlayout(r)
-                       
+
                        # recalculate screencoords in lists
                        for posn in range(len(self.selverts[r])):
                                self.selcoords[r][posn] = [self.getscreencoords(Vector(self.vertd[self.selverts[r][posn][0]]), r)[:2], self.getscreencoords(Vector(self.vertd[self.selverts[r][posn][1]]), r)[:2]]
@@ -350,36 +350,36 @@ class EdgeTune(bpy.types.Operator):
                                self.slidecoords[r][posn] = [self.getscreencoords(self.slideverts[r][posn][0].co, r)[:2],  self.getscreencoords(self.slideverts[r][posn][1].co, r)[:2]]
                        for posn in range(len(self.singles)):
                                self.boxes[r][posn] = self.getscreencoords(Vector(self.vertd[self.singles[posn]]), r)[:2]
-                       
-       
-       
+
+
+
        def findworldco(self, vec):
-       
+
                vec = vec.copy()
                vec.rotate(self.selobj.matrix_world)
                vec.rotate(self.selobj.matrix_world)
                vec = vec * self.selobj.matrix_world + self.selobj.matrix_world.to_translation()
                return vec
-       
+
        def getscreencoords(self, vec, reg):
-       
+
                # calculate screencoords of given Vector
                vec = self.findworldco(vec)
                prj = self.perspm[reg] * vec.to_4d()
                return (self.halfwidth[reg] + self.halfwidth[reg] * (prj.x / prj.w), self.halfheight[reg] + self.halfheight[reg] * (prj.y / prj.w), prj.z)
-       
-       
-       
-       
+
+
+
+
        def init_edgetune(self):
-       
+
                self.mesh = self.selobj.data
                self.bm = bmesh.from_edit_mesh(self.mesh)
                self.bmundo = self.bm.copy()
-       
+
                self.viewwidth = self.area.width
                self.viewheight = self.area.height
-               
+
                #remember initial selection
                self.keepverts = []
                for vert in self.bm.verts:
@@ -389,25 +389,25 @@ class EdgeTune(bpy.types.Operator):
                for edge in self.bm.edges:
                        if edge.select:
                                self.keepedges.append(edge)
-       
+
                self.firstrun = True
                self.highoff = False
                self.mbns = False
                self.viewchange = False
-               self.mouseover = False  
+               self.mouseover = False
                self.bx1, self.bx2, self.by1, self.by2 = {}, {}, {}, {}
                self.undolist = []
                self.undocolist = []
                self.contedge = None
-       
+
                self.adapt()
                for r in self.regions:
                        r.tag_redraw()
-       
-       
-       
+
+
+
        def getlayout(self, reg):
-               
+
                # seledges: selected edges list
                # selverts: selected verts list per edge
                # selcoords: selected verts coordinate list per edge
@@ -446,7 +446,7 @@ class EdgeTune(bpy.types.Operator):
                        for vert in self.keepverts:
                                visible[vert] = True
                                self.sverts[reg].append(self.bmundo.verts[vert.index])
-                               
+
                for edge in self.keepedges:
                        if visible[edge.verts[0]] and visible[edge.verts[1]]:
                                edge = self.bmundo.edges[edge.index]
@@ -455,7 +455,7 @@ class EdgeTune(bpy.types.Operator):
                                x1, y1, dummy = self.getscreencoords(edge.verts[0].co, reg)
                                x2, y2, dummy = self.getscreencoords(edge.verts[1].co, reg)
                                self.selcoords[reg].append([[x1, y1],[x2, y2]])
-       
+
                # selverts: selected verts list
                # slideedges: slideedges list
                # slideverts: slideverts list per edge
@@ -474,7 +474,7 @@ class EdgeTune(bpy.types.Operator):
                                        self.slideverts[reg].append([edge.verts[0], edge.verts[1]])
                                        x1, y1, dummy = self.getscreencoords(edge.verts[0].co, reg)
                                        x2, y2, dummy = self.getscreencoords(edge.verts[1].co, reg)
-                                       self.slidecoords[reg].append([[x1, y1], [x2, y2]])                              
+                                       self.slidecoords[reg].append([[x1, y1], [x2, y2]])
                # Box out single vertices.
                self.singles = []
                self.boxes[reg] = []
@@ -487,15 +487,15 @@ class EdgeTune(bpy.types.Operator):
                        if single:
                                self.singles.append(vert)
                                self.boxes[reg].append(self.getscreencoords(vert.co, reg)[:2])
-       
-       
+
+
        def redraw(self):
-               
+
                drawregion = bpy.context.region
-                                       
+
                if self.viewchange:
                        self.adapt()
-                       
+
                if self.slideverts[drawregion] != []:
                        # Draw single verts as boxes.
                        glColor3f(1.0,1.0,0)
@@ -507,7 +507,7 @@ class EdgeTune(bpy.types.Operator):
                                glVertex2f(x+2, y+2)
                                glVertex2f(x+2, y-2)
                                glEnd()
-               
+
                        # Accentuate selected edges.
                        glColor3f(1.0, 1.0, 0)
                        for posn in range(len(self.selcoords[drawregion])):
@@ -517,7 +517,7 @@ class EdgeTune(bpy.types.Operator):
                                x, y = self.selcoords[drawregion][posn][1]
                                glVertex2f(x, y)
                                glEnd()
-               
+
                        # Draw slide-edges.
                        glColor3f(1.0, 0, 0)
                        for posn in range(len(self.slidecoords[drawregion])):
@@ -527,7 +527,7 @@ class EdgeTune(bpy.types.Operator):
                                x, y = self.slidecoords[drawregion][posn][1]
                                glVertex2f(x, y)
                                glEnd()
-       
+
                # Draw mouseover highlighting.
                if self.mouseover:
                        glColor3f(0, 0, 1.0)
@@ -578,4 +578,4 @@ if __name__ == "__main__":
 
 
 
-       
+
index 33b7439..507541a 100644 (file)
@@ -17,7 +17,7 @@
 # ##### END GPL LICENSE BLOCK #####
 
 __bpydoc__ = """\
-The FanConnect addon connects multiple selected verts to one single other vert. 
+The FanConnect addon connects multiple selected verts to one single other vert.
 
 
 Documentation
@@ -38,7 +38,7 @@ bl_info = {
        "name": "FanConnect",
        "author": "Gert De Roost",
        "version": (0, 2, 0),
-       "blender": (2, 6, 3),
+       "blender": (2, 63, 0),
        "location": "View3D > Tools",
        "description": "Connects multiple selected verts to one single other vert.",
        "warning": "",
@@ -58,28 +58,28 @@ class FanConnect(bpy.types.Operator):
        bl_label = "Fan Connect"
        bl_description = "Connects multiple selected verts to one single other vert"
        bl_options = {"REGISTER", "UNDO"}
-       
+
        @classmethod
        def poll(cls, context):
                obj = context.active_object
                return (obj and obj.type == 'MESH' and context.mode == 'EDIT_MESH' and list(context.tool_settings.mesh_select_mode)[0] == True)
 
        def invoke(self, context, event):
-               
+
                ret = self.do_fanconnect(context)
                if ret == False:
                        return {'CANCELLED'}
                self.bm.free()
                bpy.ops.object.editmode_toggle()
                bpy.ops.object.editmode_toggle()
-               
+
                return {'FINISHED'}
 
 
 
 
        def do_fanconnect(self, context):
-       
+
                bpy.ops.object.editmode_toggle()
                bpy.ops.object.editmode_toggle()
                # initialization
@@ -89,13 +89,13 @@ class FanConnect(bpy.types.Operator):
                actvert = self.bm.select_history.active
                if not(isinstance(actvert, bmesh.types.BMVert)):
                        return False
-               
+
                vertlist = []
                for v in self.bm.verts:
                        if v.select:
                                if not(v == actvert):
                                        vertlist.append(v)
-                       
+
                # do connection
                for v in vertlist:
                        for f in actvert.link_faces:
index 23af8f8..4384a93 100644 (file)
@@ -17,7 +17,7 @@
 # ##### END GPL LICENSE BLOCK #####
 
 __bpydoc__ = """\
-This addon enables you to "flood-select" or deselect entire areas of selected/deselected elements. 
+This addon enables you to "flood-select" or deselect entire areas of selected/deselected elements.
 
 
 Documentation
@@ -43,7 +43,7 @@ bl_info = {
        "name": "FloodSel",
        "author": "Gert De Roost",
        "version": (1, 0, 0),
-       "blender": (2, 6, 3),
+       "blender": (2, 63, 0),
        "location": "View3D > Tools",
        "description": "Flood-(de)select areas.",
        "warning": "",
@@ -81,30 +81,30 @@ class FloodSel(bpy.types.Operator):
        bl_label = "FloodSel"
        bl_description = "Flood-(de)select areas"
        bl_options = {'REGISTER', 'UNDO'}
-       
-       
+
+
        SelectMode = bpy.props.BoolProperty(
-               name = "Deselect", 
+               name = "Deselect",
                description = "Switch between selecting and deselecting",
                default = False,
                update = change_header)
 
        Multiple = bpy.props.BoolProperty(
-               name = "Multiple", 
+               name = "Multiple",
                description = "Several operations after each other",
                default = False,
                update = change_header)
 
        Preselection = bpy.props.BoolProperty(
-               name = "Preselection", 
+               name = "Preselection",
                description = "Preview when hovering over areas",
                default = True)
 
        Diagonal = bpy.props.BoolProperty(
-               name = "Diagonal is border", 
+               name = "Diagonal is border",
                description = "Diagonal selections are treated as borders",
                default = True)
-       
+
 
        @classmethod
        def poll(cls, context):
@@ -112,24 +112,24 @@ class FloodSel(bpy.types.Operator):
                return (obj and obj.type == 'MESH' and context.mode == 'EDIT_MESH')
 
        def invoke(self, context, event):
-       
+
                global mainop, started
-       
+
                started = True
-               
+
                mainop = self
-               
+
                self.initialize(context)
-               
+
                context.window_manager.modal_handler_add(self)
-               
+
                return {'RUNNING_MODAL'}
 
 
        def modal(self, context, event):
-       
+
                global started
-               
+
                if event.type in ['MIDDLEMOUSE']:
                        return {'PASS_THROUGH'}
                elif event.type in ['WHEELDOWNMOUSE', 'WHEELUPMOUSE']:
@@ -137,7 +137,7 @@ class FloodSel(bpy.types.Operator):
                elif event.type in ['LEFTMOUSE']:
                        if not(self.region):
                                return {'PASS_THROUGH'}
-                               
+
                        if not(self.Preselection):
                                for elem in self.doneset:
                                        elem.select = not(self.state)
@@ -160,10 +160,10 @@ class FloodSel(bpy.types.Operator):
                        bpy.ops.object.editmode_toggle()
                        return {'FINISHED'}
                elif event.type in ['MOUSEMOVE']:
-                               
+
                        mxa = event.mouse_x
                        mya = event.mouse_y
-                       
+
                        oldregion = self.region
                        self.region = None
                        for a in context.screen.areas:
@@ -178,21 +178,21 @@ class FloodSel(bpy.types.Operator):
                                                        if sp.type == 'VIEW_3D':
                                                                self.space = sp
                                                break
-                                               
+
                        if not(self.region):
-                               if len(self.doneset):   
+                               if len(self.doneset):
                                        oldregion.tag_redraw()
                                        for elem in self.doneset:
                                                elem.select = self.state
                                        self.doneset = set([])
                                return {'PASS_THROUGH'}
-                               
+
                        for elem in self.doneset:
                                elem.select = self.state
-                               
+
                        mx = mxa - self.region.x
                        my = mya - self.region.y
-                       
+
                        rv3d = self.space.region_3d
                        eye = Vector(rv3d.view_matrix.inverted().col[3][:3])
                        mpoint = Vector((mx, my))
@@ -277,34 +277,34 @@ class FloodSel(bpy.types.Operator):
                        if self.Preselection:
                                for elem in self.doneset:
                                        elem.select = not(self.state)
-                                       
+
                        return {'RUNNING_MODAL'}
-                       
+
                return {'RUNNING_MODAL'}
 
 
        def initialize(self, context):
-               
+
                bpy.types.Scene.PreSelOff = bpy.props.BoolProperty(
-                               name = "PreSelOff", 
+                               name = "PreSelOff",
                                description = "Switch off PreSel during FloodSel",
                                default = True)
-               
+
                self.area = context.area
                self.selobj = context.active_object
                self.mesh = self.selobj.data
                self.bm = bmesh.from_edit_mesh(self.mesh)
-       
+
                self.area.header_text_set(text="FloodSel :  Leftclick selects")
-               
+
                self.region = None
                self.doneset = set([])
-               
+
                self.getmatrix()
-       
-       
+
+
        def getmatrix(self):
-               
+
                # Rotating / panning / zooming 3D view is handled here.
                # Calculate matrix.
                if self.selobj.rotation_mode == 'AXIS_ANGLE':
@@ -338,18 +338,18 @@ class FloodSel(bpy.types.Operator):
                        self.matrix = mat_rotZ * mat_rotX * mat_rotY
                elif self.selobj.rotation_mode == 'ZYX':
                        self.matrix = mat_rotZ * mat_rotY * mat_rotX
-       
+
                # handle object scaling
                sx, sy, sz = self.selobj.scale
                mat_scX = Matrix.Scale(sx, 4, Vector([1, 0, 0]))
                mat_scY = Matrix.Scale(sy, 4, Vector([0, 1, 0]))
                mat_scZ = Matrix.Scale(sz, 4, Vector([0, 0, 1]))
                self.matrix = mat_scX * mat_scY * mat_scZ * self.matrix
-       
+
 
 
 def panel_func(self, context):
-       
+
        self.layout.label(text="FloodSel:")
        self.layout.operator("mesh.floodsel", text="Flood SelArea")
        if started:
index 8d1be76..bd2875c 100644 (file)
@@ -17,7 +17,7 @@
 # ##### END GPL LICENSE BLOCK #####
 
 __bpydoc__ = """\
-InnerWeld.  This addon welds parallel connected selected edges together. 
+InnerWeld.  This addon welds parallel connected selected edges together.
 
 Documentation
 
@@ -38,7 +38,7 @@ bl_info = {
        "name": "InnerWeld",
        "author": "Gert De Roost",
        "version": (0, 2, 0),
-       "blender": (2, 6, 3),
+       "blender": (2, 63, 0),
        "location": "View3D > Tools",
        "description": "Welding parallel edges together.",
        "warning": "",
@@ -60,39 +60,39 @@ class InnerWeld(bpy.types.Operator):
        bl_description = "Welding parallel edges together"
        bl_options = {'REGISTER', 'UNDO'}
 
-       
+
        @classmethod
        def poll(cls, context):
                obj = context.active_object
                return (obj and obj.type == 'MESH' and context.mode == 'EDIT_MESH' and list(context.tool_settings.mesh_select_mode) == [False, True, False])
 
        def invoke(self, context, event):
-               
+
                bpy.ops.object.editmode_toggle()
                bpy.ops.object.editmode_toggle()
-               
+
                self.do_innerweld(context)
-               
+
                bpy.ops.object.editmode_toggle()
                bpy.ops.object.editmode_toggle()
-               
+
                return {'FINISHED'}
 
 
        def do_innerweld(self, context):
-       
+
                selobj = context.active_object
                mesh = selobj.data
                bm = bmesh.from_edit_mesh(mesh)
-       
+
                self.sellist = []
                for edge in bm.edges:
                        if edge.select:
                                self.sellist.append(edge)
-       
-       
+
+
                def addstart(vert, posn):
-                       
+
                        # recursive: adds to initial edgelist at start
                        for e in vert.link_edges:
                                if e in self.sellist:
@@ -100,9 +100,9 @@ class InnerWeld(bpy.types.Operator):
                                        v = e.other_vert(vert)
                                        self.vertlist[posn].insert(0, v)
                                        addstart(v, posn)
-               
+
                def addend(vert, posn):
-                       
+
                        # recursive: adds to initial edgelist at end
                        for e in vert.link_edges:
                                if e in self.sellist:
@@ -110,11 +110,11 @@ class InnerWeld(bpy.types.Operator):
                                        v = e.other_vert(vert)
                                        self.vertlist[posn].append(v)
                                        addend(v, posn)
-       
+
                posn = 0
                self.vertlist = []
                while len(self.sellist) > 0:
-                       # initialize next edgesnake             
+                       # initialize next edgesnake
                        self.vertlist.append([])
                        vert = self.sellist[0].verts[0]
                        self.vertlist[posn].append(vert)
@@ -122,8 +122,8 @@ class InnerWeld(bpy.types.Operator):
                        addstart(vert, posn)
                        addend(vert, posn)
                        posn += 1
-                       
-                       
+
+
                found = True
                posn = 0
                mergesets = []
@@ -147,7 +147,7 @@ class InnerWeld(bpy.types.Operator):
                                                                        vset.add(v1)
                                                                        self.vertlist[self.vertlist.index(vlist)].pop(vlist.index(v1))
                                        posn +=1
-       
+
                mergeverts = []
                for st in mergesets:
                        bpy.ops.mesh.select_all(action = 'DESELECT')
@@ -155,19 +155,19 @@ class InnerWeld(bpy.types.Operator):
                                vert.select = True
                                mergeverts.append(vert)
                        bpy.ops.mesh.merge(type='CENTER', uvs=True)
-               
+
                for v in mergeverts:
                        try:
                                v.select = True
                        except:
                                pass
-               
+
                bm.select_flush(1)
                bm.free()
-               
-               
-               
-       
+
+
+
+
 
 def panel_func(self, context):
        self.layout.label(text="InnerWeld:")
index adfd7a5..42a8a5e 100644 (file)
@@ -40,7 +40,7 @@ bl_info = {
        "name": "LapRelax",
        "author": "Gert De Roost",
        "version": (0, 2, 0),
-       "blender": (2, 6, 3),
+       "blender": (2, 63, 0),
        "location": "View3D > Tools",
        "description": "Smoothing mesh keeping volume",
        "warning": "",
@@ -61,9 +61,9 @@ class LapRelax(bpy.types.Operator):
        bl_label = "LapRelax"
        bl_description = "Smoothing mesh keeping volume"
        bl_options = {'REGISTER', 'UNDO'}
-       
+
        Repeat = bpy.props.IntProperty(
-               name = "Repeat", 
+               name = "Repeat",
                description = "Repeat how many times",
                default = 1,
                min = 1,
@@ -76,24 +76,24 @@ class LapRelax(bpy.types.Operator):
                return (obj and obj.type == 'MESH' and context.mode == 'EDIT_MESH')
 
        def invoke(self, context, event):
-               
+
                # smooth #Repeat times
                for i in range(self.Repeat):
                        self.do_laprelax()
-               
+
                return {'FINISHED'}
 
 
        def do_laprelax(self):
-       
+
                context = bpy.context
-               region = context.region  
+               region = context.region
                area = context.area
                selobj = bpy.context.active_object
                mesh = selobj.data
                bm = bmesh.from_edit_mesh(mesh)
                bmprev = bm.copy()
-       
+
                for v in bmprev.verts:
                        if v.select:
                                tot = Vector((0, 0, 0))
@@ -108,12 +108,12 @@ class LapRelax(bpy.types.Operator):
                                if cnt:
                                        # dont affect border edges: they cause shrinkage
                                        continue
-                                       
+
                                # find Laplacian mean
                                for e in v.link_edges:
                                        tot += e.other_vert(v).co
                                tot /= len(v.link_edges)
-                               
+
                                # cancel movement in direction of vertex normal
                                delta = (tot - v.co)
                                if delta.length != 0:
@@ -122,8 +122,8 @@ class LapRelax(bpy.types.Operator):
                                        nor = v.normal
                                        nor.length = abs(deltanor)
                                        bm.verts[v.index].co = tot + nor
-                       
-                       
+
+
                mesh.update()
                bm.free()
                bmprev.free()
@@ -133,7 +133,7 @@ class LapRelax(bpy.types.Operator):
 
 
 def panel_func(self, context):
-       
+
        scn = bpy.context.scene
        self.layout.label(text="LapRelax:")
        self.layout.operator("mesh.laprelax", text="Laplace Relax")
@@ -156,4 +156,4 @@ if __name__ == "__main__":
 
 
 
-       
+
index d7cd054..8e8c1f4 100644 (file)
@@ -23,12 +23,12 @@ This script uses the concept of support edges, or the inserting of new edges par
 Documentation
 
 First go to User Preferences->Addons and enable the ParEdge addon in the Mesh category.
-Go to EditMode, select a closed edge path without corners (an edgeloop or part of an edgeloop)and invoke 
-the addon (button in the Mesh Tool panel).  Enter a distance (positive or negative) with the slider in 
+Go to EditMode, select a closed edge path without corners (an edgeloop or part of an edgeloop)and invoke
+the addon (button in the Mesh Tool panel).  Enter a distance (positive or negative) with the slider in
 the Mesh Tools panel or leftclick-drag from left to right to
 interactively choose the parallel distance.  Select "Both Sides" on the panel to insert edges on both sides.
 Select "Endpoint quads" if you want to have edgepath endpoints "self.capped".
-Press the right mouse button to cancel operation or ENTER to accept changes.  
+Press the right mouse button to cancel operation or ENTER to accept changes.
 The tool will remember the last set distance and the "Both Sides" setting for the next ParEdge operation.
 
 If you wish to hotkey ParEdge:
@@ -43,7 +43,7 @@ bl_info = {
        "name": "ParEdge",
        "author": "Gert De Roost",
        "version": (0, 5, 0),
-       "blender": (2, 6, 3),
+       "blender": (2, 63, 0),
        "location": "View3D > Tools",
        "description": "Inserting of parallel edges",
        "warning": "",
@@ -64,7 +64,7 @@ started = 0
 
 
 def parchangedef(self, context):
-       
+
        mainop.adapt(None)
 
 
@@ -74,10 +74,10 @@ class ParEdge(bpy.types.Operator):
        bl_label = "ParEdge"
        bl_description = "Inserting of parallel edges"
        bl_options = {"REGISTER", "UNDO"}
-       
-       
+
+
        Distance = bpy.props.FloatProperty(
-               name = "Distance", 
+               name = "Distance",
                description = "Enter distance",
                default = 0,
                min = -1,
@@ -85,13 +85,13 @@ class ParEdge(bpy.types.Operator):
                update = parchangedef)
 
        Both = bpy.props.BoolProperty(
-               name = "Both sides", 
+               name = "Both sides",
                description = "Insert on both sides",
                default = False,
                update = parchangedef)
 
        Cap = bpy.props.BoolProperty(
-               name = "Endpoint quads", 
+               name = "Endpoint quads",
                description = "Create endpoint quads",
                default = False,
                update = parchangedef)
@@ -103,28 +103,28 @@ class ParEdge(bpy.types.Operator):
                return (obj and obj.type == 'MESH' and context.mode == 'EDIT_MESH')
 
        def invoke(self, context, event):
-       
+
                global mainop
-               
+
                mainop = self
-               
+
                bpy.types.Scene.PreSelOff = bpy.props.BoolProperty(
-                               name = "PreSelOff", 
+                               name = "PreSelOff",
                                description = "Switch off PreSel during FPS navigation mode",
                                default = True)
-               
+
                self.area = context.area
                self.area.header_text_set(text="ParEdge :  Leftmouse to shift - Enter to confirm - Rightmouse/ESC cancels")
-               
+
                self.init_paredge(context)
-               
+
                context.window_manager.modal_handler_add(self)
-               
+
                return {'RUNNING_MODAL'}
 
 
        def modal(self, context, event):
-               
+
                global started
 
                mxa = event.mouse_x
@@ -139,7 +139,7 @@ class ParEdge(bpy.types.Operator):
                                if mxa > r.x and mya > r.y and mxa < r.x + r.width and mya < r.y + r.height:
                                        self.region = r
                                        break
-                                       
+
                if event.type in {'RIGHTMOUSE', 'ESC'} or self.wrongsel or self.stop:
                        self.area.header_text_set()
                        del bpy.types.Scene.PreSelOff
@@ -150,7 +150,7 @@ class ParEdge(bpy.types.Operator):
                        self.bmundo.to_mesh(self.mesh)
                        bpy.ops.object.editmode_toggle()
                        return {'CANCELLED'}
-                       
+
                elif event.type == 'LEFTMOUSE':
                        if not(self.region):
                                # this for splitting up mouse func between panel and 3d view
@@ -162,11 +162,11 @@ class ParEdge(bpy.types.Operator):
                        if event.value == 'RELEASE':
                                self.mbns = 0
                        return {'RUNNING_MODAL'}
-                       
+
                elif event.type in {'MIDDLEMOUSE', 'WHEELDOWNMOUSE', 'WHEELUPMOUSE'}:
                        # user transforms view
                        return {'PASS_THROUGH'}
-                       
+
                elif event.type in {'RET', 'NUMPAD_ENTER'}:
                        self.area.header_text_set()
                        del bpy.types.Scene.PreSelOff
@@ -227,19 +227,19 @@ class ParEdge(bpy.types.Operator):
                        self.bmundo.free()
                        bpy.ops.object.editmode_toggle()
                        return {'FINISHED'}
-                       
+
                elif event.type == 'MOUSEMOVE':
                        # do some edgecreating
                        self.adapt(event)
                        return {'PASS_THROUGH'}
-                       
+
                return {'RUNNING_MODAL'}
 
 
        def adapt(self, event):
-               
+
                global started
-               
+
                def removecaps():
                        self.capped = False
                        for posn in range(len(self.vertlist)):
@@ -256,8 +256,8 @@ class ParEdge(bpy.types.Operator):
                                                templ.append(f)
                                        bmesh.utils.face_join(templ)
                        self.mesh.calc_tessface()
-       
-       
+
+
                if self.mbns == 0:
                        if self.Cap != self.oldcap:
                                if self.dist != 0:
@@ -269,7 +269,7 @@ class ParEdge(bpy.types.Operator):
                                self.oldcap = self.Cap
                        if self.Both != self.oldboth:
                                if self.dist != 0:
-                                       # enter edge-building through the backdoor to instantaneously show both inserts 
+                                       # enter edge-building through the backdoor to instantaneously show both inserts
                                        self.mbns = 2
                                if self.Both == True:
                                        # if just set
@@ -310,7 +310,7 @@ class ParEdge(bpy.types.Operator):
                                                                for edge in self.dissedges1[posn]:
                                                                        edge.select = True
                                                                bpy.ops.mesh.dissolve_limited()
-                                                               self.mesh.calc_tessface()                                                                                                       
+                                                               self.mesh.calc_tessface()
                                                                for vert in self.dissverts2[posn]:
                                                                        vert.select = True
                                                                for edge in self.dissedges2[posn]:
@@ -343,7 +343,7 @@ class ParEdge(bpy.types.Operator):
                        # dont do anything if zero - removing edges will be handled once exiting with ENTER
                        if self.Distance == 0:
                                return
-                       
+
                        #negative side handling
                        if self.dist < 0 or self.Both == True:
                                for posn in range(len(self.vertlist)):
@@ -367,7 +367,7 @@ class ParEdge(bpy.types.Operator):
                                                self.railverts1[posn] = []
                                                self.dissverts1[posn] = []
                                                self.dissedges1[posn] = []
-                               
+
                                for posn in range(len(self.vertlist)):
                                        if not(self.negsubd[posn]):
                                                self.negsubd[posn] = True
@@ -382,8 +382,8 @@ class ParEdge(bpy.types.Operator):
                                                                        self.railedges1[posn].append(e)
                                                                        if self.vertlist[posn].index(vert) == len(self.vertlist[posn]) - 2:
                                                                                self.railverts1[posn].append(loop.link_loop_next.link_loop_next.vert)
-                                                                               e = loop.link_loop_next.edge        
-                                                                               self.railedges1[posn].append(e)                                                 
+                                                                               e = loop.link_loop_next.edge
+                                                                               self.railedges1[posn].append(e)
                                                if self.railedges1[posn] != []:
                                                        # insert parallel edges
                                                        prev = None
@@ -401,7 +401,7 @@ class ParEdge(bpy.types.Operator):
                                                                else:
                                                                        dummy, vert = bmesh.utils.edge_split(edge, self.vertlist[posn][self.railedges1[posn].index(edge)], 0.5)
                                                                if idx == 0:
-                                                                       startvert = vert 
+                                                                       startvert = vert
                                                                self.dissverts1[posn].append(vert)
                                                                if not(prev == None):
                                                                        for f in edge.link_faces:
@@ -415,14 +415,14 @@ class ParEdge(bpy.types.Operator):
                                                                prev = vert
                                                                prevedge = edge
                                                        self.mesh.calc_tessface()
-       
+
                                # select inserted edges/verts
                                for posn in range(len(self.vertlist)):
                                        for v in self.dissverts1[posn]:
                                                v.select = True
                                        for e in self.dissedges1[posn]:
                                                e.select = True
-       
+
                        # do distance shifting
                        for posn in range(len(self.vertlist)):
                                if self.railedges1[posn] != []:
@@ -433,8 +433,8 @@ class ParEdge(bpy.types.Operator):
                                                vec = rv.co - sv.co
                                                vec.length = abs(self.dist)
                                                pv.co = sv.co + vec
-       
-       
+
+
                        #positive side handling
                        if self.dist > 0 or self.Both == True:
                                for posn in range(len(self.vertlist)):
@@ -493,7 +493,7 @@ class ParEdge(bpy.types.Operator):
                                                                else:
                                                                        dummy, vert = bmesh.utils.edge_split(edge, self.vertlist[posn][self.railedges2[posn].index(edge)], 0.5)
                                                                if idx == 0:
-                                                                       startvert = vert 
+                                                                       startvert = vert
                                                                self.dissverts2[posn].append(vert)
                                                                if not(prev == None):
                                                                        for f in edge.link_faces:
@@ -507,15 +507,15 @@ class ParEdge(bpy.types.Operator):
                                                                prev = vert
                                                                prevedge = edge
                                                        self.mesh.calc_tessface()
-                                               
-       
+
+
                                # select inserted edges/verts
                                for posn in range(len(self.vertlist)):
                                        for v in self.dissverts2[posn]:
                                                v.select = True
                                        for e in self.dissedges2[posn]:
                                                e.select = True
-       
+
                        # do distance shifting
                        for posn in range(len(self.vertlist)):
                                if self.railedges2[posn] != []:
@@ -526,14 +526,14 @@ class ParEdge(bpy.types.Operator):
                                                vec = rv.co - sv.co
                                                vec.length = abs(self.dist)
                                                pv.co = sv.co + vec
-                       
+
                        # create cap
                        if not(self.capped):
                                capsellist = []
                                for posn in range(len(self.vertlist)):
                                        if self.Both and self.Cap:
                                                self.capped = True
-                                               
+
                                                def capendpoint(i):
                                                        self.capedges = []
                                                        es1 = None
@@ -579,29 +579,29 @@ class ParEdge(bpy.types.Operator):
                                                                self.caplist[posn].append((es1, es2, vert, v2, f3, fo1, fo2))
                                                        capsellist.append(es1)
                                                        capsellist.append(es2)
-                                                               
+
                                                self.caplist[posn] = []
                                                capendpoint(0)
                                                capendpoint(-1)
                                self.mesh.calc_tessface()
-       
+
                        # select original verts/edges
                        for posn in range(len(self.vertlist)):
                                for edge in self.edgelist[posn]:
                                        edge.select = True
                                for vert in self.vertlist[posn]:
                                        vert.select = True
-                                       
+
                bmesh.update_edit_mesh(self.mesh, destructive=True)
                self.mesh.update()
-               
-       
-       
-       
+
+
+
+
        def init_paredge(self, context):
-       
+
                global started
-               
+
                self.oldcap = False
                self.capped = False
                self.stop = False
@@ -624,18 +624,18 @@ class ParEdge(bpy.types.Operator):
                self.caplist = []
                self.singledir = []
                self.firstvert = []
-       
+
                bpy.ops.object.editmode_toggle()
                bpy.ops.object.editmode_toggle()
-               
+
                bpy.ops.mesh.sort_elements(elements={'VERT'})
-               self.region = context.region  
+               self.region = context.region
                selobj = bpy.context.active_object
                self.mesh = selobj.data
                self.bm = bmesh.from_edit_mesh(self.mesh)
                self.bmundo = self.bm.copy()
                started = True
-       
+
                self.sellist = []
                self.sellist2 = []
                self.edgelist = []
@@ -649,7 +649,7 @@ class ParEdge(bpy.types.Operator):
                        return
                # find first two connected verts: v and nxv
                # they consitute edge e
-               
+
                # self.vertlist: make ordered list of selected vert-string
                # self.edgelist: make ordered list of selected edges-string
                p = 0
@@ -685,7 +685,7 @@ class ParEdge(bpy.types.Operator):
                                pass
                        print (self.vertlist[0])
 
-                       # add in front of lists 
+                       # add in front of lists
                        while len(self.sellist) > 0:
                                self.facelist = []
                                invlist = []
@@ -723,11 +723,11 @@ class ParEdge(bpy.types.Operator):
                                                self.sellist.pop(self.sellist.index(fv))
                                                continue
                                break
-                       
+
                        #store first vert for closedness checking
                        self.firstvert[p] = self.vertlist[p][0]
                        self.sellist.append(self.firstvert[p])
-       
+
                        # add to end of lists
                        while len(self.sellist) > 0:
                                self.facelist = []
@@ -778,18 +778,18 @@ class ParEdge(bpy.types.Operator):
                                self.sellist.pop(self.sellist.index(self.firstvert[p]))
                        # next selected edgeloopslice
                        p += 1
-       
-       
+
+
                # orient edge and vertlists parallel - reverse if necessary
-       
-               self.singledir[0] = self.edgelist[0][0].verts[0]                
-               
+
+               self.singledir[0] = self.edgelist[0][0].verts[0]
+
                for i in range(len(self.edgelist) - 1):
                        bpy.ops.mesh.select_all(action = 'DESELECT')
                        # get first vert and edge for two adjacent slices
                        for v in self.edgelist[i][0].verts:
                                if len(self.edgelist[i]) == 1:
-                                       vt = self.singledir[i]  
+                                       vt = self.singledir[i]
                                        vt.select = True
                                        self.bm.select_history.add(vt)
                                        v1 = vt
@@ -816,15 +816,15 @@ class ParEdge(bpy.types.Operator):
                        self.bm.select_history.validate()
                        # get path between startverts for checking orientation
                        bpy.ops.mesh.shortest_path_select()
-                       
+
                        for e in self.bm.edges:
                                if e.verts[0].select and e.verts[1].select:
                                        e.select = True
-                       
-                       
+
+
                        # correct selected path when not connected neatly to vert from left or right(cant know direction)
                        def correctsel(e1, v1, lst):
-                       
+
                                found = False
                                # check situation where left/right connection is on some other slicevert than first
                                while not(found):
@@ -852,7 +852,7 @@ class ParEdge(bpy.types.Operator):
                                                                                v1 = e1.other_vert(v1)
                                                                                e1 = edge
                                                        found = False
-                                               
+
                                # check situation where left/right connection is on vert thats outside slice
                                found = False
                                while not(found):
@@ -871,19 +871,19 @@ class ParEdge(bpy.types.Operator):
                                                                e1 = edge
                                                                found = False
                                return e1, v1, 'NORMAL'
-                                                               
+
                        e1, v1, state1 = correctsel(e1, v1, self.edgelist[i])
                        if state1 == 'REVERSE':
                                # special trick - mail me
                                for j in range(i + 1):
                                        self.edgelist[j].reverse()
                                        self.vertlist[j].reverse()
-                       e2, v2, state2 = correctsel(e2, v2, self.edgelist[i+1])                                 
+                       e2, v2, state2 = correctsel(e2, v2, self.edgelist[i+1])
                        if state2 == 'REVERSE':
                                # special trick - mail me
                                self.edgelist[i+1].reverse()
                                self.vertlist[i+1].reverse()
-       
+
                        # do all the checking to see if the checked lists must be reversed
                        brk = False
                        for face1 in e1.link_faces:
@@ -943,39 +943,39 @@ class ParEdge(bpy.types.Operator):
                                                                                        break
                                                                break
                                                break
-       
+
                bpy.ops.mesh.select_all(action = 'DESELECT')
                for posn in range(len(self.vertlist)):
                        for v in self.vertlist[posn]:
                                v.select = True
                        for e in self.edgelist[posn]:
                                e.select = True
-       
-       
+
+
                # try to guess min and max values for distance slider - can always use mouse to override
                co1 = self.vertlist[0][0].co
-               co2 = self.vertlist[0][len(self.vertlist[0]) - 1].co                            
+               co2 = self.vertlist[0][len(self.vertlist[0]) - 1].co
                self.meanmin = (co1 - co2).length * -2
                self.meanmax = -self.meanmin
                if self.meanmax == 0:
                        self.meanmax = self.meanmin = 1
-       
+
                # this is only local - must find way to change Operator prop
                Distance = bpy.props.FloatProperty(
-                               name = "Distance", 
+                               name = "Distance",
                                description = "Enter distance2",
                                default = 0,
                                min = self.meanmin,
                                max = self.meanmax)
-               
-               
+
+
 
 
 
 
 
 def panel_func(self, context):
-       
+
        self.layout.label(text="ParEdge:")
        self.layout.operator("mesh.paredge", text="Insert Edges")
        if started:
@@ -1001,4 +1001,4 @@ if __name__ == "__main__":
 
 
 
-       
+
index b70dbb6..942afee 100644 (file)
@@ -35,7 +35,7 @@ bl_info = {
        "name": "Quadder",
        "author": "Gert De Roost",
        "version": (0, 4, 0),
-       "blender": (2, 6, 3),
+       "blender": (2, 63, 0),
        "location": "View3D > Tools",
        "description": "Fills selected border verts/edges area with quads",
        "warning": "",
@@ -54,26 +54,26 @@ class Quadder(bpy.types.Operator):
        bl_label = "Quadder"
        bl_description = "Fills selected border verts/edges area with quads"
        bl_options = {'REGISTER', 'UNDO'}
-       
+
        @classmethod
        def poll(cls, context):
                obj = context.active_object
                return (obj and obj.type == 'MESH' and context.mode == 'EDIT_MESH')
 
        def invoke(self, context, event):
-               
+
                self.do_quadder()
-               
+
                return {'FINISHED'}
-               
-               
-               
+
+
+
        def do_quadder(self):
-               
+
                selobj = bpy.context.active_object
                mesh = selobj.data
                self.bm = bmesh.from_edit_mesh(mesh)
-       
+
                smoothlist = []
                for v in self.bm.verts:
                        if v.select:
@@ -82,7 +82,7 @@ class Quadder(bpy.types.Operator):
                for e in self.bm.edges:
                        if e.select:
                                self.ecnt += 1
-               
+
                vertlist = []
                templist = []
                verts = self.findcorner()
@@ -103,7 +103,7 @@ class Quadder(bpy.types.Operator):
                        verts = self.findcorner()
                        if self.ecnt == 2:
                                verts = None
-                       
+
                for v in vertlist:
                        v.select = True
                for v in smoothlist:
@@ -122,14 +122,14 @@ class Quadder(bpy.types.Operator):
                for v in vertlist:
                        v.select = True
                bpy.ops.mesh.select_all(action = 'DESELECT')
-                       
+
                bpy.ops.object.editmode_toggle()
                bpy.ops.object.editmode_toggle()
                self.bm.free()
-               
-               
+
+
        def findcorner(self):
-               
+
                if self.ecnt == 2:
                        for v in self.bm.verts:
                                if v.select:
@@ -165,7 +165,7 @@ class Quadder(bpy.types.Operator):
                                                                        v2 = e1.other_vert(v1)
                                                                        v3 = e2.other_vert(v1)
                                                                        return [v2, v1, v3]
-                                               
+
                                linkedges = []
                                linkverts = []
                                for e1 in v1.link_edges:
@@ -242,4 +242,4 @@ if __name__ == "__main__":
 
 
 
-       
+
index 051ed82..3af1cff 100644 (file)
@@ -17,7 +17,7 @@
 # ##### END GPL LICENSE BLOCK #####
 
 __bpydoc__ = """\
-The SelProject addon enables you to "project" an object onto another object, every vertex inside the 
+The SelProject addon enables you to "project" an object onto another object, every vertex inside the
 projection's shape will be selected.
 
 
@@ -29,8 +29,8 @@ is the object you project, To object the one you project on.  If switching to ed
 the "Use Selection" option appears.  When choosing this you will use a copy of the selected area
 instead of a From object.
 Press Start SelProject to start the projection.  When in Use Selection mode, the object selected from
-will be temporarily hidden for the duration of the operation.  You can use manipulator and 
-G, R and S (and XYZ) hotkeys as usual to transform both objects.  Also there is the direction Empty 
+will be temporarily hidden for the duration of the operation.  You can use manipulator and
+G, R and S (and XYZ) hotkeys as usual to transform both objects.  Also there is the direction Empty
 which is used in combination with the origin of the From object (which will be temporarily set to
 object geometry median) to set the projection direction.
 Press ENTER to finalize the selection projection operation.
@@ -41,7 +41,7 @@ bl_info = {
        "name": "SelProject",
        "author": "Gert De Roost",
        "version": (0, 3, 0),
-       "blender": (2, 6, 3),
+       "blender": (2, 63, 0),
        "location": "View3D > Tools",
        "description": "Use object projection as selection tool.",
        "warning": "",
@@ -66,19 +66,19 @@ oldobjs = []
 
 
 bpy.types.Scene.UseSel = bpy.props.BoolProperty(
-               name = "Use Selection", 
+               name = "Use Selection",
                description = "Use selected area as From object",
                default = False)
 
 bpy.types.Scene.FromObject = bpy.props.EnumProperty(
                items = [("Empty", "Empty", "Empty")],
-               name = "From", 
+               name = "From",
                description = "Object to project",
                default = "Empty")
 
 bpy.types.Scene.ToObject = bpy.props.EnumProperty(
                items = [("Empty", "Empty", "Empty")],
-               name = "To", 
+               name = "To",
                description = "Object to project onto")
 
 
@@ -90,29 +90,29 @@ class SelProject(bpy.types.Operator):
        bl_label = "SelProject"
        bl_description = "Use object projection as selection tool"
        bl_options = {'REGISTER', 'UNDO'}
-       
+
        def invoke(self, context, event):
-               
+
                global started
-               
+
                started = True
-               
+
                self.area = context.area
                self.area.header_text_set(text="SelProject :  Enter to confirm - ESC to exit")
 
                self.init_selproject(context)
-               
+
                context.window_manager.modal_handler_add(self)
 
                self._handle = bpy.types.SpaceView3D.draw_handler_add(self.redraw, (), 'WINDOW', 'POST_PIXEL')
-               
+
                return {'RUNNING_MODAL'}
 
 
        def modal(self, context, event):
 
                global started
-                               
+
                if event.type in {'RET', 'NUMPAD_ENTER'}:
                        self.area.header_text_set()
                        if self.obhide != None:
@@ -126,7 +126,7 @@ class SelProject(bpy.types.Operator):
                        bpy.context.scene.objects.active = self.empt
                        bpy.ops.object.delete()
                        self.obT.select = True
-                       bpy.context.scene.objects.active = self.obT                             
+                       bpy.context.scene.objects.active = self.obT
                        started = False
                        for v in self.vsellist:
                                v.select = True
@@ -144,7 +144,7 @@ class SelProject(bpy.types.Operator):
                        bpy.types.SpaceView3D.draw_handler_remove(self._handle, 'WINDOW')
                        bpy.ops.object.editmode_toggle()
                        return {'FINISHED'}
-                       
+
                elif event.type == 'ESC':
                        self.area.header_text_set()
                        if self.obhide != None:
@@ -173,12 +173,12 @@ class SelProject(bpy.types.Operator):
                elif event.type in {'LEFTMOUSE', 'MIDDLEMOUSE', 'RIGHTMOUSE', 'WHEELDOWNMOUSE', 'WHEELUPMOUSE', 'G', 'S', 'R', 'X', 'Y', 'Z', 'MOUSEMOVE'}:
                        context.region.tag_redraw()
                        return {'PASS_THROUGH'}
-                       
+
                return {'RUNNING_MODAL'}
 
 
        def getmatrix(self, selobj):
-               
+
                # Rotating / panning / zooming 3D view is handled here.
                # Creates a matrix.
                if selobj.rotation_mode == 'AXIS_ANGLE':
@@ -212,33 +212,33 @@ class SelProject(bpy.types.Operator):
                        matrix = mat_rotZ * mat_rotX * mat_rotY
                elif selobj.rotation_mode == 'ZYX':
                        matrix = mat_rotZ * mat_rotY * mat_rotX
-       
+
                # handle object scaling
                sx, sy, sz = selobj.scale
                mat_scX = Matrix.Scale(sx, 4, Vector([1, 0, 0]))
                mat_scY = Matrix.Scale(sy, 4, Vector([0, 1, 0]))
                mat_scZ = Matrix.Scale(sz, 4, Vector([0, 0, 1]))
                matrix = mat_scX * mat_scY * mat_scZ * matrix
-               
+
                return matrix
-       
-       
+
+
        def getscreencoords(self, vector):
                # calculate screencoords of given Vector
                vector = vector * self.matrixT
                vector = vector + self.obT.location
-               
+
                svector = bpy_extras.view3d_utils.location_3d_to_region_2d(self.region, self.rv3d, vector)
                if svector == None:
                        return [0, 0]
                else:
                        return [svector[0], svector[1]]
-       
-       
-       
-       
+
+
+
+
        def checksel(self):
-               
+
                self.selverts = []
                self.matrixT = self.getmatrix(self.obT)
                self.matrixF = self.getmatrix(self.obF).inverted()
@@ -259,24 +259,24 @@ class SelProject(bpy.types.Operator):
                                hit = self.obF.ray_cast(vco, vco + direc1)
                                if hit[2] != -1:
                                        v.select = True
-                                       self.selverts.append(v) 
-       
-       
-       
-       
-       
+                                       self.selverts.append(v)
+
+
+
+
+
        def init_selproject(self, context):
-       
+
                self.obhide = None
                # main operation
                self.scn = context.scene
-               self.region = context.region  
+               self.region = context.region
                self.rv3d = context.space_data.region_3d
                self.oldobjlist = list(self.scn.objects)
                self.oldobj = context.active_object
                self.oldmode = self.oldobj.mode
                mesh = self.oldobj.data
-               
+
                if self.scn.UseSel and context.mode == 'EDIT_MESH':
                        self.obhide = context.active_object
                        me = self.obhide.data
@@ -303,7 +303,7 @@ class SelProject(bpy.types.Operator):
                self.meF = self.obF.to_mesh(self.scn, 1, 'PREVIEW')
                self.bmF = bmesh.new()
                self.bmF.from_mesh(self.meF)
-               
+
                self.obT = bpy.data.objects.get(self.scn.ToObject)
                self.obT.select = True
                self.scn.objects.active = self.obT
@@ -312,7 +312,7 @@ class SelProject(bpy.types.Operator):
                self.meT = self.obT.data
                self.bmT = bmesh.new()
                self.bmT.from_mesh(self.meT)
-                       
+
                self.vsellist = []
                for v in self.bmT.verts:
                        if v.select:
@@ -325,16 +325,16 @@ class SelProject(bpy.types.Operator):
                for f in self.bmT.faces:
                        if f.select:
                                self.fsellist.append(f)
-                               
+
                bpy.ops.object.add(type='EMPTY', location=(self.obF.location + self.obT.location) / 2)
                self.empt = context.active_object
                self.empt.name = "SelProject_dir_empty"
-       
+
                self.selverts = []
-       
-       
+
+
        def redraw(self):
-               
+
                if started:
                        self.checksel()
                        glColor3f(1.0, 1.0, 0)
@@ -346,15 +346,15 @@ class SelProject(bpy.types.Operator):
                                glVertex2f(x+2, y+2)
                                glVertex2f(x+2, y-2)
                                glEnd()
-       
-       
-       
+
+
+
 
 
 def panel_func(self, context):
-       
+
        self.scn = context.scene
-       
+
        self.layout.label(text="SelProject:")
        if started:
                self.layout.operator("mesh.selproject", text="SelProject")
@@ -376,7 +376,7 @@ def panel_func(self, context):
 
 def register():
 
-       bpy.app.handlers.scene_update_post.append(sceneupdate_handler)  
+       bpy.app.handlers.scene_update_post.append(sceneupdate_handler)
 
        bpy.utils.register_module(__name__)
        bpy.types.VIEW3D_PT_tools_meshedit.append(panel_func)
@@ -385,7 +385,7 @@ def register():
 
 def unregister():
        bpy.app.handlers.scene_update_post.remove(sceneupdate_handler)
-       
+
        bpy.utils.unregister_module(__name__)
        bpy.types.VIEW3D_PT_tools_meshedit.remove(panel_func)
        bpy.types.VIEW3D_PT_tools_objectmode.append(panel_func)
@@ -414,14 +414,14 @@ def sceneupdate_handler(dummy):
                                itemlist.append((ob.name, ob.name, "Set From:"))
                bpy.types.Scene.FromObject = bpy.props.EnumProperty(
                                items = itemlist,
-                               name = "From", 
+                               name = "From",
                                description = "Object to project")
                bpy.types.Scene.ToObject = bpy.props.EnumProperty(
                                items = itemlist,
-                               name = "To", 
+                               name = "To",
                                description = "Object to project onto")
                oldobjs = list(scn.objects)
-                       
+
        return {'RUNNING_MODAL'}
 
 
index 0626e78..cf1b9d5 100644 (file)
@@ -41,7 +41,7 @@ bl_info = {
        "name": "StraightenPlus",
        "author": "Gert De Roost",
        "version": (0, 3, 0),
-       "blender": (2, 6, 3),
+       "blender": (2, 63, 0),
        "location": "View3D > Tools",
        "description": "Straighten connected edges",
        "warning": "",
@@ -65,38 +65,38 @@ class StraightenPlus(bpy.types.Operator):
        bl_label = "StraightenPlus"
        bl_description = "Straighten edgeslices"
        bl_options = {'REGISTER', 'UNDO'}
-       
+
        CancelAxis = bpy.props.BoolProperty(
-               name = "Restrict axis", 
+               name = "Restrict axis",
                description = "Dont straighten along the view axis",
                default = False)
 
        Percentage = bpy.props.FloatProperty(
-               name = "Amount", 
+               name = "Amount",
                description = "Amount of straightening",
         default = 1,
         min = 0,
         max = 1)
 
-       
+
        @classmethod
        def poll(cls, context):
                obj = context.active_object
                return (obj and obj.type == 'MESH' and context.mode == 'EDIT_MESH')
 
        def invoke(self, context, event):
-       
+
                global started, mainop
-               
+
                started = True
-               
+
                mainop = self
-               
+
                bpy.types.Scene.PreSelOff = bpy.props.BoolProperty(
-                               name = "PreSelOff", 
+                               name = "PreSelOff",
                                description = "Switch off PreSel during Straighten operation",
                                default = True)
-               
+
                area = context.area
                area.header_text_set(text="Straighten :  Leftmouse tweaks - Enter confirms - Rightmouse/ESC cancels")
 
@@ -111,17 +111,17 @@ class StraightenPlus(bpy.types.Operator):
                        bpy.ops.object.editmode_toggle()
                        bpy.ops.object.editmode_toggle()
                        started = False
-                       return {'FINISHED'}                     
-               
+                       return {'FINISHED'}
+
                context.window_manager.modal_handler_add(self)
-               
+
                return {'RUNNING_MODAL'}
 
 
        def modal(self, context, event):
-               
+
                global started
-               
+
                if event.type in {'RIGHTMOUSE', 'ESC'}:
                        # cancel operation, reset mesh
                        del bpy.types.Scene.PreSelOff
@@ -134,10 +134,10 @@ class StraightenPlus(bpy.types.Operator):
                        bpy.ops.object.editmode_toggle()
                        started = False
                        return {'CANCELLED'}
-                       
+
                elif event.type in {'MIDDLEMOUSE', 'WHEELDOWNMOUSE', 'WHEELUPMOUSE'}:
                        return {'PASS_THROUGH'}
-                       
+
                elif event.type in {'MOUSEMOVE', 'LEFTMOUSE'}:
                        mxa = event.mouse_x
                        mya = event.mouse_y
@@ -153,7 +153,7 @@ class StraightenPlus(bpy.types.Operator):
                                                break
                        if not(self.region) and not(self.tweaking):
                                return {'PASS_THROUGH'}
-                               
+
                if event.type == 'LEFTMOUSE':
                        if event.value == 'PRESS':
                                self.tweaking = True
@@ -161,7 +161,7 @@ class StraightenPlus(bpy.types.Operator):
                        else:
                                self.tweaking = False
                        return {'RUNNING_MODAL'}
-                       
+
                if self.tweaking and event.type == 'MOUSEMOVE':
                        mx = event.mouse_x
                        newperc = self.Percentage + (mx - self.oldmx) / 200
@@ -173,7 +173,7 @@ class StraightenPlus(bpy.types.Operator):
                        self.do_straighten()
                        self.oldmx = mx
                        return {'RUNNING_MODAL'}
-                               
+
                if event.type in {'RET', 'NUMPAD_ENTER'}:
                        if not(self.region):
                                return {'PASS_THROUGH'}
@@ -186,26 +186,26 @@ class StraightenPlus(bpy.types.Operator):
                        bpy.ops.object.editmode_toggle()
                        started = 0
                        return {'FINISHED'}
-                       
+
                return {'RUNNING_MODAL'}
-               
+
 
        def prepare_lists(self, context):
-       
+
                bpy.ops.object.editmode_toggle()
                bpy.ops.object.editmode_toggle()
                selobj = context.active_object
                self.mesh = selobj.data
                self.bm = bmesh.from_edit_mesh(self.mesh)
-       
+
                self.selset = set([])
                for edge in self.bm.edges:
                        if edge.select:
                                self.selset.add(edge)
-       
-       
+
+
                def addstart(vert, posn):
-                       
+
                        # recursive: adds to initial edgelist at start
                        for e in vert.link_edges:
                                if e in self.selset:
@@ -214,9 +214,9 @@ class StraightenPlus(bpy.types.Operator):
                                        self.vertlist[posn].insert(0, (v, Vector(v.co[:])))
                                        addstart(v, posn)
                                        break
-               
+
                def addend(vert, posn):
-                       
+
                        # recursive: adds to initial edgelist at end
                        for e in vert.link_edges:
                                if e in self.selset:
@@ -225,11 +225,11 @@ class StraightenPlus(bpy.types.Operator):
                                        self.vertlist[posn].append((v, Vector(v.co[:])))
                                        addend(v, posn)
                                        break
-               
+
                posn = 0
                self.vertlist = []
                while len(self.selset) > 0:
-                       # initialize next edgesnake             
+                       # initialize next edgesnake
                        self.vertlist.append([])
                        elem = self.selset.pop()
                        vert = elem.verts[0]
@@ -239,11 +239,11 @@ class StraightenPlus(bpy.types.Operator):
                        addstart(vert, posn)
                        addend(vert, posn)
                        posn += 1
-               
-       
-       
+
+
+
        def do_straighten(self):
-       
+
                for vlist in self.vertlist:
                        vstart = vlist[0][0]
                        vend = vlist[len(vlist) - 1][0]
@@ -256,7 +256,7 @@ class StraightenPlus(bpy.types.Operator):
                                ap = vco - vstart.co
                                perpco = vstart.co + ((ab.dot(ap) / (ab.length ** 2)) * ab)
                                vert.co = vco + ((perpco - vco) * (self.Percentage))
-                               
+
                                if self.CancelAxis:
                                        # cancel movement in direction perp view
                                        delta = (vert.co - vco)
@@ -268,15 +268,15 @@ class StraightenPlus(bpy.types.Operator):
                                                nor.length = abs(deltanor)
                                                if deltanor >= 0:
                                                        nor = -1*nor
-                                               vert.co = vert.co + nor         
-       
+                                               vert.co = vert.co + nor
+
                self.mesh.update()
-                               
+
 
 
 
 def panel_func(self, context):
-       
+
        self.layout.label(text="StraightenPlus:")
        self.layout.operator("mesh.straightenplus", text="Straighten")
        if started:
@@ -302,4 +302,4 @@ if __name__ == "__main__":
 
 
 
-                               
+
index 12e138c..3dca80b 100644 (file)
@@ -42,7 +42,7 @@ bl_info = {
        "name": "DeCouple",
        "author": "Gert De Roost",
        "version": (0, 2, 0),
-       "blender": (2, 6, 5),
+       "blender": (2, 65, 0),
        "location": "View3D > Tools",
        "description": "Temporarily decouples parent and children",
        "warning": "",
@@ -64,27 +64,27 @@ class DeCouple(bpy.types.Operator):
        bl_label = "DeCouple"
        bl_description = "Temporarily decouples parent and children"
        bl_options = {"REGISTER", "UNDO"}
-       
-       
+
+
        @classmethod
        def poll(cls, context):
                obj = context.active_object
                return (obj and context.mode == 'OBJECT')
 
        def execute(self, context):
-       
+
                global unparented
-               
+
                self.do_decouple(context)
                unparented = True
-                       
-               return {'FINISHED'}             
-               
-               
+
+               return {'FINISHED'}
+
+
        def do_decouple(self, context):
-       
+
                global parent, children
-       
+
                parent = context.active_object
                if len(parent.children) == 0:
                        return
@@ -98,30 +98,30 @@ class DeCouple(bpy.types.Operator):
                        child.select = 0
                parent.select = 1
                context.scene.objects.active = parent
-               
-               
+
+
 class ReCouple(bpy.types.Operator):
        bl_idname = "object.recouple"
        bl_label = "ReCouple"
        bl_description = "Recouples decoupled parent and children"
        bl_options = {"REGISTER", "UNDO"}
-       
+
        @classmethod
        def poll(cls, context):
                obj = context.active_object
                return (obj and context.mode == 'OBJECT')
 
        def execute(self, context):
-       
+
                global unparented
-               
+
                self.do_recouple(context)
                unparented = False
-                       
-               return {'FINISHED'}             
-               
+
+               return {'FINISHED'}
+
        def do_recouple(self, context):
-       
+
                parent.select = 0
                for child in children:
                        child.select = 1
index f89835e..edc371b 100644 (file)
@@ -26,7 +26,7 @@ Documentation
 First go to User Preferences->Addons and enable the FastOrigin addon in the Object category.
 Select an object.  Invoke addon (button in Tools panel).  When in Object mode, addon will switch into
 EditMode and create a sinbgl.gle selected vertex which can be translated by standard means with snapping
-on for vertices (this can be changed in the standard way to other targets or no snap , the snap target 
+on for vertices (this can be changed in the standard way to other targets or no snap , the snap target
 mode will be retained when using the addon a second time).  The 3D cursor will move along with the vert
 to make the chosen position a bit clearer.  The old origin will remain visible during moving, this is
 perfectly normal.
@@ -48,7 +48,7 @@ bl_info = {
        "name": "FastOrigin",
        "author": "Gert De Roost",
        "version": (0, 4, 0),
-       "blender": (2, 6, 8),
+       "blender": (2, 68, 0),
        "location": "View3D > Tools",
        "description": "Set object origin with snapping.",
        "warning": "",
@@ -63,7 +63,7 @@ from bpy_extras.view3d_utils import location_3d_to_region_2d
 import bmesh
 import bgl
 import blf
-from mathutils import * 
+from mathutils import *
 import time
 
 
@@ -72,25 +72,25 @@ class FastOrigin(bpy.types.Operator):
        bl_label = "Fast Origin"
        bl_description = "Set object origin with snapping"
        bl_options = {'REGISTER', 'UNDO'}
-       
+
        @classmethod
        def poll(cls, context):
                obj = context.active_object
                return (obj and obj.type == 'MESH')
 
        def invoke(self, context, event):
-               
+
                bpy.types.Scene.PreSelOff = bpy.props.BoolProperty(
-                               name = "PreSelOff", 
+                               name = "PreSelOff",
                                description = "Switch off PreSel during Straighten operation",
                                default = True)
-               
+
                self.init_fastorigin(context)
-               
+
                context.window_manager.modal_handler_add(self)
 
                self._handle = bpy.types.SpaceView3D.draw_handler_add(self.redraw, (), 'WINDOW', 'POST_PIXEL')
-               
+
                return {'RUNNING_MODAL'}
 
 
@@ -98,7 +98,7 @@ class FastOrigin(bpy.types.Operator):
 
                if event.type in {'LEFTMOUSE', 'MIDDLEMOUSE', 'RIGHTMOUSE', 'WHEELDOWNMOUSE', 'WHEELUPMOUSE', 'G', 'X', 'Y', 'Z', 'MOUSEMOVE'}:
                        return {'PASS_THROUGH'}
-                       
+
                elif event.type in {'RET', 'NUMPAD_ENTER'}:
                        del bpy.types.Scene.PreSelOff
                        # Consolidate changes.
@@ -116,12 +116,12 @@ class FastOrigin(bpy.types.Operator):
                        context.tool_settings.use_snap = self.snapstsave
                        bpy.ops.object.editmode_toggle()
                        bpy.ops.object.origin_set(type='ORIGIN_CURSOR')
-                       self.space3d.cursor_location = self.cursorsave                  
+                       self.space3d.cursor_location = self.cursorsave
                        if self.mode == 'EDIT':
                                bpy.ops.object.editmode_toggle()
                        bpy.types.SpaceView3D.draw_handler_remove(self._handle, 'WINDOW')
                        return {'FINISHED'}
-                       
+
                elif event.type == 'ESC':
                        del bpy.types.Scene.PreSelOff
                        # Cancel
@@ -137,24 +137,24 @@ class FastOrigin(bpy.types.Operator):
                        self.bm.free()
                        context.tool_settings.snap_element = self.snapelsave
                        context.tool_settings.use_snap = self.snapstsave
-                       self.space3d.cursor_location = self.cursorsave                  
+                       self.space3d.cursor_location = self.cursorsave
                        if self.mode == 'EDIT':
                                bpy.ops.object.editmode_toggle()
                        bpy.types.SpaceView3D.draw_handler_remove(self._handle, 'WINDOW')
                        return {'CANCELLED'}
-               
+
                return {'RUNNING_MODAL'}
 
 
        def init_fastorigin(self, context):
-       
+
                for space in context.area.spaces:
                        if space.type == 'VIEW_3D':
                                self.space3d = space
                self.selobj = context.active_object
                self.mesh = self.selobj.data
                self.region = context.region
-               
+
                self.rv3ds = {}
                for a in bpy.context.screen.areas:
                        if not(a.type == "VIEW_3D"):
@@ -165,12 +165,12 @@ class FastOrigin(bpy.types.Operator):
                                                if not(r.type == "WINDOW"):
                                                        continue
                                                self.rv3ds[r] = sp.region_3d
-               
+
                self.mode = self.selobj.mode
                if self.mode == 'OBJECT':
                        bpy.ops.object.editmode_toggle()
                self.bm = bmesh.from_edit_mesh(self.mesh)
-               
+
                self.vsellist = []
                self.esellist = []
                self.fsellist = []
@@ -183,10 +183,10 @@ class FastOrigin(bpy.types.Operator):
                for f in self.bm.faces:
                        if f.select:
                                self.fsellist.append(f)
-                       
+
                self.snapelem = 'VERTEX'
                self.snapstate = True
-               
+
                self.snapelsave = context.tool_settings.snap_element
                self.snapstsave = context.tool_settings.use_snap
                context.tool_settings.snap_element = self.snapelem
@@ -200,10 +200,10 @@ class FastOrigin(bpy.types.Operator):
                bmesh.update_edit_mesh(self.mesh, destructive=True)
                self.mesh.update()
                self.space3d.cursor_location = self.originvert.co[:]
-               
-                               
+
+
        def getscreencoords(self, vec, reg, rv3d):
-       
+
                # calculate screencoords of given Vector
                vec.rotate(self.selobj.matrix_world)
                vec.rotate(self.selobj.matrix_world)
@@ -211,11 +211,11 @@ class FastOrigin(bpy.types.Operator):
                return location_3d_to_region_2d(reg, rv3d, vec)
 
 
-       
+
        def redraw(self):
-       
+
                drawregion = bpy.context.region
-               
+
                rv3d = self.rv3ds[drawregion]
                vec = self.originvert.co.copy()
                vec.rotate(self.selobj.matrix_world)
@@ -262,4 +262,4 @@ if __name__ == "__main__":
        register()
 
 
-       
+
index 7660f6d..4a9e8f3 100644 (file)
@@ -38,7 +38,7 @@ bl_info = {
        "name": "KeepTrans",
        "author": "Gert De Roost",
        "version": (0, 5, 0),
-       "blender": (2, 6, 5),
+       "blender": (2, 65, 0),
        "location": "View3D > Tools",
        "description": "Remove ChildOf constraint and keep transforms",
        "warning": "",
@@ -49,7 +49,7 @@ bl_info = {
 
 
 import bpy
-from mathutils import * 
+from mathutils import *
 
 
 
@@ -61,21 +61,21 @@ class DeCouple(bpy.types.Operator):
        bl_label = "KeepTrans"
        bl_description = "Remove ChildOf constraint and keep transforms"
        bl_options = {"REGISTER", "UNDO"}
-       
+
        @classmethod
        def poll(cls, context):
                obj = context.active_object
                return (obj and context.mode == 'OBJECT')
 
        def invoke(self, context, event):
-               
+
                self.do_keeptrans(context)
-               
+
                return {'FINISHED'}
 
 
        def do_keeptrans(self, context):
-       
+
                ob = context.active_object
                childof = None
                for c in ob.constraints:
@@ -117,4 +117,4 @@ if __name__ == "__main__":
 
 
 
-       
+
index 4520b90..0f136d6 100644 (file)
 #---------------------------------------------#
 #    changelog
 #---------------------------------------------#
-'''  
+'''
     "version": (1,2,0)
         - added missing texture types
         - new way to filter file types
         - option for fake user flag
-        
+
     "version": (1,1,5)
         - changed addon category to Import-Export
-    
+
     "version": (1,1,4),
         filename will be used as texture name (still limited by stringlength)
 
     "version": (1,1,3),
         fixed operator and registration
         added tracker and wiki url\
-    
+
     version": (1,1,2)
         replaced image.new() with image.load()
         changed addon category
-        removed some unused/old code    
-        
+        removed some unused/old code
+
     version":1.11:
         added type arg to texture.new() [L48]
         cleared default filename
@@ -65,7 +65,7 @@ bl_info = {
     "name": "import BrushSet",
     "author": "Daniel Grauer (kromar)",
     "version": (1, 2, 0),
-    "blender": (2, 6, 4),
+    "blender": (2, 64, 0),
     "category": "Import-Export",
     "location": "File > Import > BrushSet",
     "description": "imports all image files from a folder",
@@ -122,8 +122,8 @@ def LoadBrushSet(filepath, filename):
                 #    and assign the image to the texture
                 bpy.data.textures[texture.name].image = image
 
-            
-    print("Brush Set imported!")  
+
+    print("Brush Set imported!")
 
 #---------------------------------------------#
 
@@ -134,7 +134,7 @@ class BrushSetImporter(bpy.types.Operator):
 
     filename = StringProperty(name="File Name", description="filepath", default="", maxlen=1024, options={'ANIMATABLE'}, subtype='NONE')
     filepath = StringProperty(name="File Name", description="filepath", default="", maxlen=1024, options={'ANIMATABLE'}, subtype='NONE')
-    
+
     def execute(self, context):
         LoadBrushSet(self.properties.filepath, self.properties.filename)
         return {'FINISHED'}
@@ -164,19 +164,19 @@ class Brush_set_UI(bpy.types.Panel):
     bl_label = 'Brush_Path'
     bl_region_type = 'WINDOW'
     bl_options = {'HIDE_HEADER'}
-   
+
     def draw(self, context):
-        
-        scn = context.scene 
+
+        scn = context.scene
         layout = self.layout
         column = layout.column(align=True)
         column.label(text='Brush Directory:')
-        column.prop(scn,'filepath')  
+        column.prop(scn,'filepath')
 '''
 
 #---------------------------------------------#
 
-def register():    
+def register():
     bpy.utils.register_module(__name__)
     bpy.types.INFO_MT_file_import.append(menu_func)
 
index 30a07da..8ee7681 100644 (file)
@@ -3,8 +3,8 @@ bl_info = {
     "location": "View3D > Toolbar",
     "description": "Add Boolean Tools for running boolean operations on two selected objects.",
     "author": "Jonathan Williamson",
-    "version": (0,4),
-    "blender": (2, 6, 6),
+    "version": (0, 4),
+    "blender": (2, 66, 0),
     "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/3D_interaction/booleanoperators",
     "tracker_url": "http://projects.blender.org/tracker/index.php?func=detail&aid=34502&group_id=153&atid=467",
     "category": "3D View",
@@ -13,25 +13,25 @@ bl_info = {
 import bpy
 
 ###------ Create Boolean Operators -------###
-   
+
 class boolean(bpy.types.Operator):
     """Boolean the currently selected objects"""
     bl_idname = "mesh.boolean"
     bl_label = "Boolean Operator"
-    bl_options = {'REGISTER', 'UNDO'}     
-            
+    bl_options = {'REGISTER', 'UNDO'}
+
     modOp = bpy.props.StringProperty()
-    
-    @classmethod        
+
+    @classmethod
     def poll(cls, context):
         return len(context.selected_objects) > 0
-    
+
     def execute(self, context):
+
         scene = bpy.context.scene
-         
+
         modName = "Bool"
-    
+
         activeObj = context.active_object
         selected = context.selected_objects
 
@@ -41,17 +41,17 @@ class boolean(bpy.types.Operator):
                     for ob in selected:
                         if ob != activeObj:
                             nonActive = ob
-    
-                    bpy.ops.object.modifier_add(type="BOOLEAN")   
-                    
+
+                    bpy.ops.object.modifier_add(type="BOOLEAN")
+
                     for mod in activeObj.modifiers:
                         if mod.type == 'BOOLEAN':
                             mod.operation = self.modOp
                             mod.object = nonActive
                             mod.name = modName
-                    
+
                     bpy.ops.object.modifier_apply(apply_as='DATA', modifier=modName)
-                    scene.objects.active = nonActive 
+                    scene.objects.active = nonActive
                     activeObj.select = False
                     bpy.ops.object.delete(use_global=False)
                     activeObj.select = True
@@ -62,30 +62,30 @@ class boolean(bpy.types.Operator):
                 self.report({'INFO'}, "Only 1 object selected")
         else:
             self.report({'INFO'}, "No objects selected")
-                
-        return {"FINISHED"}     
 
+        return {"FINISHED"}
 
-###------- Create the Boolean Menu --------###          
+
+###------- Create the Boolean Menu --------###
 
 class booleanMenu(bpy.types.Menu):
     bl_label = "Boolean Tools"
     bl_idname = "object.boolean_menu"
-       
+
     def draw(self, context):
         layout = self.layout
-        
+
         union = layout.operator("mesh.boolean", "Union")
         union.modOp = 'UNION'
-        
+
         intersect = layout.operator("mesh.boolean", "Intersect")
         intersect.modOp = 'INTERSECT'
-        
+
         difference = layout.operator("mesh.boolean", "Difference")
         difference.modOp = 'DIFFERENCE'
 
 
-###------- Create the Boolean Toolbar --------###          
+###------- Create the Boolean Toolbar --------###
 
 class booleanToolbar(bpy.types.Panel):
     bl_label = "Boolean Tools"
@@ -93,54 +93,54 @@ class booleanToolbar(bpy.types.Panel):
     bl_space_type = 'VIEW_3D'
     bl_region_type = 'TOOLS'
     bl_context = 'objectmode'
-    
+
     def draw(self, context):
         layout = self.layout
-        
+
         col = layout.column(align=True)
-        
+
         col.label(text="Operation:", icon="MOD_BOOLEAN")
-        
+
         row = col.row()
         union = row.operator("mesh.boolean", "Union")
         union.modOp = 'UNION'
-        
+
         intersect = row.operator("mesh.boolean", "Intersect")
         intersect.modOp = 'INTERSECT'
-        
+
         difference = row.operator("mesh.boolean", "Difference")
         difference.modOp = 'DIFFERENCE'
-    
+
 ###------- Define the Hotkeys and Register Operators ---------###
 
 addon_keymaps = []
-    
-            
+
+
 def register():
     bpy.utils.register_class(boolean)
     bpy.utils.register_class(booleanMenu)
     bpy.utils.register_class(booleanToolbar)
-    
+
     wm = bpy.context.window_manager
-    
+
     # create the boolean menu hotkey
     km = wm.keyconfigs.addon.keymaps.new(name='Object Mode')
     kmi = km.keymap_items.new('wm.call_menu', 'B', 'PRESS', ctrl=True, shift=True)
     kmi.properties.name = 'object.boolean_menu'
 
     addon_keymaps.append(km)
-    
+
 def unregister():
     bpy.utils.unregister_class(boolean)
     bpy.utils.unregister_class(booleanMenu)
     bpy.utils.unregister_class(booleanToolbar)
-    
-    
+
+
     # remove keymaps when add-on is deactivated
     wm = bpy.context.window_manager
     for km in addon_keymaps:
         wm.keyconfigs.addon.keymaps.remove(km)
     del addon_keymaps[:]
-    
+
 if __name__ == "__main__":
     register()
\ No newline at end of file
index 7b2cfb3..20eea41 100755 (executable)
@@ -2,7 +2,7 @@ bl_info = {
     "name": "Mesh Cache Tools",
     "author": "Oscurart",
     "version": (1, 0),
-    "blender": (2, 6, 4),
+    "blender": (2, 64, 0),
     "location": "Tools > Mesh Cache Tools",
     "description": "Tools for Management Mesh Cache Process",
     "warning": "",
@@ -162,7 +162,7 @@ class OscPc2iMporterCopy(bpy.types.Operator):
     def execute(self, context):
         filefolder = os.path.dirname(bpy.data.filepath)
         os.chdir(filefolder)
-        if bpy.context.scene.muu_pc2_relative_path != "":            
+        if bpy.context.scene.muu_pc2_relative_path != "":
             if os.path.exists("%s" % (os.path.join(filefolder,bpy.context.scene.muu_pc2_relative_path))):
                 print("Folder Already Exists.")
             else:
@@ -205,7 +205,7 @@ class OscGroupLinkedToLocal(bpy.types.Operator):
     def execute(self, context):
         OscLinkedGroupToLocal()
         return {'FINISHED'}
-    
+
 class OscMeshCacheUp(bpy.types.Operator):
     bl_idname = "object.modifier_mesh_cache_up"
     bl_label = "Mesh Cache To Top"
@@ -228,9 +228,9 @@ class OscMeshCacheUp(bpy.types.Operator):
                         bpy.ops.object.modifier_move_up(modifier=mod.name)
 
         bpy.context.scene.objects.active = actob
-        
-        return {'FINISHED'}    
-    
+
+        return {'FINISHED'}
+
 
 def register():
     from bpy.types import Scene
@@ -238,7 +238,7 @@ def register():
                            IntProperty,
                            StringProperty,
                            )
-    
+
     Scene.muu_pc2_rotx = BoolProperty(default=True, name="Rotx = 90")
     Scene.muu_pc2_world_space = BoolProperty(default=True, name="World Space")
     Scene.muu_pc2_modifiers = BoolProperty(default=True, name="Apply Modifiers")
@@ -268,4 +268,4 @@ def unregister():
     bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
-    register() 
\ No newline at end of file
+    register()
\ No newline at end of file
index 85a2dd4..368a1c2 100644 (file)
@@ -20,7 +20,7 @@ bl_info = {
     "name": "Worn Edges",
     "author": "Oscurart",
     "version": (1, 2),
-    "blender": (2, 6, 8),
+    "blender": (2, 68, 0),
     "location": "Vertex Paint > Paint > Worn Edges",
     "description": "Create a Vertex Color map with Worn Edges",
     "warning": "",
index b3e786a..ace37fb 100755 (executable)
@@ -20,7 +20,7 @@ bl_info = {
     "name": "Amaranth Toolset",
     "author": "Pablo Vazquez, Bassam Kurdali, Sergey Sharybin",
     "version": (0, 7, 3),
-    "blender": (2, 69),
+    "blender": (2, 69, 0),
     "location": "Scene Properties > Amaranth Toolset Panel",
     "description": "A collection of tools and settings to improve productivity",
     "warning": "",
@@ -96,7 +96,7 @@ class AmaranthToolsetPreferences(AddonPreferences):
 
         sub.separator()
 
-        sub.label(text="Nodes Editor", icon="NODETREE")        
+        sub.label(text="Nodes Editor", icon="NODETREE")
         sub.prop(self, "use_image_node_display")
 
         col = split.column()
@@ -164,7 +164,7 @@ def clear_properties():
         "use_simplify_nodes_vector",
         "status"
     )
-    
+
     wm = bpy.context.window_manager
     for p in props:
         if p in wm:
@@ -175,16 +175,16 @@ class SCENE_OT_refresh(Operator):
     """Refresh the current scene"""
     bl_idname = "scene.refresh"
     bl_label = "Refresh!"
-    
+
     def execute(self, context):
         preferences = context.user_preferences.addons[__name__].preferences
         scene = context.scene
 
-        if preferences.use_scene_refresh:    
+        if preferences.use_scene_refresh:
             # Changing the frame is usually the best way to go
             scene.frame_current = scene.frame_current
             self.report({"INFO"}, "Scene Refreshed!")
-            
+
         return {'FINISHED'}
 
 def button_refresh(self, context):
@@ -258,7 +258,7 @@ def label_timeline_extra_info(self, context):
         # Check for preview range
         frame_start = scene.frame_preview_start if scene.use_preview_range else scene.frame_start
         frame_end = scene.frame_preview_end if scene.use_preview_range else scene.frame_end
-        
+
         row.label(text="%s / %s" % (bpy.utils.smpte_from_frame(scene.frame_current - frame_start),
                         bpy.utils.smpte_from_frame(frame_end - frame_start)))
 
@@ -316,10 +316,10 @@ class FILE_PT_libraries(Panel):
         libslist = sorted(libslist)
 
         # Draw the box with libs
-        
+
         row = layout.row()
         box = row.box()
-       
+
         if libslist:
             for filepath in libslist:
                 if filepath != '//':
@@ -327,7 +327,7 @@ class FILE_PT_libraries(Panel):
                     col = split.column()
                     sub = col.column(align=True)
                     sub.label(text=filepath)
-            
+
                     col = split.column()
                     sub = col.column(align=True)
                     props = sub.operator(
@@ -341,14 +341,14 @@ class FILE_OT_directory_go_to(Operator):
     """Go to this library's directory"""
     bl_idname = "file.directory_go_to"
     bl_label = "Go To"
-    
+
     filepath = bpy.props.StringProperty(subtype="FILE_PATH")
 
     def execute(self, context):
 
         bpy.ops.file.select_bookmark(dir=self.filepath)
         return {'FINISHED'}
-    
+
 # FEATURE: Node Templates
 class NODE_OT_AddTemplateVignette(Operator):
     bl_idname = "node.template_add_vignette"
@@ -416,7 +416,7 @@ class NODE_OT_AddTemplateVignette(Operator):
         frame.label = 'Vignette'
         frame.use_custom_color = True
         frame.color = (0.783538, 0.0241576, 0.0802198)
-        
+
         overlay.parent = None
         overlay.label = 'Vignette Overlay'
 
@@ -488,7 +488,7 @@ class NODE_PT_simplify(bpy.types.Panel):
             layout.operator(NODE_OT_toggle_mute.bl_idname,
                 text="Turn On" if node_tree.toggle_mute else "Turn Off",
                 icon='RESTRICT_VIEW_OFF' if node_tree.toggle_mute else 'RESTRICT_VIEW_ON')
-        
+
             if node_tree.types == 'VECBLUR':
                 layout.label(text="This will also toggle the Vector pass {}".format(
                                     "on" if node_tree.toggle_mute else "off"), icon="INFO")
@@ -503,10 +503,10 @@ class NODE_OT_toggle_mute(Operator):
         node_tree = scene.node_tree
         node_type = node_tree.types
         rlayers = scene.render
-        
+
         if not 'amaranth_pass_vector' in scene.keys():
             scene['amaranth_pass_vector'] = []
-        
+
         #can't extend() the list, so make a dummy one
         pass_vector = scene['amaranth_pass_vector']
 
@@ -548,7 +548,7 @@ class NODE_OT_toggle_mute(Operator):
         scene['amaranth_pass_vector'] = pass_vector
 
         return {'FINISHED'}
-        
+
 
 # FEATURE: OB/MA ID panel in Node Editor
 class NODE_PT_indices(bpy.types.Panel):
@@ -585,10 +585,10 @@ class NODE_PT_indices(bpy.types.Panel):
         for ma in materials:
             if ma and ma.pass_index > 0:
                 show_ma_id = True
-        row = layout.row(align=True)  
+        row = layout.row(align=True)
         row.prop(node, 'index', text="Mask Index")
         row.prop(node, 'use_matching_indices', text="Only Matching IDs")
-        
+
         layout.separator()
 
         if not show_ob_id and not show_ma_id:
@@ -702,7 +702,7 @@ def stats_scene(self, context):
         cameras_selected = 0
         meshlights = 0
         meshlights_visible = 0
-    
+
         for ob in context.scene.objects:
             if ob.material_slots:
                 for ma in ob.material_slots:
@@ -717,9 +717,9 @@ def stats_scene(self, context):
             if ob in context.selected_objects:
                 if ob.type == 'CAMERA':
                     cameras_selected = cameras_selected + 1
-    
+
         meshlights_string = '| Meshlights:{}/{}'.format(meshlights_visible, meshlights)
-    
+
         row = self.layout.row(align=True)
         row.label(text="Scenes:{} | Cameras:{}/{} {}".format(
                    scenes_count, cameras_selected, cameras_count,
@@ -750,7 +750,7 @@ class VIEW3D_OT_render_border_camera(Operator):
 def button_render_border_camera(self, context):
 
     view3d = context.space_data.region_3d
-    
+
     if view3d.view_perspective == 'CAMERA':
         layout = self.layout
         layout.separator()
@@ -764,7 +764,7 @@ def button_camera_passepartout(self, context):
 
     view3d = context.space_data.region_3d
     cam = context.scene.camera.data
-    
+
     if view3d.view_perspective == 'CAMERA':
         layout = self.layout
         if cam.show_passepartout:
@@ -779,7 +779,7 @@ class VIEW3D_OT_show_only_render(Operator):
 
     def execute(self, context):
         space = bpy.context.space_data
-        
+
         if space.show_only_render:
             space.show_only_render = False
         else:
@@ -811,7 +811,7 @@ class NODE_OT_show_active_node_image(Operator):
                                 if space.type == "IMAGE_EDITOR":
                                     space.image = active_node.image
                             break
-    
+
         return {'FINISHED'}
 # // FEATURE: Display Active Image Node on Image Editor
 
@@ -846,18 +846,18 @@ class OBJECT_OT_select_meshlights(Operator):
         return {'FINISHED'}
 
 def button_select_meshlights(self, context):
-    
+
     if context.scene.render.engine == 'CYCLES':
         self.layout.operator('object.select_meshlights', icon="LAMP_SUN")
 # // FEATURE: Select Meshlights
 
 # FEATURE: Cycles Viewport Extra Settings
 def material_cycles_settings_extra(self, context):
-    
+
     layout = self.layout
     col = layout.column()
     row = col.row(align=True)
-    
+
     obj = context.object
     mat = context.material
     if obj.type == 'MESH':
@@ -1035,13 +1035,13 @@ def render_cycles_scene_samples(self, context):
             for s in bpy.data.scenes:
                 if s != scene and s.render.engine == 'CYCLES':
                     cscene = s.cycles
-    
+
                     split = layout.split()
                     col = split.column()
                     sub = col.column(align=True)
-    
+
                     sub.label(text="%s" % s.name)
-    
+
                     col = split.column()
                     sub = col.column(align=True)
                     sub.prop(cscene, "samples", text="Render")
@@ -1049,13 +1049,13 @@ def render_cycles_scene_samples(self, context):
             for s in bpy.data.scenes:
                 if s != scene and s.render.engine == 'CYCLES':
                     cscene = s.cycles
-    
+
                     split = layout.split()
                     col = split.column()
                     sub = col.column(align=True)
-    
+
                     sub.label(text="%s" % s.name)
-    
+
                     col = split.column()
                     sub = col.column(align=True)
                     sub.prop(cscene, "aa_samples", text="Render")
@@ -1202,11 +1202,11 @@ def unregister():
 
     bpy.app.handlers.render_pre.remove(unsimplify_render_pre)
     bpy.app.handlers.render_post.remove(unsimplify_render_post)
-    
+
     for km, kmi in addon_keymaps:
         km.keymap_items.remove(kmi)
     addon_keymaps.clear()
-    
+
     clear_properties()
 
 if __name__ == "__main__":
index 29a2859..0dfb0f3 100644 (file)
@@ -3,7 +3,7 @@ bl_info = {
     "description": "Help Clone tool",
     "author": "kgeogeo",
     "version": (2, 0),
-    "blender": (2, 6, 6),
+    "blender": (2, 66, 0),
     "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/3D_interaction/bprojection",
     "tracker_url":"http://projects.blender.org/tracker/index.php?func=detail&aid=30521&group_id=153&atid=468",
     "category": "Paint"}
@@ -27,18 +27,18 @@ def align_to_view(context):
     global last_mouse
     last_mouse = Vector((0,0))
     ob = context.object
-    em = bpy.data.objects[BProjection_Empty]       
+    em = bpy.data.objects[BProjection_Empty]
     rotation = em.custom_rotation
     scale = em.custom_scale
     z = em.custom_location.z
     pos = [em.custom_location.x, em.custom_location.y]
-    
-    reg = context.region       
+
+    reg = context.region
     width = reg.width
-    height = reg.height 
-    
-    sd = context.space_data    
-    r3d = sd.region_3d     
+    height = reg.height
+
+    sd = context.space_data
+    r3d = sd.region_3d
     r3d.update()
     vr = r3d.view_rotation
     quat = mathutils.Quaternion((0.0, 0.0, 1.0), math.radians(float(rotation)))
@@ -49,19 +49,19 @@ def align_to_view(context):
     img = bpy.data.textures[BProjection_Texture].image
     if img and img.size[1] != 0:
         prop = img.size[0]/img.size[1]
-    else: prop = 1    
-    
-    if em.custom_linkscale:    
+    else: prop = 1
+
+    if em.custom_linkscale:
         em.scale = Vector((prop*scale[0], scale[0], 1))
     else:
         em.scale = Vector((prop*scale[0], scale[1], 1))
     pos_cur = em.location - sd.cursor_location
     rot_cur1 = em.rotation_euler.to_quaternion()
     em.location = v + ob.location
-    em.rotation_euler = Quaternion.to_euler(vr*quat)   
+    em.rotation_euler = Quaternion.to_euler(vr*quat)
     if em.custom_c3d:
         if em.custom_old_scale != em.custom_scale:
-            pos_cur = em.location - sd.cursor_location       
+            pos_cur = em.location - sd.cursor_location
         rot_cur2 = em.rotation_euler.to_quaternion()
         rot_cur1.invert()
         pos_cur.rotate(rot_cur1)
@@ -69,23 +69,23 @@ def align_to_view(context):
         v = em.location - pos_cur
         sd.cursor_location =  v
 
-def applyimage(context):        
+def applyimage(context):
         img = bpy.data.textures[BProjection_Texture].image
         em = bpy.data.objects[BProjection_Empty]
         ob = context.object
-               
+
         face = ob.data.polygons
-        uvdata = ob.data.uv_textures.active.data 
-            
+        uvdata = ob.data.uv_textures.active.data
+
         for f,d in zip(face,uvdata):
             if f.select:
                 d.image = img
-               
+
         align_to_view(context)
         ob.data.update()
 
 # Function to update the properties
-def update_Location(self, context):          
+def update_Location(self, context):
     align_to_view(context)
 
 def find_uv(context):
@@ -93,7 +93,7 @@ def find_uv(context):
     me = obj.data.vertices
     vg = obj.vertex_groups
     l=[]
-    index_uv = 0      
+    index_uv = 0
     for face in obj.data.polygons:
         x=len(face.vertices)
         for vertex in face.vertices:
@@ -101,8 +101,8 @@ def find_uv(context):
                 for g in me[vertex].groups:
                     if vg[g.group].name == 'texture plane':
                         x-=1
-        
-                        
+
+
         if x == 0:
             l.append([index_uv,len(face.vertices)])
         index_uv += len(face.vertices)
@@ -115,18 +115,18 @@ def update_UVScale(self, context):
     v = Vector((em.custom_offsetuv[0]/10 + 0.5, em.custom_offsetuv[1]/10 + 0.5))
     l = Vector((0.0,0.0))
     s = em.custom_scaleuv
-    os = em.custom_old_scaleuv 
+    os = em.custom_old_scaleuv
     scale = s - os
     l = find_uv(context)
     for i,j in l:
         for t in range(j):
             d = context.object.data.uv_layers.active.data[i+t]
-            vres =  v - d.uv  
+            vres =  v - d.uv
             d.uv.x = v.x - vres.x/os[0]*s[0]
             d.uv.y = v.y - vres.y/os[1]*s[1]
 
-    em.custom_old_scaleuv = s  
-    
+    em.custom_old_scaleuv = s
+
     applyimage(context)
 
 def update_PropUVScale(self, context):
@@ -140,21 +140,21 @@ def update_LinkUVScale(self, context):
         em.custom_propscaleuv = em.custom_scaleuv.x
         update_PropUVScale(self, context)
     else:
-        update_UVScale(self, context) 
-        
+        update_UVScale(self, context)
+
 # Function to update the offsetUV
 def update_UVOffset(self, context):
     ob = context.object
     em = bpy.data.objects[BProjection_Empty]
     o = em.custom_offsetuv
-    oo = em.custom_old_offsetuv 
+    oo = em.custom_old_offsetuv
     l = find_uv(context)
     for i,j in l:
         for t in range(j):
             d = context.object.data.uv_layers.active.data[i+t]
-            d.uv = [d.uv[0] - oo[0]/10 + o[0]/10, d.uv[1] - oo[1]/10 + o[1]/10]   
+            d.uv = [d.uv[0] - oo[0]/10 + o[0]/10, d.uv[1] - oo[1]/10 + o[1]/10]
     em.custom_old_offsetuv = o
-    
+
     applyimage(context)
 
 # Function to update the flip horizontal
@@ -165,7 +165,7 @@ def update_FlipUVX(self, context):
             d = context.object.data.uv_layers.active.data[i+t]
             x = d.uv.x
             d.uv.x = 1 - x
-    
+
     applyimage(context)
 
 # Function to update the flip vertical
@@ -176,17 +176,17 @@ def update_FlipUVY(self, context):
             d = context.object.data.uv_layers.active.data[i+t]
             y = d.uv[1]
             d.uv[1] = 1 - y
-    
+
     applyimage(context)
 
 # Function to update
-def update_Rotation(self, context):              
+def update_Rotation(self, context):
     ob = context.object
     em = bpy.data.objects[BProjection_Empty]
     if em.custom_rotc3d:
         angle = em.custom_rotation - em.custom_old_rotation
         sd = context.space_data
-        vr = sd.region_3d.view_rotation.copy()        
+        vr = sd.region_3d.view_rotation.copy()
         c = sd.cursor_location - ob.location
         e = bpy.data.objects[BProjection_Empty].location - ob.location
         vo = Vector((0.0, 0.0, 1.0))
@@ -198,16 +198,16 @@ def update_Rotation(self, context):
         v.rotate(vr)
         c.rotate(vr)
         em.custom_location = c + v
-    else:        
+    else:
         align_to_view(context)
-   
+
     em.custom_old_rotation = em.custom_rotation
 
 # Function to update scale
-def update_Scale(self, context):              
+def update_Scale(self, context):
     ob = context.object
     em = bpy.data.objects[BProjection_Empty]
-    
+
     if em.custom_scac3d:
         sd = context.space_data
         r3d =  sd.region_3d
@@ -216,68 +216,68 @@ def update_Scale(self, context):
         e = em.location - ob.location
         c = sd.cursor_location - ob.location
         ce = e - c
-        
+
         s = em.custom_scale
         os = em.custom_old_scale
         c.rotate(vr)
         ce.rotate(vr)
-        
+
         img = bpy.data.textures[BProjection_Texture].image
         if img and img.size[1] != 0:
             prop = img.size[0]/img.size[1]
         else: prop = 1
-        
+
         v = Vector((s.x*ce.x/os.x, s.y*ce.y/os.y,0.0))
         em.custom_location = c + v
-        
 
-    else:          
+
+    else:
         align_to_view(context)
-                
+
     em.custom_old_scale = em.custom_scale
 
 def update_PropScale(self, context):
     em = bpy.data.objects[BProjection_Empty]
     if em.custom_linkscale:
         em.custom_scale = [em.custom_propscale,em.custom_propscale]
-    
+
 def update_LinkScale(self, context):
     em = bpy.data.objects[BProjection_Empty]
     if em.custom_linkscale:
         em.custom_propscale = em.custom_scale.x
         update_PropScale(self, context)
     else:
-        update_Scale(self, context) 
+        update_Scale(self, context)
 
 def update_activeviewname(self, context):
     em = bpy.data.objects[BProjection_Empty]
     if self.custom_active:
         em.custom_active_view = self.custom_active_view
 
-def update_style_clone(self, context):    
+def update_style_clone(self, context):
     km = context.window_manager.keyconfigs.default.keymaps['Image Paint']
     for kmi in km.keymap_items:
-        if self.custom_style_clone:         
+        if self.custom_style_clone:
             if kmi.idname == 'paint.image_paint':
                 kmi.idname = 'paint.bp_paint'
         else:
             if kmi.idname == 'paint.bp_paint':
-                kmi.idname = 'paint.image_paint'    
+                kmi.idname = 'paint.image_paint'
 
 class custom_props(bpy.types.PropertyGroup):
     custom_fnlevel = IntProperty(name="Fast navigate level", description="Increase or decrease the SubSurf level, decrease make navigation faster", default=0)
-    
+
     custom_location = FloatVectorProperty(name="Location", description="Location of the plane",
                                           default=(1.0,0,-1.0),
-                                          subtype = 'XYZ', 
+                                          subtype = 'XYZ',
                                           soft_min = -10,
                                           soft_max = 10,
                                           step=0.1,
                                           size=3)
-                                           
+
     custom_rotation = FloatProperty(name="Rotation", description="Rotate the plane",
                                     min=-180, max=180, default=0)
-                                         
+
     custom_scale = FloatVectorProperty(name="Scales", description="Scale the planes",
                                        default=(1.0, 1.0),
                                        subtype = 'XYZ',
@@ -294,53 +294,53 @@ class custom_props(bpy.types.PropertyGroup):
                                      soft_min=0.1,
                                      soft_max=10,
                                      step=0.1)
-                                                                                    
+
     custom_linkscale = BoolProperty(name="linkscale", default=True)
-   
+
     # UV properties
     custom_scaleuv = FloatVectorProperty(name="ScaleUV", description="Scale the texture's UV",
                                             default=(1.0,1.0),min = 0.01, subtype = 'XYZ', size=2)
     custom_propscaleuv = FloatProperty(name="PropScaleUV", description="Scale the texture's UV",
-                                           default=1.0,min = 0.01) 
+                                           default=1.0,min = 0.01)
     custom_offsetuv = FloatVectorProperty(name="OffsetUV", description="Decal the texture's UV",
-                                            default=(0.0,0.0), subtype = 'XYZ', size=2)       
+                                            default=(0.0,0.0), subtype = 'XYZ', size=2)
     custom_linkscaleuv = BoolProperty(name="linkscaleUV", default=True)
     custom_flipuvx = BoolProperty(name="flipuvx", default=False)
     custom_flipuvy = BoolProperty(name="flipuvy", default=False)
-    
+
     # other properties
-    custom_active= BoolProperty(name="custom_active", default=True)   
+    custom_active= BoolProperty(name="custom_active", default=True)
     custom_expand = BoolProperty(name="expand", default=False)
     custom_style_clone = BoolProperty(name="custom_style_clone", default=False)
-    
+
     custom_active_view = StringProperty(name = "custom_active_view",default = "View",update = update_activeviewname)
-    
+
     custom_image = StringProperty(name = "custom_image",default = "")
-    
+
     custom_index = IntProperty()
 
 # Function to create custom properties
 def createcustomprops(context):
     Ob = bpy.types.Object
-    
+
     Ob.custom_fnlevel = IntProperty(name="Fast navigate level", description="Increase or decrease the SubSurf level, decrease make navigation faster", default=0)
-    
-    # plane properties 
+
+    # plane properties
     Ob.custom_location = FloatVectorProperty(name="Location", description="Location of the plane",
                                            default  = (1.0, 0, -1.0),
-                                           subtype  = 'XYZ', 
+                                           subtype  = 'XYZ',
                                            size     = 3,
                                            step     = 0.5,
                                            soft_min = -10,
                                            soft_max = 10,
                                            update = update_Location)
-                                           
+
     Ob.custom_rotation = FloatProperty(name="Rotation", description="Rotate the plane",
                                        min=-180, max=180, default=0,update = update_Rotation)
-                                     
+
     Ob.custom_old_rotation = FloatProperty(name="old_Rotation", description="Old Rotate the plane",
                                            min=-180, max=180, default=0)
-                                         
+
     Ob.custom_scale = FloatVectorProperty(name="Scales", description="Scale the planes",
                                           subtype = 'XYZ',
                                           default=(1.0, 1.0),
@@ -351,7 +351,7 @@ def createcustomprops(context):
                                           size=2,
                                           step=0.5,
                                           update = update_Scale)
-                                          
+
     Ob.custom_propscale = FloatProperty(name="PropScale", description="Scale the Plane",
                                         default  = 1.0,
                                         min      = 0.1,
@@ -359,59 +359,59 @@ def createcustomprops(context):
                                         soft_max = 10,
                                         step     = 0.5,
                                         update   = update_PropScale)
-                                           
+
     Ob.custom_old_scale = FloatVectorProperty(name="old_Scales", description="Old Scale the planes",
                                           subtype = 'XYZ', default=(1.0, 1.0),min = 0.1, size=2)
-                                          
+
     Ob.custom_linkscale = BoolProperty(name="linkscale", default=True, update = update_LinkScale)
-    
-                                
+
+
     Ob.custom_sub = IntProperty(name="Subdivide", description="Number of subdivision of the plane",
-                                     min=0, max=20, default=0)                                
-    
+                                     min=0, max=20, default=0)
+
     # UV properties
     Ob.custom_scaleuv = FloatVectorProperty(name="ScaleUV", description="Scale the texture's UV",
                                             default  = (1.0,1.0),
                                             soft_min = 0.01,
                                             soft_max = 100,
-                                            min      = 0.01, 
+                                            min      = 0.01,
                                             subtype  = 'XYZ',
                                             size     = 2,
                                             update   = update_UVScale)
-                                            
+
     Ob.custom_propscaleuv = FloatProperty(name="PropScaleUV", description="Scale the texture's UV",
                                           default    = 1.0,
                                           soft_min   = 0.01,
                                           soft_max   = 100,
                                           min        = 0.01,
-                                          update     = update_PropUVScale)    
+                                          update     = update_PropUVScale)
 
     Ob.custom_old_scaleuv = FloatVectorProperty(name="old_ScaleUV", description="Scale the texture's UV",
                                                 default=(1.0,1.0),min = 0.01, subtype = 'XYZ', size=2)
     Ob.custom_offsetuv = FloatVectorProperty(name="OffsetUV", description="Decal the texture's UV",
-                                            default=(0.0,0.0), subtype = 'XYZ', size=2,update = update_UVOffset)    
+                                            default=(0.0,0.0), subtype = 'XYZ', size=2,update = update_UVOffset)
     Ob.custom_old_offsetuv = FloatVectorProperty(name="old_OffsetUV", description="Decal the texture's UV",
-                                                 default=(0.0,0.0), subtype = 'XYZ', size=2)    
+                                                 default=(0.0,0.0), subtype = 'XYZ', size=2)
     Ob.custom_linkscaleuv = BoolProperty(name="linkscaleUV", default=True, update = update_LinkUVScale)
     Ob.custom_flipuvx = BoolProperty(name="flipuvx", default=False, update = update_FlipUVX)
     Ob.custom_flipuvy = BoolProperty(name="flipuvy", default=False, update = update_FlipUVY)
-    
-    # other properties    
+
+    # other properties
     Ob.custom_c3d = BoolProperty(name="c3d", default=True)
     Ob.custom_rotc3d = BoolProperty(name="rotc3d", default=False)
     Ob.custom_scac3d = BoolProperty(name="scac3d", default=False)
     Ob.custom_expand = BoolProperty(name="expand", default=True)
     Ob.custom_style_clone = BoolProperty(name="custom_style_clone", default=False, update = update_style_clone)
-    
+
     Ob.custom_active_view = StringProperty(name = "custom_active_view",default = "View")
     try:
         Ob.custom_active_object = StringProperty(name = "custom_active_object",default = context.object.name)
     except:
-        Ob.custom_active_object = StringProperty(name = "custom_active_object",default = 'debut')    
+        Ob.custom_active_object = StringProperty(name = "custom_active_object",default = 'debut')
     Ob.custom_props = CollectionProperty(type = custom_props)
 
 # Function to remove custom properties
-def removecustomprops():    
+def removecustomprops():
     list_prop = ['custom_location', 'custom_rotation', 'custom_old_rotation', 'custom_scale', 'custom_old_scale', 'custom_c3d',
                  'custom_rotc3d', 'custom_scaleuv', 'custom_flipuvx', 'custom_flipuvy', 'custom_linkscale',
                  'custom_linkscaleuv', 'custom_old_scaleuv', 'custom_offsetuv', 'custom_old_offsetuv', 'custom_scac3d', 'custom_sub',
@@ -421,9 +421,9 @@ def removecustomprops():
             del bpy.data.objects[BProjection_Empty][prop]
         except:
             pass
-        
+
 def clear_props(context):
-    em = bpy.data.objects[BProjection_Empty] 
+    em = bpy.data.objects[BProjection_Empty]
     em.custom_scale = [1,1]
     em.custom_rotation = 0
     em.custom_scaleuv =[1.0,1.0]
@@ -435,16 +435,16 @@ def clear_props(context):
     if em.custom_flipuvy == True:
         em.custom_flipuvy = False
 
-# Oprerator Class to create view            
+# Oprerator Class to create view
 class CreateView(Operator):
     bl_idname = "object.create_view"
     bl_label = "Create a new view"
 
-    def execute(self, context):              
+    def execute(self, context):
         ob = context.object
         em = bpy.data.objects[BProjection_Empty]
-        new_props = em.custom_props.add()        
-        em.custom_active_view = new_props.custom_active_view               
+        new_props = em.custom_props.add()
+        em.custom_active_view = new_props.custom_active_view
         ob.data.shape_keys.key_blocks[ob.active_shape_key_index].mute = True
         bpy.ops.object.shape_key_add(from_mix = False)
         ob.data.shape_keys.key_blocks[ob.active_shape_key_index].value = 1.0
@@ -452,22 +452,22 @@ class CreateView(Operator):
         bpy.ops.object.active_view(index = new_props.custom_index)
         return {'FINISHED'}
 
-# Oprerator Class to copy view 
+# Oprerator Class to copy view
 class SaveView(Operator):
     bl_idname = "object.save_view"
     bl_label = "copy the view"
-    
+
     index = IntProperty(default = 0)
-    
-    def execute(self, context):              
+
+    def execute(self, context):
         em = bpy.data.objects[BProjection_Empty]
-        prop = em.custom_props[self.index]                            
-        prop.custom_rotation =  em.custom_rotation                    
-        prop.custom_scale =  em.custom_scale                  
-        prop.custom_linkscale =  em.custom_linkscale                                      
+        prop = em.custom_props[self.index]
+        prop.custom_rotation =  em.custom_rotation
+        prop.custom_scale =  em.custom_scale
+        prop.custom_linkscale =  em.custom_linkscale
         prop.custom_scaleuv = em.custom_scaleuv
         prop.custom_propscale = em.custom_propscale
-        prop.custom_offsetuv =  em.custom_offsetuv  
+        prop.custom_offsetuv =  em.custom_offsetuv
         prop.custom_linkscaleuv = em.custom_linkscaleuv
         prop.custom_propscaleuv = em.custom_propscaleuv
         prop.custom_flipuvx = em.custom_flipuvx
@@ -476,17 +476,17 @@ class SaveView(Operator):
             prop.custom_image = bpy.data.textures[BProjection_Texture].image.name
         except:
             pass
-        
+
         return {'FINISHED'}
 
-# Oprerator Class to copy view 
+# Oprerator Class to copy view
 class PasteView(Operator):
     bl_idname = "object.paste_view"
     bl_label = "paste the view"
-    
+
     index = IntProperty(default = 0)
-    
-    def execute(self, context):              
+
+    def execute(self, context):
         em = bpy.data.objects[BProjection_Empty]
         tmp_scac3d = em.custom_scac3d
         tmp_rotc3d = em.custom_rotc3d
@@ -494,13 +494,13 @@ class PasteView(Operator):
         em.custom_rotc3d = False
         prop = em.custom_props[self.index]
         em.custom_linkscale =  prop.custom_linkscale
-        em.custom_offsetuv =  prop.custom_offsetuv 
+        em.custom_offsetuv =  prop.custom_offsetuv
         em.custom_linkscaleuv = prop.custom_linkscaleuv
         em.custom_scaleuv = prop.custom_scaleuv
-        em.custom_propscaleuv = prop.custom_propscaleuv       
-        em.custom_rotation =  prop.custom_rotation                    
+        em.custom_propscaleuv = prop.custom_propscaleuv
+        em.custom_rotation =  prop.custom_rotation
         em.custom_scale =  prop.custom_scale
-        em.custom_propscale = prop.custom_propscale                     
+        em.custom_propscale = prop.custom_propscale
         if prop.custom_image != '':
             if bpy.data.textures[BProjection_Texture].image.name != prop.custom_image:
                 bpy.data.textures[BProjection_Texture].image = bpy.data.images[prop.custom_image]
@@ -510,53 +510,53 @@ class PasteView(Operator):
         if em.custom_flipuvy != prop.custom_flipuvy:
             em.custom_flipuvy = prop.custom_flipuvy
         em.custom_scac3d = tmp_scac3d
-        em.custom_rotc3d = tmp_rotc3d        
+        em.custom_rotc3d = tmp_rotc3d
         return {'FINISHED'}
 
-# Oprerator Class to remove view 
+# Oprerator Class to remove view
 class RemoveView(Operator):
     bl_idname = "object.remove_view"
     bl_label = "Rmeove the view"
-    
+
     index = IntProperty(default = 0)
-    
-    def execute(self, context):              
+
+    def execute(self, context):
         ob = context.object
         em = bpy.data.objects[BProjection_Empty]
-        
+
         ob.active_shape_key_index =  self.index + 1
         bpy.ops.object.shape_key_remove()
-        
-        if  em.custom_props[self.index].custom_active: 
+
+        if  em.custom_props[self.index].custom_active:
             if len(em.custom_props) > 0:
                 bpy.ops.object.active_view(index = self.index-1)
             if self.index == 0 and len(em.custom_props) > 1:
-                bpy.ops.object.active_view(index = 1)            
-                
+                bpy.ops.object.active_view(index = 1)
+
         em.custom_props.remove(self.index)
-                
+
         if len(em.custom_props) == 0:
             clear_props(context)
-            
-            bpy.ops.object.create_view()            
-                 
+
+            bpy.ops.object.create_view()
+
         i=0
         for item in em.custom_props:
-            item.custom_index = i           
-            i+=1 
+            item.custom_index = i
+            i+=1
 
         for item in (item for item in em.custom_props if item.custom_active):
                 ob.active_shape_key_index = item.custom_index+1
-           
+
         return {'FINISHED'}
 
-# Oprerator Class to copy view 
+# Oprerator Class to copy view
 class ActiveView(Operator):
     bl_idname = "object.active_view"
     bl_label = "Active the view"
-    
+
     index = IntProperty(default = 0)
-    
+
     def execute(self, context):
         ob = context.object
         em = bpy.data.objects[BProjection_Empty]
@@ -564,16 +564,16 @@ class ActiveView(Operator):
             bpy.ops.object.save_view(index = item.custom_index)
             item.custom_active = False
         em.custom_props[self.index].custom_active  = True
-        em.custom_active_view = em.custom_props[self.index].custom_active_view 
+        em.custom_active_view = em.custom_props[self.index].custom_active_view
         ob.active_shape_key_index =  self.index + 1
-        
+
         for i in ob.data.shape_keys.key_blocks:
             i.mute = True
-        
+
         ob.data.shape_keys.key_blocks[ob.active_shape_key_index].mute = False
-        
-        bpy.ops.object.paste_view(index = self.index)         
-        
+
+        bpy.ops.object.paste_view(index = self.index)
+
         return {'FINISHED'}
 
 # Draw Class to show the panel
@@ -587,21 +587,21 @@ class BProjection(Panel):
         return (context.image_paint_object or context.sculpt_object)
 
     def draw(self, context):
-        layout = self.layout        
+        layout = self.layout
         if  BProjection_Empty in [ob.name for ob in bpy.data.objects]:
             tex = bpy.data.textures[BProjection_Texture]
 
             ob = context.object
             em = bpy.data.objects[BProjection_Empty]
-            if ob == bpy.data.objects[em.custom_active_object]:            
+            if ob == bpy.data.objects[em.custom_active_object]:
                 col = layout.column(align =True)
-                col.operator("object.removebprojectionplane", text="Remove BProjection plane")           
+                col.operator("object.removebprojectionplane", text="Remove BProjection plane")
 
             try:
                 matBProjection = bpy.data.materials[BProjection_Material]
             except:
                 matBProjection = None
-            
+
             box = layout.box()
 
             row = box.row()
@@ -609,9 +609,9 @@ class BProjection(Panel):
                 row.prop(em, "custom_expand", text  = "", icon="TRIA_RIGHT", emboss=False)
                 row.label(text= 'Paint Object: '+ ob.name)
             else:
-                row.prop(em, "custom_expand", text = "" , icon="TRIA_DOWN", emboss=False)                
+                row.prop(em, "custom_expand", text = "" , icon="TRIA_DOWN", emboss=False)
                 row.label(text= 'Paint Object: '+ ob.name)
-                
+
                 if ob == bpy.data.objects[em.custom_active_object]:
                     col = box.column(align =True)
                     col.template_ID(tex, "image", open="image.open")
@@ -622,69 +622,69 @@ class BProjection(Panel):
                     row.label(text="Location:")
                     row  = box.row(align =True)
                     row.prop(em,'custom_location', text='')
-                    row  = box.row(align =True)            
+                    row  = box.row(align =True)
                     row.prop(em,'custom_rotation')
-                    row.prop(em,'custom_rotc3d',text="",icon='MANIPUL')            
+                    row.prop(em,'custom_rotc3d',text="",icon='MANIPUL')
                     row  = box.row(align =True)
                     row.label(text="Scale:")
-                    row  = box.row(align =True) 
+                    row  = box.row(align =True)
                     if em.custom_linkscale :
                         row.prop(em, "custom_propscale",text="")
                         row.prop(em, "custom_linkscale",text="",icon='LINKED')
-                    else: 
+                    else:
                         row.prop(em,'custom_scale',text='')
                         row.prop(em, "custom_linkscale",text="",icon='UNLINKED')
-                    row.prop(em,'custom_scac3d',text="",icon='MANIPUL')                            
+                    row.prop(em,'custom_scac3d',text="",icon='MANIPUL')
                     row  = box.row(align =True)
                     row.label(text="UV's Offset:")
                     row  = box.row(align =True)
                     row.prop(em,'custom_offsetuv',text='')
-                    row.prop(em, "custom_flipuvx",text="",icon='ARROW_LEFTRIGHT')   
-                    row.prop(em, "custom_flipuvy",text="",icon='FULLSCREEN_ENTER') 
+                    row.prop(em, "custom_flipuvx",text="",icon='ARROW_LEFTRIGHT')
+                    row.prop(em, "custom_flipuvy",text="",icon='FULLSCREEN_ENTER')
                     row  = box.row(align =True)
                     row.label(text="UV's Scale:")
-                    row  = box.row(align =True)                            
+                    row  = box.row(align =True)
                     if em.custom_linkscaleuv:
                         row.prop(em,'custom_propscaleuv',text='')
                         row.prop(em, "custom_linkscaleuv",text="",icon='LINKED')
-                    else: 
+                    else:
                         row.prop(em,'custom_scaleuv',text='')
-                        row.prop(em, "custom_linkscaleuv",text="",icon='UNLINKED')            
-                    
+                        row.prop(em, "custom_linkscaleuv",text="",icon='UNLINKED')
+
                     if matBProjection:
                         if context.scene.game_settings.material_mode == 'GLSL' and context.space_data.viewport_shade == 'TEXTURED':
                             row = box.column(align =True)
                             row.prop(matBProjection,'alpha', slider = True)
-                            
+
                     row = box.column(align =True)
                     row.prop(ob,"custom_fnlevel")
                     row = box.column(align =True)
                     if not em.custom_style_clone:
                         row.prop(em,"custom_style_clone",text="Style Clone Normal", icon='RENDERLAYERS')
                     else:
-                        row.prop(em,"custom_style_clone",text="Style Clone New", icon='RENDERLAYERS')    
-                    row = box.column(align =True)    
-    
-                if ob == bpy.data.objects[em.custom_active_object]:    
+                        row.prop(em,"custom_style_clone",text="Style Clone New", icon='RENDERLAYERS')
+                    row = box.column(align =True)
+
+                if ob == bpy.data.objects[em.custom_active_object]:
                     for item in em.custom_props:
                         box = layout.box()
                         row = box.row()
                         if item.custom_active:
-                            row.operator("object.active_view",text = "", icon='RADIOBUT_ON', emboss = False).index = item.custom_index 
+                            row.operator("object.active_view",text = "", icon='RADIOBUT_ON', emboss = False).index = item.custom_index
                         else:
-                            row.operator("object.active_view",text = "", icon='RADIOBUT_OFF', emboss = False).index = item.custom_index 
-                        row.prop(item, "custom_active_view", text="")        
+                            row.operator("object.active_view",text = "", icon='RADIOBUT_OFF', emboss = False).index = item.custom_index
+                        row.prop(item, "custom_active_view", text="")
                         row.operator('object.remove_view', text="", icon = 'PANEL_CLOSE', emboss = False).index = item.custom_index
                     row = layout.row()
-                    row.operator('object.create_view', text="Create View", icon = 'RENDER_STILL') 
+                    row.operator('object.create_view', text="Create View", icon = 'RENDER_STILL')
                 else:
                     col = box.column(align =True)
-                    col.operator("object.change_object", text="Change Object")       
+                    col.operator("object.change_object", text="Change Object")
 
         else:
             ob = context.object
             col = layout.column(align = True)
-            
+
             if ob.active_material is None:
                 col.label(text="Add a material first!", icon="ERROR")
             elif ob.data.uv_textures.active is None:
@@ -693,16 +693,16 @@ class BProjection(Panel):
                 col.operator("object.addbprojectionplane", text="Add BProjection plane")
                 col = layout.column(align = True)
                 col.prop(ob, "custom_sub",text="Subdivision level")
-                   
 
-# Oprerator Class to apply the image to the plane             
+
+# Oprerator Class to apply the image to the plane
 class ApplyImage(Operator):
     bl_idname = "object.applyimage"
     bl_label = "Apply image"
 
-    def execute(self, context):        
+    def execute(self, context):
         applyimage(context)
-        
+
         return {'FINISHED'}
 
 # Oprerator Class to make the 4 or 6 point and scale the plan
@@ -714,8 +714,8 @@ class IntuitiveScale(Operator):
         ob = context.object
         em = bpy.data.objects[BProjection_Empty]
         x = event.mouse_region_x
-        y = event.mouse_region_y                
-        if len(ob.grease_pencil.layers.active.frames) == 0: 
+        y = event.mouse_region_y
+        if len(ob.grease_pencil.layers.active.frames) == 0:
             bpy.ops.gpencil.draw(mode='DRAW', stroke=[{"name":"", "pen_flip":False,
                                                        "is_start":True, "location":(0, 0, 0),
                                                        "mouse":(x,y), "pressure":1, "time":0}])
@@ -724,12 +724,12 @@ class IntuitiveScale(Operator):
                 nb_point = 4
             else:
                 nb_point = 6
-                   
+
             if len(ob.grease_pencil.layers.active.frames[0].strokes) < nb_point:
                 bpy.ops.gpencil.draw(mode='DRAW', stroke=[{"name":"", "pen_flip":False,
                                                            "is_start":True, "location":(0, 0, 0),
                                                            "mouse":(x,y), "pressure":1, "time":0}])
-                                                           
+
             if len(ob.grease_pencil.layers.active.frames[0].strokes) == nb_point:
                 s = ob.grease_pencil.layers.active.frames[0]
                 v1 = s.strokes[1].points[0].co - s.strokes[0].points[0].co
@@ -737,39 +737,39 @@ class IntuitiveScale(Operator):
                     v2 = s.strokes[4].points[0].co - s.strokes[3].points[0].co
                 else:
                     v2 = s.strokes[3].points[0].co - s.strokes[2].points[0].co
-                propx = v1.x/v2.x                
+                propx = v1.x/v2.x
                 em.custom_scale[0] *= abs(propx)
-                
+
                 if not em.custom_linkscale:
                     v1 = s.strokes[2].points[0].co - s.strokes[0].points[0].co
                     v2 = s.strokes[5].points[0].co - s.strokes[3].points[0].co
                     propy = v1.y/v2.y
                     em.custom_scale[1] *= abs(propy)
                 bpy.ops.gpencil.active_frame_delete()
-        
+
         return {'FINISHED'}
 
 # Oprerator Class to configure all wath is needed
 class AddBProjectionPlane(Operator):
     bl_idname = "object.addbprojectionplane"
     bl_label = "Configure"
-    
-    def creatematerial(self, context):        
-        if 'Material for BProjection' not in [mat.name for mat in bpy.data.materials]:            
+
+    def creatematerial(self, context):
+        if 'Material for BProjection' not in [mat.name for mat in bpy.data.materials]:
             bpy.data.textures.new(name='Texture for BProjection',type='IMAGE')
-    
+
             bpy.data.materials.new(name='Material for BProjection')
-            
+
             matBProjection = bpy.data.materials['Material for BProjection']
             matBProjection.texture_slots.add()
             matBProjection.use_shadeless = True
             matBProjection.use_transparency = True
             matBProjection.active_texture = bpy.data.textures['Texture for BProjection']
-        
+
             index = matBProjection.active_texture_index
             matBProjection.texture_slots[index].texture_coords = 'UV'
-        
-        ob = context.object 
+
+        ob = context.object
         old_index = ob.active_material_index
         bpy.ops.object.material_slot_add()
         index = ob.active_material_index
@@ -777,68 +777,68 @@ class AddBProjectionPlane(Operator):
         bpy.ops.object.material_slot_assign()
         ob.active_material_index = old_index
         ob.data.update()
-            
-    def execute(self, context):    
-        if  BProjection_Empty not in [ob.name for ob in bpy.data.objects]:                
-            
+
+    def execute(self, context):
+        if  BProjection_Empty not in [ob.name for ob in bpy.data.objects]:
+
             cm = bpy.context.object.mode
             '''tmp = context.object
             for ob in (ob for ob in bpy.data.objects if ob.type == 'MESH' and ob.hide == False and context.scene in ob.users_scene):
                 context.scene.objects.active = ob
-                bpy.ops.object.mode_set(mode = cm, toggle=False) 
-            
+                bpy.ops.object.mode_set(mode = cm, toggle=False)
+
             context.scene.objects.active = tmp'''
             bpy.ops.object.mode_set(mode = 'OBJECT', toggle=False)
-            
+
             context.space_data.show_relationship_lines = False
-            
+
             ob = context.object
-        
+
             bpy.ops.object.add()
             em = context.object
             em.name = BProjection_Empty
-                        
+
             context.scene.objects.active = ob
             ob.select = True
-    
+
             bpy.ops.object.editmode_toggle()
-    
+
             bpy.ops.mesh.primitive_plane_add()
             bpy.ops.object.vertex_group_assign(new = True)
-            ob.vertex_groups.active.name = 'texture plane'   
+            ob.vertex_groups.active.name = 'texture plane'
             bpy.ops.uv.unwrap()
-            
-            bpy.ops.mesh.select_all(action='DESELECT')                                
+
+            bpy.ops.mesh.select_all(action='DESELECT')
             bpy.ops.object.vertex_group_select()
-            
+
             bpy.ops.object.editmode_toggle()
             for i in range(4):
                 ob.data.edges[len(ob.data.edges)-1-i].crease = 1
             bpy.ops.object.editmode_toggle()
-            
+
             em.custom_sub = ob.custom_sub
             if em.custom_sub > 0:
                 bpy.ops.mesh.subdivide(number_cuts = em.custom_sub)
-    
+
             em.select = True
             bpy.ops.object.hook_add_selob()
             em.select = False
-            em.hide = True   
-                     
+            em.hide = True
+
             self.creatematerial(context)
-  
-          
+
+
             bpy.ops.gpencil.data_add()
             ob.grease_pencil.draw_mode = 'VIEW'
             bpy.ops.gpencil.layer_add()
             ob.grease_pencil.layers.active.color = [1.0,0,0]
-            
+
             bpy.ops.object.editmode_toggle()
-            
+
             bpy.ops.object.shape_key_add(from_mix = False)
-            
+
             bpy.ops.object.create_view()
-                    
+
             km = bpy.data.window_managers['WinMan'].keyconfigs['Blender'].keymaps['3D View']
             l = ['view3d.rotate','view3d.move','view3d.zoom','view3d.viewnumpad','paint.bp_paint','MOUSE','KEYBOARD','LEFT','MIDDLEMOUSE','WHEELINMOUSE','WHEELOUTMOUSE','NUMPAD_1','NUMPAD_3','NUMPAD_7']
             for kmi in km.keymap_items:
@@ -856,104 +856,104 @@ class AddBProjectionPlane(Operator):
                                 kmi.properties.view = p
                         except:
                             if kmi.idname == 'view3d.rotate':
-                                kmi.idname = 'view3d.rotate_view3d'  
+                                kmi.idname = 'view3d.rotate_view3d'
                             if kmi.idname == 'view3d.move':
                                 kmi.idname = 'view3d.pan_view3d'
-                                                              
+
             km = context.window_manager.keyconfigs.default.keymaps['Image Paint']
-                    
+
             kmi = km.keymap_items.new("object.intuitivescale", 'LEFTMOUSE', 'PRESS', shift=True)
             kmi = km.keymap_items.new("object.bp_grab", 'G', 'PRESS')
-            kmi = km.keymap_items.new("object.bp_rotate", 'R', 'PRESS') 
-            kmi = km.keymap_items.new("object.bp_scale", 'S', 'PRESS')            
+            kmi = km.keymap_items.new("object.bp_rotate", 'R', 'PRESS')
+            kmi = km.keymap_items.new("object.bp_scale", 'S', 'PRESS')
             kmi = km.keymap_items.new("object.bp_scaleuv", 'U', 'PRESS')
             kmi = km.keymap_items.new("object.bp_offsetuv", 'Y', 'PRESS')
             kmi = km.keymap_items.new("object.bp_clear_prop", 'C', 'PRESS')
             kmi = km.keymap_items.new("object.bp_toggle_alpha", 'Q', 'PRESS')
             align_to_view(context)
-            
+
             context.space_data.cursor_location = em.location
-            
+
             bpy.ops.object.mode_set(mode = cm, toggle=False)
             bpy.data.objects[BProjection_Empty].custom_active_object = context.object.name
-            
+
         return {'FINISHED'}
 
-# Oprerator Class to remove what is no more needed    
+# Oprerator Class to remove what is no more needed
 class RemoveBProjectionPlane(Operator):
     bl_idname = "object.removebprojectionplane"
     bl_label = "Configure"
 
     def removematerial(self, context):
-        ob = context.object 
+        ob = context.object
         i = 0
 
         for ms in ob.material_slots:
             if ms.name == BProjection_Material:
                 index = i
             i+=1
-                
+
         ob.active_material_index = index
         bpy.ops.object.material_slot_remove()
-    
+
     def execute(self, context):
-        try:               
+        try:
             cm = bpy.context.object.mode
             bpy.ops.object.mode_set(mode = 'OBJECT', toggle=False)
-            
+
             context.space_data.show_relationship_lines = True
-            
+
             bpy.ops.object.modifier_remove(modifier="Hook-Empty for BProjection")
-            
+
             self.removematerial(context)
 
             ob = context.object
-    
+
             bpy.ops.object.editmode_toggle()
-    
+
             bpy.ops.mesh.reveal()
-                                   
-            bpy.ops.mesh.select_all(action='DESELECT')                    
-            
+
+            bpy.ops.mesh.select_all(action='DESELECT')
+
             ob.vertex_groups.active_index = ob.vertex_groups['texture plane'].index
             bpy.ops.object.vertex_group_select()
             bpy.ops.mesh.delete()
             bpy.ops.object.vertex_group_remove()
-    
+
             bpy.ops.object.editmode_toggle()
-   
+
             ob.select = False
-                
+
             em = bpy.data.objects[BProjection_Empty]
             context.scene.objects.active = em
             em.hide = False
             em.select = True
             bpy.ops.object.delete()
-    
+
             context.scene.objects.active = ob
             ob.select = True
-            
+
             reinitkey()
-                        
+
             '''tmp = context.object
             for ob in (ob for ob in bpy.data.objects if ob.type == 'MESH' and ob.hide == False and context.scene in ob.users_scene):
                 context.scene.objects.active = ob
-                bpy.ops.object.mode_set(mode = 'OBJECT', toggle=False) 
-            
+                bpy.ops.object.mode_set(mode = 'OBJECT', toggle=False)
+
             context.scene.objects.active = tmp'''
-            ob = context.object           
-            
-            
+            ob = context.object
+
+
             for i in ob.data.shape_keys.key_blocks:
                 bpy.ops.object.shape_key_remove()
             bpy.ops.object.shape_key_remove()
-               
+
             bpy.ops.object.mode_set(mode = cm, toggle=False)
             removecustomprops()
-                    
+
         except:
             nothing = 0
-        
+
         return {'FINISHED'}
 
 def reinitkey():
@@ -974,94 +974,94 @@ def reinitkey():
                         kmi.properties.type = p
                 except:
                     if kmi.idname == 'view3d.rotate_view3d':
-                        kmi.idname = 'view3d.rotate'  
+                        kmi.idname = 'view3d.rotate'
                     if kmi.idname == 'view3d.pan_view3d':
-                        kmi.idname = 'view3d.move'            
-            
+                        kmi.idname = 'view3d.move'
+
     km = bpy.context.window_manager.keyconfigs.default.keymaps['Image Paint']
-                
+
     for kmi in km.keymap_items:
         if kmi.idname == 'paint.bp_paint':
             kmi.idname = 'paint.image_paint'
-            
+
     for kmi in (kmi for kmi in km.keymap_items if kmi.idname in {"object.intuitivescale", "object.bp_grab", "object.bp_rotate", "object.bp_scale", "object.bp_scaleuv", "object.bp_clear_prop", "object.bp_offsetuv","object.bp_toggle_alpha", }):
             km.keymap_items.remove(kmi)
 
-# Oprerator Class to remove what is no more needed    
+# Oprerator Class to remove what is no more needed
 class ChangeObject(Operator):
     bl_idname = "object.change_object"
     bl_label = "Change Object"
 
     def removematerial(self, context):
-        ob = context.object 
+        ob = context.object
         i = 0
 
         for ms in ob.material_slots:
             if ms.name == BProjection_Material:
                 index = i
             i+=1
-                
+
         ob.active_material_index = index
         bpy.ops.object.material_slot_remove()
-    
+
     def execute(self, context):
             new_ob = context.object
-            em = bpy.data.objects[BProjection_Empty]              
+            em = bpy.data.objects[BProjection_Empty]
             context.scene.objects.active = bpy.data.objects[em.custom_active_object]
             ob = context.object
             if ob != new_ob:
                 cm = bpy.context.object.mode
                 bpy.ops.object.mode_set(mode = 'OBJECT', toggle=False)
-                
-                bpy.ops.object.modifier_remove(modifier="Hook-Empty for BProjection") 
-    
+
+                bpy.ops.object.modifier_remove(modifier="Hook-Empty for BProjection")
+
                 ob = context.object
-        
+
                 bpy.ops.object.editmode_toggle()
-        
+
                 bpy.ops.mesh.reveal()
-                                       
-                bpy.ops.mesh.select_all(action='DESELECT')                               
+
+                bpy.ops.mesh.select_all(action='DESELECT')
                 ob.vertex_groups.active_index = ob.vertex_groups['texture plane'].index
                 bpy.ops.object.vertex_group_select()
                 lo_b = [ob for ob in bpy.data.objects if ob.type == 'MESH']
                 bpy.ops.mesh.separate(type='SELECTED')
                 lo_a = [ob for ob in bpy.data.objects if ob.type == 'MESH']
                 bpy.ops.object.vertex_group_remove()
-                
+
                 for i in lo_b:
                     lo_a.remove(i)
                 bplane = lo_a[0]
-                
+
                 bpy.ops.object.editmode_toggle()
-                
+
                 self.removematerial(context)
-                
+
                 bpy.ops.object.mode_set(mode = cm, toggle=False)
-                
+
                 shape_index = ob.active_shape_key_index
-                
+
                 for i in ob.data.shape_keys.key_blocks:
                     bpy.ops.object.shape_key_remove()
                 bpy.ops.object.shape_key_remove()
-                
+
                 ob.select = False
-                
-                bplane.select = True            
+
+                bplane.select = True
                 context.scene.objects.active = bplane
                 for ms in (ms for ms in bplane.material_slots if ms.name != BProjection_Material):
                     bplane.active_material = ms.material
                     bpy.ops.object.material_slot_remove()
-                
+
                 for gs in (gs for gs in bplane.vertex_groups if gs.name != 'texture plane'):
                     bplane.vertex_groups.active_index = gs.index
                     bpy.ops.object.vertex_group_remove()
-              
+
                 context.scene.objects.active = new_ob
                 cm = new_ob.mode
-                bpy.ops.object.mode_set(mode = 'OBJECT', toggle=False) 
+                bpy.ops.object.mode_set(mode = 'OBJECT', toggle=False)
                 bpy.ops.object.join()
-    
+
                 em.hide = False
                 em.select = True
                 new_ob.select = False
@@ -1069,7 +1069,7 @@ class ChangeObject(Operator):
                 bpy.ops.object.rotation_clear()
                 bpy.ops.object.scale_clear()
                 context.scene.objects.active = new_ob
-                bpy.ops.object.editmode_toggle()            
+                bpy.ops.object.editmode_toggle()
                 bpy.ops.object.hook_add_selob()
                 bpy.ops.object.editmode_toggle()
                 em.hide = True
@@ -1080,162 +1080,162 @@ class ChangeObject(Operator):
                 em.custom_c3d = False
                 bpy.ops.object.active_view(index = shape_index-1)
                 bpy.ops.object.mode_set(mode = cm, toggle=False)
-                        
+
                 sd = context.space_data
-                r3d = sd.region_3d 
+                r3d = sd.region_3d
                 vr = r3d.view_rotation.copy()
                 vr.invert()
-                ob_loc = ob.location.copy()            
-                new_ob_loc = new_ob.location.copy() 
+                ob_loc = ob.location.copy()
+                new_ob_loc = new_ob.location.copy()
                 ob_loc.rotate(vr)
                 new_ob_loc.rotate(vr)
                 em.custom_location += Vector((ob_loc.x - new_ob_loc.x, ob_loc.y - new_ob_loc.y, 0.0))
                 em.custom_c3d = tmp
-                    
+
             return {'FINISHED'}
-    
+
 #Paint from the bp_plan
 
 last_mouse = Vector((0,0))
 
 def move_bp(self,context,cm,fm):
     em = bpy.data.objects['Empty for BProjection']
-    
+
     deltax = cm.x - round(fm.x)
     deltay = cm.y - round(fm.y)
-    
-    sd = context.space_data              
+
+    sd = context.space_data
     l =  sd.region_3d
     vr = l.view_rotation.copy()
     vr.invert()
-    
+
     v_init = Vector((0.0,0.0,1.0))
-    
+
     pos = [-deltax,-deltay]
     v = view3d_utils.region_2d_to_location_3d(context.region, l, pos, v_init)
     pos = [0,0]
-    vbl = view3d_utils.region_2d_to_location_3d(context.region, l, pos, v_init)        
-    loc = vbl - v 
-      
+    vbl = view3d_utils.region_2d_to_location_3d(context.region, l, pos, v_init)
+    loc = vbl - v
+
     loc.rotate(vr)
-        
+
     em.custom_location -= loc
-    
+
     self.first_mouse = cm
-            
+
 class BP_Paint(bpy.types.Operator):
     bl_idname = "paint.bp_paint"
     bl_label = "Paint BProjection Plane"
     first_mouse = Vector((0,0))
-    
+
     @classmethod
     def poll(cls, context):
         return 1
 
     def modal(self, context, event):
         global last_mouse
-        em = bpy.data.objects['Empty for BProjection']        
+        em = bpy.data.objects['Empty for BProjection']
         sd = context.space_data
-        
+
         center = view3d_utils.location_3d_to_region_2d(context.region, sd.region_3d, em.location)
-        vec_init = self.first_mouse - center        
-        vec_act = Vector((event.mouse_region_x, event.mouse_region_y)) - center               
-            
-        if event.type == 'MOUSEMOVE':#'INBETWEEN_MOUSEMOVE':                
+        vec_init = self.first_mouse - center
+        vec_act = Vector((event.mouse_region_x, event.mouse_region_y)) - center
+
+        if event.type == 'MOUSEMOVE':#'INBETWEEN_MOUSEMOVE':
             step_act = Vector((event.mouse_region_x, event.mouse_region_y)) - self.step_prev
-            if step_act.length >= context.scene.tool_settings.unified_paint_settings.size*bpy.data.brushes['Clone'].spacing/100 or bpy.data.brushes['Clone'].use_airbrush: 
-                move_bp(self,context,Vector((event.mouse_region_x, event.mouse_region_y)) - self.v_offset,self.first_mouse)   
-                
+            if step_act.length >= context.scene.tool_settings.unified_paint_settings.size*bpy.data.brushes['Clone'].spacing/100 or bpy.data.brushes['Clone'].use_airbrush:
+                move_bp(self,context,Vector((event.mouse_region_x, event.mouse_region_y)) - self.v_offset,self.first_mouse)
+
                 bpy.ops.paint.image_paint(stroke=[{"name":"", "location":(0, 0, 0), "mouse":(event.mouse_region_x, event.mouse_region_y),
                                                        "pressure":1, "pen_flip":False, "time":0, "is_start":False}])
                 self.step_prev = Vector((event.mouse_region_x, event.mouse_region_y))
-                
+
         if event.type == 'LEFTMOUSE':
             em.custom_c3d = True
             bpy.data.materials['Material for BProjection'].alpha = self.alpha
             em.custom_location = self.first_location
             return {'FINISHED'}
-        
+
         if event.type == 'ESC' or event.type == 'RIGHTMOUSE':
             em.custom_c3d = True
             bpy.data.materials['Material for BProjection'].alpha = self.alpha
             em.custom_location = self.first_location
             return {'FINISHED'}
-        
+
         return {'PASS_THROUGH'}
-                
-    def invoke(self, context, event):   
+
+    def invoke(self, context, event):
         em = bpy.data.objects['Empty for BProjection']
         context.window_manager.modal_handler_add(self)
         self.first_mouse = Vector((event.mouse_region_x, event.mouse_region_y))
-        
-        sd = context.space_data              
-        l =  sd.region_3d        
+
+        sd = context.space_data
+        l =  sd.region_3d
         v_init = Vector((0.0,0.0,1.0))
         context.scene.cursor_location = view3d_utils.region_2d_to_location_3d(context.region, l, [event.mouse_region_x, event.mouse_region_y], v_init)
-        
+
         self.first_location = em.custom_location.copy()
-        
+
         self.v_offset =  Vector((context.region.width, context.region.height)) - Vector((event.mouse_region_x, event.mouse_region_y))
         move_bp(self,context,Vector((event.mouse_region_x, event.mouse_region_y)) - self.v_offset,self.first_mouse)
-        
+
         em.custom_c3d = False
         self.alpha = bpy.data.materials['Material for BProjection'].alpha
-        
+
         em.custom_location.z = -10
-         
+
         bpy.data.materials['Material for BProjection'].alpha = 0
-            
+
         bpy.ops.paint.image_paint(stroke=[{"name":"", "location":(0, 0, 0), "mouse":(event.mouse_region_x, event.mouse_region_y),
                                                    "pressure":1, "pen_flip":False, "time":0, "is_start":False}])
-        self.step_prev = Vector((event.mouse_region_x, event.mouse_region_y))       
-        return {'RUNNING_MODAL'}  
+        self.step_prev = Vector((event.mouse_region_x, event.mouse_region_y))
+        return {'RUNNING_MODAL'}
 
-# Oprerator Class toggle the alpha of the plane             
+# Oprerator Class toggle the alpha of the plane
 temp_alpha = 0
 class ApplyImage(Operator):
     bl_idname = "object.bp_toggle_alpha"
     bl_label = "Toggle Alpha of the BP"
-    
-    def execute(self, context):        
-        global temp_alpha  
+
+    def execute(self, context):
+        global temp_alpha
         if temp_alpha != 0:
-            bpy.data.materials['Material for BProjection'].alpha = temp_alpha 
+            bpy.data.materials['Material for BProjection'].alpha = temp_alpha
             temp_alpha = 0
         else:
             temp_alpha = bpy.data.materials['Material for BProjection'].alpha
-            bpy.data.materials['Material for BProjection'].alpha = 0    
-        
+            bpy.data.materials['Material for BProjection'].alpha = 0
+
         return {'FINISHED'}
-    
+
 #reinit the values of the bp_plane
 class BP_Clear_Props(Operator):
     bl_idname = "object.bp_clear_prop"
     bl_label = "Clear Props BProjection Plane"
 
-    def execute(self, context):        
+    def execute(self, context):
         clear_props(context)
-        
+
         return{'FINISHED'}
-    
+
 #Move the UV of the bp_plane
 class BP_OffsetUV(bpy.types.Operator):
     bl_idname = "object.bp_offsetuv"
     bl_label = "OffsetUV BProjection Plane"
-    
+
     axe_x = True
     axe_y = True
 
     first_mouse = Vector((0,0))
     first_offsetuv = Vector((0,0))
-    
+
     @classmethod
     def poll(cls, context):
         return 1
 
     def modal(self, context, event):
-        em = bpy.data.objects['Empty for BProjection']        
-                
+        em = bpy.data.objects['Empty for BProjection']
+
         if event.shift:
             fac = 0.1
         else:
@@ -1248,8 +1248,8 @@ class BP_OffsetUV(bpy.types.Operator):
                 self.axe_y = True
             elif self.axe_x == False and self.axe_y == True:
                 self.axe_y = False
-                self.axe_x = True   
-        
+                self.axe_x = True
+
         if event.type == 'Y' and event.value == 'PRESS':
             if self.axe_x == True and self.axe_y == True:
                 self.axe_x = False
@@ -1258,7 +1258,7 @@ class BP_OffsetUV(bpy.types.Operator):
             elif self.axe_x == True and self.axe_y == False:
                 self.axe_y = True
                 self.axe_x = False
-                
+
         deltax = (event.mouse_region_x - self.first_mouse.x)*fac
         deltay = (event.mouse_region_y - self.first_mouse.y)*fac
 
@@ -1267,50 +1267,50 @@ class BP_OffsetUV(bpy.types.Operator):
             if  not self.axe_y:
                 deltay = 0
             if not self.axe_x:
-                deltax = 0                  
-                                                
+                deltax = 0
+
             ouv = em.custom_offsetuv
             em.custom_offsetuv = [ouv[0] - deltax/50,ouv[1] - deltay/50]
-        
+
             self.first_mouse.x = event.mouse_region_x
-            self.first_mouse.y = event.mouse_region_y 
+            self.first_mouse.y = event.mouse_region_y
 
         if event.type == 'LEFTMOUSE':
             return {'FINISHED'}
-        
+
         if event.type == 'ESC' or event.type == 'RIGHTMOUSE':
             em.custom_offsetuv = self.first_offsetuv
             return {'FINISHED'}
-        
+
         return {'RUNNING_MODAL'}
-                
-    def invoke(self, context, event):   
+
+    def invoke(self, context, event):
         em = bpy.data.objects['Empty for BProjection']
         context.window_manager.modal_handler_add(self)
         self.first_mouse.x = event.mouse_region_x
         self.first_mouse.y = event.mouse_region_y
         self.first_offsetuv = em.custom_offsetuv.copy()
-                
+
         return {'RUNNING_MODAL'}
 
 #Scale the UV of the bp_plane
 class BP_ScaleUV(bpy.types.Operator):
     bl_idname = "object.bp_scaleuv"
     bl_label = "ScaleUV BProjection Plane"
-    
+
     axe_x = True
     axe_y = True
 
     first_mouse = Vector((0,0))
     first_scaleuv = Vector((0,0))
-    
+
     @classmethod
     def poll(cls, context):
         return 1
 
     def modal(self, context, event):
-        em = bpy.data.objects['Empty for BProjection']        
-                
+        em = bpy.data.objects['Empty for BProjection']
+
         if event.shift:
             fac = 0.1
         else:
@@ -1323,8 +1323,8 @@ class BP_ScaleUV(bpy.types.Operator):
                 self.axe_y = True
             elif self.axe_x == False and self.axe_y == True:
                 self.axe_y = False
-                self.axe_x = True   
-        
+                self.axe_x = True
+
         if event.type == 'Y' and event.value == 'PRESS':
             if self.axe_x == True and self.axe_y == True:
                 self.axe_x = False
@@ -1333,7 +1333,7 @@ class BP_ScaleUV(bpy.types.Operator):
             elif self.axe_x == True and self.axe_y == False:
                 self.axe_y = True
                 self.axe_x = False
-                
+
         deltax = (event.mouse_region_x - self.first_mouse.x)*fac
         deltay = (event.mouse_region_y - self.first_mouse.y)*fac
 
@@ -1342,62 +1342,62 @@ class BP_ScaleUV(bpy.types.Operator):
             if  not self.axe_y:
                 deltay = 0
             if not self.axe_x:
-                deltax = 0                
-            
+                deltax = 0
+
             if self.axe_x and self.axe_y:
                 fac = em.custom_scaleuv[1]/em.custom_scaleuv[0]
                 deltay = deltax * fac
             else:
-                em.custom_linkscaleuv = False    
-                                                
+                em.custom_linkscaleuv = False
+
             s = em.custom_scaleuv
             em.custom_scaleuv = [s[0] + deltax/50, s[1] + deltay/50]
-        
+
             self.first_mouse.x = event.mouse_region_x
-            self.first_mouse.y = event.mouse_region_y 
+            self.first_mouse.y = event.mouse_region_y
 
         if event.type == 'LEFTMOUSE':
             return {'FINISHED'}
-        
+
         if event.type == 'ESC' or event.type == 'RIGHTMOUSE':
             em.custom_scaleuv = self.first_scaleuv
             return {'FINISHED'}
-        
+
         return {'RUNNING_MODAL'}
-                
-    def invoke(self, context, event):   
+
+    def invoke(self, context, event):
         em = bpy.data.objects['Empty for BProjection']
         context.window_manager.modal_handler_add(self)
         self.first_mouse.x = event.mouse_region_x
         self.first_mouse.y = event.mouse_region_y
         self.first_scaleuv = em.custom_scaleuv.copy()
-                
+
         return {'RUNNING_MODAL'}
-    
+
 #Scale the bp_plane
 class BP_Scale(bpy.types.Operator):
     bl_idname = "object.bp_scale"
     bl_label = "Scale BProjection Plane"
-    
+
     axe_x = True
     axe_y = True
 
     first_mouse = Vector((0,0))
     first_scale = Vector((0,0,0))
-    
+
     @classmethod
     def poll(cls, context):
         return 1
 
     def modal(self, context, event):
-        em = bpy.data.objects['Empty for BProjection']        
+        em = bpy.data.objects['Empty for BProjection']
         sd = context.space_data
 
         center = view3d_utils.location_3d_to_region_2d(context.region, sd.region_3d, em.location)
-        vec_init = self.first_mouse - center        
+        vec_init = self.first_mouse - center
         vec_act = Vector((event.mouse_region_x, event.mouse_region_y)) - center
         scale_fac = vec_act.length/vec_init.length
-                        
+
         if event.ctrl:
             scale_fac = round(scale_fac,1)
 
@@ -1408,8 +1408,8 @@ class BP_Scale(bpy.types.Operator):
                 self.axe_y = True
             elif self.axe_x == False and self.axe_y == True:
                 self.axe_y = False
-                self.axe_x = True   
-        
+                self.axe_x = True
+
         if event.type == 'Y' and event.value == 'PRESS':
             if self.axe_x == True and self.axe_y == True:
                 self.axe_x = False
@@ -1418,106 +1418,106 @@ class BP_Scale(bpy.types.Operator):
             elif self.axe_x == True and self.axe_y == False:
                 self.axe_y = True
                 self.axe_x = False
-        
+
         if event.type == 'MOUSEMOVE':
-            
+
             if self.axe_x:
                 em.custom_scale = [self.first_scale[0]*scale_fac, self.first_scale[1]]
             if self.axe_y:
-                em.custom_scale = [self.first_scale[0], self.first_scale[1]*scale_fac]                
-            
+                em.custom_scale = [self.first_scale[0], self.first_scale[1]*scale_fac]
+
             if self.axe_x and self.axe_y:
                 em.custom_scale = [self.first_scale[0]*scale_fac, self.first_scale[1]*scale_fac]
             else:
-                em.custom_linkscale = False    
+                em.custom_linkscale = False
 
         if event.type == 'LEFTMOUSE':
             return {'FINISHED'}
-        
+
         if event.type == 'ESC' or event.type == 'RIGHTMOUSE':
             em.custom_scale = self.first_scale
             return {'FINISHED'}
-        
+
         return {'RUNNING_MODAL'}
-                
-    def invoke(self, context, event):   
+
+    def invoke(self, context, event):
         em = bpy.data.objects['Empty for BProjection']
         context.window_manager.modal_handler_add(self)
         self.first_mouse.x = event.mouse_region_x
         self.first_mouse.y = event.mouse_region_y
         self.first_scale = em.custom_scale.copy()
-                
+
         return {'RUNNING_MODAL'}
-    
+
 #Rotate the bp_plan
 class BP_Rotate(bpy.types.Operator):
     bl_idname = "object.bp_rotate"
     bl_label = "Rotate BProjection Plane"
-    
+
     first_mouse = Vector((0,0))
     first_rotation = 0
-    
+
     @classmethod
     def poll(cls, context):
         return 1
 
     def modal(self, context, event):
-        em = bpy.data.objects['Empty for BProjection']        
+        em = bpy.data.objects['Empty for BProjection']
         sd = context.space_data
-        
+
         center = view3d_utils.location_3d_to_region_2d(context.region, sd.region_3d, em.location if em.custom_rotc3d else context.scene.cursor_location)
-        vec_init = self.first_mouse - center        
+        vec_init =&