[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3789] contrib/py/scripts/addons/ oscurart_tools.py: Improves in overrides GUI
Eugenio Pignataro
info at oscurart.com.ar
Tue Sep 25 15:39:59 CEST 2012
Revision: 3789
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3789
Author: oscurart
Date: 2012-09-25 13:39:59 +0000 (Tue, 25 Sep 2012)
Log Message:
-----------
Improves in overrides GUI
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-09-24 22:09:09 UTC (rev 3788)
+++ contrib/py/scripts/addons/oscurart_tools.py 2012-09-25 13:39:59 UTC (rev 3789)
@@ -2314,21 +2314,74 @@
colrow.operator("render.overrides_add_slot", icon = "ZOOMIN")
colrow.operator("render.overrides_remove_slot", icon = "ZOOMOUT")
col.operator("render.overrides_transfer", icon = "SHORTDISPLAY")
+ i = 0
for m in bpy.context.scene.ovlist:
colrow = col.row(align=1)
colrow.prop_search(m, "grooverride", bpy.data, "groups", text= "")
colrow.prop_search(m, "matoverride", bpy.data, "materials", text= "")
+ if i != len(bpy.context.scene.ovlist)-1:
+ pa = colrow.operator("ovlist.move_down", text="", icon="TRIA_DOWN")
+ pa.index = i
+ if i > 0:
+ p = colrow.operator("ovlist.move_up", text="", icon="TRIA_UP")
+ p.index = i
+ pb = colrow.operator("ovlist.kill", text="", icon="X")
+ pb.index = i
+ i+=1
-
+class OscOverridesUp (bpy.types.Operator):
+ bl_idname = 'ovlist.move_up'
+ bl_label = 'Move Override up'
+ bl_options = {'INTERNAL'}
+
+ index = bpy.props.IntProperty(min=0)
+
+ @classmethod
+ def poll(self,context):
+ return len(context.scene.ovlist)
+ def execute(self,context):
+ ovlist = context.scene.ovlist
+ ovlist.move(self.index,self.index-1)
+ return {'FINISHED'}
+class OscOverridesDown (bpy.types.Operator):
+ bl_idname = 'ovlist.move_down'
+ bl_label = 'Move Override down'
+ bl_options = {'INTERNAL'}
+
+ index = bpy.props.IntProperty(min=0)
+
+ @classmethod
+ def poll(self,context):
+ return len(context.scene.ovlist)
+ def execute(self,context):
+ ovlist = context.scene.ovlist
+ ovlist.move(self.index,self.index+1)
+ return {'FINISHED'}
+
+class OscOverridesKill (bpy.types.Operator):
+ bl_idname = 'ovlist.kill'
+ bl_label = 'Kill Override'
+ bl_options = {'INTERNAL'}
+
+ index = bpy.props.IntProperty(min=0)
+
+ @classmethod
+ def poll(self,context):
+ return len(context.scene.ovlist)
+ def execute(self,context):
+ ovlist = context.scene.ovlist
+ ovlist.remove(self.index)
+ return {'FINISHED'}
+
+
class OscOverridesProp(bpy.types.PropertyGroup):
matoverride = bpy.props.StringProperty()
grooverride = bpy.props.StringProperty()
bpy.utils.register_class(OscOverridesGUI)
bpy.utils.register_class(OscOverridesProp)
-#bpy.types.Material.oscurart_override = bpy.props.StringProperty()
bpy.types.Scene.ovlist = bpy.props.CollectionProperty(type=OscOverridesProp)
More information about the Bf-extensions-cvs
mailing list