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:
authorCampbell Barton <ideasman42@gmail.com>2012-05-18 14:37:49 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-05-18 14:37:49 +0400
commit76f28921dc9757da9ba04b195dd66acda2e4acf2 (patch)
tree0a0306dc0664f52fd864ef929e73205d9e7ceead /source/blender
parent181f3670c904efe662444d0e542ea8234f7571a9 (diff)
add option for screw modifier to smooth shade. (renamed smooth_shading to use_smooth_shade for remesh modifier too)
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h9
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c7
-rw-r--r--source/blender/modifiers/intern/MOD_screw.c6
3 files changed, 15 insertions, 7 deletions
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 8e39ded84d5..971ce613edc 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -745,10 +745,11 @@ typedef struct ScrewModifierData {
short flag;
} ScrewModifierData;
-#define MOD_SCREW_NORMAL_FLIP (1<<0)
-#define MOD_SCREW_NORMAL_CALC (1<<1)
-#define MOD_SCREW_OBJECT_OFFSET (1<<2)
-// #define MOD_SCREW_OBJECT_ANGLE (1<<4)
+#define MOD_SCREW_NORMAL_FLIP (1 << 0)
+#define MOD_SCREW_NORMAL_CALC (1 << 1)
+#define MOD_SCREW_OBJECT_OFFSET (1 << 2)
+// #define MOD_SCREW_OBJECT_ANGLE (1 << 4)
+#define MOD_SCREW_SMOOTH_SHADING (1 << 5)
typedef struct OceanModifierData {
ModifierData modifier;
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 38a0147b07c..4a7050b47e9 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -2627,6 +2627,11 @@ static void rna_def_modifier_screw(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Object Screw", "Use the distance between the objects to make a screw");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
+ prop = RNA_def_property(srna, "use_smooth_shade", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SCREW_SMOOTH_SHADING);
+ RNA_def_property_ui_text(prop, "Smooth Shading", "Output faces with smooth shading rather than flat shaded");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
#if 0
prop= RNA_def_property(srna, "use_angle_object", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SCREW_OBJECT_ANGLE);
@@ -3001,7 +3006,7 @@ static void rna_def_modifier_remesh(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Remove Disconnected Pieces", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop = RNA_def_property(srna, "smooth_shading", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "use_smooth_shade", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_REMESH_SMOOTH_SHADING);
RNA_def_property_ui_text(prop, "Smooth Shading", "Output faces with smooth shading rather than flat shaded");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c
index 6a57cd82b50..f45cc9c2ade 100644
--- a/source/blender/modifiers/intern/MOD_screw.c
+++ b/source/blender/modifiers/intern/MOD_screw.c
@@ -111,7 +111,7 @@ static void initData(ModifierData *md)
ltmd->ob_axis = NULL;
ltmd->angle = M_PI * 2.0;
ltmd->axis = 2;
- ltmd->flag = 0;
+ ltmd->flag = MOD_SCREW_SMOOTH_SHADING;
ltmd->steps = 16;
ltmd->render_steps = 16;
ltmd->iter = 1;
@@ -175,6 +175,8 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
ScrewVertConnect *vc, *vc_tmp, *vert_connect = NULL;
+ const char mpoly_flag = (ltmd->flag & MOD_SCREW_SMOOTH_SHADING) ? ME_SMOOTH : 0;
+
/* don't do anything? */
if (!totvert)
return CDDM_from_template(dm, 0, 0, 0, 0, 0);
@@ -810,7 +812,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
mp_new->loopstart = mpoly_index * 4;
mp_new->totloop = 4;
- mp_new->flag = ME_SMOOTH;
+ mp_new->flag = mpoly_flag;
origindex[mpoly_index] = ORIGINDEX_NONE;
mp_new++;
ml_new += 4;