[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [4817] contrib/py/scripts/addons/ scene_amaranth_toolset.py: Amaranth Addon 0.7.3

Pablo Vazquez venomgfx at gmail.com
Tue Oct 29 19:25:45 CET 2013


Revision: 4817
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=4817
Author:   venomgfx
Date:     2013-10-29 18:25:45 +0000 (Tue, 29 Oct 2013)
Log Message:
-----------
Amaranth Addon 0.7.3
- New: Show render samples for other Cycles scenes on Sampling panel
- New shortcut: Ctrl+Tab for toggling between Dopesheet and Graph Editor.
Shift+Tab on Dopesheet to toggle between Summary-Action only
- Fix: More checks for the material indicator on particle systems

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

Modified: contrib/py/scripts/addons/scene_amaranth_toolset.py
===================================================================
--- contrib/py/scripts/addons/scene_amaranth_toolset.py	2013-10-27 20:58:55 UTC (rev 4816)
+++ contrib/py/scripts/addons/scene_amaranth_toolset.py	2013-10-29 18:25:45 UTC (rev 4817)
@@ -19,7 +19,7 @@
 bl_info = {
     "name": "Amaranth Toolset",
     "author": "Pablo Vazquez, Bassam Kurdali, Sergey Sharybin",
-    "version": (0, 7),
+    "version": (0, 7, 3),
     "blender": (2, 69),
     "location": "Scene Properties > Amaranth Toolset Panel",
     "description": "A collection of tools and settings to improve productivity",
@@ -440,11 +440,13 @@
             icon='COLOR')
 
 def node_templates_pulldown(self, context):
-    layout = self.layout
-    row = layout.row(align=True)
-    row.scale_x = 1.3
-    row.menu("NODE_MT_amaranth_templates",
-        icon="RADIO")
+
+    if context.space_data.tree_type == 'CompositorNodeTree':
+        layout = self.layout
+        row = layout.row(align=True)
+        row.scale_x = 1.3
+        row.menu("NODE_MT_amaranth_templates",
+            icon="RADIO")
 # // FEATURE: Node Templates
 
 def node_stats(self,context):
@@ -468,8 +470,15 @@
     bl_space_type = 'NODE_EDITOR'
     bl_region_type = 'UI'
     bl_label = 'Simplify'
-#    bl_options = {'DEFAULT_CLOSED'}
+    bl_options = {'DEFAULT_CLOSED'}
 
+    @classmethod
+    def poll(cls, context):
+        space = context.space_data
+        return space.type == 'NODE_EDITOR' \
+                and space.node_tree is not None \
+                and space.tree_type == 'CompositorNodeTree'
+
     def draw(self, context):
         layout = self.layout
         node_tree = context.scene.node_tree
@@ -865,11 +874,21 @@
     ob = context.object
     psys = context.particle_system
 
-    layout.label(
-        text="Material: %s" % ob.material_slots[psys.settings.material-1].name \
-            if psys.settings.material <= len(ob.material_slots) \
-            else "No material with this index. Using '{}'".format( \
-                ob.material_slots[len(ob.material_slots)-1].name))
+    mats = len(ob.material_slots)
+
+
+    if ob.material_slots:
+        if psys.settings.material <= len(ob.material_slots) \
+        and ob.material_slots[psys.settings.material-1].name == "":
+            layout.label(text="No material on this slot", icon="MATSPHERE")
+        else:
+            layout.label(
+                text="%s" % ob.material_slots[psys.settings.material-1].name \
+                    if psys.settings.material <= mats \
+                    else "No material with this index{}".format( \
+                        ". Using %s" % ob.material_slots[mats-1].name \
+                        if ob.material_slots[mats-1].name != "" else ""),
+                icon="MATERIAL_DATA")
 # // FEATURE: Particles Material indicator
 
 # FEATURE: Mesh Symmetry Tools by Sergey Sharybin
@@ -998,7 +1017,50 @@
         return {'FINISHED'}
 # // FEATURE: Mesh Symmetry Tools by Sergey Sharybin
 
+# FEATURE: Cycles Render Samples per Scene
+def render_cycles_scene_samples(self, context):
 
+    layout = self.layout
+
+    scenes = bpy.data.scenes
+    scene = context.scene
+    cscene = scene.cycles
+
+    if (len(bpy.data.scenes) > 1):
+        layout.separator()
+
+        layout.label(text="Samples Per Scene:")
+
+        if cscene.progressive == 'PATH':
+            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")
+        else:
+            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")
+# // FEATURE: Cycles Render Samples per Scene
+
 classes = (SCENE_OT_refresh,
            WM_OT_save_reload,
            MESH_OT_find_asymmetric,
@@ -1048,6 +1110,7 @@
     bpy.types.NODE_HT_header.append(node_stats)
 
     bpy.types.CyclesMaterial_PT_settings.append(material_cycles_settings_extra)
+    bpy.types.CyclesRender_PT_sampling.append(render_cycles_scene_samples)
 
     bpy.types.FILEBROWSER_HT_header.append(button_directory_current_blend)
 
@@ -1073,6 +1136,22 @@
         kmi.properties.value_1 = 'SOLID'
         kmi.properties.value_2 = 'RENDERED'
 
+        km = kc.keymaps.new(name='Graph Editor', space_type='GRAPH_EDITOR')
+        kmi = km.keymap_items.new('wm.context_set_enum', 'TAB', 'PRESS', ctrl=True)
+        kmi.properties.data_path = 'area.type'
+        kmi.properties.value = 'DOPESHEET_EDITOR'
+
+        km = kc.keymaps.new(name='Dopesheet', space_type='DOPESHEET_EDITOR')
+        kmi = km.keymap_items.new('wm.context_set_enum', 'TAB', 'PRESS', ctrl=True)
+        kmi.properties.data_path = 'area.type'
+        kmi.properties.value = 'GRAPH_EDITOR'
+
+        km = kc.keymaps.new(name='Dopesheet', space_type='DOPESHEET_EDITOR')
+        kmi = km.keymap_items.new('wm.context_toggle_enum', 'TAB', 'PRESS', shift=True)
+        kmi.properties.data_path = 'space_data.mode'
+        kmi.properties.value_1 = 'ACTION'
+        kmi.properties.value_2 = 'DOPESHEET'
+
         km = kc.keymaps.new(name='Node Editor', space_type='NODE_EDITOR')
         km.keymap_items.new("node.show_active_node_image", 'ACTIONMOUSE', 'RELEASE')
         km.keymap_items.new("node.show_active_node_image", 'SELECTMOUSE', 'RELEASE')
@@ -1112,6 +1191,7 @@
     bpy.types.NODE_HT_header.remove(node_stats)
 
     bpy.types.CyclesMaterial_PT_settings.remove(material_cycles_settings_extra)
+    bpy.types.CyclesRender_PT_sampling.remove(render_cycles_scene_samples)
 
     bpy.types.FILEBROWSER_HT_header.remove(button_directory_current_blend)
 



More information about the Bf-extensions-cvs mailing list