Color Management, Stage 2: Switch color pipeline to use OpenColorIO
[blender.git] / release / scripts / startup / bl_ui / properties_scene.py
index 6e28c8b42f13dbd458214cbe44a7a06dcc3a95b4..2ccdb9cee268883a753116874eeb4aac7f77ba78 100644 (file)
@@ -29,19 +29,22 @@ class SceneButtonsPanel():
 
     @classmethod
     def poll(cls, context):
-        return context.scene
+        rd = context.scene.render
+        return context.scene and (rd.engine in cls.COMPAT_ENGINES)
 
 
 class SCENE_PT_scene(SceneButtonsPanel, Panel):
     bl_label = "Scene"
-    COMPAT_ENGINES = {'BLENDER_RENDER'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
     def draw(self, context):
         layout = self.layout
+
         scene = context.scene
 
         layout.prop(scene, "camera")
         layout.prop(scene, "background_set", text="Background")
+        layout.prop(scene, "active_clip", text="Active Clip")
 
 
 class SCENE_PT_audio(SceneButtonsPanel, Panel):
@@ -50,8 +53,10 @@ class SCENE_PT_audio(SceneButtonsPanel, Panel):
 
     def draw(self, context):
         layout = self.layout
+
         scene = context.scene
         rd = context.scene.render
+        ffmpeg = rd.ffmpeg
 
         layout.prop(scene, "audio_volume")
         layout.operator("sound.bake_animation")
@@ -66,18 +71,19 @@ class SCENE_PT_audio(SceneButtonsPanel, Panel):
 
         col = split.column()
         col.label("Format:")
-        col.prop(rd, "ffmpeg_audio_channels", text="")
-        col.prop(rd, "ffmpeg_audio_mixrate", text="Rate")
+        col.prop(ffmpeg, "audio_channels", text="")
+        col.prop(ffmpeg, "audio_mixrate", text="Rate")
 
         layout.operator("sound.mixdown")
 
 
 class SCENE_PT_unit(SceneButtonsPanel, Panel):
     bl_label = "Units"
-    COMPAT_ENGINES = {'BLENDER_RENDER'}
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
     def draw(self, context):
         layout = self.layout
+
         unit = context.scene.unit_settings
 
         col = layout.column()
@@ -92,6 +98,7 @@ class SCENE_PT_unit(SceneButtonsPanel, Panel):
 
 class SCENE_PT_keying_sets(SceneButtonsPanel, Panel):
     bl_label = "Keying Sets"
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
     def draw(self, context):
         layout = self.layout
@@ -111,19 +118,21 @@ class SCENE_PT_keying_sets(SceneButtonsPanel, Panel):
             row = layout.row()
 
             col = row.column()
-            col.prop(ks, "name")
+            col.prop(ks, "bl_label")
+            col.prop(ks, "bl_description")
 
             subcol = col.column()
             subcol.operator_context = 'INVOKE_DEFAULT'
             subcol.operator("anim.keying_set_export", text="Export to File").filepath = "keyingset.py"
 
-            col = row.column()
+            col = row.column(align=True)
             col.label(text="Keyframing Settings:")
             col.prop(ks, "bl_options")
 
 
 class SCENE_PT_keying_set_paths(SceneButtonsPanel, Panel):
     bl_label = "Active Keying Set"
+    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
 
     @classmethod
     def poll(cls, context):
@@ -155,20 +164,25 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel, Panel):
             col.template_any_ID(ksp, "id", "id_type")
             col.template_path_builder(ksp, "data_path", ksp.id)
 
-            row = layout.row()
+            row = col.row(align=True)
+            row.label(text="Array Target:")
+            row.prop(ksp, "use_entire_array", text="All Items")
+            if ksp.use_entire_array:
+                row.label(text=" ")  # padding
+            else:
+                row.prop(ksp, "array_index", text="Index")
 
-            col = row.column()
-            col.label(text="Array Target:")
-            col.prop(ksp, "use_entire_array")
-            if ksp.use_entire_array is False:
-                col.prop(ksp, "array_index")
+            layout.separator()
 
+            row = layout.row()
             col = row.column()
             col.label(text="F-Curve Grouping:")
-            col.prop(ksp, "group_method")
+            col.prop(ksp, "group_method", text="")
             if ksp.group_method == 'NAMED':
                 col.prop(ksp, "group")
 
+            col = row.column(align=True)
+            col.label(text="Keyframing Settings:")
             col.prop(ksp, "bl_options")
 
 
@@ -194,14 +208,13 @@ class SCENE_PT_simplify(SceneButtonsPanel, Panel):
     COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw_header(self, context):
-        scene = context.scene
-        rd = scene.render
+        rd = context.scene.render
         self.layout.prop(rd, "use_simplify", text="")
 
     def draw(self, context):
         layout = self.layout
-        scene = context.scene
-        rd = scene.render
+
+        rd = context.scene.render
 
         layout.active = rd.use_simplify
 
@@ -218,14 +231,30 @@ class SCENE_PT_simplify(SceneButtonsPanel, Panel):
         col.prop(rd, "simplify_ao_sss", text="AO and SSS")
 
 
-class SCENE_PT_movie_clip(SceneButtonsPanel, Panel):
-    bl_label = "Movie Clip"
+class SCENE_PT_color_management(Panel):
+    bl_label = "Color Management"
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "scene"
 
     def draw(self, context):
         layout = self.layout
+
         scene = context.scene
 
-        layout.prop(scene, "active_clip", text="Active Clip")
+        col = layout.column()
+        col.label(text="Display:")
+        col.prop(scene.display_settings, "display_device")
+
+        col = layout.column()
+        col.separator()
+        col.label(text="Render:")
+        col.template_colormanaged_view_settings(scene, "view_settings")
+
+        col = layout.column()
+        col.separator()
+        col.label(text="Sequencer:")
+        col.prop(scene.sequencer_colorspace_settings, "name")
 
 
 class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, Panel):