[Bf-extensions-cvs] [76c3ec6] master: Upgrade to Amaranth 0.9.4

Pablo Vazquez noreply at git.blender.org
Thu May 15 23:25:41 CEST 2014


Commit: 76c3ec6af52744d6ac19a254d0fafdc0034ec8e5
Author: Pablo Vazquez
Date:   Thu May 15 23:24:27 2014 +0200
https://developer.blender.org/rBAC76c3ec6af52744d6ac19a254d0fafdc0034ec8e5

Upgrade to Amaranth 0.9.4

- Feature: Add Meshlight. Lets you add a light emitting mesh on Cycles.
  Options: Once added, the Last Operator (F6) menu will let you change:
    - Single Sided: Only light on one side.
    - Visibility on Camera
    - Size, Strength, and Temperature (Kelvin)
    Shift+A > Mesh > Meshlight

- Feature: Toggle Wire on all or selected meshes (even inside dupli groups!)
  Display panel on the 'N' sidebar.
  Options: Optimal (subsurf), Show All Edges, Go Through All Scenes.

- Feature: Compositing Nodes Template: Add Vector Blur, just adds+connects a vblur filter.
  Available on 'W' and header menu when a RenderLayer is selected (todo: work with multilayer EXRs as well)

- Feature: Jump in Between Keyframes.
  Shift+Ctrl+UP/DOWN jumps to the frame between two keyframes.
  (e.g.: If you have a keyframe in #1 and #10, it will jump to #5)

- Tweak: Making an image show on image editor by clicking an image node is now double click (was just LMB)
- User Preference for "Save Current Layers for Render"
- Fix: Deleting unused materials was failing when object wasn't on a visible layer (unlikely but can happen!)
- Cosmetic tweaks on compositing vignette template (dark frame, hide unused sockets)
- Check if Cycles is available. Makes Amaranth run on Blender builds without Cycles (some debug, VRay, etc)

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

M	scene_amaranth_toolset.py

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

diff --git a/scene_amaranth_toolset.py b/scene_amaranth_toolset.py
index c18c573..431e18f 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, Lukas Tönne",
-    "version": (0, 9, 0),
+    "version": (0, 9, 4),
     "blender": (2, 70),
     "location": "Everywhere!",
     "description": "A collection of tools and settings to improve productivity",
@@ -33,12 +33,16 @@ import bpy
 import bmesh
 from bpy.types import Operator, AddonPreferences, Panel, Menu
 from bpy.props import (BoolProperty, EnumProperty,
-                       FloatProperty, IntProperty,
-                       StringProperty)
+                       FloatProperty, FloatVectorProperty,
+                       IntProperty, StringProperty)
 from mathutils import Vector
 from bpy.app.handlers import persistent
 from bl_operators.presets import AddPresetBase
 
+# Addon wide, we need to know if cycles is available
+global cycles_exists
+cycles_exists = 'cycles' in dir(bpy.types.Scene)
+
 # Preferences
 class AmaranthToolsetPreferences(AddonPreferences):
     bl_idname = __name__
@@ -80,6 +84,12 @@ class AmaranthToolsetPreferences(AddonPreferences):
                 default=10,
                 min=1)
 
+    use_layers_for_render = BoolProperty(
+            name="Current Layers for Render",
+            description="Save the layers that should be enabled for render",
+            default=True,
+            )
+
 
     def draw(self, context):
         layout = self.layout
@@ -102,6 +112,7 @@ class AmaranthToolsetPreferences(AddonPreferences):
         sub.prop(self, "use_file_save_reload")
         sub.prop(self, "use_timeline_extra_info")
         sub.prop(self, "use_scene_stats")
+        sub.prop(self, "use_layers_for_render")
 
         sub.separator()
 
@@ -166,28 +177,38 @@ def init_properties():
 
     # Scene Debug
     # Cycles Node Types
-    cycles_shader_node_types = [
-        ("BSDF_DIFFUSE", "Diffuse BSDF", "", 0),
-        ("BSDF_GLOSSY", "Glossy BSDF", "", 1),
-        ("BSDF_TRANSPARENT", "Transparent BSDF", "", 2),
-        ("BSDF_REFRACTION", "Refraction BSDF", "", 3),
-        ("BSDF_GLASS", "Glass BSDF", "", 4),
-        ("BSDF_TRANSLUCENT", "Translucent BSDF", "", 5),
-        ("BSDF_ANISOTROPIC", "Anisotropic BSDF", "", 6),
-        ("BSDF_VELVET", "Velvet BSDF", "", 7),
-        ("BSDF_TOON", "Toon BSDF", "", 8),
-        ("SUBSURFACE_SCATTERING", "Subsurface Scattering", "", 9),
-        ("EMISSION", "Emission", "", 10),
-        ("BSDF_HAIR", "Hair BSDF", "", 11),
-        ("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 = EnumProperty(
-        items=cycles_shader_node_types, name = "Shader")
+    if cycles_exists:
+        cycles_shader_node_types = [
+            ("BSDF_DIFFUSE", "Diffuse BSDF", "", 0),
+            ("BSDF_GLOSSY", "Glossy BSDF", "", 1),
+            ("BSDF_TRANSPARENT", "Transparent BSDF", "", 2),
+            ("BSDF_REFRACTION", "Refraction BSDF", "", 3),
+            ("BSDF_GLASS", "Glass BSDF", "", 4),
+            ("BSDF_TRANSLUCENT", "Translucent BSDF", "", 5),
+            ("BSDF_ANISOTROPIC", "Anisotropic BSDF", "", 6),
+            ("BSDF_VELVET", "Velvet BSDF", "", 7),
+            ("BSDF_TOON", "Toon BSDF", "", 8),
+            ("SUBSURFACE_SCATTERING", "Subsurface Scattering", "", 9),
+            ("EMISSION", "Emission", "", 10),
+            ("BSDF_HAIR", "Hair BSDF", "", 11),
+            ("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 = EnumProperty(
+            items=cycles_shader_node_types, name = "Shader")
+
+        scene.amaranth_cycles_list_sampling = BoolProperty(
+            default=False,
+            name="Samples Per:")
+
+        bpy.types.CyclesRenderSettings.use_samples_final = BoolProperty(
+            name="Use Final Render Samples",
+            description="Use current shader samples as final render samples",
+            default=False)
 
     scene.amaranth_lighterscorner_list_meshlights = BoolProperty(
         default=False,
@@ -199,17 +220,28 @@ 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)
+
+    bpy.types.Object.is_keyframe = is_keyframe
+
+    scene.amth_wire_toggle_scene_all = BoolProperty(
+        default=False,
+        name="All Scenes",
+        description="Toggle wire on objects in all scenes")
+    scene.amth_wire_toggle_is_selected = BoolProperty(
+        default=False,
+        name="Only Selected",
+        description="Only toggle wire on selected objects")
+    scene.amth_wire_toggle_edges_all = BoolProperty(
+        default=True,
+        name="All Edges",
+        description="Draw all edges")
+    scene.amth_wire_toggle_optimal = BoolProperty(
+        default=False,
+        name="Optimal Display",
+        description="Skip drawing/rendering of interior subdivided edges "
+                    "on meshes with Subdivision Surface modifier")
 
 def clear_properties():
     props = (
@@ -225,7 +257,11 @@ def clear_properties():
         "amaranth_debug_scene_list_missing_images",
         "amarath_cycles_list_sampling",
         "normal_vector",
-        "use_samples_final"
+        "use_samples_final",
+        'amth_wire_toggle_is_selected',
+        'amth_wire_toggle_scene_all',
+        "amth_wire_toggle_edges_all",
+        "amth_wire_toggle_optimal"
     )
     
     wm = bpy.context.window_manager
@@ -262,7 +298,7 @@ def amaranth_text_startup(context):
     except AttributeError:
         return None
 
-# Is Emission Material? For select and stats
+# FUNCTION: Check if material has Emission (for select and stats)
 def cycles_is_emission(context, ob):
 
     is_emission = False
@@ -287,6 +323,14 @@ def cycles_is_emission(context, ob):
                                             is_emission = True
     return is_emission
 
+# FUNCTION: Check if object has keyframes for a specific frame
+def is_keyframe(ob, frame):
+    if ob is not None and ob.animation_data is not None and ob.animation_data.action is not None:
+        for fcu in ob.animation_data.action.fcurves:
+            if frame in (p.co.x for p in fcu.keyframe_points):
+                return True
+    return False
+
 # FEATURE: Refresh Scene!
 class AMTH_SCENE_OT_refresh(Operator):
     """Refresh the current scene"""
@@ -372,6 +416,9 @@ def label_timeline_extra_info(self, context):
     if preferences.use_timeline_extra_info:
         row = layout.row(align=True)
 
+        row.operator(AMTH_SCREEN_OT_keyframe_jump_inbetween.bl_idname, icon="PREV_KEYFRAME", text="").backwards = True
+        row.operator(AMTH_SCREEN_OT_keyframe_jump_inbetween.bl_idname, icon="NEXT_KEYFRAME", text="").backwards = False
+
         # Check for preview range
         frame_start = scene.frame_preview_start if scene.use_preview_range else scene.frame_start
         frame_end = scene.frame_preview_end if scene.use_preview_range else scene.frame_end
@@ -481,6 +528,7 @@ class AMTH_NODE_OT_AddTemplateVignette(Operator):
         scene = context.scene
         space = context.space_data
         tree = scene.node_tree
+        has_act = True if tree.nodes.active else False
 
         bpy.ops.node.select_all(action='DESELECT')
 
@@ -503,21 +551,27 @@ class AMTH_NODE_OT_AddTemplateVignette(Operator):
         tree.links.new(ellipse.outputs["Mask"],blur.inputs["Image"])
         tree.links.new(blur.outputs["Image"],ramp.inputs[0])
         tree.links.new(ramp.outputs["Image"],overlay.inputs[2])
+        if has_act:
+            tree.links.new(tree.nodes.active.outputs[0],overlay.inputs[1])
 
-        if tree.nodes.active:
-            blur.location = tree.nodes.active.location
-            blur.location += Vector((330.0, -250.0))
+        if has_act:
+            overlay.location = tree.nodes.active.location
+            overlay.location += Vector((350.0, 0.0))
         else:
-            blur.location += Vector((space.cursor_location[0], space.cursor_location[1]))
+            overlay.location += Vector((space.cursor_location[0], space.cursor_location[1]))
+
+        ellipse.location = overlay.location
+        ellipse.location += Vector((-715.0, -400))
+        ellipse.inputs[0].hide = True
+        ellipse.inputs[1].hide = True
 
-        ellipse.location = blur.location
-        ellipse.location += Vector((-300.0, 0))
+        blur.location = ellipse.location
+        blur.location += Vector((300.0, 0.0))
+        blur.inputs['Size'].hide = True
 
         ramp.location = blur.location
         ramp.location += Vector((175.0, 0))
-
-        overlay.location = ramp.location
-        overlay.location += Vector((240.0, 275.0))
+        ramp.outputs['Alpha'].hide = True
 
         for node in {ellipse, blur, ramp, overlay}:
             node.select = True
@@ -528,7 +582,7 @@ class AMTH_NODE_OT_AddTemplateVignette(Operator):
         frame = ellipse.parent
         frame.label = 'Vignette'
         frame.use_custom_color = True
-        frame.color = (0.783538, 0.0241576, 0.0802198)
+        frame.color = (0.1, 0.1, 0.1)
         
         overlay.parent = None
         overlay.label = 'Vignette Overlay'
@@ -538,6 +592,57 @@ clas

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list