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>2017-08-25 08:13:11 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-08-25 08:13:11 +0300
commit3f4b3fdfba00952cfc7565f3d55738c042f609c1 (patch)
tree14a96fd369c50ee6da4af5cdd5e2ba2edd070722 /source/blender/editors/manipulator_library
parent1b5a690c721e257f4d2b6b0df3ad87c011af121e (diff)
Manipulator: zero grab offset w/o target property
Some manipulators are used like on-screen buttons, in this case it doesn't make sense to keep track of their state, so zero the offset when its unused. Needed for lamp-target manipulator.
Diffstat (limited to 'source/blender/editors/manipulator_library')
-rw-r--r--source/blender/editors/manipulator_library/manipulator_types/grab3d_manipulator.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/editors/manipulator_library/manipulator_types/grab3d_manipulator.c b/source/blender/editors/manipulator_library/manipulator_types/grab3d_manipulator.c
index a714dd0f061..a5deb47a753 100644
--- a/source/blender/editors/manipulator_library/manipulator_types/grab3d_manipulator.c
+++ b/source/blender/editors/manipulator_library/manipulator_types/grab3d_manipulator.c
@@ -267,6 +267,9 @@ static int manipulator_grab_modal(
if (WM_manipulator_target_property_is_valid(mpr_prop)) {
WM_manipulator_target_property_value_set_array(C, mpr, mpr_prop, grab->prop_co);
}
+ else {
+ zero_v3(grab->prop_co);
+ }
ED_region_tag_redraw(ar);
@@ -326,7 +329,12 @@ static int manipulator_grab_test_select(
static void manipulator_grab_property_update(wmManipulator *mpr, wmManipulatorProperty *mpr_prop)
{
GrabManipulator3D *grab = (GrabManipulator3D *)mpr;
- WM_manipulator_target_property_value_get_array(mpr, mpr_prop, grab->prop_co);
+ if (WM_manipulator_target_property_is_valid(mpr_prop)) {
+ WM_manipulator_target_property_value_get_array(mpr, mpr_prop, grab->prop_co);
+ }
+ else {
+ zero_v3(grab->prop_co);
+ }
}
static int manipulator_grab_cursor_get(wmManipulator *UNUSED(mpr))