[Bf-extensions-cvs] [3d20026] master: Amaranth Addon, upgrade to 0.8.1 Changelog at http://pablovazquez.org/amaranth
Pablo Vazquez
noreply at git.blender.org
Thu Mar 6 02:55:05 CET 2014
Commit: 3d20026764c29df8e412c7b492ebfe017b8d4782
Author: Pablo Vazquez
Date: Wed Mar 5 22:53:25 2014 -0300
https://developer.blender.org/rBAC3d20026764c29df8e412c7b492ebfe017b8d4782
Amaranth Addon, upgrade to 0.8.1
Changelog at http://pablovazquez.org/amaranth
===================================================================
M scene_amaranth_toolset.py
===================================================================
diff --git a/scene_amaranth_toolset.py b/scene_amaranth_toolset.py
old mode 100644
new mode 100755
index d4f46e5..55c52c1
--- a/scene_amaranth_toolset.py
+++ b/scene_amaranth_toolset.py
@@ -19,9 +19,9 @@
bl_info = {
"name": "Amaranth Toolset",
"author": "Pablo Vazquez, Bassam Kurdali, Sergey Sharybin",
- "version": (0, 7, 3),
- "blender": (2, 69, 0),
- "location": "Scene Properties > Amaranth Toolset Panel",
+ "version": (0, 8, 1),
+ "blender": (2, 70),
+ "location": "Everywhere!",
"description": "A collection of tools and settings to improve productivity",
"warning": "",
"wiki_url": "http://pablovazquez.org/amaranth",
@@ -31,10 +31,11 @@ bl_info = {
import bpy
import bmesh
-from bpy.types import Operator, AddonPreferences, Panel
+from bpy.types import Operator, AddonPreferences, Panel, Menu
from bpy.props import BoolProperty
from mathutils import Vector
from bpy.app.handlers import persistent
+from bl_operators.presets import AddPresetBase
# Preferences
class AmaranthToolsetPreferences(AddonPreferences):
@@ -130,13 +131,13 @@ def init_properties():
node = bpy.types.Node
nodes_compo = bpy.types.CompositorNodeTree
- scene.use_unsimplify_render = bpy.props.BoolProperty(
+ scene.use_unsimplify_render = BoolProperty(
default=False,
name="Unsimplify Render",
description="Disable Simplify during render")
- scene.simplify_status = bpy.props.BoolProperty(default=False)
+ scene.simplify_status = BoolProperty(default=False)
- node.use_matching_indices = bpy.props.BoolProperty(
+ node.use_matching_indices = BoolProperty(
default=True,
description="If disabled, display all available indices")
@@ -152,8 +153,43 @@ def init_properties():
nodes_compo.types = bpy.props.EnumProperty(
items=test_items, name = "Types")
- nodes_compo.toggle_mute = bpy.props.BoolProperty(default=False)
- node.status = bpy.props.BoolProperty(default=False)
+ nodes_compo.toggle_mute = BoolProperty(default=False)
+ node.status = BoolProperty(default=False)
+
+ # 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),
+ ]
+
+ scene.amaranth_cycles_node_types = bpy.props.EnumProperty(
+ items=cycles_shader_node_types, name = "Shader")
+
+ scene.amaranth_debug_scene_list_lamps = BoolProperty(
+ default=False,
+ name="Lamps List",
+ description="Display a list of all the lamps")
+
+ scene.amaranth_debug_scene_list_missing_images = BoolProperty(
+ default=False,
+ name="List Missing Images",
+ description="Display a list of all the missing images")
+
+ global materials
def clear_properties():
@@ -164,7 +200,7 @@ def clear_properties():
"use_simplify_nodes_vector",
"status"
)
-
+
wm = bpy.context.window_manager
for p in props:
if p in wm:
@@ -175,16 +211,16 @@ class SCENE_OT_refresh(Operator):
"""Refresh the current scene"""
bl_idname = "scene.refresh"
bl_label = "Refresh!"
-
+
def execute(self, context):
preferences = context.user_preferences.addons[__name__].preferences
scene = context.scene
- if preferences.use_scene_refresh:
+ if preferences.use_scene_refresh:
# Changing the frame is usually the best way to go
scene.frame_current = scene.frame_current
self.report({"INFO"}, "Scene Refreshed!")
-
+
return {'FINISHED'}
def button_refresh(self, context):
@@ -258,7 +294,7 @@ def label_timeline_extra_info(self, context):
# 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
-
+
row.label(text="%s / %s" % (bpy.utils.smpte_from_frame(scene.frame_current - frame_start),
bpy.utils.smpte_from_frame(frame_end - frame_start)))
@@ -316,23 +352,19 @@ class FILE_PT_libraries(Panel):
libslist = sorted(libslist)
# Draw the box with libs
-
+
row = layout.row()
box = row.box()
-
+
if libslist:
for filepath in libslist:
if filepath != '//':
- split = box.split(percentage=0.85)
- col = split.column()
- sub = col.column(align=True)
- sub.label(text=filepath)
-
- col = split.column()
- sub = col.column(align=True)
- props = sub.operator(
+ row = box.row()
+ row.alignment = 'LEFT'
+ props = row.operator(
FILE_OT_directory_go_to.bl_idname,
- text="", icon="BOOKMARKS")
+ text=filepath, icon="BOOKMARKS",
+ emboss=False)
props.filepath = filepath
else:
box.label(text='No libraries loaded')
@@ -341,14 +373,14 @@ class 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):
bl_idname = "node.template_add_vignette"
@@ -416,7 +448,7 @@ class NODE_OT_AddTemplateVignette(Operator):
frame.label = 'Vignette'
frame.use_custom_color = True
frame.color = (0.783538, 0.0241576, 0.0802198)
-
+
overlay.parent = None
overlay.label = 'Vignette Overlay'
@@ -426,7 +458,7 @@ class NODE_OT_AddTemplateVignette(Operator):
return {'FINISHED'}
# Node Templates Menu
-class NODE_MT_amaranth_templates(bpy.types.Menu):
+class NODE_MT_amaranth_templates(Menu):
bl_idname = 'NODE_MT_amaranth_templates'
bl_space_type = 'NODE_EDITOR'
bl_label = "Templates"
@@ -465,7 +497,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(bpy.types.Panel):
+class NODE_PT_simplify(Panel):
'''Simplify Compositor Panel'''
bl_space_type = 'NODE_EDITOR'
bl_region_type = 'UI'
@@ -488,7 +520,7 @@ class NODE_PT_simplify(bpy.types.Panel):
layout.operator(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')
-
+
if node_tree.types == 'VECBLUR':
layout.label(text="This will also toggle the Vector pass {}".format(
"on" if node_tree.toggle_mute else "off"), icon="INFO")
@@ -503,10 +535,10 @@ class NODE_OT_toggle_mute(Operator):
node_tree = scene.node_tree
node_type = node_tree.types
rlayers = scene.render
-
+
if not 'amaranth_pass_vector' in scene.keys():
scene['amaranth_pass_vector'] = []
-
+
#can't extend() the list, so make a dummy one
pass_vector = scene['amaranth_pass_vector']
@@ -548,10 +580,10 @@ class NODE_OT_toggle_mute(Operator):
scene['amaranth_pass_vector'] = pass_vector
return {'FINISHED'}
-
+
# FEATURE: OB/MA ID panel in Node Editor
-class NODE_PT_indices(bpy.types.Panel):
+class NODE_PT_indices(Panel):
'''Object / Material Indices Panel'''
bl_space_type = 'NODE_EDITOR'
bl_region_type = 'UI'
@@ -585,10 +617,10 @@ class NODE_PT_indices(bpy.types.Panel):
for ma in materials:
if ma and ma.pass_index > 0:
show_ma_id = True
- row = layout.row(align=True)
+ row = layout.row(align=True)
row.prop(node, 'index', text="Mask Index")
row.prop(node, 'use_matching_indices', text="Only Matching IDs")
-
+
layout.separator()
if not show_ob_id and not show_ma_id:
@@ -702,7 +734,7 @@ def stats_scene(self, context):
cameras_selected = 0
meshlights = 0
meshlights_visible = 0
-
+
for ob in context.scene.objects:
if ob.material_slots:
for ma in ob.material_slots:
@@ -710,16 +742,18 @@ def stats_scene(self, context):
if ma.material.node_tree:
for no in ma.material.node_tree.nodes:
if no.type == 'EMISSION':
- meshlights = meshlights + 1
- if ob in context.visible_objects:
- meshlights_visible = meshlights_visible + 1
- break
+ for ou in no.outputs:
+ if ou.links:
+ meshlights = meshlights + 1
+ if ob in context.visible_objects:
+ meshlights_visible = meshlights_visible
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list