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:
authorMartin Poirier <theeth@yahoo.com>2009-10-13 02:33:32 +0400
committerMartin Poirier <theeth@yahoo.com>2009-10-13 02:33:32 +0400
commit3a1216a2f299025c992561f55c0bb29034c79bdf (patch)
treefa8248f553582e5442810853a8e7f084c28bd947 /source/blender/editors/transform/transform_ops.c
parent1fc616351ba8ead153c0c951a91cfadcd740cc17 (diff)
Project option for snap to faces.
This is similar to the old retopo all option but uses the snapping code and not the openGL depth buffer (it's thus more precise). Not sure if making it available as a snap option is sensible, this is up for discussion. NOTE: it will get slow fast on large meshes, we need to plug in an acceleration structure into snapping. This will need an icon too.
Diffstat (limited to 'source/blender/editors/transform/transform_ops.c')
-rw-r--r--source/blender/editors/transform/transform_ops.c34
1 files changed, 5 insertions, 29 deletions
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index b0e79b3b062..3408f6cf3f7 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -63,32 +63,6 @@ EnumPropertyItem proportional_mode_types[] = {
{0, NULL, 0, NULL, NULL}
};
-EnumPropertyItem snap_mode_types[] = {
- {SCE_SNAP_TARGET_CLOSEST, "CLOSEST", 0, "Closest", ""},
- {SCE_SNAP_TARGET_CENTER, "CENTER", 0, "Center", ""},
- {SCE_SNAP_TARGET_MEDIAN, "MEDIAN", 0, "Median", ""},
- {SCE_SNAP_TARGET_ACTIVE, "ACTIVE", 0, "Active", ""},
- {0, NULL, 0, NULL, NULL}
-};
-
-EnumPropertyItem proportional_falloff_types[] = {
- {PROP_SMOOTH, "SMOOTH", 0, "Smooth", ""},
- {PROP_SPHERE, "SPHERE", 0, "Sphere", ""},
- {PROP_ROOT, "ROOT", 0, "Root", ""},
- {PROP_SHARP, "SHARP", 0, "Sharp", ""},
- {PROP_LIN, "LINEAR", 0, "Linear", ""},
- {PROP_CONST, "CONSTANT", 0, "Constant", ""},
- {PROP_RANDOM, "RANDOM", 0, "Random", ""},
- {0, NULL, 0, NULL, NULL}
-};
-
-EnumPropertyItem orientation_items[]= {
- {V3D_MANIP_GLOBAL, "GLOBAL", 0, "Global", ""},
- {V3D_MANIP_NORMAL, "NORMAL", 0, "Normal", ""},
- {V3D_MANIP_LOCAL, "LOCAL", 0, "Local", ""},
- {V3D_MANIP_VIEW, "VIEW", 0, "View", ""},
- {0, NULL, 0, NULL, NULL}};
-
char OP_TRANSLATION[] = "TFM_OT_translate";
char OP_ROTATION[] = "TFM_OT_rotate";
char OP_TOSPHERE[] = "TFM_OT_tosphere";
@@ -157,7 +131,8 @@ void TFM_OT_select_orientation(struct wmOperatorType *ot)
ot->exec = select_orientation_exec;
ot->poll = ED_operator_areaactive;
- prop= RNA_def_enum(ot->srna, "orientation", orientation_items, V3D_MANIP_GLOBAL, "Orientation", "DOC_BROKEN");
+ prop= RNA_def_property(ot->srna, "orientation", PROP_ENUM, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Orientation", "Transformation orientation.");
RNA_def_enum_funcs(prop, rna_TransformOrientation_itemf);
}
@@ -374,7 +349,7 @@ void Properties_Proportional(struct wmOperatorType *ot)
void Properties_Snapping(struct wmOperatorType *ot, short align)
{
RNA_def_boolean(ot->srna, "snap", 0, "Snap to Point", "");
- RNA_def_enum(ot->srna, "snap_mode", snap_mode_types, 0, "Mode", "");
+ RNA_def_enum(ot->srna, "snap_mode", snap_mode_items, 0, "Mode", "");
RNA_def_float_vector(ot->srna, "snap_point", 3, NULL, -FLT_MAX, FLT_MAX, "Point", "", -FLT_MAX, FLT_MAX);
if (align)
@@ -389,7 +364,8 @@ void Properties_Constraints(struct wmOperatorType *ot)
PropertyRNA *prop;
RNA_def_boolean_vector(ot->srna, "constraint_axis", 3, NULL, "Constraint Axis", "");
- prop= RNA_def_enum(ot->srna, "constraint_orientation", orientation_items, V3D_MANIP_GLOBAL, "Orientation", "DOC_BROKEN");
+ prop= RNA_def_property(ot->srna, "constraint_orientation", PROP_ENUM, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Orientation", "Transformation orientation.");
RNA_def_enum_funcs(prop, rna_TransformOrientation_itemf);
}