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:
Diffstat (limited to 'source/blender/makesrna/intern/rna_modifier.c')
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c84
1 files changed, 73 insertions, 11 deletions
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index f2683e39c54..aee2b048f6b 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -344,10 +344,43 @@ static void rna_MultiresModifier_level_range(PointerRNA *ptr, int *min, int *max
{
MultiresModifierData *mmd = (MultiresModifierData*)ptr->data;
- *min = 1;
+ *min = 0;
*max = mmd->totlvl;
}
+static int rna_MultiresModifier_external_get(PointerRNA *ptr)
+{
+ Object *ob= (Object*)ptr->id.data;
+ Mesh *me= ob->data;
+
+ return CustomData_external_test(&me->fdata, CD_MDISPS);
+}
+
+static void rna_MultiresModifier_filename_get(PointerRNA *ptr, char *value)
+{
+ Object *ob= (Object*)ptr->id.data;
+ CustomDataExternal *external= ((Mesh*)ob->data)->fdata.external;
+
+ BLI_strncpy(value, (external)? external->filename: "", sizeof(external->filename));
+}
+
+static void rna_MultiresModifier_filename_set(PointerRNA *ptr, const char *value)
+{
+ Object *ob= (Object*)ptr->id.data;
+ CustomDataExternal *external= ((Mesh*)ob->data)->fdata.external;
+
+ if(external)
+ BLI_strncpy(external->filename, value, sizeof(external->filename));
+}
+
+static int rna_MultiresModifier_filename_length(PointerRNA *ptr)
+{
+ Object *ob= (Object*)ptr->id.data;
+ CustomDataExternal *external= ((Mesh*)ob->data)->fdata.external;
+
+ return strlen((external)? external->filename: "");
+}
+
static void modifier_object_set(Object *self, Object **ob_p, int type, PointerRNA value)
{
Object *ob= value.data;
@@ -496,22 +529,20 @@ static void rna_def_modifier_subsurf(BlenderRNA *brna)
rna_def_property_subdivision_common(srna, "subdivType");
- prop= RNA_def_property(srna, "levels", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "levels", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "levels");
- RNA_def_property_range(prop, 1, 6);
- RNA_def_property_ui_range(prop, 1, 6, 1, 0);
+ RNA_def_property_ui_range(prop, 0, 6, 1, 0);
RNA_def_property_ui_text(prop, "Levels", "Number of subdivisions to perform.");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "render_levels", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "render_levels", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "renderLevels");
- RNA_def_property_range(prop, 1, 6);
- RNA_def_property_ui_range(prop, 1, 6, 1, 0);
+ RNA_def_property_ui_range(prop, 0, 6, 1, 0);
RNA_def_property_ui_text(prop, "Render Levels", "Number of subdivisions to perform when rendering.");
- prop= RNA_def_property(srna, "optimal_draw", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "optimal_display", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", eSubsurfModifierFlag_ControlEdges);
- RNA_def_property_ui_text(prop, "Optimal Draw", "Skip drawing/rendering of interior subdivided edges");
+ RNA_def_property_ui_text(prop, "Optimal Display", "Skip drawing/rendering of interior subdivided edges");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "subsurf_uv", PROP_BOOLEAN, PROP_NONE);
@@ -532,11 +563,42 @@ static void rna_def_modifier_multires(BlenderRNA *brna)
rna_def_property_subdivision_common(srna, "simple");
- prop= RNA_def_property(srna, "level", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "levels", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "lvl");
- RNA_def_property_ui_text(prop, "Level", "");
+ RNA_def_property_ui_text(prop, "Levels", "Number of subdivisions to use in the viewport.");
RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MultiresModifier_level_range");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ prop= RNA_def_property(srna, "sculpt_levels", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "sculptlvl");
+ RNA_def_property_ui_text(prop, "Sculpt Levels", "Number of subdivisions to use in sculpt mode.");
+ RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MultiresModifier_level_range");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ prop= RNA_def_property(srna, "render_levels", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "renderlvl");
+ RNA_def_property_ui_text(prop, "Render Levels", "");
+ RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MultiresModifier_level_range");
+
+ prop= RNA_def_property(srna, "total_levels", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "totlvl");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Total Levels", "Number of subdivisions for which displacements are stored.");
+
+ prop= RNA_def_property(srna, "external", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_boolean_funcs(prop, "rna_MultiresModifier_external_get", NULL);
+ RNA_def_property_ui_text(prop, "External", "Store multires displacements outside the .blend file, to save memory.");
+
+ prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
+ RNA_def_property_string_funcs(prop, "rna_MultiresModifier_filename_get", "rna_MultiresModifier_filename_length", "rna_MultiresModifier_filename_set");
+ RNA_def_property_ui_text(prop, "Filename", "Path to external displacements file.");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ prop= RNA_def_property(srna, "optimal_display", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flags", eMultiresModifierFlag_ControlEdges);
+ RNA_def_property_ui_text(prop, "Optimal Display", "Skip drawing/rendering of interior subdivided edges");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
}
static void rna_def_modifier_lattice(BlenderRNA *brna)