Revision: 18250
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18250
Author:   nicholasbishop
Date:     2009-01-02 08:29:35 +0100 (Fri, 02 Jan 2009)

Log Message:
-----------
Added RNA for the UVProject modifier.

Had a couple problems with this one; the uv layer and the projectors. The 
projectors in particular is confusing; I figured this would be one of the cases 
handled by RNA automagically, but maybe I need to define custom functions for 
it? Anyway, marked the code with XXX.

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

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-02 06:03:53 UTC (rev 18249)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_modifier.c   
2009-01-02 07:29:35 UTC (rev 18250)
@@ -684,10 +684,40 @@
 static void rna_def_modifier_uvproject(BlenderRNA *brna)
 {
        StructRNA *srna;
+       PropertyRNA *prop;
 
        srna= RNA_def_struct(brna, "UVProjectModifier", "Modifier");
        RNA_def_struct_ui_text(srna, "UVProject Modifier", "UVProject 
Modifier.");
        RNA_def_struct_sdna(srna, "UVProjectModifierData");
+
+       /* XXX: not sure how to handle uvlayer_tmp */
+
+       /* XXX: and how to do UVProjectModifier.projectors, a statically-sized 
array of Object pointers?
+               (this code crashes when it's expanded in the RNA viewer...) */
+       /*prop= RNA_def_property(srna, "projectors", PROP_COLLECTION, 
PROP_NONE);
+       RNA_def_property_collection_sdna(prop, NULL, "projectors", 
"num_projectors");
+       RNA_def_property_struct_type(prop, "Object");
+       RNA_def_property_ui_text(prop, "Projectors", "");*/
+
+       prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
+       RNA_def_property_struct_type(prop, "Image");
+       RNA_def_property_ui_text(prop, "Image", "");
+
+       prop= RNA_def_property(srna, "horizontal_aspect_ratio", PROP_FLOAT, 
PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "aspectx");
+       RNA_def_property_range(prop, 1, FLT_MAX);
+       RNA_def_property_ui_range(prop, 1, 1000, 100, 2);
+       RNA_def_property_ui_text(prop, "Horizontal Aspect Ratio", "");
+
+       prop= RNA_def_property(srna, "vertical_aspect_ratio", PROP_FLOAT, 
PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "aspecty");
+       RNA_def_property_range(prop, 1, FLT_MAX);
+       RNA_def_property_ui_range(prop, 1, 1000, 100, 2);
+       RNA_def_property_ui_text(prop, "Vertical Aspect Ratio", "");
+
+       prop= RNA_def_property(srna, "override_image", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "flags", 
MOD_UVPROJECT_OVERRIDEIMAGE);
+       RNA_def_property_ui_text(prop, "Override Image", "Override faces' 
current images with the given image.");
 }
 
 static void rna_def_modifier_smooth(BlenderRNA *brna)


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to