Separated metaball size values, and hid inapplicable values depending on metaball type.
This commit is contained in:
parent
1c6cb51e65
commit
a39192f243
@ -66,16 +66,46 @@ class DATA_PT_metaball_element(DataButtonsPanel):
|
|||||||
split.itemR(metaelem, "type", text="")
|
split.itemR(metaelem, "type", text="")
|
||||||
|
|
||||||
split = layout.split()
|
split = layout.split()
|
||||||
|
|
||||||
col = split.column()
|
|
||||||
col.itemL(text="Size:")
|
|
||||||
col.itemR(metaelem, "size", text="")
|
|
||||||
|
|
||||||
col = split.column()
|
col = split.column()
|
||||||
col.itemL(text="Settings:")
|
col.itemL(text="Settings:")
|
||||||
col.itemR(metaelem, "stiffness", text="Stiffness")
|
col.itemR(metaelem, "stiffness", text="Stiffness")
|
||||||
col.itemR(metaelem, "negative", text="Negative")
|
col.itemR(metaelem, "negative", text="Negative")
|
||||||
col.itemR(metaelem, "hide", text="Hide")
|
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_context_metaball)
|
||||||
bpy.types.register(DATA_PT_metaball)
|
bpy.types.register(DATA_PT_metaball)
|
||||||
|
@ -48,7 +48,9 @@ typedef struct MetaElem {
|
|||||||
short type, flag, selcol1, selcol2;
|
short type, flag, selcol1, selcol2;
|
||||||
float x, y, z; /* Position of center of MetaElem */
|
float x, y, z; /* Position of center of MetaElem */
|
||||||
float quat[4]; /* Rotation 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 rad; /* radius of the meta element */
|
||||||
float rad2; /* temp field, used only while processing */
|
float rad2; /* temp field, used only while processing */
|
||||||
float s; /* stiffness, how much of the element to fill */
|
float s; /* stiffness, how much of the element to fill */
|
||||||
|
@ -99,11 +99,22 @@ void rna_def_metaelement(BlenderRNA *brna)
|
|||||||
RNA_def_property_ui_text(prop, "Radius", "");
|
RNA_def_property_ui_text(prop, "Radius", "");
|
||||||
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
|
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_float_sdna(prop, NULL, "expx");
|
||||||
RNA_def_property_range(prop, 0.0f, 20.0f);
|
RNA_def_property_range(prop, 0.0f, 20.0f);
|
||||||
RNA_def_property_array(prop, 3);
|
RNA_def_property_ui_text(prop, "Size X", "Size of element, use of components depends on element type.");
|
||||||
RNA_def_property_ui_text(prop, "Size", "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");
|
RNA_def_property_update(prop, 0, "rna_MetaBall_update_data");
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "stiffness", PROP_FLOAT, PROP_NONE);
|
prop= RNA_def_property(srna, "stiffness", PROP_FLOAT, PROP_NONE);
|
||||||
|
Loading…
Reference in New Issue
Block a user