[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3338] contrib/py/scripts/addons/ oscurart_tools.py: Improves in overrides.

Eugenio Pignataro info at oscurart.com.ar
Thu May 3 02:29:59 CEST 2012


Revision: 3338
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3338
Author:   oscurart
Date:     2012-05-03 00:29:58 +0000 (Thu, 03 May 2012)
Log Message:
-----------
Improves in overrides.

Modified Paths:
--------------
    contrib/py/scripts/addons/oscurart_tools.py

Modified: contrib/py/scripts/addons/oscurart_tools.py
===================================================================
--- contrib/py/scripts/addons/oscurart_tools.py	2012-05-02 21:56:42 UTC (rev 3337)
+++ contrib/py/scripts/addons/oscurart_tools.py	2012-05-03 00:29:58 UTC (rev 3338)
@@ -20,7 +20,7 @@
     "name": "Oscurart Tools",
     "author": "Oscurart",
     "version": (2,9),
-    "blender": (2, 6, 2),
+    "blender": (2, 6, 3),
     "location": "View3D > Tools > Oscurart Tools",
     "description": "Tools for objects, render, shapes, and files.",
     "warning": "",
@@ -63,6 +63,10 @@
         col.prop(bpy.context.scene,"osc_render_tools",text="Render",icon="SCENE")
         col.prop(bpy.context.scene,"osc_files_tools",text="Files",icon="IMASEL")
         col.prop(bpy.context.scene,"osc_overrides_tools",text="Overrides",icon="GREASEPENCIL")
+        
+    # RECARGO EL SELECTION    
+    def __init__(self):
+        select_osc()
 
 # POLLS
 class OscPollObject():
@@ -2371,10 +2375,10 @@
     LISTSCENE=[]
     
     for SCENE in bpy.data.scenes[:]:
-        if bpy.selection[-1] in SCENE.objects[:]:
+        if bpy.selection_osc[-1] in SCENE.objects[:]:
             LISTSCENE.append(SCENE)    
 
-    OBJECTS = bpy.selection[:-1]
+    OBJECTS = bpy.selection_osc[:-1]
     
     ## REMUEVO ESCENA ACTIVA
     LISTSCENE.remove(bpy.context.scene)
@@ -2411,7 +2415,7 @@
 
 def CopyObjectGroupsAndLayers (self): 
               
-    OBSEL=bpy.selection[:]
+    OBSEL=bpy.selection_osc[:]
     GLOBALLAYERS=str(OBSEL[-1].layers[:])
     ACTSCENE=bpy.context.scene
     GROUPS=OBSEL[-1].users_group
@@ -2611,44 +2615,30 @@
           
 
 ## ------------------------------------ SELECTION -------------------------------------- 
+bpy.selection_osc=[]
 
-def select():
-    bpy.selection=[]
+def select_osc():
     if bpy.context.mode=="OBJECT":
         obj = bpy.context.object
         sel = len(bpy.context.selected_objects)
 	
 
         if sel==0:
-            bpy.selection=[]
+            bpy.selection_osc=[]
         else:
             if sel==1:
-                bpy.selection=[]
-                bpy.selection.append(obj)
-            elif sel>len(bpy.selection):
+                bpy.selection_osc=[]
+                bpy.selection_osc.append(obj)
+            elif sel>len(bpy.selection_osc):
                 for sobj in bpy.context.selected_objects:
-                    if (sobj in bpy.selection)==False:
-                        bpy.selection.append(sobj)
+                    if (sobj in bpy.selection_osc)==False:
+                        bpy.selection_osc.append(sobj)
 
-            elif sel<len(bpy.selection):
-                for it in bpy.selection:
+            elif sel<len(bpy.selection_osc):
+                for it in bpy.selection_osc:
                     if (it in bpy.context.selected_objects)==False:
-                        bpy.selection.remove(it)
+                        bpy.selection_osc.remove(it)
 
-
-
-class Selection(bpy.types.Header):
-    bl_label = "Selection"
-    bl_space_type = "VIEW_3D"
-
-    def __init__(self):
-        select()
-
-    def draw(self, context):
-        layout = self.layout
-        row = layout.row()
-        row.label("Sel: "+str(len(bpy.selection)))
-     
    
 ##======================================================================================FIN DE SCRIPTS    
     
@@ -2706,4 +2696,4 @@
 bpy.utils.register_class(OscApplyOverrides)
 bpy.utils.register_class(OscRestoreOverrides)
 bpy.utils.register_class(OscCheckOverrides)
-bpy.utils.register_class(Selection)
+



More information about the Bf-extensions-cvs mailing list