[Bf-extensions-cvs] [36076b0] master: Amaranth 0.8.8 upgrade - Cycles: Set as Render Samples - Object ID for objects in Dupli Groups - Nodes: XYZ sliders for Normal node (by Lukas Toenne) - several fixes and tweaks

Pablo Vazquez noreply at git.blender.org
Fri Apr 4 05:03:29 CEST 2014


Commit: 36076b04f5939010eaa34deca215675d43862308
Author: Pablo Vazquez
Date:   Fri Apr 4 00:00:52 2014 -0300
https://developer.blender.org/rBAC36076b04f5939010eaa34deca215675d43862308

Amaranth 0.8.8 upgrade
- Cycles: Set as Render Samples
- Object ID for objects in Dupli Groups
- Nodes: XYZ sliders for Normal node (by Lukas Toenne)
- several fixes and tweaks

Full changelog at: http://pablovazquez.org/amaranth/

===================================================================

M	scene_amaranth_toolset.py

===================================================================

diff --git a/scene_amaranth_toolset.py b/scene_amaranth_toolset.py
index 6c34a54..f251bdb 100755
--- a/scene_amaranth_toolset.py
+++ b/scene_amaranth_toolset.py
@@ -19,7 +19,7 @@
 bl_info = {
     "name": "Amaranth Toolset",
     "author": "Pablo Vazquez, Bassam Kurdali, Sergey Sharybin",
-    "version": (0, 8, 4),
+    "version": (0, 8, 8),
     "blender": (2, 70),
     "location": "Everywhere!",
     "description": "A collection of tools and settings to improve productivity",
@@ -32,7 +32,9 @@ bl_info = {
 import bpy
 import bmesh
 from bpy.types import Operator, AddonPreferences, Panel, Menu
-from bpy.props import BoolProperty
+from bpy.props import (BoolProperty, EnumProperty,
+                       FloatProperty, IntProperty,
+                       StringProperty)
 from mathutils import Vector
 from bpy.app.handlers import persistent
 from bl_operators.presets import AddPresetBase
@@ -141,7 +143,7 @@ def init_properties():
         default=True,
         description="If disabled, display all available indices")
 
-    test_items = [
+    nodes_compo_types = [
         ("ALL", "All Types", "", 0),
         ("BLUR", "Blur", "", 1),
         ("BOKEHBLUR", "Bokeh Blur", "", 2),
@@ -150,8 +152,8 @@ def init_properties():
         ("R_LAYERS", "Render Layer", "", 5)
         ]
 
-    nodes_compo.types = bpy.props.EnumProperty(
-        items=test_items, name = "Types")
+    nodes_compo.types = EnumProperty(
+        items=nodes_compo_types, name = "Types")
 
     nodes_compo.toggle_mute = BoolProperty(default=False)
     node.status = BoolProperty(default=False)
@@ -174,9 +176,11 @@ def init_properties():
         ("BACKGROUND", "Background", "", 12),
         ("AMBIENT_OCCLUSION", "Ambient Occlusion", "", 13),
         ("HOLDOUT", "Holdout", "", 14),
+        ("VOLUME_ABSORPTION", "Volume Absorption", "", 15),
+        ("VOLUME_SCATTER", "Volume Scatter", "", 16)
         ]
 
-    scene.amaranth_cycles_node_types = bpy.props.EnumProperty(
+    scene.amaranth_cycles_node_types = EnumProperty(
         items=cycles_shader_node_types, name = "Shader")
 
     scene.amaranth_debug_scene_list_lamps = BoolProperty(
@@ -189,6 +193,18 @@ def init_properties():
         name="List Missing Images",
         description="Display a list of all the missing images")
 
+    scene.amaranth_cycles_list_sampling = BoolProperty(
+        default=False,
+        name="Samples Per:")
+
+    bpy.types.ShaderNodeNormal.normal_vector = prop_normal_vector
+    bpy.types.CompositorNodeNormal.normal_vector = prop_normal_vector
+    
+    bpy.types.CyclesRenderSettings.use_samples_final = BoolProperty(
+        name="Use Final Render Samples",
+        description="Use current shader samples as final render samples",
+        default=False,)
+
 
 def clear_properties():
     props = (
@@ -196,7 +212,15 @@ def clear_properties():
         "simplify_status",
         "use_matching_indices",
         "use_simplify_nodes_vector",
-        "status"
+        "status",
+        "types",
+        "toggle_mute",
+        "amaranth_cycles_node_types",
+        "amaranth_debug_scene_list_lamps",
+        "amaranth_debug_scene_list_missing_images",
+        "amarath_cycles_list_sampling",
+        "normal_vector",
+        "use_samples_final"
     )
     
     wm = bpy.context.window_manager
@@ -204,8 +228,35 @@ def clear_properties():
         if p in wm:
             del wm[p]
 
+# Some settings are bound to be saved on a startup py file
+def amaranth_text_startup(context):
+
+    amth_text_name = "AmaranthStartup.py"
+    amth_text_exists = False
+
+    global amth_text
+
+    try:
+        for tx in bpy.data.texts:
+            if tx.name == amth_text_name:
+                amth_text_exists = True
+                amth_text = bpy.data.texts[amth_text_name]
+                break
+            else:
+                amth_text_exists = False
+                bpy.ops.text.new()
+                amth_text = bpy.data.texts[-1]
+                amth_text.name = amth_text_name
+                amth_text.write("# Amaranth Startup Script\nimport bpy\n\n")
+                amth_text.use_module = True
+                break
+
+        return amth_text_exists
+    except AttributeError:
+        return None
+
 # FEATURE: Refresh Scene!
-class SCENE_OT_refresh(Operator):
+class AMTH_SCENE_OT_refresh(Operator):
     """Refresh the current scene"""
     bl_idname = "scene.refresh"
     bl_label = "Refresh!"
@@ -228,7 +279,7 @@ def button_refresh(self, context):
     if preferences.use_scene_refresh:
         self.layout.separator()
         self.layout.operator(
-            SCENE_OT_refresh.bl_idname,
+            AMTH_SCENE_OT_refresh.bl_idname,
             text="Refresh!",
             icon='FILE_REFRESH')
 # // FEATURE: Refresh Scene!
@@ -243,7 +294,7 @@ def save_reload(self, context, path):
     else:
         bpy.ops.wm.save_as_mainfile("INVOKE_AREA")
 
-class WM_OT_save_reload(Operator):
+class AMTH_WM_OT_save_reload(Operator):
     """Save and Reload the current blend file"""
     bl_idname = "wm.save_reload"
     bl_label = "Save & Reload"
@@ -261,7 +312,7 @@ def button_save_reload(self, context):
     if preferences.use_file_save_reload:
         self.layout.separator()
         self.layout.operator(
-            WM_OT_save_reload.bl_idname,
+            AMTH_WM_OT_save_reload.bl_idname,
             text="Save & Reload",
             icon='FILE_REFRESH')
 # // FEATURE: Save & Reload
@@ -308,7 +359,7 @@ def label_timeline_extra_info(self, context):
 # // FEATURE: Timeline Time + Frames Left
 
 # FEATURE: Directory Current Blend
-class FILE_OT_directory_current_blend(Operator):
+class AMTH_FILE_OT_directory_current_blend(Operator):
     """Go to the directory of the currently open blend file"""
     bl_idname = "file.directory_current_blend"
     bl_label = "Current Blend's Folder"
@@ -321,13 +372,13 @@ def button_directory_current_blend(self, context):
 
     if bpy.data.filepath:
         self.layout.operator(
-            FILE_OT_directory_current_blend.bl_idname,
+            AMTH_FILE_OT_directory_current_blend.bl_idname,
             text="Current Blend's Folder",
             icon='APPEND_BLEND')
 # // FEATURE: Directory Current Blend
 
 # FEATURE: Libraries panel on file browser
-class FILE_PT_libraries(Panel):
+class AMTH_FILE_PT_libraries(Panel):
     bl_space_type = 'FILE_BROWSER'
     bl_region_type = 'CHANNELS'
     bl_label = "Libraries"
@@ -350,37 +401,37 @@ class FILE_PT_libraries(Panel):
         libslist = sorted(libslist)
 
         # Draw the box with libs
-        
+
         row = layout.row()
         box = row.box()
-       
+
         if libslist:
+            col = box.column()
             for filepath in libslist:
                 if filepath != '//':
-                    row = box.row()
+                    row = col.row()
                     row.alignment = 'LEFT'
                     props = row.operator(
-                        FILE_OT_directory_go_to.bl_idname,
+                        AMTH_FILE_OT_directory_go_to.bl_idname,
                         text=filepath, icon="BOOKMARKS",
                         emboss=False)
                     props.filepath = filepath
         else:
             box.label(text='No libraries loaded')
 
-class FILE_OT_directory_go_to(Operator):
+class AMTH_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):
+class AMTH_NODE_OT_AddTemplateVignette(Operator):
     bl_idname = "node.template_add_vignette"
     bl_label = "Add Vignette"
     bl_description = "Add a vignette effect"
@@ -456,8 +507,8 @@ class NODE_OT_AddTemplateVignette(Operator):
         return {'FINISHED'}
 
 # Node Templates Menu
-class NODE_MT_amaranth_templates(Menu):
-    bl_idname = 'NODE_MT_amaranth_templates'
+class AMTH_NODE_MT_amaranth_templates(Menu):
+    bl_idname = 'AMTH_NODE_MT_amaranth_templates'
     bl_space_type = 'NODE_EDITOR'
     bl_label = "Templates"
     bl_description = "List of Amaranth Templates"
@@ -465,7 +516,7 @@ class NODE_MT_amaranth_templates(Menu):
     def draw(self, context):
         layout = self.layout
         layout.operator(
-            NODE_OT_AddTemplateVignette.bl_idname,
+            AMTH_NODE_OT_AddTemplateVignette.bl_idname,
             text="Vignette",
             icon='COLOR')
 
@@ -475,7 +526,7 @@ 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",
+        row.menu("AMTH_NODE_MT_amaranth_templates",
             icon="RADIO")
 # // FEATURE: Node Templates
 
@@ -495,7 +546,7 @@ def node_stats(self,context):
             row.label(text="Nodes: %s/%s" % (nodes_selected, str(nodes_total)))
 
 # FEATURE: Simplify Compo Nodes
-class NODE_PT_simplify(Panel):
+class AMTH_NODE_PT_simplify(Panel):
     '''Simplify Compositor Panel'''
     bl_space_type = 'NODE_EDITOR'
     bl_region_type = 'UI'
@@ -515,7 +566,7 @@ class NODE_PT_simplify(Panel):
 
         if node_tree is not None:
             layout.prop(node_tree, 'types')
-            layout.operator(NODE_OT_toggle_mute.bl_idname,
+            layout.operator(AMTH_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')
         
@@ -523,7 +574,7 @@ class NODE_PT_simplify(Panel):
                 layout.label(text="This will also toggle the Vector pass {}".format(
                                     "on" if node_tree.toggle_mute else "off"), icon="INFO")
 
-class NODE_OT_toggle_mute(Operator):
+class AMTH_NODE_OT_toggle_mute(Operator):
     """"""
     bl_idname = "node.toggle_mute"
     bl_label = "Toggle Mute"
@@ -581,7 +632,7 @@ class NODE_OT_toggle_mute(Operator):
         
 
 # FEATURE: OB/MA ID panel in Node Editor
-class NODE_

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list