[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31635] branches/soc-2008-mxcurioni: RNA fix/addition: Made scene render freestyle_settings.linesets consistent

Tamito Kajiyama rd6t-kjym at asahi-net.or.jp
Sat Aug 28 17:10:37 CEST 2010


Revision: 31635
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31635
Author:   kjym3
Date:     2010-08-28 17:10:37 +0200 (Sat, 28 Aug 2010)

Log Message:
-----------
RNA fix/addition: Made scene render freestyle_settings.linesets consistent
with recent changes in the trunk revision 31570 for adding scene render
layers' active and active_index properties.

Revision Links:
--------------
    http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31570

Modified Paths:
--------------
    branches/soc-2008-mxcurioni/release/scripts/ui/properties_render.py
    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-08-28 15:06:05 UTC (rev 31634)
+++ branches/soc-2008-mxcurioni/release/scripts/ui/properties_render.py	2010-08-28 15:10:37 UTC (rev 31635)
@@ -198,14 +198,14 @@
             col.prop(freestyle, "sphere_radius")
             col.prop(freestyle, "kr_derivative_epsilon")
 
-            lineset = freestyle.active_lineset
+            lineset = freestyle.linesets.active
 
             col.label(text="Line Sets:")
             row = col.row()
             rows = 2
             if lineset:
                 rows = 5
-            row.template_list(freestyle, "linesets", freestyle, "active_lineset_index", rows=rows)
+            row.template_list(freestyle, "linesets", freestyle.linesets, "active_index", rows=rows)
 
             sub = row.column()
             subsub = sub.column(align=True)
@@ -284,7 +284,7 @@
         rl = rd.layers.active
         if rl and rl.use_freestyle:
             freestyle = rl.freestyle_settings
-            return freestyle.mode == "EDITOR" and freestyle.active_lineset
+            return freestyle.mode == "EDITOR" and freestyle.linesets.active
         return False
 
     def draw_modifier_box_header(self, box, modifier):
@@ -377,7 +377,7 @@
 
         rd = context.scene.render
         rl = rd.layers.active
-        lineset = rl.freestyle_settings.active_lineset
+        lineset = rl.freestyle_settings.linesets.active
         linestyle = lineset.linestyle
 
         split = layout.split()

Modified: branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_scene.c	2010-08-28 15:06:05 UTC (rev 31634)
+++ branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_scene.c	2010-08-28 15:10:37 UTC (rev 31635)
@@ -1581,6 +1581,28 @@
 	else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 }
 
+static void rna_def_freestyle_linesets(BlenderRNA *brna, PropertyRNA *cprop)
+{
+	StructRNA *srna;
+	PropertyRNA *prop;
+
+	RNA_def_property_srna(cprop, "Linesets");
+	srna= RNA_def_struct(brna, "Linesets", NULL);
+	RNA_def_struct_sdna(srna, "RenderData");
+	RNA_def_struct_ui_text(srna, "Line Sets", "Line sets for associating lines and style parameters");
+
+	prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
+	RNA_def_property_struct_type(prop, "FreestyleLineSet");
+	RNA_def_property_pointer_funcs(prop, "rna_FreestyleSettings_active_lineset_get", NULL, NULL, NULL);
+	RNA_def_property_ui_text(prop, "Active Line Set", "Active line set being displayed");
+	RNA_def_property_update(prop, NC_SCENE, NULL);
+
+	prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
+	RNA_def_property_int_funcs(prop, "rna_FreestyleSettings_active_lineset_index_get", "rna_FreestyleSettings_active_lineset_index_set", "rna_FreestyleSettings_active_lineset_index_range");
+	RNA_def_property_ui_text(prop, "Active Line Set Index", "Index of active line set slot");
+	RNA_def_property_update(prop, NC_SCENE, NULL);
+}
+
 static void rna_def_freestyle_settings(BlenderRNA *brna)
 {
 	StructRNA *srna;
@@ -1792,18 +1814,8 @@
 	prop= RNA_def_property(srna, "linesets", PROP_COLLECTION, PROP_NONE);
 	RNA_def_property_collection_sdna(prop, NULL, "linesets", NULL);
 	RNA_def_property_struct_type(prop, "FreestyleLineSet");
-	RNA_def_property_ui_text(prop, "Line Sets", "Line sets for associating lines and style parameters");
-
-	prop= RNA_def_property(srna, "active_lineset", PROP_POINTER, PROP_NONE);
-	RNA_def_property_struct_type(prop, "FreestyleLineSet");
-	RNA_def_property_pointer_funcs(prop, "rna_FreestyleSettings_active_lineset_get", NULL, NULL, NULL);
-	RNA_def_property_ui_text(prop, "Active Line Set", "Active line set being displayed");
-	RNA_def_property_update(prop, NC_SCENE, NULL);
-
-	prop= RNA_def_property(srna, "active_lineset_index", PROP_INT, PROP_UNSIGNED);
-	RNA_def_property_int_funcs(prop, "rna_FreestyleSettings_active_lineset_index_get", "rna_FreestyleSettings_active_lineset_index_set", "rna_FreestyleSettings_active_lineset_index_range");
-	RNA_def_property_ui_text(prop, "Active Line Set Index", "Index of active line set slot");
-	RNA_def_property_update(prop, NC_SCENE, NULL);
+	RNA_def_property_ui_text(prop, "Line Sets", "");
+	rna_def_freestyle_linesets(brna, prop);
 }
 
 static void rna_def_scene_game_data(BlenderRNA *brna)





More information about the Bf-blender-cvs mailing list