[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29725] branches/soc-2008-mxcurioni: More on the new GUI for the Parameter Editor mode.

Tamito Kajiyama rd6t-kjym at asahi-net.or.jp
Sun Jun 27 02:03:34 CEST 2010


Revision: 29725
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29725
Author:   kjym3
Date:     2010-06-27 02:03:34 +0200 (Sun, 27 Jun 2010)

Log Message:
-----------
More on the new GUI for the Parameter Editor mode.  This is a WIP commit.

* Moved render layer-specific Freestyle options to a separate "Freestyle"
tab (in addition to the "Freestyle: Line Style" tab that has been introduced
in the previous commit).

* Added UI controls for specifying feature edge selection criteria in the
Parameter Editor mode.  Feature edge selection starts with a set of all
feature edges in the view map.  Each line set specifies edge selection
criteria (e.g., to select only visible crease edges) by enabling appropriate
UI controls (e.g., by turning on the "Crease" and "Visibility" toggle
buttons).  Selected criteria are combined by logical conjunction.  Logical
disjunction (e.g., "crease edges or contours") is represented by two or
more line sets.

* Slightly rearranged several UI controls in the Python Scripting mode.

Modified Paths:
--------------
    branches/soc-2008-mxcurioni/release/scripts/ui/properties_render.py
    branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/linestyle.c
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
    branches/soc-2008-mxcurioni/source/blender/makesdna/DNA_freestyle_types.h
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_scene.c

Modified: branches/soc-2008-mxcurioni/release/scripts/ui/properties_render.py
===================================================================
--- branches/soc-2008-mxcurioni/release/scripts/ui/properties_render.py	2010-06-26 22:32:47 UTC (rev 29724)
+++ branches/soc-2008-mxcurioni/release/scripts/ui/properties_render.py	2010-06-27 00:03:34 UTC (rev 29725)
@@ -69,27 +69,6 @@
         layout.prop(rd, "display_mode", text="Display")
 
 
-class RENDER_PT_freestyle_linestyle(RenderButtonsPanel):
-    bl_label = "Freestyle Line Style"
-    COMPAT_ENGINES = {'BLENDER_RENDER'}
-
-    def poll(self, context):
-        rd = context.scene.render
-        rl = rd.layers[rd.active_layer_index]
-        return rl and rl.freestyle and rl.freestyle_settings.active_lineset
-
-    def draw(self, context):
-        layout = self.layout
-
-        rd = context.scene.render
-        rl = rd.layers[rd.active_layer_index]
-        linestyle = rl.freestyle_settings.active_lineset.linestyle
-
-        split = layout.split()
-        col = split.column()
-        col.prop(linestyle, "name")
-
-
 class RENDER_PT_layers(RenderButtonsPanel):
     bl_label = "Layers"
     bl_default_closed = True
@@ -195,65 +174,128 @@
         row.prop(rl, "pass_refraction")
         row.prop(rl, "pass_refraction_exclude", text="")
 
-        if rl.freestyle:
-            layout.separator()
 
-            split = layout.split()
+class RENDER_PT_freestyle(RenderButtonsPanel):
+    bl_label = "Freestyle"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
-            col = split.column()
-            col.label(text="Freestyle:")
-            freestyle = rl.freestyle_settings
-            col.prop(freestyle, "mode", text="Control Mode")
-            if freestyle.mode == "EDITOR":
+    def poll(self, context):
+        rd = context.scene.render
+        rl = rd.layers[rd.active_layer_index]
+        return rl and rl.freestyle
 
-                lineset = freestyle.active_lineset
+    def draw(self, context):
+        layout = self.layout
 
-                col.label(text="Line Sets:")
+        rd = context.scene.render
+        rl = rd.layers[rd.active_layer_index]
+        freestyle = rl.freestyle_settings
 
-                row = col.row()
-                rows = 2
-                if lineset:
-                    rows = 5
-                # FIXME: scrollbar does not work correctly
-                row.template_list(freestyle, "linesets", freestyle, "active_lineset_index", rows=rows)
+        split = layout.split()
 
-                sub = row.column()
+        col = split.column()
+        col.prop(freestyle, "mode", text="Control Mode")
 
+        if freestyle.mode == "EDITOR":
+
+            lineset = freestyle.active_lineset
+
+            col.label(text="Line Sets:")
+            row = col.row()
+            rows = 2
+            if lineset:
+                rows = 5
+            # FIXME: scrollbar does not work correctly
+            row.template_list(freestyle, "linesets", freestyle, "active_lineset_index", rows=rows)
+
+            sub = row.column()
+            subsub = sub.column(align=True)
+            subsub.operator("scene.freestyle_lineset_add", icon='ZOOMIN', text="")
+            subsub.operator("scene.freestyle_lineset_remove", icon='ZOOMOUT', text="")
+            if lineset:
+                sub.separator()
                 subsub = sub.column(align=True)
-                subsub.operator("scene.freestyle_lineset_add", icon='ZOOMIN', text="")
-                subsub.operator("scene.freestyle_lineset_remove", icon='ZOOMOUT', text="")
+                subsub.operator("scene.freestyle_lineset_move", icon='TRIA_UP', text="").direction = 'UP'
+                subsub.operator("scene.freestyle_lineset_move", icon='TRIA_DOWN', text="").direction = 'DOWN'
 
-                if lineset:
-                    sub.separator()
+            if lineset:
+                col.prop(lineset, "name")
 
-                    subsub = sub.column(align=True)
-                    subsub.operator("scene.freestyle_lineset_move", icon='TRIA_UP', text="").direction = 'UP'
-                    subsub.operator("scene.freestyle_lineset_move", icon='TRIA_DOWN', text="").direction = 'DOWN'
+                row = col.row()
+                sub = row.column()
+                sub.prop(lineset, "select_silhouette")
+                sub.prop(lineset, "select_border")
+                sub.prop(lineset, "select_crease")
+                sub.prop(lineset, "select_ridge")
+                sub.prop(lineset, "select_valley")
+                sub.prop(lineset, "select_suggestive_contour")
+                sub.prop(lineset, "select_material_boundary")
+                sub = row.column()
+                sub.prop(lineset, "select_contour")
+                sub.prop(lineset, "select_external_contour")
+                sub.prop(lineset, "select_visibility")
+                col.prop(lineset, "crease_angle")
+                col.prop(lineset, "sphere_radius")
+                if lineset.select_suggestive_contour:
+                    col.label(text="Suggestive Contours:")
+                    col.prop(lineset, "dkr_epsilon")
+                if lineset.select_visibility:
+                    col.label(text="Visibility:")
+                    sub = col.row(align=True)
+                    sub.prop(lineset, "visibility", expand=True)
+                    if lineset.visibility == "RANGE":
+                        sub = col.row(align=True)
+                        sub.prop(lineset, "qi_start")
+                        sub.prop(lineset, "qi_end")
 
-                    col.prop(lineset, "name")
-                    col.template_ID(lineset, "linestyle", new="scene.freestyle_linestyle_new")
+        else: # freestyle.mode == "SCRIPT"
 
-            else:
-                col.prop(freestyle, "crease_angle", text="Crease Angle")
-                col.prop(freestyle, "sphere_radius", text="Sphere Radius")
-                col.prop(freestyle, "ridges_and_valleys", text="Ridges and Valleys")
-                col.prop(freestyle, "suggestive_contours", text="Suggestive Contours")
-                col.prop(freestyle, "material_boundaries", text="Material Boundaries")
-                col.prop(freestyle, "dkr_epsilon", text="Dkr Epsilon")
+            col.prop(freestyle, "crease_angle")
+            col.prop(freestyle, "sphere_radius")
+            col.prop(freestyle, "ridges_and_valleys")
+            col.prop(freestyle, "suggestive_contours")
+            sub = col.row()
+            sub.prop(freestyle, "dkr_epsilon")
+            sub.active = freestyle.suggestive_contours
+            col.prop(freestyle, "material_boundaries")
+            col.operator("scene.freestyle_module_add")
 
-                col.operator("scene.freestyle_module_add", text="Add Style Module")
+            for i, module in enumerate(freestyle.modules):
+                    box = layout.box()
+                    box.set_context_pointer("freestyle_module", module)
+                    row = box.row(align=True)
+                    row.prop(module, "is_displayed", text="")
+                    row.prop(module, "module_path", text="")
+                    row.operator("scene.freestyle_module_remove", icon='X', text="")
+                    row.operator("scene.freestyle_module_move", icon='TRIA_UP', text="").direction = 'UP'
+                    row.operator("scene.freestyle_module_move", icon='TRIA_DOWN', text="").direction = 'DOWN'
 
-                for i, module in enumerate(freestyle.modules):
-                        box = layout.box()
-                        box.set_context_pointer("freestyle_module", module)
-                        row = box.row(align=True)
-                        row.prop(module, "is_displayed", text="")
-                        row.prop(module, "module_path", text="")
-                        row.operator("scene.freestyle_module_remove", icon='X', text="")
-                        row.operator("scene.freestyle_module_move", icon='TRIA_UP', text="").direction = 'UP'
-                        row.operator("scene.freestyle_module_move", icon='TRIA_DOWN', text="").direction = 'DOWN'
 
+class RENDER_PT_freestyle_linestyle(RenderButtonsPanel):
+    bl_label = "Freestyle: Line Style"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
+    def poll(self, context):
+        rd = context.scene.render
+        rl = rd.layers[rd.active_layer_index]
+        if rl and rl.freestyle:
+            freestyle = rl.freestyle_settings
+            return freestyle.mode == "EDITOR" and freestyle.active_lineset
+        return False
+
+    def draw(self, context):
+        layout = self.layout
+
+        rd = context.scene.render
+        rl = rd.layers[rd.active_layer_index]
+        lineset = rl.freestyle_settings.active_lineset
+        linestyle = lineset.linestyle
+
+        split = layout.split()
+        col = split.column()
+        col.template_ID(lineset, "linestyle", new="scene.freestyle_linestyle_new")
+
+
 class RENDER_PT_shading(RenderButtonsPanel):
     bl_label = "Shading"
     COMPAT_ENGINES = {'BLENDER_RENDER'}
@@ -757,6 +799,7 @@
     RENDER_MT_ffmpeg_presets,
     RENDER_PT_render,
     RENDER_PT_layers,
+    RENDER_PT_freestyle,
     RENDER_PT_freestyle_linestyle,
     RENDER_PT_dimensions,
     RENDER_PT_antialiasing,

Modified: branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/linestyle.c
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/linestyle.c	2010-06-26 22:32:47 UTC (rev 29724)
+++ branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/linestyle.c	2010-06-27 00:03:34 UTC (rev 29725)
@@ -38,6 +38,11 @@
 #include "BKE_linestyle.h"
 #include "BKE_main.h"
 
+static void default_linestyle_settings(FreestyleLineStyle *linestyle)
+{
+
+}
+
 FreestyleLineStyle *FRS_new_linestyle(char *name, struct Main *main)
 {
 	FreestyleLineStyle *linestyle;
@@ -47,7 +52,7 @@
 
 	linestyle = (FreestyleLineStyle *)alloc_libblock(&main->linestyle, ID_LS, name);
 	
-	/* todo: default parameter settings */
+	default_linestyle_settings(linestyle);
 
 	return linestyle;
 }

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp	2010-06-26 22:32:47 UTC (rev 29724)

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list