Revision: 22063
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22063
Author:   billrey
Date:     2009-07-30 20:32:20 +0200 (Thu, 30 Jul 2009)

Log Message:
-----------
Separated metaball size values, and hid inapplicable values depending on 
metaball type.

Modified Paths:
--------------
    branches/blender2.5/blender/release/ui/buttons_data_metaball.py
    branches/blender2.5/blender/source/blender/makesdna/DNA_meta_types.h
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_meta.c

Modified: branches/blender2.5/blender/release/ui/buttons_data_metaball.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_metaball.py     
2009-07-30 18:19:46 UTC (rev 22062)
+++ branches/blender2.5/blender/release/ui/buttons_data_metaball.py     
2009-07-30 18:32:20 UTC (rev 22063)
@@ -66,16 +66,46 @@
                split.itemR(metaelem, "type", text="")
                
                split = layout.split()
-               
+                       
                col = split.column()
-               col.itemL(text="Size:") 
-               col.itemR(metaelem, "size", text="")
-               
-               col = split.column()
                col.itemL(text="Settings:")
                col.itemR(metaelem, "stiffness", text="Stiffness")
                col.itemR(metaelem, "negative", text="Negative")
                col.itemR(metaelem, "hide", text="Hide")
+               
+               if metaelem.type == 'BALL':
+               
+                       col = split.column(align=True)
+                       
+               elif metaelem.type == 'CUBE':
+               
+                       col = split.column(align=True)
+                       col.itemL(text="Size:") 
+                       col.itemR(metaelem, "sizex", text="X")
+                       col.itemR(metaelem, "sizey", text="Y")
+                       col.itemR(metaelem, "sizez", text="Z")
+                       
+               elif metaelem.type == 'TUBE':
+               
+                       col = split.column(align=True)
+                       col.itemL(text="Size:") 
+                       col.itemR(metaelem, "sizex", text="X")
+                       
+               elif metaelem.type == 'PLANE':
+                       
+                       col = split.column(align=True)
+                       col.itemL(text="Size:") 
+                       col.itemR(metaelem, "sizex", text="X")
+                       col.itemR(metaelem, "sizey", text="Y")
+                       
+               elif metaelem.type == 'ELLIPSOID':
+                       
+                       col = split.column(align=True)
+                       col.itemL(text="Size:") 
+                       col.itemR(metaelem, "sizex", text="X")
+                       col.itemR(metaelem, "sizey", text="Y")
+                       col.itemR(metaelem, "sizez", text="Z")
+               
 
 bpy.types.register(DATA_PT_context_metaball)
 bpy.types.register(DATA_PT_metaball)

Modified: branches/blender2.5/blender/source/blender/makesdna/DNA_meta_types.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesdna/DNA_meta_types.h        
2009-07-30 18:19:46 UTC (rev 22062)
+++ branches/blender2.5/blender/source/blender/makesdna/DNA_meta_types.h        
2009-07-30 18:32:20 UTC (rev 22063)
@@ -48,7 +48,9 @@
        short type, flag, selcol1, selcol2;
        float x, y, z;          /* Position of center of MetaElem */
        float quat[4];          /* Rotation of MetaElem */
-       float expx, expy, expz; /* dimension parameters, used for some types 
like cubes */
+       float expx; /* dimension parameters, used for some types like cubes */
+       float expy;
+       float expz;
        float rad;              /* radius of the meta element */
        float rad2;             /* temp field, used only while processing */
        float s;                /* stiffness, how much of the element to fill */

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_meta.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_meta.c       
2009-07-30 18:19:46 UTC (rev 22062)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_meta.c       
2009-07-30 18:32:20 UTC (rev 22063)
@@ -99,12 +99,23 @@
        RNA_def_property_ui_text(prop, "Radius", "");
        RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
 
-       prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
+       prop= RNA_def_property(srna, "sizex", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "expx");
        RNA_def_property_range(prop, 0.0f, 20.0f);
-       RNA_def_property_array(prop, 3);
-       RNA_def_property_ui_text(prop, "Size", "Size of element, use of 
components depends on element type.");
+       RNA_def_property_ui_text(prop, "Size X", "Size of element, use of 
components depends on element type.");
        RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
+
+       prop= RNA_def_property(srna, "sizey", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "expy");
+       RNA_def_property_range(prop, 0.0f, 20.0f);
+       RNA_def_property_ui_text(prop, "Size Y", "Size of element, use of 
components depends on element type.");
+       RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
+
+       prop= RNA_def_property(srna, "sizez", PROP_FLOAT, PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "expz");
+       RNA_def_property_range(prop, 0.0f, 20.0f);
+       RNA_def_property_ui_text(prop, "Size Z", "Size of element, use of 
components depends on element type.");
+       RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
        
        prop= RNA_def_property(srna, "stiffness", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "s");


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

Reply via email to