diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-26 08:44:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-26 08:44:27 +0300 |
commit | 44370a307cc77435880793a6420be143004b34f7 (patch) | |
tree | a9cb40abec4ef1ba25a907a8ed3df37053128ce4 /source/blender/editors/transform/transform_ops.c | |
parent | e6c5490323068aad1ab9823f8974dea9ed567df9 (diff) |
UI: hide transform constraints when not used
Diffstat (limited to 'source/blender/editors/transform/transform_ops.c')
-rw-r--r-- | source/blender/editors/transform/transform_ops.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index f8e23c9744d..df118d7a272 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -499,6 +499,17 @@ static bool transform_poll_property(const bContext *UNUSED(C), wmOperator *op, c { const char *prop_id = RNA_property_identifier(prop); + /* Orientation/Constraints. */ + { + /* Hide orientation axis if no constraints are set, since it wont be used. */ + PropertyRNA *prop_con = RNA_struct_find_property(op->ptr, "constraint_axis"); + if (prop_con && !RNA_property_is_set(op->ptr, prop_con)) { + if (STRPREFIX(prop_id, "constraint")) { + return false; + } + } + } + /* Proportional Editing. */ { PropertyRNA *prop_pet = RNA_struct_find_property(op->ptr, "proportional"); |