[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3000] contrib/py/scripts/addons/ oscurart_tools.py:

Eugenio Pignataro info at oscurart.com.ar
Mon Feb 20 02:29:31 CET 2012


Revision: 3000
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3000
Author:   oscurart
Date:     2012-02-20 01:29:20 +0000 (Mon, 20 Feb 2012)
Log Message:
-----------


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

Added: contrib/py/scripts/addons/oscurart_tools.py
===================================================================
--- contrib/py/scripts/addons/oscurart_tools.py	                        (rev 0)
+++ contrib/py/scripts/addons/oscurart_tools.py	2012-02-20 01:29:20 UTC (rev 3000)
@@ -0,0 +1,2390 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+bl_info = {
+    "name": "Oscurart Tools",
+    "author": "Oscurart",
+    "version": (2,8),
+    "blender": (2, 6, 0),
+    "api": 3900,
+    "location": "View3D > Tools > Oscurart Tools",
+    "description": "Tools for objects, render, shapes, and files.",
+    "warning": "",
+    "wiki_url": "oscurart.blogspot.com",
+    "tracker_url": "",
+    "category": "Object"}
+
+
+
+import bpy
+import math
+import sys
+import os
+import stat
+
+## CREA PANELES EN TOOLS
+
+# VARIABLES DE ENTORNO
+bpy.types.Scene.osc_object_tools=bpy.props.BoolProperty(default=False)
+bpy.types.Scene.osc_mesh_tools=bpy.props.BoolProperty(default=False)
+bpy.types.Scene.osc_shapes_tools=bpy.props.BoolProperty(default=False)
+bpy.types.Scene.osc_render_tools=bpy.props.BoolProperty(default=False)
+bpy.types.Scene.osc_files_tools=bpy.props.BoolProperty(default=False)
+bpy.types.Scene.osc_overrides_tools=bpy.props.BoolProperty(default=False)
+
+# PANEL DE CONTROL
+class OscPanelControl(bpy.types.Panel):
+    bl_space_type = 'VIEW_3D'
+    bl_region_type = 'TOOLS'
+    bl_label = "Oscurart Tools"
+    def draw(self,context):
+        active_obj = context.active_object
+        layout = self.layout             
+  
+        col = layout.column(align=1)         
+        col.prop(bpy.context.scene,"osc_object_tools",text="Object",icon="OBJECT_DATAMODE")
+        col.prop(bpy.context.scene,"osc_mesh_tools",text="Mesh",icon="EDITMODE_HLT")
+        col.prop(bpy.context.scene,"osc_shapes_tools",text="Shapes",icon="SHAPEKEY_DATA")
+        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")
+
+# POLLS
+class OscPollObject():
+    bl_space_type = 'VIEW_3D'
+    bl_region_type = 'TOOLS'
+    
+    @classmethod
+    def poll(cls, context):
+        return(context.scene.osc_object_tools == True)
+    
+
+class OscPollMesh():
+    bl_space_type = 'VIEW_3D'
+    bl_region_type = 'TOOLS'
+    
+    @classmethod
+    def poll(cls, context):
+        return(context.scene.osc_mesh_tools == True)    
+
+
+class OscPollShapes():
+    bl_space_type = 'VIEW_3D'
+    bl_region_type = 'TOOLS'
+    
+    @classmethod
+    def poll(cls, context):
+        return(context.scene.osc_shapes_tools == True)
+
+class OscPollRender():
+    bl_space_type = 'VIEW_3D'
+    bl_region_type = 'TOOLS'
+    
+    @classmethod
+    def poll(cls, context):
+        return(context.scene.osc_render_tools == True)
+    
+class OscPollFiles():
+    bl_space_type = 'VIEW_3D'
+    bl_region_type = 'TOOLS'
+    
+    @classmethod
+    def poll(cls, context):
+        return(context.scene.osc_files_tools == True)  
+    
+class OscPollOverrides():
+    bl_space_type = 'VIEW_3D'
+    bl_region_type = 'TOOLS'
+    
+    @classmethod
+    def poll(cls, context):
+        return(context.scene.osc_overrides_tools == True)       
+
+
+
+## PANELES    
+class OscPanelObject(OscPollObject, bpy.types.Panel):
+    bl_idname = "Oscurart Object Tools"
+    bl_label = "Object Tools"
+        
+    def draw(self, context):
+        active_obj = context.active_object
+        layout = self.layout        
+        col = layout.column(align=1)
+        row = col.row()           
+        
+        colrow = col.row(align=1)            
+        col.operator("object.distribute_apply_osc",icon="OBJECT_DATAMODE") 
+        colrow = col.row(align=1)
+        colrow.prop(bpy.context.scene,"SearchAndSelectOt",text="")
+        colrow.operator("object.search_and_select_osc",icon="ZOOM_SELECTED")       
+        colrow = col.row(align=1)
+        colrow.prop(bpy.context.scene,"RenameObjectOt",text="")
+        colrow.operator("object.rename_objects_osc",icon="SHORTDISPLAY")  
+        col.operator("object.duplicate_object_symmetry_osc",icon="OBJECT_DATAMODE", text="Duplicate Object Symmetry")      
+        colrow = col.row(align=1)
+        colrow.operator("object.modifiers_remove_osc",icon="MODIFIER", text="Remove Modifiers")
+        colrow.operator("object.modifiers_apply_osc",icon="MODIFIER", text="Apply Modifiers")
+        
+
+class OscPanelMesh(OscPollMesh, bpy.types.Panel):
+    bl_idname = "Oscurart Mesh Tools"
+    bl_label = "Mesh Tools"
+        
+    def draw(self, context):
+        active_obj = context.active_object
+        layout = self.layout        
+        col = layout.column(align=1)
+        row = col.row()           
+        
+        col.operator("mesh.select_side_osc",icon="VERTEXSEL")  
+        col.operator("mesh.normals_outside_osc",icon="SNAP_NORMAL")       
+        colrow=col.row(align=1)
+        colrow.operator("mesh.resym_osc",icon="UV_SYNC_SELECT") 
+        colrow.operator("mesh.resym_vertex_weights_osc",icon="UV_SYNC_SELECT") 
+        colrow=col.row(align=1)        
+        colrow.operator("file.export_groups_osc", icon='GROUP_VCOL')
+        colrow.operator("file.import_groups_osc", icon='GROUP_VCOL')        
+
+        
+class OscPanelShapes(OscPollShapes, bpy.types.Panel):
+    bl_idname = "Oscurart Shapes Tools"
+    bl_label = "Shapes Tools"
+        
+    def draw(self, context):
+        active_obj = context.active_object
+        layout = self.layout        
+        col = layout.column(align=1)
+        row = col.row()           
+
+        col.operator("object.shape_key_to_objects_osc",icon="OBJECT_DATAMODE")
+        col.operator("mesh.create_lmr_groups_osc",icon="GROUP_VERTEX")
+        col.operator("mesh.split_lr_shapes_osc",icon="SHAPEKEY_DATA")
+        colrow=col.row()
+        colrow.operator("mesh.create_symmetrical_layout_osc",icon="SETTINGS")         
+        colrow.operator("mesh.create_asymmetrical_layout_osc",icon="SETTINGS") 
+        
+class OscPanelRender(OscPollRender, bpy.types.Panel):
+    bl_idname = "Oscurart Render Tools"
+    bl_label = "Render Tools"
+        
+    def draw(self, context):
+        active_obj = context.active_object
+        layout = self.layout        
+        col = layout.column(align=1)
+        row = col.row() 
+
+        col.operator("file.create_batch_maker_osc", icon="LINENUMBERS_ON", text="Make Render Batch") 
+        colrow = col.row()
+        colrow.operator("render.render_layers_at_time_osc",icon="RENDER_STILL", text="All Scenes")  
+        colrow.operator("render.render_layers_at_time_osc_cf",icon="RENDER_STILL", text="> Frame")
+        colrow = col.row()
+        colrow.operator("render.render_current_scene_osc",icon="RENDER_STILL", text="Active Scene")
+        colrow.operator("render.render_current_scene_osc_cf",icon="RENDER_STILL", text="> Frame")
+        colrow = col.row(align=1) 
+        colrow.prop(bpy.context.scene,"OscSelScenes",text="")
+        colrow.operator("render.render_selected_scenes_osc",icon="RENDER_STILL", text="Selected Scenes") 
+        colrow.operator("render.render_selected_scenes_osc_cf",icon="RENDER_STILL", text="> Fame")       
+             
+        colrow = col.row(align=1)
+        colrow.prop(bpy.context.scene,"rcPARTS",text="Render Crop Parts") 
+        colrow.operator("render.render_crop_osc",icon="RENDER_REGION")  
+
+
+class OscPanelFiles(OscPollFiles, bpy.types.Panel):
+    bl_idname = "Oscurart Files Tools"
+    bl_label = "Files Tools"
+        
+    def draw(self, context):
+        active_obj = context.active_object
+        layout = self.layout        
+        col = layout.column(align=1)
+      
+        colrow = col.row()
+        colrow.operator("file.save_incremental_osc",icon="NEW")
+        colrow.operator("image.reload_images_osc",icon="IMAGE_COL")  
+        colrow = col.row(align=1)
+        colrow.prop(bpy.context.scene,"oscSearchText",text="")               
+        colrow.prop(bpy.context.scene,"oscReplaceText",text="")         
+        col.operator("file.replace_file_path_osc",icon="SHORTDISPLAY") 
+        
+        
+class OscPanelOverrides(OscPollOverrides, bpy.types.Panel):
+    bl_idname = "Oscurart Overrides"
+    bl_label = "Overrides Tools"
+        
+    def draw(self, context):
+        layout = self.layout
+
+        obj = context.object
+        
+        col = layout.column(align=1)
+        colrow = col.row()
+        col.operator("render.overrides_set_list", text="Create Override List",icon="GREASEPENCIL")
+        col.label(text="Active Scene: " + bpy.context.scene.name)
+        col.label(text="Example: [[Group,Material]]")        
+        col.prop(bpy.context.scene, '["OVERRIDE"]', text="")
+        
+
+
+        
+##---------------------------RELOAD IMAGES------------------
+
+class reloadImages (bpy.types.Operator):
+    bl_idname = "image.reload_images_osc"
+    bl_label = "Reload Images" 
+    bl_options =  {"REGISTER","UNDO"}
+    def execute(self,context):
+        for imgs in bpy.data.images:
+            imgs.reload()
+        return{"FINISHED"}
+
+##-----------------------------RESYM---------------------------
+
+class resym (bpy.types.Operator):
+    bl_idname = "mesh.resym_osc"
+    bl_label = "ReSym Mesh" 
+    bl_options =  {"REGISTER","UNDO"}
+    def execute(self,context):
+        ##SETEO VERTEX MODE        
+        bpy.context.tool_settings.mesh_select_mode[0]=1
+        bpy.context.tool_settings.mesh_select_mode[1]=0
+        bpy.context.tool_settings.mesh_select_mode[2]=0
+        

@@ Diff output truncated at 10240 characters. @@


More information about the Bf-extensions-cvs mailing list