[Bf-extensions-cvs] [28efc5a] master: Amaranth 0.8.9 Update

Pablo Vazquez noreply at git.blender.org
Wed Apr 16 05:10:40 CEST 2014


Commit: 28efc5a63b1f8264c58065d5961e8bc294776dc7
Author: Pablo Vazquez
Date:   Wed Apr 16 00:10:20 2014 -0300
https://developer.blender.org/rBAC28efc5a63b1f8264c58065d5961e8bc294776dc7

Amaranth 0.8.9 Update

New:
- New Feature: Specify how many frames to jump on Shift+Up/Down.
  Find it on the Editing tab, User Preferences. Hit "Save Settings" will save
  the setting on your user preferences.

- Tweak/Fix: "Select Meshlights" and meshlights counter on info header was missing
  Emission nodes that were inside groups (not very likely to happen but still).
  Now take them into account. Also made it into a function to reuse.

Scene Debug:
- Tweak: Made "select lamp" operator more generic, now it selects any object
  passed as argument. Reason was to use it on Empty Material Slots
  list as well. Click on OB name to select.
- Display a more obvious remark when images listed have no users.

Fix: Blender new instance operator now will always open with real absolute paths,
  it could mess with texture/image paths sometimes if remapped+saved.

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

M	scene_amaranth_toolset.py

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

diff --git a/scene_amaranth_toolset.py b/scene_amaranth_toolset.py
index f251bdb..e324b9e 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, 8),
+    "version": (0, 8, 9),
     "blender": (2, 70),
     "location": "Everywhere!",
     "description": "A collection of tools and settings to improve productivity",
@@ -74,6 +74,12 @@ class AmaranthToolsetPreferences(AddonPreferences):
             default=True,
             )
 
+    frames_jump = IntProperty(
+                name="Frames",
+                description="Number of frames to jump forward/backward",
+                default=10,
+                min=1)
+
 
     def draw(self, context):
         layout = self.layout
@@ -205,7 +211,6 @@ def init_properties():
         description="Use current shader samples as final render samples",
         default=False,)
 
-
 def clear_properties():
     props = (
         "use_unsimplify_render",
@@ -255,6 +260,31 @@ def amaranth_text_startup(context):
     except AttributeError:
         return None
 
+# Is Emission Material? For select and stats
+def cycles_is_emission(context, ob):
+
+    is_emission = False
+
+    if ob.material_slots:
+        for ma in ob.material_slots:
+            if ma.material:
+                if ma.material.node_tree:
+                    for no in ma.material.node_tree.nodes:
+                        if no.type in {'EMISSION', 'GROUP'}:
+                            for ou in no.outputs:
+                                if ou.links:
+                                    if no.type == 'GROUP':
+                                        for gno in no.node_tree.nodes:
+                                            if gno.type == 'EMISSION':
+                                                for gou in gno.outputs:
+                                                    if ou.links and gou.links:
+                                                        is_emission = True
+
+                                    elif no.type == 'EMISSION':
+                                        if ou.links:
+                                            is_emission = True
+    return is_emission
+
 # FEATURE: Refresh Scene!
 class AMTH_SCENE_OT_refresh(Operator):
     """Refresh the current scene"""
@@ -390,7 +420,7 @@ class AMTH_FILE_PT_libraries(Panel):
         libslist = []
 
         # Build the list of folders from libraries
-        import os
+        import os.path
 
         for lib in libs:
             directory_name = os.path.dirname(lib.filepath)
@@ -783,20 +813,13 @@ 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:
-                    if ma.material:
-                        if ma.material.node_tree:
-                            for no in ma.material.node_tree.nodes:
-                                if no.type == 'EMISSION':
-                                    for ou in no.outputs:
-                                        if ou.links:
-                                            meshlights += 1
-                                            if ob in context.visible_objects:
-                                                meshlights_visible += 1
-                                            break
+            if cycles_is_emission(context, ob):
+                meshlights += 1
+                if ob in context.visible_objects:
+                    meshlights_visible += 1
+
             if ob in context.selected_objects:
                 if ob.type == 'CAMERA':
                     cameras_selected += 1
@@ -914,14 +937,9 @@ class AMTH_OBJECT_OT_select_meshlights(Operator):
         bpy.ops.object.select_all(action='DESELECT')
 
         for ob in context.scene.objects:
-            if ob.material_slots:
-                for ma in ob.material_slots:
-                    if ma.material:
-                        if ma.material.node_tree:
-                            for no in ma.material.node_tree.nodes:
-                                if no.type == 'EMISSION':
-                                    ob.select = True
-                                    context.scene.objects.active = ob
+            if cycles_is_emission(context, ob):
+                ob.select = True
+                context.scene.objects.active = ob
 
         if not context.selected_objects and not context.scene.objects.active:
             self.report({'INFO'}, "No meshlights to select")
@@ -1102,7 +1120,6 @@ def render_cycles_scene_samples(self, context):
     if (len(scene.render.layers) > 1) or \
         (len(bpy.data.scenes) > 1):
 
-        layout.separator()
         box = layout.box()
         row = box.row(align=True)
         col = row.column(align=True)
@@ -1395,19 +1412,19 @@ class AMTH_SCENE_OT_cycles_shader_list_nodes_clear(Operator):
         print("* Cleared Cycles Materials List")
         return {'FINISHED'}
 
-class AMTH_SCENE_OT_amaranth_debug_lamp_select(Operator):
-    '''Select Lamp'''
-    bl_idname = "scene.amaranth_debug_lamp_select"
-    bl_label = "Select Lamp"
-    lamp = bpy.props.StringProperty()
+class AMTH_SCENE_OT_amaranth_object_select(Operator):
+    '''Select object'''
+    bl_idname = "scene.amaranth_object_select"
+    bl_label = "Select Object"
+    object = bpy.props.StringProperty()
  
     def execute(self, context):
-        if self.lamp:
-            lamp = bpy.data.objects[self.lamp]
+        if self.object:
+            object = bpy.data.objects[self.object]
 
             bpy.ops.object.select_all(action='DESELECT')
-            lamp.select = True
-            context.scene.objects.active = lamp
+            object.select = True
+            context.scene.objects.active = object
 
         return{'FINISHED'}
 
@@ -1445,10 +1462,11 @@ class AMTH_SCENE_OT_list_missing_node_links(Operator):
                                         "[F] " if ob.use_fake_user else "",
                                         ob.name))
 
-                            missing_groups.append("NG: %s%s%s [%s]%s%s\n" % (
+                            missing_groups.append("MA: %s%s%s [%s]%s%s%s\n" % (
                                 "[L] " if ma.library else "",
                                 "[F] " if ma.use_fake_user else "",
                                 ma.name, ma.users,
+                                " *** No users *** " if ma.users == 0 else "",
                                 "\nLI: %s" % 
                                 ma.library.filepath if ma.library else "",
                                 "\nOB: %s" % ',  '.join(users_ngroup) if users_ngroup else ""))
@@ -1481,12 +1499,13 @@ class AMTH_SCENE_OT_list_missing_node_links(Operator):
                             if outputs_empty:
                                 self.__class__.count_image_node_unlinked += 1
 
-                                image_nodes_unlinked.append("%s%s%s%s%s [%s]%s%s%s%s\n" % (
+                                image_nodes_unlinked.append("%s%s%s%s%s [%s]%s%s%s%s%s\n" % (
                                     "NO: %s" % no.name,
                                     "\nMA: ",
                                     "[L] " if ma.library else "",
                                     "[F] " if ma.use_fake_user else "",
                                     ma.name, ma.users,
+                                    " *** No users *** " if ma.users == 0 else "",
                                     "\nLI: %s" % 
                                     ma.library.filepath if ma.library else "",
                                     "\nIM: %s" % no.image.name if no.image else "",
@@ -1497,10 +1516,11 @@ class AMTH_SCENE_OT_list_missing_node_links(Operator):
                             if not no.image or not image_path_exists:
                                 self.__class__.count_images += 1
 
-                                missing_images.append("MA: %s%s%s [%s]%s%s%s%s\n" % (
+                                missing_images.append("MA: %s%s%s [%s]%s%s%s%s%s\n" % (
                                     "[L] " if ma.library else "",
                                     "[F] " if ma.use_fake_user else "",
                                     ma.name, ma.users,
+                                    " *** No users *** " if ma.users == 0 else "",
                                     "\nLI: %s" % 
                                     ma.library.filepath if ma.library else "",
                                     "\nIM: %s" % no.image.name if no.image else "",
@@ -1526,20 +1546,20 @@ class AMTH_SCENE_OT_list_missing_node_links(Operator):
 
         # List Missing Node Groups
         if missing_groups:
-            print("\n* Missing Node Group Links [NG]\n")
+            print("\n* Missing Node Group Links\n")
             for mig in missing_groups:
                 print(mig)
 
         # List Missing Image Nodes
         if missing_images:
-            print("\n* Missing Image Nodes Link [IM]\n")
+            print("\n* Missing Image Nodes Link\n")
 
             for mii in missing_images:
                 print(mii)
 
         # List Image Nodes with its outputs unlinked
         if image_nodes_unlinked:
-            print("\n* Image Nodes Unlinked [IM]\n")
+            print("\n* Image Nodes Unlinked\n")
 
             for nou in image_nodes_unlinked:
                 print(nou)
@@ -1631,10 +1651,11 @@ class AMTH_SCENE_OT_blender_instance_open(Operator):
     bl_idname = "scene.blender_instance_open"
     bl_label = "Open Blender Instance"
     filepath = bpy.props.StringProperty()
- 
+
     def execute(self, context):
         if self.filepath:
-            filepath = bpy.path.abspath(self.filepath)
+            import os.path
+            filepath = os.path.normpath(bpy.path.abspath(self.filepath))
 
             import subprocess
             try:
@@ -1719,13 +1740,13 @@ class AMTH_SCENE_PT_scene_debug(Panel):
                         col = split.column()
                         row = col.row()
                         row.

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list