Revision: 18381
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18381
Author:   nicholasbishop
Date:     2009-01-06 21:15:23 +0100 (Tue, 06 Jan 2009)

Log Message:
-----------
Added RNA for Multires modifier.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_modifier.c

Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/RNA_access.h    
2009-01-06 19:59:17 UTC (rev 18380)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_access.h    
2009-01-06 20:15:23 UTC (rev 18381)
@@ -152,6 +152,7 @@
 extern StructRNA RNA_Modifier;
 extern StructRNA RNA_MouseSensor;
 extern StructRNA RNA_MovieSequence;
+extern StructRNA RNA_MultiresModifier;
 extern StructRNA RNA_NandController;
 extern StructRNA RNA_NearSensor;
 extern StructRNA RNA_Node;

Modified: 
branches/blender2.5/blender/source/blender/makesrna/intern/rna_modifier.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_modifier.c   
2009-01-06 19:59:17 UTC (rev 18380)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_modifier.c   
2009-01-06 20:15:23 UTC (rev 18381)
@@ -111,6 +111,8 @@
                        return &RNA_MaskModifier;
                case eModifierType_SimpleDeform:
                        return &RNA_SimpleDeformModifier;
+               case eModifierType_Multires:
+                       return &RNA_MultiresModifier;
                default:
                        return &RNA_Modifier;
        }
@@ -231,31 +233,37 @@
 
 #else
 
-static void rna_def_modifier_subsurf(BlenderRNA *brna)
+static void rna_def_property_subdivision_common(StructRNA *srna, const char 
type[], const char level[])
 {
-       StructRNA *srna;
-       PropertyRNA *prop;
-
        static EnumPropertyItem prop_subdivision_type_items[] = {
                {0, "CATMULL_CLARK", "Catmull-Clark", ""},
                {1, "SIMPLE", "Simple", ""},
                {0, NULL, NULL, NULL}};
 
-       srna= RNA_def_struct(brna, "SubsurfModifier", "Modifier");
-       RNA_def_struct_ui_text(srna, "Subsurf Modifier", "Subsurf Modifier.");
-       RNA_def_struct_sdna(srna, "SubsurfModifierData");
-
-       prop= RNA_def_property(srna, "subdivision_type", PROP_ENUM, PROP_NONE);
-       RNA_def_property_enum_sdna(prop, NULL, "subdivType");
+       PropertyRNA *prop= RNA_def_property(srna, "subdivision_type", 
PROP_ENUM, PROP_NONE);
+       RNA_def_property_enum_sdna(prop, NULL, type);
        RNA_def_property_enum_items(prop, prop_subdivision_type_items);
        RNA_def_property_ui_text(prop, "Subdivision Type", "Selects type of 
subdivision algorithm.");
 
        prop= RNA_def_property(srna, "levels", PROP_INT, PROP_NONE);
+       RNA_def_property_int_sdna(prop, NULL, level);
        RNA_def_property_range(prop, 1, 20);
        RNA_def_property_ui_range(prop, 1, 6, 1, 0);
        RNA_def_property_ui_text(prop, "Levels", "Number of subdivisions to 
perform.");
        RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, 
"rna_Modifier_update");
+}
 
+static void rna_def_modifier_subsurf(BlenderRNA *brna)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+
+       srna= RNA_def_struct(brna, "SubsurfModifier", "Modifier");
+       RNA_def_struct_ui_text(srna, "Subsurf Modifier", "Subsurf Modifier.");
+       RNA_def_struct_sdna(srna, "SubsurfModifierData");
+
+       rna_def_property_subdivision_common(srna, "subdivType", "levels");
+
        prop= RNA_def_property(srna, "render_levels", PROP_INT, PROP_NONE);
        RNA_def_property_int_sdna(prop, NULL, "renderLevels");
        RNA_def_property_range(prop, 1, 20);
@@ -273,6 +281,18 @@
        RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, 
"rna_Modifier_update");
 }
 
+static void rna_def_modifier_multires(BlenderRNA *brna)
+{
+       StructRNA *srna;
+       PropertyRNA *prop;
+
+       srna= RNA_def_struct(brna, "MultiresModifier", "Modifier");
+       RNA_def_struct_ui_text(srna, "Multires Modifier", "");
+       RNA_def_struct_sdna(srna, "MultiresModifierData");
+
+       rna_def_property_subdivision_common(srna, "simple", "lvl");
+}
+
 static void rna_def_modifier_lattice(BlenderRNA *brna)
 {
        StructRNA *srna;
@@ -1519,6 +1539,7 @@
                {eModifierType_Fluidsim, "FLUID_SIMULATION", "Fluid 
Simulation", ""},
                {eModifierType_Mask, "MASK", "Mask", ""},
                {eModifierType_SimpleDeform, "SIMPLE_DEFORM", "Simple Deform", 
""},
+               {eModifierType_SimpleDeform, "MULTIRES", "Multires", ""},
                {0, NULL, NULL, NULL}};
        
        /* data */
@@ -1593,6 +1614,7 @@
        rna_def_modifier_fluidsim(brna);
        rna_def_modifier_mask(brna);
        rna_def_modifier_simpledeform(brna);
+       rna_def_modifier_multires(brna);
 }
 
 #endif


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to