Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_placement.c
| Show First 20 Lines • Show All 1,432 Lines • ▼ Show 20 Lines | if (ELEM(event->type, ipd->launch_event, LEFTMOUSE)) { | ||||
| } | } | ||||
| mat3_to_eul(rotation, matrix_orient_axis); | mat3_to_eul(rotation, matrix_orient_axis); | ||||
| mid_v3_v3v3(location, bounds.vec[0], bounds.vec[6]); | mid_v3_v3v3(location, bounds.vec[0], bounds.vec[6]); | ||||
| const int cube_verts[3] = {3, 1, 4}; | const int cube_verts[3] = {3, 1, 4}; | ||||
| for (int i = 0; i < 3; i++) { | for (int i = 0; i < 3; i++) { | ||||
| scale[i] = len_v3v3(bounds.vec[0], bounds.vec[cube_verts[i]]); | scale[i] = len_v3v3(bounds.vec[0], bounds.vec[cube_verts[i]]); | ||||
| /* Primitives have size 2 by default, compensate for this here. */ | |||||
| scale[i] /= 2.0f; | |||||
| } | } | ||||
| wmOperatorType *ot = NULL; | wmOperatorType *ot = NULL; | ||||
| PointerRNA op_props; | PointerRNA op_props; | ||||
| if (ipd->primitive_type == PLACE_PRIMITIVE_TYPE_CUBE) { | if (ipd->primitive_type == PLACE_PRIMITIVE_TYPE_CUBE) { | ||||
| ot = WM_operatortype_find("MESH_OT_primitive_cube_add", false); | ot = WM_operatortype_find("MESH_OT_primitive_cube_add", false); | ||||
| } | } | ||||
| else if (ipd->primitive_type == PLACE_PRIMITIVE_TYPE_CYLINDER) { | else if (ipd->primitive_type == PLACE_PRIMITIVE_TYPE_CYLINDER) { | ||||
| ▲ Show 20 Lines • Show All 669 Lines • Show Last 20 Lines | |||||