Amaranth: Update to 2.8
authorPablo Vazquez <venomgfx@gmail.com>
Sat, 14 Jul 2018 02:00:07 +0000 (04:00 +0200)
committerPablo Vazquez <venomgfx@gmail.com>
Sat, 14 Jul 2018 02:00:07 +0000 (04:00 +0200)
* 'Remember Layers' does not longer apply for 2.8 and it wasn't that used anyway.
If a 'Remember Collections' is needed it can be implemented once the API is stable.
* Move stats and SMPTE Timecode to status bar
* Bump to 1.0.6

amaranth/__init__.py
amaranth/animation/timeline_extra_info.py
amaranth/misc/toggle_wire.py
amaranth/prefs.py
amaranth/render/remember_layers.py [deleted file]
amaranth/scene/stats.py

index 8a579f2..e951c0b 100644 (file)
@@ -66,7 +66,6 @@ from amaranth.render import (
     unsimplify,
     final_resolution,
     samples_scene,
-    remember_layers,
     render_output_z,
     )
 
@@ -90,12 +89,12 @@ from amaranth.misc import (
 bl_info = {
     "name": "Amaranth Toolset",
     "author": "Pablo Vazquez, Bassam Kurdali, Sergey Sharybin, Lukas Tönne, Cesar Saez",
-    "version": (1, 0, 5),
-    "blender": (2, 74),
+    "version": (1, 0, 6),
+    "blender": (2, 80, 0),
     "location": "Everywhere!",
     "description": "A collection of tools and settings to improve productivity",
     "warning": "",
-    "wiki_url": "http://pablovazquez.org/amaranth",
+    "wiki_url": "https://pablovazquez.art/amaranth",
     "tracker_url": "https://developer.blender.org/maniphest/task/edit/form/2/",
     "category": "Scene",
 }
index 7e494ee..8419345 100644 (file)
@@ -60,8 +60,8 @@ def label_timeline_extra_info(self, context):
 
 
 def register():
-    bpy.types.TIME_HT_header.append(label_timeline_extra_info)
+    bpy.types.STATUSBAR_HT_header.append(label_timeline_extra_info)
 
 
 def unregister():
-    bpy.types.TIME_HT_header.remove(label_timeline_extra_info)
+    bpy.types.STATUSBAR_HT_header.remove(label_timeline_extra_info)
index 9102f3b..d815ad3 100644 (file)
@@ -125,10 +125,10 @@ def clear_properties():
 def register():
     init_properties()
     bpy.utils.register_class(AMTH_OBJECT_OT_wire_toggle)
-    bpy.types.VIEW3D_PT_view3d_display.append(ui_object_wire_toggle)
+    bpy.types.VIEW3D_PT_view3d_properties.append(ui_object_wire_toggle)
 
 
 def unregister():
     bpy.utils.unregister_class(AMTH_OBJECT_OT_wire_toggle)
-    bpy.types.VIEW3D_PT_view3d_display.remove(ui_object_wire_toggle)
+    bpy.types.VIEW3D_PT_view3d_properties.remove(ui_object_wire_toggle)
     clear_properties()
index 59281f4..00d2935 100644 (file)
@@ -33,7 +33,7 @@ class AmaranthToolsetPreferences(bpy.types.AddonPreferences):
     )
     use_scene_refresh = BoolProperty(
         name="Refresh Scene",
-        description="Specials Menu [W], or hit F5",
+        description="Specials Menu [W]",
         default=True,
     )
     use_timeline_extra_info = BoolProperty(
@@ -48,7 +48,7 @@ class AmaranthToolsetPreferences(bpy.types.AddonPreferences):
     )
     use_scene_stats = BoolProperty(
         name="Extra Scene Statistics",
-        description="Display extra scene statistics in Info header (may be slow in heavy scenes)",
+        description="Display extra scene statistics in the status bar (may be slow in heavy scenes)",
         default=False,
     )
     frames_jump = IntProperty(
diff --git a/amaranth/render/remember_layers.py b/amaranth/render/remember_layers.py
deleted file mode 100644 (file)
index a9fcbb6..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-"""
-Remember Layers for Render
-If you're doing lighting/rendering tasks, you'll probably have a bunch of
-layers that you want/need to be enabled for final renders.
-
-When tweaking lighting, or if somebody else has to open the file to check
-something, you/they are likely to tweak the layers visibility and forget
-which ones were needed for the render to look good.
-
-In the Render Layers properties, you'll now find a "Save Current Layers for
-Render" button, this will save the currently visible scene layers as those
-that should be enabled for render. You can adjust this further by clicking
-on the slots on the right.
-
-Now all you need to do before saving your file for rendering is press the
-"View Layers for Render". Find it on the Render Layers properties.
-"""
-
-import bpy
-from bpy.types import Operator
-from bpy.props import (
-        BoolProperty,
-        IntProperty,
-        )
-
-
-# FEATURE: Set Layers to Render
-class AMTH_SCENE_OT_layers_render_save(Operator):
-    """Save the current scene layers as those that should be enabled for final renders"""
-    bl_idname = "scene.amaranth_layers_render_save"
-    bl_label = "Save as Layers for Render"
-
-    def execute(self, context):
-        which = []
-        n = -1
-
-        for l in context.scene.layers:
-            n += 1
-            if l:
-                which.append(n)
-
-        context.scene["amth_layers_for_render"] = which
-        self.report({"INFO"}, "Layers for Render Saved")
-
-        return {"FINISHED"}
-
-
-class AMTH_SCENE_OT_layers_render_view(Operator):
-    """Enable the scene layers that should be active for final renders"""
-    bl_idname = "scene.amaranth_layers_render_view"
-    bl_label = "View Layers for Render"
-
-    def execute(self, context):
-        scene = context.scene
-        layers_render = scene["amth_layers_for_render"]
-
-        for window in bpy.context.window_manager.windows:
-            screen = window.screen
-
-            for area in screen.areas:
-                if area.type == "VIEW_3D":
-                    override = {
-                        "window": window,
-                        "screen": screen,
-                        "scene": scene,
-                        "area": area,
-                        "region": area.regions[4],
-                        "blend_data": context.blend_data}
-
-                    if layers_render:
-                        bpy.ops.view3d.layers(
-                            override,
-                            nr=layers_render[0] + 1,
-                            extend=False,
-                            toggle=False)
-
-                        for n in layers_render:
-                            context.scene.layers[n] = True
-                    else:
-                        bpy.ops.view3d.layers(
-                            override,
-                            nr=1,
-                            extend=False,
-                            toggle=False)
-                        self.report({"INFO"}, "No layers set for render")
-
-                    break
-
-        return {"FINISHED"}
-
-
-class AMTH_SCENE_OT_layers_render_set_individual(Operator):
-    """Whether this layer should be enabled or not for final renders"""
-    bl_idname = "scene.amaranth_layers_render_set_individual"
-    bl_label = "Set This Layer for Render"
-
-    toggle = BoolProperty()
-    number = IntProperty()
-
-    def execute(self, context):
-        number = self.number
-
-        new_layers = []
-
-        for la in context.scene["amth_layers_for_render"]:
-            new_layers.append(la)
-
-        if len(context.scene["amth_layers_for_render"]) and number in new_layers:
-            new_layers.remove(number)
-        else:
-            new_layers.append(number)
-
-        # Remove Duplicates
-        new_layers = list(set(new_layers))
-        context.scene["amth_layers_for_render"] = new_layers
-
-        bpy.ops.scene.amaranth_layers_render_view()
-
-        return {"FINISHED"}
-
-
-class AMTH_SCENE_OT_layers_render_clear(Operator):
-    """Clear layers for render"""
-    bl_idname = "scene.amaranth_layers_render_clear"
-    bl_label = "Clear Layers for Render"
-
-    def execute(self, context):
-
-        if context.scene.get("amth_layers_for_render"):
-            context.scene["amth_layers_for_render"] = []
-
-        return {"FINISHED"}
-
-
-def ui_layers_for_render(self, context):
-    get_addon = "amaranth" in context.user_preferences.addons.keys()
-    if not get_addon:
-        return
-
-    if context.user_preferences.addons["amaranth"].preferences.use_layers_for_render:
-        lfr_available = context.scene.get("amth_layers_for_render")
-        if lfr_available:
-            lfr = context.scene["amth_layers_for_render"]
-
-        layout = self.layout
-        layout.label("Layers for Rendering:")
-        split = layout.split()
-        col = split.column(align=True)
-        row = col.row(align=True)
-        row.operator(
-            AMTH_SCENE_OT_layers_render_save.bl_idname,
-            text="Replace Layers" if lfr_available else "Save Current Layers for Render",
-            icon="FILE_REFRESH" if lfr_available else "LAYER_USED")
-
-        if lfr_available:
-            row.operator(
-                AMTH_SCENE_OT_layers_render_clear.bl_idname,
-                icon="X", text="")
-            col = col.column(align=True)
-            col.enabled = True if lfr_available else False
-            col.operator(
-                AMTH_SCENE_OT_layers_render_view.bl_idname,
-                icon="RESTRICT_VIEW_OFF")
-
-            split = split.split()
-            col = split.column(align=True)
-            row = col.row(align=True)
-
-            for n in range(0, 5):
-                row.operator(
-                    AMTH_SCENE_OT_layers_render_set_individual.bl_idname,
-                    text="",
-                    icon="LAYER_ACTIVE" if n in lfr else "BLANK1").number = n
-            row = col.row(align=True)
-            for n in range(10, 15):
-                row.operator(
-                    AMTH_SCENE_OT_layers_render_set_individual.bl_idname,
-                    text="",
-                    icon="LAYER_ACTIVE" if n in lfr else "BLANK1").number = n
-
-            split = split.split()
-            col = split.column(align=True)
-            row = col.row(align=True)
-
-            for n in range(5, 10):
-                row.operator(
-                    AMTH_SCENE_OT_layers_render_set_individual.bl_idname,
-                    text="",
-                    icon="LAYER_ACTIVE" if n in lfr else "BLANK1").number = n
-            row = col.row(align=True)
-            for n in range(15, 20):
-                row.operator(
-                    AMTH_SCENE_OT_layers_render_set_individual.bl_idname,
-                    text="",
-                    icon="LAYER_ACTIVE" if n in lfr else "BLANK1").number = n
-
-
-def ui_layers_for_render_header(self, context):
-    get_addon = "amaranth" in context.user_preferences.addons.keys()
-    if not get_addon:
-        return
-
-    if context.user_preferences.addons["amaranth"].preferences.use_layers_for_render:
-        if context.scene.get("amth_layers_for_render"):
-            self.layout.operator(
-                AMTH_SCENE_OT_layers_render_view.bl_idname,
-                text="", icon="IMGDISPLAY")
-
-# // FEATURE: Set Layers to Render
-
-
-def register():
-    bpy.utils.register_class(AMTH_SCENE_OT_layers_render_clear)
-    bpy.utils.register_class(AMTH_SCENE_OT_layers_render_save)
-    bpy.utils.register_class(AMTH_SCENE_OT_layers_render_set_individual)
-    bpy.utils.register_class(AMTH_SCENE_OT_layers_render_view)
-    bpy.types.VIEW3D_HT_header.append(ui_layers_for_render_header)
-    bpy.types.RENDERLAYER_PT_layers.append(ui_layers_for_render)
-
-
-def unregister():
-    bpy.utils.unregister_class(AMTH_SCENE_OT_layers_render_clear)
-    bpy.utils.unregister_class(AMTH_SCENE_OT_layers_render_save)
-    bpy.utils.unregister_class(AMTH_SCENE_OT_layers_render_set_individual)
-    bpy.utils.unregister_class(AMTH_SCENE_OT_layers_render_view)
-    bpy.types.VIEW3D_HT_header.remove(ui_layers_for_render_header)
-    bpy.types.RENDERLAYER_PT_layers.remove(ui_layers_for_render)
index b073492..602cc23 100644 (file)
@@ -55,8 +55,8 @@ def stats_scene(self, context):
 
 
 def register():
-    bpy.types.INFO_HT_header.append(stats_scene)
+    bpy.types.STATUSBAR_HT_header.append(stats_scene)
 
 
 def unregister():
-    bpy.types.INFO_HT_header.remove(stats_scene)
+    bpy.types.STATUSBAR_HT_header.remove(stats_scene)