|
Blender V4.3
|
Functions to paint images in 2D and 3D. More...
#include <algorithm>#include <cfloat>#include <climits>#include <cmath>#include <cstdio>#include <cstring>#include <utility>#include "MEM_guardedalloc.h"#include "BLI_blenlib.h"#include "BLI_linklist.h"#include "BLI_math_base_safe.h"#include "BLI_math_bits.h"#include "BLI_math_color_blend.h"#include "BLI_math_geom.h"#include "BLI_math_vector.hh"#include "BLI_memarena.h"#include "BLI_task.h"#include "BLI_threads.h"#include "BLI_utildefines.h"#include "atomic_ops.h"#include "BLT_translation.hh"#include "IMB_imbuf.hh"#include "IMB_interp.hh"#include "DNA_brush_types.h"#include "DNA_customdata_types.h"#include "DNA_defs.h"#include "DNA_material_types.h"#include "DNA_mesh_types.h"#include "DNA_node_types.h"#include "DNA_object_enums.h"#include "DNA_object_types.h"#include "DNA_scene_types.h"#include "BKE_attribute.hh"#include "BKE_brush.hh"#include "BKE_camera.h"#include "BKE_colorband.hh"#include "BKE_colortools.hh"#include "BKE_context.hh"#include "BKE_customdata.hh"#include "BKE_global.hh"#include "BKE_idprop.hh"#include "BKE_image.hh"#include "BKE_layer.hh"#include "BKE_lib_id.hh"#include "BKE_main.hh"#include "BKE_material.h"#include "BKE_mesh.hh"#include "BKE_mesh_mapping.hh"#include "BKE_mesh_runtime.hh"#include "BKE_node.hh"#include "BKE_node_runtime.hh"#include "BKE_object.hh"#include "BKE_paint.hh"#include "BKE_report.hh"#include "BKE_scene.hh"#include "BKE_screen.hh"#include "DNA_screen_types.h"#include "DNA_space_types.h"#include "DEG_depsgraph.hh"#include "DEG_depsgraph_query.hh"#include "ED_image.hh"#include "ED_node.hh"#include "ED_object.hh"#include "ED_paint.hh"#include "ED_screen.hh"#include "ED_sculpt.hh"#include "ED_uvedit.hh"#include "ED_view3d.hh"#include "ED_view3d_offscreen.hh"#include "GPU_capabilities.hh"#include "GPU_init_exit.hh"#include "NOD_shader.h"#include "UI_interface.hh"#include "UI_resources.hh"#include "WM_api.hh"#include "WM_types.hh"#include "RNA_access.hh"#include "RNA_define.hh"#include "RNA_enum_types.hh"#include "RNA_types.hh"#include "IMB_colormanagement.hh"#include "paint_intern.hh"Go to the source code of this file.
Classes | |
| struct | ProjPaintImage |
| struct | ProjStrokeHandle |
| struct | LoopSeamData |
| struct | ProjPaintState |
| union | PixelPointer |
| union | PixelStore |
| struct | ProjPixel |
| struct | ProjPixelClone |
| struct | TileInfo |
| struct | VertSeam |
| struct | ProjPaintLayerClone |
| struct | ProjPaintFaceLookup |
| struct | ProjPaintFaceCoSS |
| struct | PrepareImageEntry |
| struct | ProjectHandle |
Enumerations | |
| enum | { LAYER_BASE_COLOR , LAYER_SPECULAR , LAYER_ROUGHNESS , LAYER_METALLIC , LAYER_NORMAL , LAYER_BUMP , LAYER_DISPLACEMENT } |
Functions | |
| static void | partial_redraw_array_init (ImagePaintPartialRedraw *pr) |
| BLI_INLINE uchar | f_to_char (const float val) |
| static int | project_paint_face_paint_tile (Image *ima, const float *uv) |
| static Material * | tex_get_material (const ProjPaintState *ps, int face_i) |
| static TexPaintSlot * | project_paint_face_paint_slot (const ProjPaintState *ps, int tri_index) |
| static Image * | project_paint_face_paint_image (const ProjPaintState *ps, int tri_index) |
| static TexPaintSlot * | project_paint_face_clone_slot (const ProjPaintState *ps, int tri_index) |
| static Image * | project_paint_face_clone_image (const ProjPaintState *ps, int tri_index) |
| static int | project_bucket_offset (const ProjPaintState *ps, const float projCoSS[2]) |
| static int | project_bucket_offset_safe (const ProjPaintState *ps, const float projCoSS[2]) |
| static float | VecZDepthOrtho (const float pt[2], const float v1[3], const float v2[3], const float v3[3], float w[3]) |
| static float | VecZDepthPersp (const float pt[2], const float v1[4], const float v2[4], const float v3[4], float w[3]) |
| static int | project_paint_PickFace (const ProjPaintState *ps, const float pt[2], float w[3]) |
| static bool | project_paint_PickColor (const ProjPaintState *ps, const float pt[2], float *rgba_fp, uchar *rgba, const bool interp) |
| static int | project_paint_occlude_ptv (const float pt[3], const float v1[4], const float v2[4], const float v3[4], float w[3], const bool is_ortho) |
| static int | project_paint_occlude_ptv_clip (const float pt[3], const float v1[4], const float v2[4], const float v3[4], const float v1_3d[3], const float v2_3d[3], const float v3_3d[3], float w[3], const bool is_ortho, RegionView3D *rv3d) |
| static bool | project_bucket_point_occluded (const ProjPaintState *ps, LinkNode *bucketFace, const int orig_face, const float pixelScreenCo[4]) |
| static int | line_isect_y (const float p1[2], const float p2[2], const float y_level, float *x_isect) |
| static int | line_isect_x (const float p1[2], const float p2[2], const float x_level, float *y_isect) |
| static bool | cmp_uv (const float vec2a[2], const float vec2b[2]) |
| static bool | pixel_bounds_uv (const float uv_quad[4][2], const int ibuf_x, const int ibuf_y, rcti *r_bounds_px) |
| static bool | pixel_bounds_array (float(*uv)[2], const int ibuf_x, const int ibuf_y, int tot, rcti *r_bounds_px) |
| static void | project_face_winding_init (const ProjPaintState *ps, const int tri_index) |
| static bool | check_seam (const ProjPaintState *ps, const int orig_face, const int orig_i1_fidx, const int orig_i2_fidx, int *other_face, int *orig_fidx) |
| static VertSeam * | find_adjacent_seam (const ProjPaintState *ps, uint loop_index, uint vert_index, VertSeam **r_seam) |
| static float | compute_seam_normal (VertSeam *seam, VertSeam *adj, float r_no[2]) |
| static void | uv_image_outset (const ProjPaintState *ps, float(*orig_uv)[2], float(*puv)[2], uint tri_index, const int ibuf_x, const int ibuf_y) |
| static void | insert_seam_vert_array (const ProjPaintState *ps, MemArena *arena, const int tri_index, const int fidx1, const int ibuf_x, const int ibuf_y) |
| static void | project_face_seams_init (const ProjPaintState *ps, MemArena *arena, const int tri_index, const uint vert_index, bool init_all, const int ibuf_x, const int ibuf_y) |
| static void | screen_px_from_ortho (const float uv[2], const float v1co[3], const float v2co[3], const float v3co[3], const float uv1co[2], const float uv2co[2], const float uv3co[2], float pixelScreenCo[4], float w[3]) |
| static void | screen_px_from_persp (const float uv[2], const float v1co[4], const float v2co[4], const float v3co[4], const float uv1co[2], const float uv2co[2], const float uv3co[2], float pixelScreenCo[4], float w[3]) |
| static void | screen_px_to_vector_persp (int winx, int winy, const float projmat_inv[4][4], const float view_pos[3], const float co_px[2], float r_dir[3]) |
| static float | screen_px_line_point_factor_v2_persp (const ProjPaintState *ps, const float p[2], const float v1[3], const float v2[3]) |
| static void | project_face_pixel (const float *tri_uv[3], ImBuf *ibuf_other, const float w[3], uchar rgba_ub[4], float rgba_f[4]) |
| static float | project_paint_uvpixel_mask (const ProjPaintState *ps, const int tri_index, const float w[3]) |
| static int | project_paint_pixel_sizeof (const short brush_type) |
| static int | project_paint_undo_subtiles (const TileInfo *tinf, int tx, int ty) |
| static ProjPixel * | project_paint_uvpixel_init (const ProjPaintState *ps, MemArena *arena, const TileInfo *tinf, int x_px, int y_px, const float mask, const int tri_index, const float pixelScreenCo[4], const float world_spaceCo[3], const float w[3]) |
| static bool | line_clip_rect2f (const rctf *cliprect, const rctf *rect, const float l1[2], const float l2[2], float l1_clip[2], float l2_clip[2]) |
| static void | scale_tri (float insetCos[3][3], const float *origCos[3], const float inset) |
| static float | len_squared_v2v2_alt (const float v1[2], const float v2_1, const float v2_2) |
| static bool | project_bucket_isect_circle (const float cent[2], const float radius_squared, const rctf *bucket_bounds) |
| static void | rect_to_uvspace_ortho (const rctf *bucket_bounds, const float *v1coSS, const float *v2coSS, const float *v3coSS, const float *uv1co, const float *uv2co, const float *uv3co, float bucket_bounds_uv[4][2], const int flip) |
| static void | rect_to_uvspace_persp (const rctf *bucket_bounds, const float *v1coSS, const float *v2coSS, const float *v3coSS, const float *uv1co, const float *uv2co, const float *uv3co, float bucket_bounds_uv[4][2], const int flip) |
| static bool | IsectPT2Df_limit (const float pt[2], const float v1[2], const float v2[2], const float v3[2], const float limit) |
| static int | float_z_sort_flip (const void *p1, const void *p2) |
| static int | float_z_sort (const void *p1, const void *p2) |
| static bool | line_rect_clip (const rctf *rect, const float l1[4], const float l2[4], const float uv1[2], const float uv2[2], float uv[2], bool is_ortho) |
| static void | project_bucket_clip_face (const bool is_ortho, const bool is_flip_object, const rctf *cliprect, const rctf *bucket_bounds, const float *v1coSS, const float *v2coSS, const float *v3coSS, const float *uv1co, const float *uv2co, const float *uv3co, float bucket_bounds_uv[8][2], int *tot, bool cull) |
| static bool | IsectPoly2Df (const float pt[2], const float uv[][2], const int tot) |
| static bool | IsectPoly2Df_twoside (const float pt[2], const float uv[][2], const int tot) |
| static void | project_paint_face_init (const ProjPaintState *ps, const int thread_index, const int bucket_index, const int tri_index, const int image_index, const rctf *clip_rect, const rctf *bucket_bounds, ImBuf *ibuf, ImBuf **tmpibuf) |
| static void | project_paint_bucket_bounds (const ProjPaintState *ps, const float min[2], const float max[2], int bucketMin[2], int bucketMax[2]) |
| static void | project_bucket_bounds (const ProjPaintState *ps, const int bucket_x, const int bucket_y, rctf *r_bucket_bounds) |
| static void | project_bucket_init (const ProjPaintState *ps, const int thread_index, const int bucket_index, const rctf *clip_rect, const rctf *bucket_bounds) |
| static bool | project_bucket_face_isect (ProjPaintState *ps, int bucket_x, int bucket_y, const int3 &tri) |
| static void | project_paint_delayed_face_init (ProjPaintState *ps, const int3 &corner_tri, const int tri_index) |
| static void | proj_paint_state_viewport_init (ProjPaintState *ps, const char symmetry_flag) |
| static void | proj_paint_state_screen_coords_init (ProjPaintState *ps, const int diameter) |
| static void | proj_paint_state_cavity_init (ProjPaintState *ps) |
| static void | proj_paint_state_seam_bleed_init (ProjPaintState *ps) |
| static void | proj_paint_state_thread_init (ProjPaintState *ps, const bool reset_threads) |
| static void | proj_paint_state_vert_flags_init (ProjPaintState *ps) |
| static void | project_paint_bleed_add_face_user (const ProjPaintState *ps, MemArena *arena, const int3 &corner_tri, const int tri_index) |
| static bool | proj_paint_state_mesh_eval_init (const bContext *C, ProjPaintState *ps) |
| static void | proj_paint_layer_clone_init (ProjPaintState *ps, ProjPaintLayerClone *layer_clone) |
| static bool | project_paint_clone_face_skip (ProjPaintState *ps, ProjPaintLayerClone *lc, const TexPaintSlot *slot, const int tri_index) |
| static void | proj_paint_face_lookup_init (const ProjPaintState *ps, ProjPaintFaceLookup *face_lookup) |
| static bool | project_paint_check_face_paintable (const ProjPaintState *ps, const ProjPaintFaceLookup *face_lookup, const int tri_i) |
| static void | proj_paint_face_coSS_init (const ProjPaintState *ps, const int3 &corner_tri, ProjPaintFaceCoSS *coSS) |
| static bool | project_paint_flt_max_cull (const ProjPaintState *ps, const ProjPaintFaceCoSS *coSS) |
| static bool | project_paint_winclip (const ProjPaintState *ps, const ProjPaintFaceCoSS *coSS) |
| static void | project_paint_build_proj_ima (ProjPaintState *ps, MemArena *arena, ListBase *used_images) |
| static void | project_paint_prepare_all_faces (ProjPaintState *ps, MemArena *arena, const ProjPaintFaceLookup *face_lookup, ProjPaintLayerClone *layer_clone, const float(*mloopuv_base)[2], const bool is_multi_view) |
| static void | project_paint_begin (const bContext *C, ProjPaintState *ps, const bool is_multi_view, const char symmetry_flag) |
| static void | paint_proj_begin_clone (ProjPaintState *ps, const float mouse[2]) |
| static void | project_paint_end (ProjPaintState *ps) |
| static void | partial_redraw_single_init (ImagePaintPartialRedraw *pr) |
| static bool | partial_redraw_array_merge (ImagePaintPartialRedraw *pr, ImagePaintPartialRedraw *pr_other, int tot) |
| static bool | project_image_refresh_tagged (ProjPaintState *ps) |
| static bool | project_bucket_iter_init (ProjPaintState *ps, const float mval_f[2]) |
| static bool | project_bucket_iter_next (ProjPaintState *ps, int *bucket_index, rctf *bucket_bounds, const float mval[2]) |
| static void | do_projectpaint_clone (ProjPaintState *ps, ProjPixel *projPixel, float mask) |
| static void | do_projectpaint_clone_f (ProjPaintState *ps, ProjPixel *projPixel, float mask) |
| static void | do_projectpaint_smear (ProjPaintState *ps, ProjPixel *projPixel, float mask, MemArena *smearArena, LinkNode **smearPixels, const float co[2]) |
| static void | do_projectpaint_smear_f (ProjPaintState *ps, ProjPixel *projPixel, float mask, MemArena *smearArena, LinkNode **smearPixels_f, const float co[2]) |
| static void | do_projectpaint_soften_f (ProjPaintState *ps, ProjPixel *projPixel, float mask, MemArena *softenArena, LinkNode **softenPixels) |
| static void | do_projectpaint_soften (ProjPaintState *ps, ProjPixel *projPixel, float mask, MemArena *softenArena, LinkNode **softenPixels) |
| static void | do_projectpaint_draw (ProjPaintState *ps, ProjPixel *projPixel, const float texrgb[3], float mask, float dither, float u, float v) |
| static void | do_projectpaint_draw_f (ProjPaintState *ps, ProjPixel *projPixel, const float texrgb[3], float mask) |
| static void | do_projectpaint_mask (ProjPaintState *ps, ProjPixel *projPixel, float mask) |
| static void | do_projectpaint_mask_f (ProjPaintState *ps, ProjPixel *projPixel, float mask) |
| static void | image_paint_partial_redraw_expand (ImagePaintPartialRedraw *cell, const ProjPixel *projPixel) |
| static void | copy_original_alpha_channel (ProjPixel *pixel, bool is_floatbuf) |
| static void | do_projectpaint_thread (TaskPool *__restrict, void *ph_v) |
| static bool | project_paint_op (void *state, const float lastpos[2], const float pos[2]) |
| static void | paint_proj_stroke_ps (const bContext *, void *ps_handle_p, const float prev_pos[2], const float pos[2], const bool eraser, float pressure, float distance, float size, ProjPaintState *ps) |
| void | paint_proj_stroke (const bContext *C, void *ps_handle_p, const float prev_pos[2], const float pos[2], const bool eraser, float pressure, float distance, float size) |
| static void | project_state_init (bContext *C, Object *ob, ProjPaintState *ps, int mode) |
| void * | paint_proj_new_stroke (bContext *C, Object *ob, const float mouse[2], int mode) |
| void | paint_proj_redraw (const bContext *C, void *ps_handle_p, bool final) |
| void | paint_proj_stroke_done (void *ps_handle_p) |
| static int | texture_paint_camera_project_exec (bContext *C, wmOperator *op) |
| void | PAINT_OT_project_image (wmOperatorType *ot) |
| static bool | texture_paint_image_from_view_poll (bContext *C) |
| static int | texture_paint_image_from_view_exec (bContext *C, wmOperator *op) |
| void | PAINT_OT_image_from_view (wmOperatorType *ot) |
| void | ED_paint_data_warning (ReportList *reports, bool has_uvs, bool has_mat, bool has_tex, bool has_stencil) |
| bool | ED_paint_proj_mesh_data_check (Scene &scene, Object &ob, bool *r_has_uvs, bool *r_has_mat, bool *r_has_tex, bool *r_has_stencil) |
| static Material * | get_or_create_current_material (bContext *C, Object *ob) |
| static Image * | proj_paint_image_create (wmOperator *op, Main *bmain, bool is_data) |
| static const char * | proj_paint_color_attribute_create (wmOperator *op, Object &ob) |
| static void | default_paint_slot_color_get (int layer_type, Material *ma, float color[4]) |
| static bool | proj_paint_add_slot (bContext *C, wmOperator *op) |
| static int | get_texture_layer_type (wmOperator *op, const char *prop_name) |
| static int | texture_paint_add_texture_paint_slot_exec (bContext *C, wmOperator *op) |
| static void | get_default_texture_layer_name_for_object (Object *ob, int texture_type, char *dst, int dst_maxncpy) |
| static int | texture_paint_add_texture_paint_slot_invoke (bContext *C, wmOperator *op, const wmEvent *) |
| static void | texture_paint_add_texture_paint_slot_ui (bContext *C, wmOperator *op) |
| void | PAINT_OT_add_texture_paint_slot (wmOperatorType *ot) |
| static int | add_simple_uvs_exec (bContext *C, wmOperator *) |
| static bool | add_simple_uvs_poll (bContext *C) |
| void | PAINT_OT_add_simple_uvs (wmOperatorType *ot) |
Variables | |
| static const EnumPropertyItem | layer_type_items [] |
Functions to paint images in 2D and 3D.
Definition in file paint_image_proj.cc.
Definition at line 6894 of file paint_image_proj.cc.
Referenced by PAINT_OT_add_texture_paint_slot().
| #define ISECT_1 (1) |
Definition at line 2399 of file paint_image_proj.cc.
Referenced by project_bucket_clip_face().
| #define ISECT_2 (1 << 1) |
Definition at line 2400 of file paint_image_proj.cc.
Referenced by project_bucket_clip_face().
| #define ISECT_3 (1 << 2) |
Definition at line 2401 of file paint_image_proj.cc.
Referenced by project_bucket_clip_face().
| #define ISECT_4 (1 << 3) |
Definition at line 2402 of file paint_image_proj.cc.
Referenced by project_bucket_clip_face().
| #define ISECT_ALL3 ((1 << 3) - 1) |
Definition at line 2403 of file paint_image_proj.cc.
Referenced by project_bucket_clip_face().
| #define ISECT_ALL4 ((1 << 4) - 1) |
Definition at line 2404 of file paint_image_proj.cc.
Referenced by project_bucket_clip_face().
| #define ISECT_TRUE 1 |
Definition at line 925 of file paint_image_proj.cc.
Referenced by line_isect_x(), and line_isect_y().
| #define ISECT_TRUE_P1 2 |
Definition at line 926 of file paint_image_proj.cc.
Referenced by line_isect_x(), and line_isect_y().
| #define ISECT_TRUE_P2 3 |
Definition at line 927 of file paint_image_proj.cc.
Referenced by line_isect_x(), and line_isect_y().
| #define PROJ_BOUNDBOX_DIV 8 |
Definition at line 139 of file paint_image_proj.cc.
Referenced by project_paint_uvpixel_init().
| #define PROJ_BOUNDBOX_SQUARED (PROJ_BOUNDBOX_DIV * PROJ_BOUNDBOX_DIV) |
Definition at line 140 of file paint_image_proj.cc.
Referenced by partial_redraw_array_init(), project_image_refresh_tagged(), project_paint_build_proj_ima(), and project_paint_op().
| #define PROJ_BUCKET_BRUSH_DIV 4 |
Definition at line 134 of file paint_image_proj.cc.
Referenced by project_paint_begin().
| #define PROJ_BUCKET_INIT (1 << 0) |
Definition at line 188 of file paint_image_proj.cc.
Referenced by project_bucket_init().
| #define PROJ_BUCKET_NULL 0 |
Definition at line 187 of file paint_image_proj.cc.
Referenced by do_projectpaint_thread().
| #define PROJ_BUCKET_RECT_MAX 256 |
Definition at line 137 of file paint_image_proj.cc.
Referenced by project_paint_begin().
| #define PROJ_BUCKET_RECT_MIN 4 |
Definition at line 136 of file paint_image_proj.cc.
Referenced by project_paint_begin().
| #define PROJ_DEBUG_WINCLIP 1 |
Definition at line 145 of file paint_image_proj.cc.
| #define PROJ_FACE_DEGENERATE (1 << 12) |
Definition at line 166 of file paint_image_proj.cc.
Referenced by project_paint_bleed_add_face_user(), and project_paint_face_init().
| #define PROJ_FACE_NOSEAM0 (1 << 4) |
Definition at line 157 of file paint_image_proj.cc.
Referenced by project_face_seams_init().
| #define PROJ_FACE_NOSEAM1 (1 << 5) |
Definition at line 158 of file paint_image_proj.cc.
| #define PROJ_FACE_NOSEAM2 (1 << 6) |
Definition at line 159 of file paint_image_proj.cc.
| #define PROJ_FACE_SCALE_SEAM 0.99f |
Definition at line 175 of file paint_image_proj.cc.
Referenced by project_paint_face_init().
| #define PROJ_FACE_SEAM0 (1 << 0) |
Definition at line 153 of file paint_image_proj.cc.
Referenced by project_face_seams_init(), project_paint_face_init(), and uv_image_outset().
| #define PROJ_FACE_SEAM1 (1 << 1) |
Definition at line 154 of file paint_image_proj.cc.
Referenced by project_paint_face_init().
| #define PROJ_FACE_SEAM2 (1 << 2) |
Definition at line 155 of file paint_image_proj.cc.
Referenced by project_paint_face_init().
| #define PROJ_FACE_SEAM_INIT0 (1 << 8) |
Definition at line 162 of file paint_image_proj.cc.
Referenced by project_face_seams_init(), and project_paint_face_init().
| #define PROJ_FACE_SEAM_INIT1 (1 << 9) |
Definition at line 163 of file paint_image_proj.cc.
Referenced by project_paint_face_init().
| #define PROJ_FACE_SEAM_INIT2 (1 << 10) |
Definition at line 164 of file paint_image_proj.cc.
Referenced by project_paint_face_init().
| #define PROJ_FACE_WINDING_CW 2 |
Definition at line 170 of file paint_image_proj.cc.
Referenced by check_seam(), insert_seam_vert_array(), and project_face_winding_init().
| #define PROJ_FACE_WINDING_INIT 1 |
Definition at line 169 of file paint_image_proj.cc.
Referenced by check_seam(), insert_seam_vert_array(), project_face_seams_init(), and project_face_winding_init().
| #define PROJ_GEOM_TOLERANCE 0.00075f |
Definition at line 192 of file paint_image_proj.cc.
Referenced by cmp_uv(), and project_bucket_clip_face().
| #define PROJ_PAINT_STATE_SHARED_CLEAR | ( | ps | ) | MEMSET_STRUCT_AFTER(ps, 0, is_shared_user) |
Definition at line 404 of file paint_image_proj.cc.
Referenced by paint_proj_stroke_done().
| #define PROJ_PAINT_STATE_SHARED_MEMCPY | ( | ps_dst, | |
| ps_src ) MEMCPY_STRUCT_AFTER(ps_dst, ps_src, is_shared_user) |
This data is owned by ProjStrokeHandle.ps_views[0], all other views re-use the data.
Definition at line 401 of file paint_image_proj.cc.
Referenced by paint_proj_new_stroke().
| #define PROJ_PIXEL_TOLERANCE 0.01f |
Definition at line 193 of file paint_image_proj.cc.
Referenced by do_projectpaint_thread(), line_clip_rect2f(), project_bucket_clip_face(), and project_paint_face_init().
| #define PROJ_SRC_IMAGE_CAM 2 |
Definition at line 179 of file paint_image_proj.cc.
Referenced by proj_paint_state_viewport_init(), and texture_paint_camera_project_exec().
| #define PROJ_SRC_IMAGE_VIEW 3 |
Definition at line 180 of file paint_image_proj.cc.
Referenced by proj_paint_state_viewport_init(), and texture_paint_camera_project_exec().
| #define PROJ_SRC_VIEW 1 |
Definition at line 178 of file paint_image_proj.cc.
Referenced by do_projectpaint_thread(), paint_proj_new_stroke(), proj_paint_state_screen_coords_init(), proj_paint_state_viewport_init(), project_bucket_iter_init(), project_bucket_iter_next(), project_paint_begin(), and project_paint_op().
| #define PROJ_SRC_VIEW_FILL 4 |
Definition at line 181 of file paint_image_proj.cc.
Referenced by do_projectpaint_thread(), paint_proj_new_stroke(), proj_paint_state_screen_coords_init(), proj_paint_state_viewport_init(), project_paint_op(), and project_paint_winclip().
| #define PROJ_VERT_CULL 1 |
Definition at line 196 of file paint_image_proj.cc.
Referenced by proj_paint_state_vert_flags_init(), and project_paint_prepare_all_faces().
| #define PROJ_VIEW_DATA_ID "view_data" |
Definition at line 183 of file paint_image_proj.cc.
Referenced by proj_paint_state_viewport_init(), texture_paint_camera_project_exec(), and texture_paint_image_from_view_exec().
| #define PROJ_VIEW_DATA_SIZE (4 * 4 + 4 * 4 + 3) |
Definition at line 185 of file paint_image_proj.cc.
Referenced by texture_paint_camera_project_exec().
| #define PS_CORNER_TRI_AS_UV_3 | ( | uvlayer, | |
| face_i, | |||
| tri ) uvlayer[face_i][tri[0]], uvlayer[face_i][tri[1]], uvlayer[face_i][tri[2]], |
Definition at line 533 of file paint_image_proj.cc.
Referenced by check_seam(), insert_seam_vert_array(), project_bucket_init(), project_face_winding_init(), project_paint_bleed_add_face_user(), project_paint_face_init(), and project_paint_uvpixel_init().
| #define PS_CORNER_TRI_AS_VERT_INDEX_3 | ( | ps, | |
| tri ) ps->corner_verts_eval[tri[0]], ps->corner_verts_eval[tri[1]], ps->corner_verts_eval[tri[2]], |
Definition at line 530 of file paint_image_proj.cc.
Referenced by check_seam(), proj_paint_face_coSS_init(), project_bucket_face_isect(), project_paint_bleed_add_face_user(), project_paint_delayed_face_init(), project_paint_face_init(), project_paint_op(), and project_paint_uvpixel_mask().
| #define PS_CORNER_TRI_ASSIGN_UV_3 | ( | uv_tri, | |
| uvlayer, | |||
| face_i, | |||
| tri ) |
Definition at line 536 of file paint_image_proj.cc.
Referenced by project_paint_PickColor().
| #define TILE_PENDING POINTER_FROM_INT(-1) |
Definition at line 199 of file paint_image_proj.cc.
Referenced by project_paint_undo_subtiles(), and project_paint_uvpixel_init().
| anonymous enum |
| Enumerator | |
|---|---|
| LAYER_BASE_COLOR | |
| LAYER_SPECULAR | |
| LAYER_ROUGHNESS | |
| LAYER_METALLIC | |
| LAYER_NORMAL | |
| LAYER_BUMP | |
| LAYER_DISPLACEMENT | |
Definition at line 6488 of file paint_image_proj.cc.
|
static |
Definition at line 6981 of file paint_image_proj.cc.
References CTX_data_active_object(), CTX_data_main(), CTX_data_scene(), Object::data, DEG_id_tag_update(), ED_paint_proj_mesh_data_check(), ED_uvedit_add_simple_uvs(), NC_GEOM, NC_SCENE, ND_DATA, ND_TOOLSETTINGS, OPERATOR_FINISHED, and WM_event_add_notifier().
Referenced by PAINT_OT_add_simple_uvs().
|
static |
Definition at line 6998 of file paint_image_proj.cc.
References CTX_data_active_object(), Object::mode, OB_MESH, OB_MODE_TEXTURE_PAINT, and Object::type.
Referenced by PAINT_OT_add_simple_uvs().
|
static |
Definition at line 1116 of file paint_image_proj.cc.
References BKE_MESH_TESSTRI_VINDEX_ORDER, BLI_assert, cmp_uv(), ProjPaintState::corner_tri_faces_eval, ProjPaintState::corner_tris_eval, ProjPaintState::corner_verts_eval, ProjPaintState::faceWindingFlags, node, POINTER_AS_INT, ProjPaintState::poly_to_loop_uv, PROJ_FACE_WINDING_CW, PROJ_FACE_WINDING_INIT, project_face_winding_init(), project_paint_face_paint_image(), project_paint_face_paint_tile(), PS_CORNER_TRI_AS_UV_3, PS_CORNER_TRI_AS_VERT_INDEX_3, tile, and ProjPaintState::vertFaces.
Referenced by project_face_seams_init().
Definition at line 1004 of file paint_image_proj.cc.
References fabsf, fmodf, PROJ_GEOM_TOLERANCE, and true.
Referenced by check_seam(), and find_adjacent_seam().
Definition at line 1242 of file paint_image_proj.cc.
References VertSeam::angle, cosf, M_PI, and sinf.
Referenced by uv_image_outset().
|
static |
Definition at line 5163 of file paint_image_proj.cc.
References premul_to_straight_v4_v4(), and straight_to_premul_v4_v4().
Referenced by do_projectpaint_thread().
Get a default color for the paint slot layer from a material's Principled BSDF.
| layer_type | The layer type of the paint slot |
| ma | The material to attempt using as the default color source. If this fails or ma is null, a default Principled BSDF is used instead. |
Definition at line 6599 of file paint_image_proj.cc.
References BLI_assert_unreachable, copy_v3_fl(), copy_v3_v3(), bNodeSocket::default_value, blender::bke::bNodeTreeType::idname, LAYER_BASE_COLOR, LAYER_BUMP, LAYER_DISPLACEMENT, LAYER_METALLIC, LAYER_NORMAL, LAYER_ROUGHNESS, LAYER_SPECULAR, layer_type_items, MEM_freeN(), blender::bke::node_add_static_node(), blender::bke::node_find_socket(), blender::bke::node_tree_add_tree(), blender::bke::node_tree_free_tree(), Material::nodetree, ntreeType_Shader, rgba_float_args_set(), SOCK_FLOAT, SOCK_IN, SOCK_RGBA, SOCK_VECTOR, bNodeSocket::type, bNodeSocketValueFloat::value, and bNodeSocketValueRGBA::value.
Referenced by texture_paint_add_texture_paint_slot_invoke().
|
static |
Definition at line 4844 of file paint_image_proj.cc.
References ProjPaintState::blend, PixelPointer::ch_pt, ProjPaintState::do_masking, IMB_blend_color_byte(), ProjPixel::origColor, and ProjPixel::pixel.
Referenced by do_projectpaint_thread().
|
static |
Definition at line 4869 of file paint_image_proj.cc.
References ProjPaintState::blend, ProjPaintState::do_masking, PixelPointer::f_pt, IMB_blend_color_float(), mul_v4_v4fl(), ProjPixel::origColor, and ProjPixel::pixel.
Referenced by do_projectpaint_thread().
|
static |
Definition at line 5058 of file paint_image_proj.cc.
References ProjPaintState::blend, PixelPointer::ch_pt, copy_v3_v3(), ProjPaintState::do_masking, f_to_char(), float_to_byte_dither_v3(), IMB_blend_color_byte(), ProjPaintState::is_texbrush, linearrgb_to_srgb_v3_v3(), mul_v3_v3v3(), ProjPixel::origColor, ProjPaintState::paint_color, ProjPaintState::paint_color_linear, ProjPixel::pixel, unit_float_to_uchar_clamp_v3, and v.
Referenced by do_projectpaint_thread().
|
static |
Definition at line 5096 of file paint_image_proj.cc.
References ProjPaintState::blend, copy_v3_v3(), ProjPaintState::do_masking, PixelPointer::f_pt, IMB_blend_color_float(), ProjPaintState::is_texbrush, mask(), mul_v3_fl(), mul_v3_v3(), ProjPixel::origColor, ProjPaintState::paint_color_linear, and ProjPixel::pixel.
Referenced by do_projectpaint_thread().
|
static |
Definition at line 5122 of file paint_image_proj.cc.
References ProjPaintState::blend, PixelPointer::ch_pt, ProjPaintState::do_masking, f_to_char(), IMB_blend_color_byte(), ProjPixel::origColor, ProjPixel::pixel, and ProjPaintState::stencil_value.
Referenced by do_projectpaint_thread().
|
static |
Definition at line 5138 of file paint_image_proj.cc.
References ProjPaintState::blend, ProjPaintState::do_masking, PixelPointer::f_pt, IMB_blend_color_float(), mask(), ProjPixel::origColor, ProjPixel::pixel, and ProjPaintState::stencil_value.
Referenced by do_projectpaint_thread().
|
static |
Definition at line 4894 of file paint_image_proj.cc.
References blend_color_interpolate_byte(), BLI_linklist_prepend_arena(), PixelPointer::ch_pt, ProjPixel::pixel, and project_paint_PickColor().
Referenced by do_projectpaint_thread().
|
static |
Definition at line 4912 of file paint_image_proj.cc.
References blend_color_interpolate_float(), BLI_linklist_prepend_arena(), PixelPointer::f_pt, ProjPixel::pixel, and project_paint_PickColor().
Referenced by do_projectpaint_thread().
|
static |
Definition at line 4990 of file paint_image_proj.cc.
References add_v2_v2(), add_v4_v4(), blend_color_add_float(), blend_color_interpolate_byte(), BLI_linklist_prepend_arena(), ProjPaintState::blurkernel, ProjPaintState::brush, BRUSH_STROKE_INVERT, PixelStore::ch, PixelPointer::ch_pt, fabsf, IMB_colormanagement_get_luminance(), LIKELY, mask(), ProjPaintState::mode, mul_v4_fl(), ProjPixel::newColor, ProjPixel::pixel, premul_float_to_straight_uchar(), ProjPixel::projCoSS, project_paint_PickColor(), Brush::sharp_threshold, BlurKernel::side, straight_uchar_to_premul_float(), sub_v3_v3v3(), BlurKernel::wdata, and zero_v4().
Referenced by do_projectpaint_thread().
|
static |
Definition at line 4930 of file paint_image_proj.cc.
References add_v2_v2(), add_v4_v4(), blend_color_add_float(), blend_color_interpolate_float(), BLI_linklist_prepend_arena(), ProjPaintState::blurkernel, ProjPaintState::brush, BRUSH_STROKE_INVERT, PixelStore::f, PixelPointer::f_pt, fabsf, IMB_colormanagement_get_luminance(), LIKELY, mask(), ProjPaintState::mode, mul_v4_fl(), ProjPixel::newColor, ProjPixel::pixel, ProjPixel::projCoSS, project_paint_PickColor(), Brush::sharp_threshold, BlurKernel::side, sub_v3_v3v3(), BlurKernel::wdata, and zero_v4().
Referenced by do_projectpaint_thread().
|
static |
Definition at line 5180 of file paint_image_proj.cc.
References ProjPixel::bb_cell_index, BKE_brush_alpha_get(), BKE_brush_color_texture_get(), BKE_brush_curve_strength_clamped(), BKE_brush_sample_masktex(), BKE_brush_sample_tex_3d(), BKE_colorband_evaluate(), Brush::blend, ProjPaintState::blend, blend_color_mix_byte(), blend_color_mix_float(), BLI_assert, BLI_memarena_free(), BLI_memarena_new(), ProjPaintState::brush, BRUSH_ACCUMULATE, BRUSH_GRADIENT_LINEAR, BRUSH_GRADIENT_RADIAL, BRUSH_LOCK_ALPHA, MTex::brush_map_mode, ProjPaintState::brush_size, ProjPaintState::brush_type, BRUSH_USE_GRADIENT, ProjPaintState::bucketFlags, ProjPaintState::bucketRect, ImBuf::byte_buffer, PixelStore::ch, PixelPointer::ch_pt, CLAMP, copy_original_alpha_channel(), copy_v2_v2(), copy_v3_v3(), copy_v4_v4(), ImBufByteBuffer::data, ImBufFloatBuffer::data, ProjPaintState::dither, ProjPaintState::do_masking, do_projectpaint_clone(), do_projectpaint_clone_f(), do_projectpaint_draw(), do_projectpaint_draw_f(), do_projectpaint_mask(), do_projectpaint_mask_f(), do_projectpaint_smear(), do_projectpaint_smear_f(), do_projectpaint_soften(), do_projectpaint_soften_f(), dot_v2v2(), ELEM, PixelStore::f, PixelPointer::f_pt, false, Brush::flag, float, ImBuf::float_buffer, float_to_byte_dither_v3(), Brush::gradient, Brush::gradient_fill_mode, ProjPaintImage::ibuf, ProjPixel::image_index, IMAGE_PAINT_BRUSH_TYPE_CLONE, IMAGE_PAINT_BRUSH_TYPE_MASK, IMAGE_PAINT_BRUSH_TYPE_SMEAR, IMAGE_PAINT_BRUSH_TYPE_SOFTEN, image_paint_partial_redraw_expand(), IMB_BLEND_ADD_ALPHA, IMB_blend_color_byte(), IMB_blend_color_float(), IMB_BLEND_ERASE_ALPHA, blender::imbuf::interpolate_cubic_bspline_byte(), blender::imbuf::interpolate_cubic_bspline_fl(), ProjPaintState::is_maskbrush, ProjPaintState::is_texbrush, len_squared_v2(), len_squared_v2v2(), len_v2(), linearrgb_to_srgb_v3_v3(), mask(), ProjPixel::mask, ProjPixel::mask_accum, MEM_SIZE_OPTIMAL, min_ff(), MTEX_MAP_MODE_3D, mul_v3_fl(), mul_v4_v4fl(), ProjPixel::newColor, LinkNode::next, node, OB_MODE_TEXTURE_PAINT, ProjPixel::origColor, ProjPaintState::paint_color, ProjPaintState::paint_color_linear, ProjPaintImage::partRedrawRect, ProjPixel::pixel, pos, PROJ_BUCKET_NULL, PROJ_PIXEL_TOLERANCE, PROJ_SRC_VIEW, PROJ_SRC_VIEW_FILL, ProjPixel::projCoSS, project_bucket_init(), project_bucket_iter_next(), ProjPaintState::reproject_ibuf, rgb_float_to_uchar(), ProjPaintState::scene, ProjPaintState::source, sqrtf, sub_v2_v2v2(), ProjPaintImage::touch, PixelStore::uint_, PixelPointer::uint_pt, unit_float_to_uchar_clamp, unit_float_to_uchar_clamp_v3, ProjPixel::valid, ProjPixel::worldCoSS, ProjPixel::x_px, rctf::xmax, rctf::xmin, ProjPixel::y_px, rctf::ymax, rctf::ymin, and zero_v3().
Referenced by project_paint_op().
| void ED_paint_data_warning | ( | ReportList * | reports, |
| bool | has_uvs, | ||
| bool | has_mat, | ||
| bool | has_tex, | ||
| bool | has_stencil ) |
Definition at line 6374 of file paint_image_proj.cc.
References BKE_reportf(), RPT_, and RPT_WARNING.
Referenced by texture_paint_camera_project_exec(), and blender::ed::sculpt_paint::image::ops::paint::texture_paint_init().
| bool ED_paint_proj_mesh_data_check | ( | Scene & | scene, |
| Object & | ob, | ||
| bool * | r_has_uvs, | ||
| bool * | r_has_mat, | ||
| bool * | r_has_tex, | ||
| bool * | r_has_stencil ) |
Make sure that active object has a material, and assign UVs and image layers if they do not exist.
Definition at line 6386 of file paint_image_proj.cc.
References BKE_mesh_from_object(), BKE_object_material_get(), BKE_paint_brush(), BKE_texpaint_slot_refresh_cache(), BLI_assert, ImagePaintSettings::canvas, CD_PROP_FLOAT2, CustomData_number_of_layers(), ImagePaintSettings::flag, ID_IS_EDITABLE, ID_IS_OVERRIDE_LIBRARY, TexPaintSlot::ima, Brush::image_brush_type, IMAGE_PAINT_BRUSH_TYPE_MASK, IMAGEPAINT_MISSING_MATERIAL, IMAGEPAINT_MISSING_STENCIL, IMAGEPAINT_MISSING_TEX, IMAGEPAINT_MISSING_UVS, IMAGEPAINT_MODE_IMAGE, IMAGEPAINT_MODE_MATERIAL, IMAGEPAINT_PROJECT_LAYER_STENCIL, ImagePaintSettings::missing_data, ImagePaintSettings::mode, OB_MESH, ImagePaintSettings::paint, Material::paint_active_slot, ImagePaintSettings::stencil, Material::texpaintslot, Object::totcol, and Object::type.
Referenced by add_simple_uvs_exec(), ED_editors_init_for_undo(), ED_object_texture_paint_mode_enter_ex(), material_slot_add_exec(), material_slot_remove_exec(), material_slot_remove_unused_exec(), mesh_uv_texture_add_exec(), mesh_uv_texture_remove_exec(), proj_paint_add_slot(), scene_changed(), texture_paint_camera_project_exec(), and blender::ed::sculpt_paint::image::ops::paint::texture_paint_init().
| BLI_INLINE uchar f_to_char | ( | const float | val | ) |
Definition at line 121 of file paint_image_proj.cc.
References unit_float_to_uchar_clamp.
Referenced by do_projectpaint_draw(), and do_projectpaint_mask().
|
static |
Definition at line 1199 of file paint_image_proj.cc.
References BLI_assert, cmp_uv(), ListBase::first, LISTBASE_CIRCULAR_BACKWARD_BEGIN, LISTBASE_CIRCULAR_BACKWARD_END, LISTBASE_CIRCULAR_FORWARD_BEGIN, LISTBASE_CIRCULAR_FORWARD_END, VertSeam::next, VertSeam::normal_cw, VertSeam::uv, and ProjPaintState::vertSeams.
Referenced by uv_image_outset().
|
static |
Definition at line 2423 of file paint_image_proj.cc.
Referenced by project_bucket_clip_face().
|
static |
Clip the face by a bucket and set the uv-space bucket_bounds_uv so we have the clipped UVs to do pixel intersection tests with
Definition at line 2418 of file paint_image_proj.cc.
Referenced by project_bucket_clip_face().
|
static |
Definition at line 6822 of file paint_image_proj.cc.
References Object::actcol, BKE_object_material_get(), BLI_snprintf(), DATA_, Material::id, Object::id, layer_type_items, and ID::name.
Referenced by texture_paint_add_texture_paint_slot_invoke().
Definition at line 6509 of file paint_image_proj.cc.
References Object::actcol, BKE_MAT_ASSIGN_USERPREF, BKE_material_add(), BKE_object_material_assign(), BKE_object_material_get(), and CTX_data_main().
Referenced by proj_paint_add_slot().
|
static |
Definition at line 6806 of file paint_image_proj.cc.
References BLI_assert, layer_type_items, wmOperator::ptr, RNA_enum_from_value(), and RNA_enum_get().
Referenced by texture_paint_add_texture_paint_slot_invoke().
|
static |
Definition at line 5154 of file paint_image_proj.cc.
References BLI_rcti_do_minmax_rcti(), BLI_rcti_init(), ImagePaintPartialRedraw::dirty_region, ProjPixel::x_px, and ProjPixel::y_px.
Referenced by do_projectpaint_thread().
|
static |
Definition at line 1366 of file paint_image_proj.cc.
References VertSeam::angle, atan2f, BLI_assert, BLI_insertlinkbefore(), BLI_memarena_alloc(), copy_v2_v2(), ProjPaintState::corner_tri_faces_eval, ProjPaintState::corner_tris_eval, ProjPaintState::corner_verts_eval, ProjPaintState::faceWindingFlags, VertSeam::loop, M_PI, VertSeam::next, VertSeam::normal_cw, ProjPaintState::poly_to_loop_uv, VertSeam::prev, PROJ_FACE_WINDING_CW, PROJ_FACE_WINDING_INIT, PS_CORNER_TRI_AS_UV_3, sub_v2_v2v2(), VertSeam::tri, VertSeam::uv, and ProjPaintState::vertSeams.
Referenced by project_face_seams_init().
Definition at line 2932 of file paint_image_proj.cc.
References line_point_side_v2().
Referenced by project_paint_face_init().
Definition at line 2947 of file paint_image_proj.cc.
References line_point_side_v2().
Referenced by project_paint_face_init().
|
static |
Definition at line 2407 of file paint_image_proj.cc.
References area_tri_v2(), and v2.
Referenced by project_bucket_clip_face().
Definition at line 2227 of file paint_image_proj.cc.
Referenced by project_bucket_isect_circle().
|
static |
Definition at line 2034 of file paint_image_proj.cc.
References BLI_rctf_isect_pt_v(), CLAMP, copy_v2_v2(), fabsf, line_isect_x(), line_isect_y(), PROJ_PIXEL_TOLERANCE, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_bucket_clip_face(), and project_paint_face_init().
|
static |
Definition at line 964 of file paint_image_proj.cc.
References fabsf, ISECT_TRUE, ISECT_TRUE_P1, and ISECT_TRUE_P2.
Referenced by line_clip_rect2f().
|
static |
yuck, horizontal line, we can't do much here.
Definition at line 928 of file paint_image_proj.cc.
References fabsf, ISECT_TRUE, ISECT_TRUE_P1, and ISECT_TRUE_P2.
Referenced by line_clip_rect2f().
|
static |
Definition at line 2429 of file paint_image_proj.cc.
References FLT_MAX, min, min_ff(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_bucket_clip_face().
| void PAINT_OT_add_simple_uvs | ( | wmOperatorType * | ot | ) |
Definition at line 7008 of file paint_image_proj.cc.
References add_simple_uvs_exec(), add_simple_uvs_poll(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by ED_operatortypes_paint().
| void PAINT_OT_add_texture_paint_slot | ( | wmOperatorType * | ot | ) |
Definition at line 6896 of file paint_image_proj.cc.
References CD_PROP_COLOR, wmOperatorType::description, ED_operator_object_active_editable_mesh(), wmOperatorType::exec, wmOperatorType::flag, FLT_MAX, wmOperatorType::idname, IMA_DEF_NAME, IMA_GENTYPE_BLANK, wmOperatorType::invoke, layer_type_items, MAX_NAME, wmOperatorType::name, OPTYPE_UNDO, ot, PAINT_CANVAS_SOURCE_COLOR_ATTRIBUTE, PAINT_CANVAS_SOURCE_IMAGE, wmOperatorType::poll, PROP_COLOR_GAMMA, PROP_HIDDEN, PROP_PIXEL, PROP_SKIP_SAVE, RNA_def_boolean(), RNA_def_enum(), RNA_def_float_color(), RNA_def_int(), RNA_def_property_flag(), RNA_def_property_float_array_default(), RNA_def_property_subtype(), RNA_def_string(), rna_enum_color_attribute_domain_items, rna_enum_color_attribute_type_items, rna_enum_image_generated_type_items, wmOperatorType::srna, texture_paint_add_texture_paint_slot_exec(), texture_paint_add_texture_paint_slot_invoke(), texture_paint_add_texture_paint_slot_ui(), and wmOperatorType::ui.
Referenced by ED_operatortypes_paint().
| void PAINT_OT_image_from_view | ( | wmOperatorType * | ot | ) |
Definition at line 6352 of file paint_image_proj.cc.
References wmOperatorType::description, wmOperatorType::exec, FILE_MAX, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, ot, wmOperatorType::poll, RNA_def_string_file_name(), wmOperatorType::srna, texture_paint_image_from_view_exec(), and texture_paint_image_from_view_poll().
Referenced by ED_operatortypes_paint().
| void PAINT_OT_project_image | ( | wmOperatorType * | ot | ) |
Definition at line 6212 of file paint_image_proj.cc.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::prop, PROP_ENUM_NO_TRANSLATE, RNA_def_enum(), RNA_def_enum_funcs(), RNA_def_property_flag(), rna_enum_dummy_NULL_items, RNA_image_itemf(), wmOperatorType::srna, texture_paint_camera_project_exec(), and WM_enum_search_invoke().
Referenced by ED_operatortypes_paint().
|
static |
Definition at line 4593 of file paint_image_proj.cc.
References ProjPaintState::brush_type, ProjPaintState::cloneOffset, copy_v3_v3(), Scene::cursor, float, IMAGE_PAINT_BRUSH_TYPE_CLONE, View3DCursor::location, mul_m4_v3(), mul_m4_v4(), ProjPaintState::obmat_imat, ProjPaintState::projectMat, ProjPaintState::scene, ProjPaintState::winx, and ProjPaintState::winy.
Referenced by paint_proj_new_stroke().
Definition at line 5946 of file paint_image_proj.cc.
References BKE_brush_size_get(), BKE_brush_size_set(), BKE_mesh_from_object(), BKE_paint_brush(), BLI_assert, ProjStrokeHandle::brush, BRUSH_STROKE_INVERT, ProjPaintState::brush_type, count_bits_i(), CTX_data_scene(), Brush::image_brush_type, IMAGE_PAINT_BRUSH_TYPE_CLONE, IMAGE_PAINT_BRUSH_TYPE_FILL, ProjStrokeHandle::is_clone_cursor_pick, ProjPaintState::is_shared_user, MEM_freeN(), ProjPaintState::mesh_eval, ProjPaintState::ob, ProjStrokeHandle::orig_brush_size, paint_brush_init_tex(), paint_proj_begin_clone(), PAINT_SYMM_X, PAINT_SYMM_Y, PAINT_SYMM_Z, pow_i(), PROJ_PAINT_STATE_SHARED_MEMCPY, PROJ_SRC_VIEW, PROJ_SRC_VIEW_FILL, project_image_refresh_tagged(), project_paint_begin(), project_state_init(), ProjStrokeHandle::ps_views, ProjStrokeHandle::ps_views_tot, ProjStrokeHandle::scene, scene, ProjPaintState::source, ProjStrokeHandle::symmetry_flags, view3d_operator_needs_opengl(), and z().
Referenced by blender::ed::sculpt_paint::image::ops::paint::ProjectionPaintMode::paint_new_stroke().
| void paint_proj_redraw | ( | const bContext * | C, |
| void * | ps_handle_p, | ||
| bool | final ) |
Definition at line 6047 of file paint_image_proj.cc.
References CTX_wm_region(), ED_region_tag_redraw(), NA_EDITED, NC_IMAGE, ProjStrokeHandle::need_redraw, and WM_event_add_notifier().
Referenced by blender::ed::sculpt_paint::image::ops::paint::ProjectionPaintMode::paint_stroke_redraw().
| void paint_proj_stroke | ( | const bContext * | C, |
| void * | ps_handle_p, | ||
| const float | prev_pos[2], | ||
| const float | pos[2], | ||
| const bool | eraser, | ||
| float | pressure, | ||
| float | distance, | ||
| float | size ) |
Definition at line 5792 of file paint_image_proj.cc.
References CTX_data_ensure_evaluated_depsgraph(), CTX_wm_region(), CTX_wm_view3d(), DEG_id_tag_update(), depsgraph, ED_region_tag_redraw(), ED_view3d_autodist(), ED_view3d_depth_override(), ID_RECALC_SYNC_TO_EVAL, int, ProjStrokeHandle::is_clone_cursor_pick, paint_proj_stroke_ps(), pos, ProjStrokeHandle::ps_views, ProjStrokeHandle::ps_views_tot, ProjStrokeHandle::scene, V3D_DEPTH_NO_GPENCIL, and view3d_operator_needs_opengl().
Referenced by blender::ed::sculpt_paint::image::ops::paint::ProjectionPaintMode::paint_stroke().
| void paint_proj_stroke_done | ( | void * | ps_handle_p | ) |
Definition at line 6067 of file paint_image_proj.cc.
References BKE_brush_size_set(), ProjStrokeHandle::brush, ProjStrokeHandle::is_clone_cursor_pick, MEM_freeN(), ProjStrokeHandle::orig_brush_size, paint_brush_exit_tex(), PROJ_PAINT_STATE_SHARED_CLEAR, project_paint_end(), ProjStrokeHandle::ps_views, ProjStrokeHandle::ps_views_tot, and ProjStrokeHandle::scene.
Referenced by blender::ed::sculpt_paint::image::ops::paint::ProjectionPaintMode::paint_stroke_done().
|
static |
Definition at line 5741 of file paint_image_proj.cc.
References Brush::blend, ProjPaintState::blend, ProjPaintState::brush, ProjPaintState::brush_size, BRUSH_STROKE_INVERT, ProjPaintState::brush_type, ELEM, IMAGE_PAINT_BRUSH_TYPE_DRAW, IMAGE_PAINT_BRUSH_TYPE_FILL, IMAGE_PAINT_BRUSH_TYPE_MASK, IMAGEPAINT_PROJECT_LAYER_STENCIL_INV, IMB_BLEND_ERASE_ALPHA, ProjPaintState::mode, ProjStrokeHandle::need_redraw, ProjPaintState::paint, paint_brush_color_get(), ProjPaintState::paint_color, ProjPaintState::paint_color_linear, pos, project_image_refresh_tagged(), project_paint_op(), ProjPaintState::scene, size(), srgb_to_linearrgb_v3_v3(), ProjPaintState::stencil_value, and Brush::weight.
Referenced by paint_proj_stroke().
|
static |
Definition at line 4694 of file paint_image_proj.cc.
References partial_redraw_single_init(), and PROJ_BOUNDBOX_SQUARED.
Referenced by project_paint_build_proj_ima().
|
static |
Definition at line 4703 of file paint_image_proj.cc.
References BLI_rcti_do_minmax_rcti(), BLI_rcti_is_empty(), and ImagePaintPartialRedraw::dirty_region.
Referenced by project_paint_op().
|
static |
Definition at line 4689 of file paint_image_proj.cc.
References BLI_rcti_init_minmax(), and ImagePaintPartialRedraw::dirty_region.
Referenced by partial_redraw_array_init(), and project_image_refresh_tagged().
|
static |
Definition at line 1066 of file paint_image_proj.cc.
References false, INIT_MINMAX2, int, minmax_v2v2_v2(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by project_paint_face_init().
|
static |
Definition at line 1036 of file paint_image_proj.cc.
References false, INIT_MINMAX2, int, minmax_v2v2_v2(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by project_paint_face_init().
|
static |
Definition at line 6663 of file paint_image_proj.cc.
References BKE_image_signal(), BKE_texpaint_slot_refresh_cache(), BLI_assert_unreachable, blender::ed::object::context_active_object(), CTX_data_main(), CTX_data_scene(), CTX_wm_area(), Object::data, DEG_id_tag_update(), ED_area_tag_redraw(), ED_node_shader_default(), ED_node_tree_propagate_change(), ED_paint_proj_mesh_data_check(), ED_space_image_sync(), blender::Span< T >::first(), get_or_create_current_material(), bNode::id, bNodeTree::id, Image::id, Material::id, ID_RECALC_GEOMETRY, ID_RECALC_SHADING, IMA_SIGNAL_USER_NEW_IMAGE, blender::Span< T >::is_empty(), LAYER_BASE_COLOR, LAYER_BUMP, LAYER_DISPLACEMENT, LAYER_NORMAL, layer_type_items, bNodeSocket::link, Object::mode, NA_ADDED, NC_GEOM, NC_IMAGE, ND_DATA, blender::bke::node_add_link(), blender::bke::node_add_static_node(), blender::bke::node_find_socket(), blender::bke::node_position_propagate(), blender::bke::node_position_relative(), blender::bke::node_set_active(), Material::nodetree, OB_MODE_SCULPT, PAINT_CANVAS_SOURCE_COLOR_ATTRIBUTE, PAINT_CANVAS_SOURCE_IMAGE, PAINT_CANVAS_SOURCE_MATERIAL, proj_paint_color_attribute_create(), proj_paint_image_create(), wmOperator::ptr, RNA_enum_get(), SH_NODE_BUMP, SH_NODE_NORMAL_MAP, SH_NODE_TEX_IMAGE, SOCK_IN, SOCK_OUT, bNode::storage, STRNCPY_UTF8, Material::use_nodes, WM_event_add_notifier(), and WM_main_add_notifier().
Referenced by texture_paint_add_texture_paint_slot_exec().
|
static |
Definition at line 6560 of file paint_image_proj.cc.
References BKE_attribute_new(), BKE_id_attributes_active_color_set(), BKE_id_attributes_default_color_set(), CD_PROP_COLOR, Object::data, AttributeOwner::from_id(), MAX_NAME, wmOperator::ptr, wmOperator::reports, RNA_enum_get(), RNA_float_get_array(), and RNA_string_get().
Referenced by proj_paint_add_slot().
|
static |
Definition at line 4218 of file paint_image_proj.cc.
References PS_CORNER_TRI_AS_VERT_INDEX_3, ProjPaintState::screenCoords, ProjPaintFaceCoSS::v1, ProjPaintFaceCoSS::v2, and ProjPaintFaceCoSS::v3.
Referenced by project_paint_prepare_all_faces().
|
static |
Definition at line 4173 of file paint_image_proj.cc.
References CD_ORIGINDEX, CD_PROP_BOOL, CustomData_get_layer(), CustomData_get_layer_named(), Object::data, ProjPaintState::do_face_sel, Mesh::face_data, ProjPaintFaceLookup::hide_poly_orig, ProjPaintFaceLookup::index_mp_to_orig, ProjPaintState::mesh_eval, ProjPaintState::ob, and ProjPaintFaceLookup::select_poly_orig.
Referenced by project_paint_begin().
|
static |
Definition at line 6520 of file paint_image_proj.cc.
References BKE_image_add_generated(), color, IMA_GENTYPE_BLANK, MAX_ID_NAME, wmOperator::ptr, RNA_boolean_get(), RNA_enum_get(), RNA_float_get_array(), RNA_int_get(), and RNA_string_get().
Referenced by proj_paint_add_slot().
|
static |
Definition at line 4102 of file paint_image_proj.cc.
References CD_PROP_FLOAT2, Mesh::corner_data, CustomData_get_clone_layer(), CustomData_get_layer(), CustomData_get_layer_n(), Object::data, ProjPaintState::do_layer_clone, ProjPaintState::faces_num_eval, float, MEM_mallocN, ProjPaintState::mesh_eval, ProjPaintLayerClone::mloopuv_clone_base, ProjPaintState::ob, and ProjPaintState::poly_to_loop_uv_clone.
Referenced by project_paint_begin().
|
static |
Definition at line 3885 of file paint_image_proj.cc.
References add_v3_v3(), ProjPaintState::cavities, ProjPaintState::do_mask_cavity, dot_v3v3(), e, ProjPaintState::edges_eval, float, M_1_PI, MEM_callocN, MEM_freeN(), MEM_mallocN, mul_v3_fl(), normalize_v3(), safe_acosf(), sub_v3_v3(), sub_v3_v3v3(), ProjPaintState::totvert_eval, ProjPaintState::vert_normals, and ProjPaintState::vert_positions_eval.
Referenced by project_paint_begin().
|
static |
Definition at line 4040 of file paint_image_proj.cc.
References BKE_object_get_evaluated_mesh(), BKE_object_material_get(), CD_PROP_BOOL, CD_PROP_FLOAT2, CD_PROP_INT32, Mesh::corner_data, ProjPaintState::corner_tri_faces_eval, ProjPaintState::corner_tris_eval, ProjPaintState::corner_verts_eval, Mesh::corners_num, CTX_data_ensure_evaluated_depsgraph(), CustomData_get_layer_named(), CustomData_has_layer(), DEG_get_evaluated_object(), depsgraph, ProjPaintState::edges_eval, Mesh::face_data, ProjPaintState::faces_eval, Mesh::faces_num, ProjPaintState::faces_num_eval, ProjPaintState::hide_poly_eval, ProjPaintState::mat_array, ProjPaintState::material_indices, MEM_malloc_arrayN, MEM_mallocN, ProjPaintState::mesh_eval, ProjPaintState::ob, ProjPaintState::poly_to_loop_uv, ProjPaintState::select_poly_eval, ProjPaintState::sharp_faces_eval, Object::totcol, ProjPaintState::totloop_eval, ProjPaintState::totvert_eval, ProjPaintState::vert_normals, ProjPaintState::vert_positions_eval, and Mesh::verts_num.
Referenced by project_paint_begin().
|
static |
Definition at line 3806 of file paint_image_proj.cc.
References CLAMP, ProjPaintState::clip_start, copy_v3_v3(), float, FLT_MAX, INIT_MINMAX2, ProjPaintState::is_ortho, MEM_mallocN, minmax_v2v2_v2(), mul_m4_v4(), mul_v3_m4v3(), PROJ_SRC_VIEW, PROJ_SRC_VIEW_FILL, ProjPaintState::projectMat, ProjPaintState::screenCoords, ProjPaintState::screenMax, ProjPaintState::screenMin, ProjPaintState::source, ProjPaintState::totvert_eval, UNUSED_VARS, ProjPaintState::vert_positions_eval, ProjPaintState::winx, and ProjPaintState::winy.
Referenced by project_paint_begin().
|
static |
Definition at line 3925 of file paint_image_proj.cc.
References ProjPaintState::corner_tris_eval, ProjPaintState::faceSeamFlags, ProjPaintState::faceWindingFlags, ProjPaintState::loopSeamData, MEM_mallocN, ProjPaintState::seam_bleed_px, blender::Span< T >::size(), ProjPaintState::totloop_eval, ProjPaintState::totvert_eval, ProjPaintState::vertFaces, and ProjPaintState::vertSeams.
Referenced by project_paint_begin().
|
static |
Definition at line 3938 of file paint_image_proj.cc.
References ProjPaintState::arena_mt, BKE_scene_num_threads(), BLI_memarena_new(), BLI_spin_init(), ED_image_paint_tile_lock_init(), ProjPaintState::is_shared_user, MEM_mallocN, MEM_SIZE_OPTIMAL, ProjPaintState::scene, ProjPaintState::thread_tot, and ProjPaintState::tile_lock.
Referenced by project_paint_begin().
|
static |
Definition at line 3969 of file paint_image_proj.cc.
References copy_v3_v3(), ProjPaintState::do_backfacecull, ProjPaintState::do_mask_normal, dot_v3v3(), ProjPaintState::is_flip_object, ProjPaintState::is_ortho, negate_v3(), ProjPaintState::normal_angle__cos, normalize_v3(), PROJ_VERT_CULL, sub_v3_v3v3(), ProjPaintState::totvert_eval, UNLIKELY, ProjPaintState::vert_normals, ProjPaintState::vert_positions_eval, ProjPaintState::vertFlags, ProjPaintState::viewDir, and ProjPaintState::viewPos.
Referenced by project_paint_begin().
|
static |
Definition at line 3692 of file paint_image_proj.cc.
References add_v3_v3(), BKE_camera_params_compute_matrix(), BKE_camera_params_compute_viewplane(), BKE_camera_params_from_object(), BKE_camera_params_init(), BLI_assert, Scene::camera, ProjPaintState::clip_end, ProjPaintState::clip_start, copy_m3_m4(), copy_m4_m4(), copy_v3_v3(), DEG_get_evaluated_object(), ProjPaintState::depsgraph, ED_view3d_clip_range_get(), ED_view3d_ob_project_mat_get_from_obmat(), ELEM, Image::id, IDP_Array, IDP_GetProperties(), IDP_GetPropertyFromGroup(), invert_m4_m4(), ProjPaintState::is_flip_object, ProjPaintState::is_ortho, mul_m3_v3(), mul_m4_m4m4(), negate_v3(), normalize_m4(), normalize_v3(), ProjPaintState::ob, ProjPaintState::obmat, ProjPaintState::obmat_imat, params, PROJ_SRC_IMAGE_CAM, PROJ_SRC_IMAGE_VIEW, PROJ_SRC_VIEW, PROJ_SRC_VIEW_FILL, PROJ_VIEW_DATA_ID, ProjPaintState::projectMat, ProjPaintState::projectMatInv, blender::MatBase< T, NumCol, NumRow, Alignment >::ptr(), ProjPaintState::region, ProjPaintState::reproject_ibuf, ProjPaintState::reproject_image, ProjPaintState::rv3d, ProjPaintState::scene, ProjPaintState::source, UNLIKELY, ProjPaintState::v3d, ProjPaintState::viewDir, RegionView3D::viewinv, RegionView3D::viewmat, ProjPaintState::viewPos, ARegion::winx, ProjPaintState::winx, ARegion::winy, ProjPaintState::winy, ImBuf::x, and ImBuf::y.
Referenced by project_paint_begin().
|
static |
Definition at line 3474 of file paint_image_proj.cc.
References ProjPaintState::buckets_x, ProjPaintState::buckets_y, ProjPaintState::screen_height, ProjPaintState::screen_width, ProjPaintState::screenMin, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_bucket_face_isect(), and project_bucket_iter_next().
|
static |
Definition at line 2476 of file paint_image_proj.cc.
References atan2f, barycentric_weights_v2(), barycentric_weights_v2_persp(), BLI_rctf_isect_pt_v(), copy_v2_v2(), dist_squared_to_line_v2(), fabsf, flag, float, float_z_sort(), float_z_sort_flip(), int, interp_v2_v2v2v2(), ISECT_1, ISECT_2, ISECT_3, ISECT_4, ISECT_ALL3, ISECT_ALL4, IsectPT2Df_limit(), line_clip_rect2f(), line_point_side_v2(), line_rect_clip(), min_fff(), printf, PROJ_GEOM_TOLERANCE, PROJ_PIXEL_TOLERANCE, rect_to_uvspace_ortho(), rect_to_uvspace_persp(), w(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_paint_face_init().
|
static |
Definition at line 3578 of file paint_image_proj.cc.
References BLI_rctf_isect_pt_v(), isect_point_tri_v2(), isect_seg_seg_v2(), project_bucket_bounds(), PS_CORNER_TRI_AS_VERT_INDEX_3, ProjPaintState::screenCoords, v, v2, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_paint_delayed_face_init().
|
static |
Definition at line 3495 of file paint_image_proj.cc.
References BLI_assert, ProjPaintState::bucketFaces, ProjPaintState::bucketFlags, ProjPaintState::corner_tri_faces_eval, ProjPaintState::corner_tris_eval, ProjPaintImage::ibuf, ProjPaintImage::ima, ProjPaintState::image_tot, IMB_freeImBuf(), ProjPaintImage::iuser, node, POINTER_AS_INT, ProjPaintState::poly_to_loop_uv, PROJ_BUCKET_INIT, project_paint_face_init(), project_paint_face_paint_image(), project_paint_face_paint_tile(), ProjPaintState::projImages, PS_CORNER_TRI_AS_UV_3, ImageUser::tile, and tile.
Referenced by do_projectpaint_thread().
|
static |
Only give bucket_bounds as an arg because we need it elsewhere.
Definition at line 2242 of file paint_image_proj.cc.
References BLI_rctf_isect_pt_v(), len_squared_v2v2_alt(), true, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_bucket_iter_next().
|
static |
Definition at line 4752 of file paint_image_proj.cc.
References ProjPaintState::brush_size, ProjPaintState::bucketMax, ProjPaintState::bucketMin, ProjPaintState::buckets_x, ProjPaintState::buckets_y, ProjPaintState::context_bucket_index, PROJ_SRC_VIEW, project_paint_bucket_bounds(), and ProjPaintState::source.
Referenced by project_paint_op().
|
static |
Definition at line 4792 of file paint_image_proj.cc.
References atomic_fetch_and_add_int32(), BLI_assert, ProjPaintState::brush_size, ProjPaintState::bucketMax, ProjPaintState::bucketMin, ProjPaintState::buckets_x, ProjPaintState::context_bucket_index, PROJ_SRC_VIEW, project_bucket_bounds(), project_bucket_isect_circle(), and ProjPaintState::source.
Referenced by do_projectpaint_thread().
|
static |
Fast projection bucket array lookup, use the safe version for bound checking.
Definition at line 607 of file paint_image_proj.cc.
References ProjPaintState::buckets_x, ProjPaintState::buckets_y, int, ProjPaintState::screen_height, ProjPaintState::screen_width, and ProjPaintState::screenMin.
Referenced by project_bucket_offset_safe().
|
static |
Definition at line 624 of file paint_image_proj.cc.
References ProjPaintState::buckets_x, ProjPaintState::buckets_y, and project_bucket_offset().
Referenced by project_paint_PickFace().
|
static |
Definition at line 877 of file paint_image_proj.cc.
References ProjPaintState::corner_tris_eval, ProjPaintState::corner_verts_eval, ProjPaintState::is_ortho, LinkNode::link, LinkNode::next, POINTER_AS_INT, project_paint_occlude_ptv(), project_paint_occlude_ptv_clip(), ProjPaintState::rv3d, RV3D_CLIPPING_ENABLED, ProjPaintState::screenCoords, UNPACK3, ProjPaintState::v3d, ProjPaintState::vert_positions_eval, and w().
Referenced by project_paint_face_init().
|
static |
Definition at line 1620 of file paint_image_proj.cc.
References blender::math::clamp(), col, ImBufFloatBuffer::data, ImBuf::float_buffer, interp_v2_v2v2v2(), UNPACK3, w(), ImBuf::x, and ImBuf::y.
Referenced by project_paint_uvpixel_init(), and project_paint_uvpixel_mask().
|
static |
Be tricky with flags, first 4 bits are PROJ_FACE_SEAM0 to 4, last 4 bits are PROJ_FACE_NOSEAM0 to 4. 1 << i - where i is (0..3).
If we're multi-threading, make sure threads are locked when this is called.
Definition at line 1422 of file paint_image_proj.cc.
References check_seam(), ProjPaintState::corner_tris_eval, ProjPaintState::corner_verts_eval, ProjPaintState::faceSeamFlags, ProjPaintState::faceWindingFlags, insert_seam_vert_array(), node, POINTER_AS_INT, PROJ_FACE_NOSEAM0, PROJ_FACE_SEAM0, PROJ_FACE_SEAM_INIT0, PROJ_FACE_WINDING_INIT, project_face_seams_init(), project_face_winding_init(), and ProjPaintState::vertFaces.
Referenced by project_face_seams_init(), and project_paint_face_init().
|
static |
Definition at line 1099 of file paint_image_proj.cc.
References ProjPaintState::corner_tri_faces_eval, ProjPaintState::corner_tris_eval, cross_tri_v2(), ProjPaintState::faceWindingFlags, ProjPaintState::poly_to_loop_uv, PROJ_FACE_WINDING_CW, PROJ_FACE_WINDING_INIT, and PS_CORNER_TRI_AS_UV_3.
Referenced by check_seam(), and project_face_seams_init().
|
static |
Definition at line 4722 of file paint_image_proj.cc.
References BLI_rcti_is_valid(), ImagePaintPartialRedraw::dirty_region, ProjPaintImage::ibuf, ProjPaintImage::ima, ProjPaintState::image_tot, imapaint_image_update(), ProjPaintImage::iuser, partial_redraw_single_init(), ProjPaintImage::partRedrawRect, PROJ_BOUNDBOX_SQUARED, ProjPaintState::projImages, set_imapaintpartial(), and ProjPaintImage::touch.
Referenced by paint_proj_new_stroke(), paint_proj_stroke_ps(), and texture_paint_camera_project_exec().
|
static |
Definition at line 4488 of file paint_image_proj.cc.
References ProjPaintState::arena_mt, BKE_brush_size_get(), ProjPaintState::brush, ProjPaintState::bucketFaces, ProjPaintState::bucketFlags, ProjPaintState::bucketRect, ProjPaintState::buckets_x, ProjPaintState::buckets_y, CD_PROP_FLOAT2, CLAMP, Mesh::corner_data, CustomData_get_layer(), CustomData_get_layer_n(), CustomData_get_stencil_layer(), Object::data, ProjPaintState::do_face_sel, ProjPaintState::do_layer_stencil, ProjPaintState::do_stencil_brush, ED_view3d_clipping_local(), float, int, ProjPaintState::is_flip_object, ProjPaintState::is_shared_user, ME_EDIT_PAINT_FACE_SEL, ProjPaintState::mesh_eval, ProjPaintState::mloopuv_stencil_eval, ProjPaintState::ob, OB_NEG_SCALE, PROJ_BUCKET_BRUSH_DIV, PROJ_BUCKET_RECT_MAX, PROJ_BUCKET_RECT_MIN, proj_paint_face_lookup_init(), proj_paint_layer_clone_init(), proj_paint_state_cavity_init(), proj_paint_state_mesh_eval_init(), proj_paint_state_screen_coords_init(), proj_paint_state_seam_bleed_init(), proj_paint_state_thread_init(), proj_paint_state_vert_flags_init(), proj_paint_state_viewport_init(), PROJ_SRC_VIEW, project_paint_prepare_all_faces(), ProjPaintState::rv3d, ProjPaintState::scene, ProjPaintState::screen_height, ProjPaintState::screen_width, ProjPaintState::screenMax, ProjPaintState::screenMin, ProjPaintState::source, and Object::transflag.
Referenced by paint_proj_new_stroke(), and texture_paint_camera_project_exec().
|
static |
Definition at line 4009 of file paint_image_proj.cc.
References area_tri_v2(), BLI_linklist_prepend_arena(), ProjPaintState::corner_tri_faces_eval, ProjPaintState::faceSeamFlags, POINTER_FROM_INT, ProjPaintState::poly_to_loop_uv, PROJ_FACE_DEGENERATE, PS_CORNER_TRI_AS_UV_3, PS_CORNER_TRI_AS_VERT_INDEX_3, ProjPaintState::seam_bleed_px, UNPACK3, and ProjPaintState::vertFaces.
Referenced by project_paint_prepare_all_faces().
|
static |
Takes floating point screen-space min/max and returns int min/max to be used as indices for ps->bucketRect, ps->bucketFlags
Definition at line 3443 of file paint_image_proj.cc.
References ProjPaintState::buckets_x, ProjPaintState::buckets_y, CLAMP, int, min, ProjPaintState::screen_height, ProjPaintState::screen_width, and ProjPaintState::screenMin.
Referenced by project_bucket_iter_init(), and project_paint_delayed_face_init().
|
static |
Definition at line 4265 of file paint_image_proj.cc.
References BKE_image_acquire_ibuf(), BLI_assert, BLI_memarena_alloc(), ED_IMAGE_UNDO_TILE_NUMBER, ListBase::first, ProjPaintImage::ibuf, PrepareImageEntry::ima, ProjPaintImage::ima, ProjPaintState::image_tot, PrepareImageEntry::iuser, ProjPaintImage::iuser, ProjPaintImage::maskRect, PrepareImageEntry::next, partial_redraw_array_init(), ProjPaintImage::partRedrawRect, PROJ_BOUNDBOX_SQUARED, ProjPaintState::projImages, size(), ImageUser::tile, ProjPaintImage::touch, ProjPaintImage::undoRect, ProjPaintImage::valid, ImBuf::x, and ImBuf::y.
Referenced by project_paint_prepare_all_faces().
|
static |
Definition at line 4188 of file paint_image_proj.cc.
References ProjPaintState::corner_tri_faces_eval, ProjPaintState::do_face_sel, ProjPaintState::hide_poly_eval, ProjPaintFaceLookup::hide_poly_orig, ProjPaintFaceLookup::index_mp_to_orig, ORIGINDEX_NONE, ProjPaintState::select_poly_eval, and ProjPaintFaceLookup::select_poly_orig.
Referenced by project_paint_prepare_all_faces().
|
static |
Definition at line 4131 of file paint_image_proj.cc.
References ProjPaintState::canvas_ima, CD_PROP_FLOAT2, ProjPaintState::clone_ima, Mesh::corner_data, ProjPaintState::corner_tri_faces_eval, CustomData_get_layer(), CustomData_get_layer_named(), ProjPaintState::do_layer_clone, ProjPaintState::do_material_slots, ELEM, ProjPaintState::mesh_eval, ProjPaintLayerClone::mloopuv_clone_base, ProjPaintState::poly_to_loop_uv_clone, project_paint_face_clone_slot(), ProjPaintLayerClone::slot_clone, ProjPaintLayerClone::slot_last_clone, and TexPaintSlot::uvname.
Referenced by project_paint_prepare_all_faces().
|
static |
Definition at line 3633 of file paint_image_proj.cc.
References ProjPaintState::arena_mt, BLI_linklist_prepend_arena(), ProjPaintState::bucketFaces, ProjPaintState::buckets_x, FLT_MAX, INIT_MINMAX2, ProjPaintState::loopSeamData, min, minmax_v2v2_v2(), POINTER_FROM_INT, project_bucket_face_isect(), project_paint_bucket_bounds(), PS_CORNER_TRI_AS_VERT_INDEX_3, ProjPaintState::screenCoords, ProjPaintState::seam_bleed_px, and LoopSeamData::seam_uvs.
Referenced by project_paint_prepare_all_faces().
|
static |
Definition at line 4610 of file paint_image_proj.cc.
References ProjPaintState::arena_mt, BKE_image_release_ibuf(), BLI_assert, BLI_memarena_free(), BLI_spin_end(), ProjPaintState::blurkernel, ProjPaintState::bucketFaces, ProjPaintState::bucketFlags, ProjPaintState::bucketRect, ProjPaintState::cavities, DEG_id_tag_update(), ProjPaintState::do_layer_clone, ProjPaintState::do_mask_cavity, ED_image_paint_tile_lock_end(), ProjPaintState::faceSeamFlags, ProjPaintState::faceWindingFlags, ProjPaintImage::ibuf, Image::id, ProjPaintImage::ima, ProjPaintState::image_tot, imb_freerectfloatImBuf(), imb_freerectImBuf(), ProjPaintState::is_shared_user, ProjPaintState::loopSeamData, ProjPaintState::mat_array, MEM_freeN(), ProjPaintState::mesh_eval, paint_delete_blur_kernel(), ProjPaintState::poly_to_loop_uv, ProjPaintState::poly_to_loop_uv_clone, ProjPaintState::projImages, ProjPaintState::reproject_ibuf, ProjPaintState::reproject_ibuf_free_float, ProjPaintState::reproject_ibuf_free_uchar, ProjPaintState::reproject_image, ProjPaintState::screenCoords, ProjPaintState::seam_bleed_px, ProjPaintState::thread_tot, ProjPaintState::tile_lock, ProjPaintState::vertFaces, ProjPaintState::vertFlags, and ProjPaintState::vertSeams.
Referenced by paint_proj_stroke_done(), and texture_paint_camera_project_exec().
|
static |
Definition at line 596 of file paint_image_proj.cc.
References ProjPaintState::clone_ima, ProjPaintState::corner_tri_faces_eval, TexPaintSlot::ima, Material::paint_clone_slot, tex_get_material(), and Material::texpaintslot.
Referenced by project_paint_uvpixel_init().
|
static |
Definition at line 589 of file paint_image_proj.cc.
References ProjPaintState::corner_tri_faces_eval, Material::paint_clone_slot, tex_get_material(), and Material::texpaintslot.
Referenced by project_paint_clone_face_skip().
|
static |
Definition at line 2965 of file paint_image_proj.cc.
References ProjPaintState::arena_mt, BLI_linklist_prepend_arena(), BLI_thread_lock(), BLI_thread_unlock(), ProjPaintState::brush, MTex::brush_map_mode, ProjPaintState::bucketFaces, ProjPaintState::bucketRect, LoopSeamData::corner_dist_sq, ProjPaintState::corner_tri_faces_eval, ProjPaintState::corner_tris_eval, ProjPaintState::do_backfacecull, ProjPaintState::do_masking, ProjPaintState::do_occlude, ED_IMAGE_UNDO_TILE_NUMBER, ED_view3d_clipping_test(), equals_v2v2(), ProjPaintState::faceSeamFlags, flag, float, interp_v2_v2v2(), interp_v3_v3v3(), interp_v3_v3v3v3(), ProjPaintState::is_flip_object, ProjPaintState::is_ortho, isect_point_quad_v2(), isect_point_tri_v2(), IsectPoly2Df(), IsectPoly2Df_twoside(), len_squared_v2v2(), line_clip_rect2f(), line_point_factor_v2(), LOCK_CUSTOM1, ProjPaintState::loopSeamData, mask(), Brush::mtex, MTEX_MAP_MODE_3D, mul_m4_v4(), pixel_bounds_array(), pixel_bounds_uv(), ProjPaintState::poly_to_loop_uv, printf, PROJ_FACE_DEGENERATE, PROJ_FACE_SCALE_SEAM, PROJ_FACE_SEAM0, PROJ_FACE_SEAM1, PROJ_FACE_SEAM2, PROJ_FACE_SEAM_INIT0, PROJ_FACE_SEAM_INIT1, PROJ_FACE_SEAM_INIT2, PROJ_PIXEL_TOLERANCE, project_bucket_clip_face(), project_bucket_point_occluded(), project_face_seams_init(), project_paint_uvpixel_init(), project_paint_uvpixel_mask(), ProjPaintState::projectMat, ProjPaintState::projImages, PS_CORNER_TRI_AS_UV_3, PS_CORNER_TRI_AS_VERT_INDEX_3, resolve_quad_u_v2(), ProjPaintState::rv3d, RV3D_CLIPPING_ENABLED, scale_tri(), screen_px_from_ortho(), screen_px_from_persp(), screen_px_line_point_factor_v2_persp(), ProjPaintState::screenCoords, ProjPaintState::seam_bleed_px, ProjPaintState::seam_bleed_px_sq, LoopSeamData::seam_puvs, LoopSeamData::seam_uvs, ProjPaintState::thread_tot, ProjPaintState::tile_lock, UNPACK3, UNPACK4, UNUSED_VARS, uv_image_outset(), ProjPaintState::v3d, ProjPaintState::vert_positions_eval, w(), ProjPaintState::winx, ProjPaintState::winy, ImBuf::x, x, rcti::xmax, rcti::xmin, ImBuf::y, y, rcti::ymax, and rcti::ymin.
Referenced by project_bucket_init().
|
static |
Definition at line 577 of file paint_image_proj.cc.
References ProjPaintState::canvas_ima, ProjPaintState::corner_tri_faces_eval, ProjPaintState::do_stencil_brush, TexPaintSlot::ima, Material::paint_active_slot, ProjPaintState::stencil_ima, tex_get_material(), and Material::texpaintslot.
Referenced by check_seam(), project_bucket_init(), and project_paint_PickColor().
|
static |
Definition at line 570 of file paint_image_proj.cc.
References ProjPaintState::corner_tri_faces_eval, Material::paint_active_slot, tex_get_material(), and Material::texpaintslot.
Referenced by project_paint_prepare_all_faces().
Definition at line 548 of file paint_image_proj.cc.
References IMA_SRC_TILED, int, and Image::source.
Referenced by check_seam(), project_bucket_init(), project_paint_PickColor(), and project_paint_prepare_all_faces().
|
static |
Definition at line 4229 of file paint_image_proj.cc.
References FLT_MAX, ProjPaintState::is_ortho, ProjPaintFaceCoSS::v1, ProjPaintFaceCoSS::v2, and ProjPaintFaceCoSS::v3.
Referenced by project_paint_prepare_all_faces().
|
static |
Check if 'pt' is in front of the 3 verts on the Z axis (used for screen-space occlusion test)
0: no occlusion.-1: no occlusion but 2D intersection is true.1: occluded.2: occluded with w[3] weights set (need to know in some cases). Definition at line 798 of file paint_image_proj.cc.
References isect_point_tri_v2(), v2, VecZDepthOrtho(), VecZDepthPersp(), and w().
Referenced by project_bucket_point_occluded(), and project_paint_occlude_ptv_clip().
|
static |
Definition at line 836 of file paint_image_proj.cc.
References barycentric_weights_v2(), barycentric_weights_v2_persp(), ED_view3d_clipping_test(), interp_v3_v3v3v3(), project_paint_occlude_ptv(), ret, v2, and w().
Referenced by project_bucket_point_occluded().
Definition at line 5604 of file paint_image_proj.cc.
References add_v3_v3(), ProjPaintState::arena_mt, UnifiedPaintSettings::average_stroke_accum, UnifiedPaintSettings::average_stroke_counter, BKE_image_pool_free(), BKE_image_pool_new(), BLENDER_MAX_THREADS, BLI_memarena_alloc(), BLI_task_pool_create_suspended(), BLI_task_pool_free(), BLI_task_pool_push(), BLI_task_pool_work_and_wait(), ImBuf::byte_buffer, copy_v2_v2(), ProjPaintState::corner_tris_eval, ImBufByteBuffer::data, ImBufFloatBuffer::data, do_projectpaint_thread(), ELEM, ImBuf::float_buffer, ProjPaintImage::ibuf, ProjPaintState::image_tot, IMB_float_from_rect(), IMB_rect_from_float(), int, interp_v3_v3v3v3(), UnifiedPaintSettings::last_stroke_valid, mul_m4_v3(), ProjPaintState::obmat, partial_redraw_array_merge(), ProjPaintImage::partRedrawRect, pos, PROJ_BOUNDBOX_SQUARED, PROJ_SRC_VIEW, PROJ_SRC_VIEW_FILL, project_bucket_iter_init(), project_paint_PickFace(), ProjPaintState::projImages, PS_CORNER_TRI_AS_VERT_INDEX_3, ProjPaintState::reproject_ibuf, ProjPaintState::reproject_ibuf_free_float, ProjPaintState::reproject_ibuf_free_uchar, ProjPaintState::scene, ProjPaintState::source, state, task_pool, TASK_PRIORITY_HIGH, ProjPaintState::thread_tot, Scene::toolsettings, ProjPaintImage::touch, ToolSettings::unified_paint_settings, USER_ORBIT_SELECTION, ProjPaintState::vert_positions_eval, and w().
Referenced by paint_proj_stroke_ps(), and texture_paint_camera_project_exec().
|
static |
we must have got the imbuf before getting here.
Definition at line 723 of file paint_image_proj.cc.
References BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), BKE_imageuser_default(), blender::math::clamp(), col, ProjPaintState::corner_tri_faces_eval, ProjPaintState::corner_tris_eval, ImBufFloatBuffer::data, ImBuf::float_buffer, ImageUser::framenr, interp(), interp_v2_v2v2v2(), Image::lastframe, ProjPaintState::poly_to_loop_uv, premul_float_to_straight_uchar(), project_paint_face_paint_image(), project_paint_face_paint_tile(), project_paint_PickFace(), PS_CORNER_TRI_ASSIGN_UV_3, straight_uchar_to_premul_float(), ImageUser::tile, UNPACK3, w(), ImBuf::x, and ImBuf::y.
Referenced by do_projectpaint_smear(), do_projectpaint_smear_f(), do_projectpaint_soften(), do_projectpaint_soften_f(), and project_paint_uvpixel_init().
|
static |
will be -1 or a valid face.
Definition at line 676 of file paint_image_proj.cc.
References ProjPaintState::bucketFaces, copy_v3_v3(), ProjPaintState::corner_tris_eval, ProjPaintState::corner_verts_eval, FLT_MAX, ProjPaintState::is_ortho, isect_point_tri_v2(), node, POINTER_AS_INT, project_bucket_offset_safe(), ProjPaintState::screenCoords, UNPACK3, VecZDepthOrtho(), VecZDepthPersp(), and w().
Referenced by project_paint_op(), and project_paint_PickColor().
|
static |
Definition at line 1784 of file paint_image_proj.cc.
References ELEM, IMAGE_PAINT_BRUSH_TYPE_CLONE, and IMAGE_PAINT_BRUSH_TYPE_SMEAR.
Referenced by project_paint_uvpixel_init(), and project_state_init().
|
static |
Definition at line 4304 of file paint_image_proj.cc.
References BKE_image_has_ibuf(), BKE_imageuser_default(), BLI_addtail(), BLI_assert, BLI_freelistN(), ProjPaintState::canvas_ima, CD_PROP_FLOAT2, Mesh::corner_data, ProjPaintState::corner_tri_faces_eval, ProjPaintState::corner_tris_eval, ProjPaintState::corner_verts_eval, CustomData_get_layer(), CustomData_get_layer_named(), ProjPaintState::do_backfacecull, ProjPaintState::do_mask_normal, ProjPaintState::do_stencil_brush, e, ProjPaintState::faces_eval, ListBase::first, ImageUser::framenr, ID_IS_EDITABLE, ID_IS_OVERRIDE_LIBRARY, TexPaintSlot::ima, ProjPaintState::image_tot, ProjPaintState::is_flip_object, ProjPaintState::is_shared_user, line_point_side_v2(), ProjPaintState::mesh_eval, ProjPaintState::poly_to_loop_uv, proj_paint_face_coSS_init(), PROJ_VERT_CULL, project_paint_bleed_add_face_user(), project_paint_build_proj_ima(), project_paint_check_face_paintable(), project_paint_clone_face_skip(), project_paint_delayed_face_init(), project_paint_face_paint_slot(), project_paint_face_paint_tile(), project_paint_flt_max_cull(), project_paint_winclip(), blender::Span< T >::size(), ProjPaintState::stencil_ima, ImageUser::tile, tile, TexPaintSlot::uvname, ProjPaintFaceCoSS::v1, ProjPaintFaceCoSS::v2, ProjPaintFaceCoSS::v3, and ProjPaintState::vertFlags.
Referenced by project_paint_begin().
Definition at line 1792 of file paint_image_proj.cc.
References BKE_image_mark_dirty(), BLI_spin_lock(), BLI_spin_unlock(), ED_image_paint_tile_map_get(), ED_image_paint_tile_push(), ProjPaintImage::ibuf, ProjPaintImage::ima, ProjPaintImage::iuser, LIKELY, TileInfo::lock, TileInfo::masked, ProjPaintImage::maskRect, TileInfo::pjima, tile_index, TILE_PENDING, TileInfo::tile_width, TileInfo::tmpibuf, ProjPaintImage::undoRect, UNLIKELY, and ProjPaintImage::valid.
Referenced by project_paint_uvpixel_init().
|
static |
Definition at line 1858 of file paint_image_proj.cc.
References ProjPixel::bb_cell_index, BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), BLI_assert, BLI_memarena_alloc(), ProjPaintState::brush, MTex::brush_map_mode, ProjPaintState::brush_type, ImBuf::byte_buffer, PixelPointer::ch_pt, ProjPaintState::cloneOffset, copy_v2_v2(), copy_v3_v3(), ProjPaintState::corner_tri_faces_eval, ProjPaintState::corner_tris_eval, ImBufByteBuffer::data, ImBufFloatBuffer::data, ProjPaintState::do_masking, ED_IMAGE_UNDO_TILE_BITS, ED_IMAGE_UNDO_TILE_NUMBER, ED_IMAGE_UNDO_TILE_SIZE, PixelStore::f, PixelPointer::f_pt, ImBuf::float_buffer, ProjPaintImage::ibuf, ProjPixel::image_index, IMAGE_PAINT_BRUSH_TYPE_CLONE, int, linearrgb_to_srgb_uchar3(), ProjPixel::mask, ProjPixel::mask_accum, ProjPaintImage::maskRect, mod_i(), Brush::mtex, MTEX_MAP_MODE_3D, ProjPixel::newColor, ProjPixel::origColor, ProjPixel::pixel, ProjPaintState::pixel_sizeof, TileInfo::pjima, ProjPaintState::poly_to_loop_uv_clone, premul_to_straight_v4(), PROJ_BOUNDBOX_DIV, ProjPixel::projCoSS, project_face_pixel(), project_paint_face_clone_image(), project_paint_PickColor(), project_paint_pixel_sizeof(), project_paint_undo_subtiles(), ProjPaintState::projImages, PS_CORNER_TRI_AS_UV_3, srgb_to_linearrgb_uchar4(), straight_to_premul_v4_v4(), sub_v2_v2v2(), tile_index, TILE_PENDING, PixelStore::uint_, PixelPointer::uint_pt, ProjPaintImage::undoRect, ProjPaintImage::valid, ProjPixel::valid, w(), ProjPixel::worldCoSS, ImBuf::x, ProjPixel::x_px, ImBuf::y, ProjPixel::y_px, and zero_v4().
Referenced by project_paint_face_init().
|
static |
Definition at line 1643 of file paint_image_proj.cc.
References acosf, BKE_curvemapping_evaluateF(), BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), ProjPaintState::cavities, ProjPaintState::cavity_curve, CLAMP, ProjPaintState::corner_tri_faces_eval, ProjPaintState::corner_tris_eval, ImBufFloatBuffer::data, ProjPaintState::do_backfacecull, ProjPaintState::do_layer_stencil, ProjPaintState::do_layer_stencil_inv, ProjPaintState::do_mask_cavity, ProjPaintState::do_mask_normal, dot_v3v3(), fabsf, ImBuf::float_buffer, ProjPaintState::is_flip_object, ProjPaintState::is_ortho, mask(), ProjPaintState::mloopuv_stencil_eval, negate_v3(), ProjPaintState::normal_angle, ProjPaintState::normal_angle_range, normal_tri_v3(), normalize_v3(), project_face_pixel(), PS_CORNER_TRI_AS_VERT_INDEX_3, ProjPaintState::sharp_faces_eval, ProjPaintState::stencil_ima, UNLIKELY, ProjPaintState::vert_normals, ProjPaintState::vert_positions_eval, ProjPaintState::viewDir, ProjPaintState::viewPos, and w().
Referenced by project_paint_face_init().
|
static |
Definition at line 4241 of file paint_image_proj.cc.
References PROJ_SRC_VIEW_FILL, ProjPaintState::screenMax, ProjPaintState::screenMin, ProjPaintState::source, ProjPaintFaceCoSS::v1, ProjPaintFaceCoSS::v2, and ProjPaintFaceCoSS::v3.
Referenced by project_paint_prepare_all_faces().
|
static |
Definition at line 5835 of file paint_image_proj.cc.
References BKE_paint_brush(), BKE_paint_get_active_from_context(), Brush::blend, ProjPaintState::blend, BLI_assert, ProjPaintState::blurkernel, ProjPaintState::brush, BRUSH_DIR_IN, BRUSH_STROKE_INVERT, BRUSH_STROKE_NORMAL, BRUSH_STROKE_SMOOTH, ProjPaintState::brush_type, ProjPaintState::canvas_ima, ProjPaintState::cavity_curve, ProjPaintState::clone_ima, cosf, CTX_data_ensure_evaluated_depsgraph(), CTX_data_scene(), CTX_wm_region(), CTX_wm_region_view3d(), CTX_wm_view3d(), ProjPaintState::depsgraph, ProjPaintState::dither, ProjPaintState::do_backfacecull, ProjPaintState::do_layer_clone, ProjPaintState::do_layer_stencil, ProjPaintState::do_layer_stencil_inv, ProjPaintState::do_mask_cavity, ProjPaintState::do_mask_normal, ProjPaintState::do_masking, ProjPaintState::do_material_slots, ProjPaintState::do_occlude, ProjPaintState::do_stencil_brush, Brush::flag, float, Brush::image_brush_type, IMAGE_PAINT_BRUSH_TYPE_CLONE, IMAGE_PAINT_BRUSH_TYPE_DRAW, IMAGE_PAINT_BRUSH_TYPE_FILL, IMAGE_PAINT_BRUSH_TYPE_MASK, IMAGE_PAINT_BRUSH_TYPE_SOFTEN, IMAGEPAINT_MODE_MATERIAL, IMAGEPAINT_PROJECT_BACKFACE, IMAGEPAINT_PROJECT_FLAT, IMAGEPAINT_PROJECT_LAYER_CLONE, IMAGEPAINT_PROJECT_LAYER_STENCIL, IMAGEPAINT_PROJECT_LAYER_STENCIL_INV, IMAGEPAINT_PROJECT_XRAY, ProjPaintState::is_maskbrush, ProjPaintState::is_texbrush, M_PI_2, Brush::mask_mtex, ProjPaintState::mode, Brush::mtex, ProjPaintState::normal_angle, ProjPaintState::normal_angle__cos, ProjPaintState::normal_angle_inner, ProjPaintState::normal_angle_inner__cos, ProjPaintState::normal_angle_range, ProjPaintState::ob, ProjPaintState::paint, paint_new_blur_kernel(), PAINT_USE_CAVITY_MASK, paint_use_opacity_masking(), ProjPaintState::pixel_sizeof, project_paint_pixel_sizeof(), ProjPaintState::region, ProjPaintState::rv3d, ProjPaintState::scene, scene, ProjPaintState::seam_bleed_px, ProjPaintState::seam_bleed_px_sq, square_s(), ProjPaintState::stencil_ima, MTex::tex, and ProjPaintState::v3d.
Referenced by paint_proj_new_stroke(), and texture_paint_camera_project_exec().
|
static |
Definition at line 2310 of file paint_image_proj.cc.
References barycentric_weights_v2(), interp_v2_v2v2v2(), w(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_bucket_clip_face().
|
static |
Same as rect_to_uvspace_ortho but use barycentric_weights_v2_persp.
Definition at line 2348 of file paint_image_proj.cc.
References barycentric_weights_v2_persp(), interp_v2_v2v2v2(), w(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_bucket_clip_face().
Scale the tri about its center scaling by PROJ_FACE_SCALE_SEAM (0.99x) is used for getting fake UV pixel coords that are on the edge of the face but slightly inside it occlusion tests don't return hits on adjacent faces.
Definition at line 2206 of file paint_image_proj.cc.
References add_v3_v3(), mul_v3_fl(), and sub_v3_v3v3().
Referenced by project_paint_face_init().
|
static |
Definition at line 1517 of file paint_image_proj.cc.
References barycentric_weights_v2(), interp_v3_v3v3v3(), and w().
Referenced by project_paint_face_init().
|
static |
Definition at line 1533 of file paint_image_proj.cc.
References barycentric_weights_v2(), interp_v3_v3v3v3(), and w().
Referenced by project_paint_face_init().
|
static |
Special function to return the factor to a point along a line in pixel space.
This is needed since we can't use line_point_factor_v2 for perspective screen-space coords.
| p | 2D screen-space location. |
| v1,v2 | 3D object-space locations. |
Definition at line 1600 of file paint_image_proj.cc.
References line_point_factor_v2(), project_plane_v3_v3v3(), ProjPaintState::projectMatInv, screen_px_to_vector_persp(), sub_v3_v3v3(), v2, ProjPaintState::viewPos, ProjPaintState::winx, and ProjPaintState::winy.
Referenced by project_paint_face_init().
|
static |
Set a direction vector based on a screen location. (use for perspective view, else we can simply use ps->viewDir)
Similar functionality to ED_view3d_win_to_vector
| r_dir | Resulting direction (length is undefined). |
Definition at line 1578 of file paint_image_proj.cc.
References mul_project_m4_v3(), and sub_v3_v3().
Referenced by screen_px_line_point_factor_v2_persp().
|
static |
Definition at line 560 of file paint_image_proj.cc.
References ProjPaintState::mat_array, and ProjPaintState::material_indices.
Referenced by project_paint_face_clone_image(), project_paint_face_clone_slot(), project_paint_face_paint_image(), and project_paint_face_paint_slot().
|
static |
Definition at line 6814 of file paint_image_proj.cc.
References OPERATOR_CANCELLED, OPERATOR_FINISHED, and proj_paint_add_slot().
Referenced by PAINT_OT_add_texture_paint_slot().
|
static |
Definition at line 6832 of file paint_image_proj.cc.
References Object::actcol, BKE_object_material_get(), BLT_I18NCONTEXT_OPERATOR_DEFAULT, blender::ed::object::context_active_object(), CTX_IFACE_, default_paint_slot_color_get(), get_default_texture_layer_name_for_object(), get_texture_layer_type(), IFACE_, MAX_ID_NAME, wmOperator::ptr, RNA_float_set_array(), RNA_string_set(), and WM_operator_props_dialog_popup().
Referenced by PAINT_OT_add_texture_paint_slot().
|
static |
Definition at line 6856 of file paint_image_proj.cc.
References BLI_assert_unreachable, col, blender::ed::object::context_active_object(), wmOperator::layout, Object::mode, OB_MODE_SCULPT, PAINT_CANVAS_SOURCE_COLOR_ATTRIBUTE, PAINT_CANVAS_SOURCE_IMAGE, PAINT_CANVAS_SOURCE_MATERIAL, wmOperator::ptr, RNA_enum_get(), UI_ITEM_NONE, UI_ITEM_R_EXPAND, uiItemR(), uiLayoutColumn(), uiLayoutSetPropDecorate(), and uiLayoutSetPropSep().
Referenced by PAINT_OT_add_texture_paint_slot().
|
static |
Definition at line 6095 of file paint_image_proj.cc.
References BKE_brush_size_get(), BKE_brush_size_set(), BKE_image_acquire_ibuf(), BKE_image_free_gputextures(), BKE_report(), BKE_view_layer_active_object_get(), BKE_view_layer_synced_ensure(), BLI_findlink(), ProjPaintState::brush, BRUSH_STROKE_NORMAL, ProjPaintState::brush_type, ImBuf::byte_buffer, CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), ImBufByteBuffer::data, ImBufFloatBuffer::data, ProjPaintState::do_masking, ED_image_undo_push_begin(), ED_image_undo_push_end(), ED_paint_data_warning(), ED_paint_proj_mesh_data_check(), ImBuf::float_buffer, IDP_ARRAY, IDP_FLOAT, IDP_GetProperties(), IDP_GetPropertyTypeFromGroup(), ProjPaintImage::ima, image(), IMAGE_PAINT_BRUSH_TYPE_DRAW, ProjPaintState::image_tot, IMAGEPAINT_DRAWING, Main::images, ProjPaintState::is_maskbrush, ProjPaintState::is_texbrush, IDProperty::len, ProjPaintState::mesh_eval, NA_EDITED, wmOperatorType::name, NC_IMAGE, NC_SCENE, ND_TOOLSETTINGS, OB_MESH, OPERATOR_CANCELLED, OPERATOR_FINISHED, pos, PROJ_SRC_IMAGE_CAM, PROJ_SRC_IMAGE_VIEW, PROJ_VIEW_DATA_ID, PROJ_VIEW_DATA_SIZE, project_image_refresh_tagged(), project_paint_begin(), project_paint_end(), project_paint_op(), project_state_init(), ProjPaintState::projImages, wmOperator::ptr, wmOperator::reports, ProjPaintState::reproject_ibuf, ProjPaintState::reproject_image, RNA_enum_get(), RPT_ERROR, ProjPaintState::source, IDProperty::subtype, tex, Texture3D, Object::type, wmOperator::type, and WM_event_add_notifier().
Referenced by PAINT_OT_project_image().
|
static |
Definition at line 6247 of file paint_image_proj.cc.
References array< T, alignment >::append(), BKE_area_find_region_active_win(), BKE_image_add_from_imbuf(), BKE_report(), BKE_reportf(), BKE_screen_find_big_area(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_wm_screen(), depsgraph, ED_view3d_clip_range_get(), ED_view3d_draw_offscreen_imbuf(), FILE_MAX, View3D::flag, View3DOverlay::flag, View3D::flag2, View3D::gizmo_flag, GPU_max_texture_size(), View3D::gridflag, IB_rect, IDP_AddToGroup(), IDP_EnsureProperties(), image(), ToolSettings::imapaint, IMB_freeImBuf(), OPERATOR_CANCELLED, OPERATOR_FINISHED, View3D::overlay, PROJ_VIEW_DATA_ID, wmOperator::ptr, R_ALPHAPREMUL, wmOperator::reports, RNA_string_get(), RPT_ERROR, ImagePaintSettings::screen_grab_size, View3D::shading, SPACE_VIEW3D, View3DOverlay::texture_paint_mode_opacity, View3DShading::type, V3D_GIZMO_HIDE, V3D_HIDE_HELPLINES, V3D_OVERLAY_HIDE_BONES, V3D_OVERLAY_HIDE_CURSOR, V3D_OVERLAY_HIDE_MOTION_PATHS, V3D_OVERLAY_HIDE_OBJECT_ORIGINS, V3D_OVERLAY_HIDE_OBJECT_XTRAS, V3D_OVERLAY_HIDE_TEXT, RegionView3D::viewmat, w(), and RegionView3D::winmat.
Referenced by PAINT_OT_image_from_view().
|
static |
Definition at line 6234 of file paint_image_proj.cc.
References BKE_screen_find_big_area(), CTX_wm_operator_poll_msg_set(), CTX_wm_screen(), G, GPU_is_init(), and SPACE_VIEW3D.
Referenced by PAINT_OT_image_from_view().
|
static |
Definition at line 1280 of file paint_image_proj.cc.
References add_v2_v2v2(), compute_seam_normal(), copy_v2_v2(), LoopSeamData::corner_dist_sq, ProjPaintState::corner_tris_eval, ProjPaintState::corner_verts_eval, cosf, ProjPaintState::faceSeamFlags, find_adjacent_seam(), float, FLT_MAX, isect_seg_seg_v2_point(), isect_seg_seg_v2_simple(), ProjPaintState::loopSeamData, M_PI, M_PI_2, mul_v2_fl(), mul_v2_v2v2(), PROJ_FACE_SEAM0, ProjPaintState::seam_bleed_px, LoopSeamData::seam_puvs, LoopSeamData::seam_uvs, square_f(), tanf, and UNLIKELY.
Referenced by project_paint_face_init().
|
static |
Definition at line 634 of file paint_image_proj.cc.
References barycentric_weights_v2(), v2, and w().
Referenced by project_paint_occlude_ptv(), and project_paint_PickFace().
|
static |
Definition at line 641 of file paint_image_proj.cc.
References barycentric_weights_v2_persp(), v2, and w().
Referenced by project_paint_occlude_ptv(), and project_paint_PickFace().
|
static |
Definition at line 6498 of file paint_image_proj.cc.
Referenced by default_paint_slot_color_get(), get_default_texture_layer_name_for_object(), get_texture_layer_type(), PAINT_OT_add_texture_paint_slot(), and proj_paint_add_slot().