[Bf-blender-cvs] [1579362] temp_custom_loop_normals: Get rid of 'custom lnors' modifier option, do not use at all target geometry.
Bastien Montagne
noreply at git.blender.org
Tue Feb 3 12:10:57 CET 2015
Commit: 15793629d212a341bba1620c43caa95edebbae16
Author: Bastien Montagne
Date: Tue Feb 3 12:08:22 2015 +0100
Branches: temp_custom_loop_normals
https://developer.blender.org/rB15793629d212a341bba1620c43caa95edebbae16
Get rid of 'custom lnors' modifier option, do not use at all target geometry.
===================================================================
M release/scripts/startup/bl_ui/properties_data_modifier.py
M source/blender/makesdna/DNA_modifier_types.h
M source/blender/makesrna/intern/rna_modifier.c
M source/blender/modifiers/intern/MOD_normal_edit.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index 91c0abe..1db85d2 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -1356,14 +1356,13 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
sub.active = needs_object_offset
sub.prop(md, "offset")
row = col.row(align=True)
- row.active = (md.mode == 'DIRECTIONAL')
- row.prop(md, "use_directional_parallel")
col = split.column()
- col.prop(md, "use_current_normals")
+ row = col.row()
+ row.active = (md.mode == 'DIRECTIONAL')
+ row.prop(md, "use_directional_parallel")
subcol = col.column(align=True)
- subcol.active = md.use_current_normals
subcol.label("Mix Mode:")
subcol.prop(md, "mix_mode", text="")
subcol.prop(md, "mix_factor")
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 32a02b5..751d164 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -1442,8 +1442,7 @@ enum {
/* NormalEditModifierData.flags */
enum {
MOD_NORMALEDIT_INVERT_VGROUP = (1 << 0),
- MOD_NORMALEDIT_USE_CURCLNORS = (1 << 1),
- MOD_NORMALEDIT_USE_PARALLEL_DIRECTIONAL = (1 << 2),
+ MOD_NORMALEDIT_USE_PARALLEL_DIRECTIONAL = (1 << 1),
};
/* NormalEditModifierData.mix_mode */
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 55b88dd..8be4b51 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -4375,12 +4375,6 @@ static void rna_def_modifier_normaledit(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Mode", "How to affect (generate) normals");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop = RNA_def_property(srna, "use_current_normals", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_NORMALEDIT_USE_CURCLNORS);
- RNA_def_property_boolean_default(prop, true);
- RNA_def_property_ui_text(prop, "Use Current Normals", "Use current split normals to mix generated ones in");
- RNA_def_property_update(prop, 0, "rna_Modifier_update");
-
prop = RNA_def_float_array(srna, "offset", 3, NULL, -FLT_MAX, FLT_MAX, "Offset",
"Offset from object's center", -100.0f, 100.0f);
RNA_def_property_subtype(prop, PROP_COORDS);
diff --git a/source/blender/modifiers/intern/MOD_normal_edit.c b/source/blender/modifiers/intern/MOD_normal_edit.c
index bed528b..e9fcf4f 100644
--- a/source/blender/modifiers/intern/MOD_normal_edit.c
+++ b/source/blender/modifiers/intern/MOD_normal_edit.c
@@ -64,13 +64,9 @@ static void generate_vert_coordinates(DerivedMesh *dm, Object *ob, Object *ob_ce
dm->getVertCos(dm, r_cos);
- /* Compute min/max's, aka bbox (use target's ob one if available). */
+ /* Get size (i.e. deformation of the spheroid generating normals), either from target object, or own geometry. */
if (ob_center) {
- BKE_object_dimensions_get(ob_center, r_size);
- if (is_zero_v3(r_size)) {
- /* Use ob_center's size as fallback (when it's e.g. an empty...). */
- copy_v3_v3(r_size, ob_center->size);
- }
+ copy_v3_v3(r_size, ob_center->size);
}
else {
minmax_v3v3_v3_array(min_co, max_co, r_cos, num_verts);
@@ -339,7 +335,9 @@ static void normalEditModifier_do(NormalEditModifierData *smd, Object *ob, Deriv
MPoly *mpoly = dm->getPolyArray(dm);
const bool use_invert_vgroup = ((smd->flags & MOD_NORMALEDIT_INVERT_VGROUP) != 0);
- const bool use_current_clnors = (smd->flags & MOD_NORMALEDIT_USE_CURCLNORS) != 0;
+ const bool use_current_clnors = (smd->mix_mode == MOD_NORMALEDIT_MIX_COPY) &&
+ (smd->mix_factor == 1.0f) &&
+ (smd->defgrp_name[0] == '\0');
int defgrp_index;
MDeformVert *dvert;
@@ -404,7 +402,6 @@ static void initData(ModifierData *md)
NormalEditModifierData *smd = (NormalEditModifierData *)md;
smd->mode = MOD_NORMALEDIT_MODE_RADIAL;
- smd->flags = MOD_NORMALEDIT_USE_CURCLNORS;
smd->mix_mode = MOD_NORMALEDIT_MIX_COPY;
smd->mix_factor = 1.0f;
@@ -462,7 +459,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, struct Scene *UN
if (smd->target) {
DagNode *Node = dag_get_node(forest, smd->target);
- dag_add_relation(forest, Node, obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "NormalEdit Modifier");
+ dag_add_relation(forest, Node, obNode, DAG_RL_OB_DATA, "NormalEdit Modifier");
}
}
More information about the Bf-blender-cvs
mailing list