Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Reynish <william@reynish.com>2009-07-30 22:32:20 +0400
committerWilliam Reynish <william@reynish.com>2009-07-30 22:32:20 +0400
commita39192f243313c45de74d3208840d4fe29dc4e0d (patch)
tree083bee186546c4da9ac4de95a3aa81758ea9bda0
parent1c6cb51e654b03dea0d33f5c35ae50c1e93c6437 (diff)
Separated metaball size values, and hid inapplicable values depending on metaball type.
-rw-r--r--release/ui/buttons_data_metaball.py40
-rw-r--r--source/blender/makesdna/DNA_meta_types.h4
-rw-r--r--source/blender/makesrna/intern/rna_meta.c17
3 files changed, 52 insertions, 9 deletions
diff --git a/release/ui/buttons_data_metaball.py b/release/ui/buttons_data_metaball.py
index fa463d49c0d..74731473683 100644
--- a/release/ui/buttons_data_metaball.py
+++ b/release/ui/buttons_data_metaball.py
@@ -66,16 +66,46 @@ class DATA_PT_metaball_element(DataButtonsPanel):
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)
diff --git a/source/blender/makesdna/DNA_meta_types.h b/source/blender/makesdna/DNA_meta_types.h
index 2da4e9ab5a6..897368fd5df 100644
--- a/source/blender/makesdna/DNA_meta_types.h
+++ b/source/blender/makesdna/DNA_meta_types.h
@@ -48,7 +48,9 @@ typedef struct MetaElem {
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 */
diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c
index 257b10d8408..df26e6b8121 100644
--- a/source/blender/makesrna/intern/rna_meta.c
+++ b/source/blender/makesrna/intern/rna_meta.c
@@ -99,11 +99,22 @@ void rna_def_metaelement(BlenderRNA *brna)
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);