217 const float plane[4],
219 const float *plane_fallback,
224 if (plane_fallback !=
NULL) {
226 region, plane, mval, do_clip, plane_fallback, r_out);
236 const float dir_test[3],
239 int index_found = -1;
240 float dot_best = -1.0f;
241 for (
int i = 0; i < dirs_len; i++) {
242 float dot_test =
dot_v3v3(dirs[i], dir_test);
243 if (is_signed ==
false) {
244 dot_test =
fabsf(dot_test);
246 if ((index_found == -1) || (dot_test > dot_best)) {
259 float dot_best = -1.0f;
260 int axis_found = axis_align;
261 for (
int i = 0; i < 3; i++) {
263 if (dot_test > dot_best) {
269 if (axis_align != axis_found) {
272 const int offset =
mod_i(axis_found - axis_align, 3);
273 for (
int i = 0; i < 3; i++) {
282 #define MVAL_MAX_PX_DIST 12.0f
309 const float mval_fl[2],
310 const float mat_fallback[3][3],
311 const float normal_fallback[3],
314 bool success =
false;
326 .use_object_edit_cage =
true,
338 else if (normal_fallback !=
NULL) {
350 for (
int i = 1; i < 3; i++) {
352 if (dot_test > dot_best) {
401 if (co_relative !=
NULL) {
405 co[0] = roundf(co[0]);
406 co[1] = roundf(co[1]);
407 co[2] = roundf(co[2]);
409 if (co_relative !=
NULL) {
420 const int snap_mode =
436 static void draw_line_loop(
const float coords[][3],
int coords_len,
const float color[4])
444 for (
int i = 0; i < coords_len; i++) {
468 const float color[4])
476 for (
int i = 0; i < coords_len; i++) {
503 const int edges[12][2] = {
524 for (
int i = 0, j = 0; i <
ARRAY_SIZE(edges); i++) {
554 float matrix_orient_inv[3][3];
560 float quad_base[4][3];
561 float quad_secondary[4][3];
567 float fixed_aspect_dimension;
572 float delta_local[3];
577 mul_m3_v3(matrix_orient_inv, delta_local);
584 delta_a[x_axis] = 0.0f;
585 delta_b[y_axis] = 0.0f;
588 fixed_aspect_dimension =
max_ff(
fabsf(delta_a[y_axis]),
fabsf(delta_b[x_axis]));
591 delta_a[y_axis] =
copysignf(fixed_aspect_dimension, delta_a[y_axis]);
592 delta_b[x_axis] =
copysignf(fixed_aspect_dimension, delta_b[x_axis]);
611 float base_co_dst[3];
613 for (
int i = 0; i <
ARRAY_SIZE(quad_base); i++) {
618 fixed_aspect_dimension *= 2.0f;
623 float delta_local[3];
647 for (
int i = 0; i <
ARRAY_SIZE(quad_base); i++) {
655 for (
int i = 0; i <
ARRAY_SIZE(quad_base); i++) {
656 add_v3_v3v3(quad_secondary[i], quad_base[i], delta_local);
666 for (
int i = 0; i < 4; i++) {
678 const int resolution,
679 const float color[4])
682 const float quad[4][2] = {
689 float(*coords)[3] =
MEM_mallocN(
sizeof(
float[3]) * (resolution + 1), __func__);
690 for (
int i = 0; i <= resolution; i++) {
691 float theta = ((2.0f *
M_PI) * ((
float)i / (
float)resolution)) + 0.01f;
692 float x =
cosf(theta);
693 float y =
sinf(theta);
694 const float pt[2] = {
x,
y};
698 float *co = coords[i];
717 const float color[4],
726 if (flatten_axis == STEP_BASE) {
752 if (flatten_axis == STEP_DEPTH) {
753 const float *base_plane = ipd->
step[0].
plane;
754 for (
int i = 0; i < 4; i++) {
776 float coords_a[4][3];
777 float coords_b[4][3];
779 for (
int i = 0; i < 4; i++) {
792 float v01[3], v12[3], v23[3], v30[3];
798 float v45[3], v56[3], v67[3], v74[3];
804 float v04[3], v15[3], v26[3], v37[3];
846 if (depth_test_enabled ==
false) {
864 const float mval_fl[2],
869 const int plane_axis,
870 const bool plane_axis_auto,
872 float r_matrix_orient[3][3])
884 bool snap_context_free =
false;
891 if (snap_context ==
NULL) {
893 snap_context_free =
true;
898 bool found_surface_or_normal =
false;
899 float matrix_orient_surface[3][3];
903 float normal_fallback[3];
908 if ((snap_context !=
NULL) &&
912 use_normal_fallback ? r_matrix_orient :
NULL,
913 use_normal_fallback ? normal_fallback :
NULL,
914 matrix_orient_surface)) {
915 copy_m3_m3(r_matrix_orient, matrix_orient_surface);
916 found_surface_or_normal =
true;
919 if (!found_surface_or_normal && plane_axis_auto) {
931 bool use_depth_fallback =
true;
935 use_depth_fallback =
false;
938 if ((snap_context !=
NULL) &&
944 .use_object_edit_cage =
true,
951 use_depth_fallback =
false;
959 const float *plane_normal = r_matrix_orient[plane_axis];
966 plane_normal = rv3d->
viewinv[2];
972 use_depth_fallback =
false;
983 use_depth_fallback =
true;
988 if (use_depth_fallback) {
1002 if (snap_context_free) {
1037 if (gzgroup !=
NULL) {
1082 for (
int i = 0; i < 2; i++) {
1116 for (
int i = 0; i < 2; i++) {
1125 float axis_fallback[4][3];
1151 if (degenerate_axis_is_flip) {
1182 if (tref &&
STREQ(tref->
idname,
"builtin.primitive_cube_add")) {
1185 else if (tref &&
STREQ(tref->
idname,
"builtin.primitive_cylinder_add")) {
1188 else if (tref &&
STREQ(tref->
idname,
"builtin.primitive_cone_add")) {
1191 else if (tref &&
STREQ(tref->
idname,
"builtin.primitive_uv_sphere_add")) {
1194 else if (tref &&
STREQ(tref->
idname,
"builtin.primitive_ico_sphere_add")) {
1247 if (gzgroup !=
NULL) {
1283 const char *keymap_name =
"View3D Placement Modal";
1303 bool do_redraw =
false;
1304 bool do_cursor_update =
false;
1308 bool is_fallthrough =
false;
1309 switch (event->
val) {
1311 is_fallthrough =
true;
1321 is_fallthrough =
true;
1331 is_fallthrough =
true;
1338 do_cursor_update =
true;
1344 switch (event->
type) {
1351 do_cursor_update =
true;
1376 float no[3], no_temp[3];
1415 float matrix_orient_axis[3][3];
1419 swap_v3_v3(matrix_orient_axis[0], matrix_orient_axis[1]);
1436 const int cube_verts[3] = {3, 1, 4};
1437 for (
int i = 0; i < 3; i++) {
1512 if (do_cursor_update) {
1578 float close[3], delta[3];
1603 ot->
name =
"Add Primitive Object";
1605 ot->
idname =
"VIEW3D_OT_interactive_add";
1644 "Select the closest axis when placing objects "
1645 "(surface overrides)");
1653 "Start placing on the surface, using the 3D cursor position as a fallback"},
1658 "Start placement using a point projected onto the orientation axis "
1659 "at the 3D cursor position"},
1664 "Start placement using a point projected onto the view plane at the 3D cursor position"},
1678 "Use the surface normal (using the transform orientation as a fallback)"},
1681 ICON_ORIENTATION_GLOBAL,
1683 "Use the current transform orientation"},
1709 const char *identifiers[2] = {
"plane_origin_base",
"plane_origin_depth"};
1710 for (
int i = 0; i < 2; i++) {
1725 const char *identifiers[2] = {
"plane_aspect_base",
"plane_aspect_depth"};
1726 for (
int i = 0; i < 2; i++) {
1771 gzgt->
name =
"Placement Widget";
1798 float r_matrix_orient[3][3],
1816 const float mval_fl[2] = {
UNPACK2(mval)};
1849 *r_plane_axis = plane_axis;
1854 const float scale_fade,
1855 const float matrix[4][4],
1856 const int plane_axis,
1857 const float color[4])
1860 const int resolution_min = resolution - 1;
1861 float color_fade[4] = {
UNPACK4(color)};
1862 const float *
center = matrix[3];
1874 const size_t coords_len = resolution * resolution;
1877 const int axis_x = (plane_axis + 0) % 3;
1878 const int axis_y = (plane_axis + 1) % 3;
1879 const int axis_z = (plane_axis + 2) % 3;
1882 const float resolution_div = (
float)1.0f / (
float)resolution;
1884 for (
int x = 0;
x < resolution;
x++) {
1885 const float x_fl = (
x * resolution_div) - 0.5f;
1886 for (
int y = 0;
y < resolution;
y++) {
1887 const float y_fl = (
y * resolution_div) - 0.5f;
1888 coords[i][axis_x] = 0.0f;
1889 coords[i][axis_y] = x_fl * scale;
1890 coords[i][axis_z] = y_fl * scale;
1898 for (
int x = 0;
x < resolution_min;
x++) {
1899 for (
int y = 0;
y < resolution_min;
y++) {
1903 max_ff(0.0f, (1.0f - square_f(((len_v3v3(v, center) / scale_fade) + resolution_div) * 2.0f)))
1905 const float *v0 = coords[(resolution *
x) +
y];
1906 const float *
v1 = coords[(resolution * (
x + 1)) +
y];
1907 const float *
v2 = coords[(resolution *
x) + (
y + 1)];
1909 const float f0 =
FADE(v0);
1910 const float f1 =
FADE(
v1);
1911 const float f2 =
FADE(
v2);
1913 if (f0 > 0.0f || f1 > 0.0f) {
1914 color_fade[3] = color[3] * f0;
1917 color_fade[3] = color[3] * f1;
1921 if (f0 > 0.0f || f2 > 0.0f) {
1922 color_fade[3] = color[3] * f0;
1926 color_fade[3] = color[3] * f2;
2001 if (gzgroup_test != plc->
gzgroup) {
2015 float orient_matrix[3][3];
2036 if (pixel_size > FLT_EPSILON) {
2039 float color_alpha = 0.75f;
2044 if (relative_pixel_scale < 1.0f) {
2051 float view_vector[3];
2064 const float scale_mod =
U.gizmo_size * 2 *
U.dpi_fac;
2066 float final_scale = (scale_mod * pixel_size);
2068 const int lines_subdiv = 10;
2069 int lines = lines_subdiv;
2071 float final_scale_fade = final_scale;
2074 float fac = final_scale_fade / final_scale;
2076 float color[4] = {1, 1, 1, color_alpha};
2078 if (color[3] > 0.0f) {
2087 color[3] = color_alpha;
2091 final_scale = final_scale_fade;
2094 lines, final_scale, final_scale_fade, plc->
matrix, plc->
plane_axis, color);
typedef float(TangentPoint)[2]
struct ScrArea * CTX_wm_area(const bContext *C)
struct Scene * CTX_data_scene(const bContext *C)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct View3D * CTX_wm_view3d(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
enum eContextObjectMode CTX_data_mode_enum(const bContext *C)
MINLINE float max_ff(float a, float b)
MINLINE int mod_i(int i, int n)
MINLINE float square_f(float a)
float ceil_power_of_10(float f)
void plane_from_point_normal_v3(float r_plane[4], const float plane_co[3], const float plane_no[3])
void closest_to_plane_normalized_v3(float r_close[3], const float plane[4], const float pt[3])
float dist_signed_to_plane_v3(const float p[3], const float plane[4])
void barycentric_weights_v2_quad(const float v1[2], const float v2[2], const float v3[2], const float v4[2], const float co[2], float w[4])
void mul_m3_v3(const float M[3][3], float r[3])
void copy_m3_m3(float m1[3][3], const float m2[3][3])
void copy_m3_m4(float m1[3][3], const float m2[4][4])
void orthogonalize_m3(float R[3][3], int axis)
void copy_m4_m3(float m1[4][4], const float m2[3][3])
void normalize_m3(float R[3][3]) ATTR_NONNULL()
void mul_m4_v3(const float M[4][4], float r[3])
bool equals_m4m4(const float mat1[4][4], const float mat2[4][4])
bool invert_m3_m3(float R[3][3], const float A[3][3])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
void mat3_to_eul(float eul[3], const float mat[3][3])
void mid_v3_v3v3v3v3(float v[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3])
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE bool compare_v3v3(const float a[3], const float b[3], const float limit) ATTR_WARN_UNUSED_RESULT
MINLINE float normalize_v3(float r[3])
MINLINE void sub_v3_v3(float r[3], const float a[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void negate_v3_v3(float r[3], const float a[3])
MINLINE bool is_zero_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void negate_v3(float r[3])
MINLINE float normalize_v3_v3(float r[3], const float a[3])
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void swap_v3_v3(float a[3], float b[3])
MINLINE float normalize_v3_length(float r[3], const float unit_scale)
MINLINE void zero_v3(float r[3])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void add_v3_v3(float r[3], const float a[3])
struct Depsgraph Depsgraph
Object groups, one object can be in many groups at once.
Object is a sort of wrapper for general info.
#define SCE_SNAP_MODE_FACE
#define SCE_SNAP_ABS_GRID
#define SCE_SNAP_MODE_EDGE_PERPENDICULAR
#define SCE_SNAP_MODE_EDGE_MIDPOINT
#define SCE_SNAP_MODE_VERTEX
#define SCE_SNAP_MODE_EDGE
#define SCE_SNAP_MODE_INCREMENT
@ ED_SNAPGIZMO_TOGGLE_ALWAYS_TRUE
bool ED_gizmo_poll_or_unlink_delayed_from_tool(const struct bContext *C, struct wmGizmoGroupType *gzgt)
void ED_region_tag_redraw(struct ARegion *region)
#define REGION_DRAW_POST_VIEW
void * ED_region_draw_cb_activate(struct ARegionType *art, void(*draw)(const struct bContext *, struct ARegion *, void *), void *customdata, int type)
void ED_region_draw_cb_exit(struct ARegionType *, void *)
SnapObjectContext * ED_transform_snap_object_context_create_view3d(struct Scene *scene, int flag, const struct ARegion *region, const struct View3D *v3d)
short ED_transform_snap_object_project_view3d_ex(struct SnapObjectContext *sctx, struct Depsgraph *depsgraph, const unsigned short snap_to, const struct SnapObjectParams *params, const float mval[2], const float prev_co[3], float *dist_px, float r_loc[3], float r_no[3], int *r_index, struct Object **r_ob, float r_obmat[4][4])
bool ED_transform_snap_object_project_view3d(struct SnapObjectContext *sctx, struct Depsgraph *depsgraph, const unsigned short snap_to, const struct SnapObjectParams *params, const float mval[2], const float prev_co[3], float *dist_px, float r_loc[3], float r_no[3])
void ED_transform_snap_object_context_destroy(SnapObjectContext *sctx)
bool ED_view3d_win_to_3d_on_plane(const struct ARegion *region, const float plane[4], const float mval[2], const bool do_clip, float r_out[3])
#define XRAY_ENABLED(v3d)
float ED_view3d_pixel_size(const struct RegionView3D *rv3d, const float co[3])
bool ED_view3d_win_to_3d_on_plane_with_fallback(const struct ARegion *region, const float plane[4], const float mval[2], const bool do_clip, const float plane_fallback[4], float r_out[3])
void ED_view3d_global_to_vector(const struct RegionView3D *rv3d, const float coord[3], float vec[3])
float ED_view3d_grid_view_scale(struct Scene *scene, struct View3D *v3d, struct ARegion *region, const char **r_grid_unit)
void ED_view3d_win_to_3d(const struct View3D *v3d, const struct ARegion *region, const float depth_pt[3], const float mval[2], float r_out[3])
NSNotificationCenter * center
#define GPU_batch_uniform_1f(batch, name, x)
void GPU_batch_discard(GPUBatch *)
void GPU_batch_program_set_builtin(GPUBatch *batch, eGPUBuiltinShader shader_id)
#define GPU_batch_uniform_2fv(batch, name, val)
GPUBatch * GPU_batch_create_ex(GPUPrimType prim, GPUVertBuf *vert, GPUIndexBuf *elem, eGPUBatchFlag owns_flag)
void GPU_batch_draw(GPUBatch *batch)
#define GPU_batch_uniform_4fv(batch, name, val)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
void GPU_matrix_pop(void)
void GPU_matrix_pop_projection(void)
#define GPU_matrix_set(x)
void GPU_matrix_push(void)
#define GPU_matrix_projection_set(x)
void GPU_matrix_push_projection(void)
@ GPU_SHADER_3D_SMOOTH_COLOR
@ GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR
void GPU_blend(eGPUBlend blend)
void GPU_line_width(float width)
void GPU_line_smooth(bool enable)
eGPUDepthTest GPU_depth_test_get(void)
void GPU_depth_test(eGPUDepthTest test)
void GPU_viewport_size_get_f(float coords[4])
#define GPU_vertbuf_create_with_format(format)
struct GPUVertBuf GPUVertBuf
void GPU_vertbuf_data_alloc(GPUVertBuf *, uint v_len)
void GPU_vertbuf_attr_set(GPUVertBuf *, uint a_idx, uint v_idx, const void *data)
Read Guarded memory(de)allocation.
void UI_GetThemeColor3fv(int colorid, float col[3])
@ WM_GIZMOGROUPTYPE_SCALE
@ WM_GIZMOGROUPTYPE_DRAW_MODAL_ALL
@ WM_GIZMO_STATE_HIGHLIGHT
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert * v
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
const Depsgraph * depsgraph
IconTextureDrawCall normal
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
static void area(int d1, int d2, int e1, int e2, float weights[2])
void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *values)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_float_set(PointerRNA *ptr, const char *name, float value)
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
const EnumPropertyItem rna_enum_axis_xyz_items[]
short ED_gizmotypes_snap_3d_update(wmGizmo *gz, struct Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const wmWindowManager *wm, const float mval_fl[2])
bool ED_gizmotypes_snap_3d_invert_snap_get(struct wmGizmo *gz)
void ED_gizmotypes_snap_3d_data_get(wmGizmo *gz, float r_loc[3], float r_nor[3], int r_elem_index[3], int *r_snap_elem)
void ED_gizmotypes_snap_3d_flag_clear(struct wmGizmo *gz, eSnapGizmo flag)
bool ED_gizmotypes_snap_3d_is_enabled(wmGizmo *gz)
SnapObjectContext * ED_gizmotypes_snap_3d_context_ensure(Scene *scene, const ARegion *region, const View3D *v3d, wmGizmo *gz)
void ED_gizmotypes_snap_3d_flag_set(struct wmGizmo *gz, eSnapGizmo flag)
struct wmGizmoMap * gizmo_map
struct ARegionType * type
enum ePlace_PrimType primitive_type
float degenerate_diagonal_display[3]
float matrix_orient[3][3]
bool is_degenerate_view_align
enum ePlace_SnapTo snap_to
bool is_fixed_aspect_init
struct InteractivePlaceData::@557 step[2]
enum InteractivePlaceData::@558 step_index
float degenerate_diagonal[3]
struct ToolSettings * toolsettings
eWM_GizmoFlagGroupTypeFlag flag
struct wmGizmoMapType_Params gzmap_params
struct wmGizmoGroupType * type
void(* customdata_free)(void *)
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
void(* cancel)(struct bContext *, struct wmOperator *)
static int dot_v3_array_find_max_index(const float dirs[][3], const int dirs_len, const float dir_test[3], bool is_signed)
static bool idp_snap_point_from_gizmo(wmGizmo *gz, float r_location[3])
static void draw_line_pairs(const float coords_a[][3], float coords_b[][3], int coords_len, const float color[4])
@ PLACE_PRIMITIVE_TYPE_SPHERE_ICO
@ PLACE_PRIMITIVE_TYPE_CONE
@ PLACE_PRIMITIVE_TYPE_CUBE
@ PLACE_PRIMITIVE_TYPE_SPHERE_UV
@ PLACE_PRIMITIVE_TYPE_CYLINDER
static wmGizmoGroup * idp_gizmogroup_from_region(ARegion *region)
static void draw_primitive_view(const struct bContext *C, ARegion *UNUSED(region), void *arg)
static const char * view3d_gzgt_placement_id
static bool view3d_win_to_3d_on_plane_maybe_fallback(const ARegion *region, const float plane[4], const float mval[2], const float *plane_fallback, float r_out[3])
static void draw_line_loop(const float coords[][3], int coords_len, const float color[4])
static void cursor_plane_draw(bContext *C, int x, int y, void *customdata)
static void draw_line_bounds(const BoundBox *bounds, const float color[4])
static bool idp_poject_surface_normal(SnapObjectContext *snap_context, struct Depsgraph *depsgraph, const float mval_fl[2], const float mat_fallback[3][3], const float normal_fallback[3], float r_mat[3][3])
static const float eps_view_align
static void view3d_interactive_add_cancel(bContext *C, wmOperator *op)
static void gizmo_plane_draw_grid(const int resolution, const float scale, const float scale_fade, const float matrix[4][4], const int plane_axis, const float color[4])
static void WIDGETGROUP_placement_setup(const bContext *UNUSED(C), wmGizmoGroup *gzgroup)
static void preview_plane_cursor_setup(wmGizmoGroup *gzgroup)
static bool idp_snap_point_from_gizmo_ex(wmGizmo *gz, const char *prop_id, float r_location[3])
static void preview_plane_cursor_free(void *customdata)
static bool idp_snap_calc_incremental(Scene *scene, View3D *v3d, ARegion *region, const float co_relative[3], float co[3])
static bool calc_bbox(struct InteractivePlaceData *ipd, BoundBox *bounds)
static void draw_circle_in_quad(const float v1[3], const float v2[3], const float v3[3], const float v4[3], const int resolution, const float color[4])
static bool view3d_interactive_add_poll(bContext *C)
static int view3d_interactive_add_modal(bContext *C, wmOperator *op, const wmEvent *event)
void VIEW3D_GGT_placement(wmGizmoGroupType *gzgt)
@ PLACE_DEPTH_CURSOR_PLANE
@ PLACE_DEPTH_CURSOR_VIEW
static bool mat3_align_axis_to_v3(float mat[3][3], const int axis_align, const float v[3])
static int view3d_interactive_add_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void view3d_interactive_add_exit(bContext *C, wmOperator *op)
static bool idp_snap_normal_from_gizmo(wmGizmo *gz, float r_normal[3])
static void preview_plane_cursor_visible_set(wmGizmoGroup *gzgroup, bool do_draw)
static void draw_primitive_view_impl(const struct bContext *C, struct InteractivePlaceData *ipd, const float color[4], int flatten_axis)
void VIEW3D_OT_interactive_add(struct wmOperatorType *ot)
static void idp_snap_gizmo_update_snap_elements(Scene *scene, enum ePlace_SnapTo snap_to, wmGizmo *gizmo)
static void gizmo_plane_update_cursor(const bContext *C, ARegion *region, const int mval[2], float r_co[3], float r_matrix_orient[3][3], int *r_plane_axis)
static void view3d_interactive_add_calc_plane(bContext *C, Scene *scene, View3D *v3d, ARegion *region, const float mval_fl[2], wmGizmo *snap_gizmo, const enum ePlace_SnapTo snap_to, const enum ePlace_Depth plane_depth, const enum ePlace_Orient plane_orient, const int plane_axis, const bool plane_axis_auto, float r_co_src[3], float r_matrix_orient[3][3])
static void view3d_interactive_add_begin(bContext *C, wmOperator *op, const wmEvent *event)
void viewplace_modal_keymap(wmKeyConfig *keyconf)
@ PLACE_MODAL_FIXED_ASPECT_OFF
@ PLACE_MODAL_FIXED_ASPECT_ON
@ PLACE_MODAL_PIVOT_CENTER_OFF
@ PLACE_MODAL_PIVOT_CENTER_ON
int WM_userdef_event_type_from_keymap_type(int kmitype)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
int WM_operator_name_call_ptr(bContext *C, wmOperatorType *ot, short context, PointerRNA *properties)
#define ISTWEAK(event_type)
wmGizmo * WM_gizmo_new_ptr(const wmGizmoType *gzt, wmGizmoGroup *gzgroup, PointerRNA *properties)
void WM_gizmo_set_color(wmGizmo *gz, const float color[4])
bool WM_gizmo_group_type_ensure(const char *idname)
wmGizmoGroup * WM_gizmomap_group_find_ptr(struct wmGizmoMap *gzmap, const struct wmGizmoGroupType *gzgt)
wmGizmoGroup * WM_gizmomap_group_find(struct wmGizmoMap *gzmap, const char *idname)
const wmGizmoType * WM_gizmotype_find(const char *idname, bool quiet)
wmKeyMap * WM_modalkeymap_find(wmKeyConfig *keyconf, const char *idname)
void WM_modalkeymap_assign(wmKeyMap *km, const char *opname)
wmKeyMap * WM_modalkeymap_ensure(wmKeyConfig *keyconf, const char *idname, const EnumPropertyItem *items)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
bool WM_paint_cursor_end(wmPaintCursor *handle)
void WM_operator_properties_create_ptr(PointerRNA *ptr, wmOperatorType *ot)
wmPaintCursor * WM_paint_cursor_activate(short space_type, short region_type, bool(*poll)(bContext *C), wmPaintCursorDraw draw, void *customdata)
void WM_operator_properties_free(PointerRNA *ptr)
void wmViewport(const rcti *winrct)