Merge pull request #2702 from TheHX/fix_align_with_view

Fix 3D editor align with current view
This commit is contained in:
Juan Linietsky 2015-11-18 19:58:52 -03:00
commit 94fdd01241

View file

@ -1957,11 +1957,11 @@ void SpatialEditorViewport::_menu_option(int p_option) {
if (!se) if (!se)
continue; continue;
Vector3 original_scale = sp->get_scale(); Transform xform = camera_transform;
sp->set_global_transform(camera_transform); xform.scale_basis(sp->get_scale());
sp->set_scale(original_scale);
undo_redo->add_do_method(sp,"set_global_transform",sp->get_global_transform()); undo_redo->add_do_method(sp,"set_global_transform",xform);
undo_redo->add_undo_method(sp,"set_global_transform",se->original); undo_redo->add_undo_method(sp,"set_global_transform",sp->get_global_transform());
} }
undo_redo->commit_action(); undo_redo->commit_action();
} break; } break;