|
Blender V4.5
|
Functions to paint images in 2D and 3D. More...
#include <algorithm>#include <cfloat>#include <climits>#include <cmath>#include <cstring>#include "MEM_guardedalloc.h"#include "BLI_linklist.h"#include "BLI_listbase.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_rect.h"#include "BLI_string.h"#include "BLI_string_utf8.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_library.hh"#include "BKE_main.hh"#include "BKE_main_invariants.hh"#include "BKE_material.hh"#include "BKE_mesh.hh"#include "BKE_mesh_mapping.hh"#include "BKE_mesh_runtime.hh"#include "BKE_node.hh"#include "BKE_node_legacy_types.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 |
Typedefs | |
| using | int3 |
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, int u, int 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 wmOperatorStatus | 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 wmOperatorStatus | 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 wmOperatorStatus | 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 wmOperatorStatus | 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 wmOperatorStatus | 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.
| #define IMA_DEF_NAME N_("Untitled") |
Definition at line 6912 of file paint_image_proj.cc.
Referenced by image_new_invoke(), IMAGE_OT_new(), and PAINT_OT_add_texture_paint_slot().
| #define ISECT_1 (1) |
Definition at line 2407 of file paint_image_proj.cc.
Referenced by project_bucket_clip_face().
| #define ISECT_2 (1 << 1) |
Definition at line 2408 of file paint_image_proj.cc.
Referenced by project_bucket_clip_face().
| #define ISECT_3 (1 << 2) |
Definition at line 2409 of file paint_image_proj.cc.
Referenced by project_bucket_clip_face().
| #define ISECT_4 (1 << 3) |
Definition at line 2410 of file paint_image_proj.cc.
Referenced by project_bucket_clip_face().
| #define ISECT_ALL3 ((1 << 3) - 1) |
Definition at line 2411 of file paint_image_proj.cc.
Referenced by project_bucket_clip_face().
| #define ISECT_ALL4 ((1 << 4) - 1) |
Definition at line 2412 of file paint_image_proj.cc.
Referenced by project_bucket_clip_face().
| #define ISECT_TRUE 1 |
Definition at line 933 of file paint_image_proj.cc.
Referenced by line_isect_x(), and line_isect_y().
| #define ISECT_TRUE_P1 2 |
Definition at line 934 of file paint_image_proj.cc.
Referenced by line_isect_x(), and line_isect_y().
| #define ISECT_TRUE_P2 3 |
Definition at line 935 of file paint_image_proj.cc.
Referenced by line_isect_x(), and line_isect_y().
| #define PROJ_BOUNDBOX_DIV 8 |
Definition at line 143 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 144 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 138 of file paint_image_proj.cc.
Referenced by project_paint_begin().
| #define PROJ_BUCKET_INIT (1 << 0) |
Definition at line 192 of file paint_image_proj.cc.
Referenced by project_bucket_init().
| #define PROJ_BUCKET_NULL 0 |
Definition at line 191 of file paint_image_proj.cc.
Referenced by do_projectpaint_thread().
| #define PROJ_BUCKET_RECT_MAX 256 |
Definition at line 141 of file paint_image_proj.cc.
Referenced by project_paint_begin().
| #define PROJ_BUCKET_RECT_MIN 4 |
Definition at line 140 of file paint_image_proj.cc.
Referenced by project_paint_begin().
| #define PROJ_DEBUG_WINCLIP 1 |
Definition at line 149 of file paint_image_proj.cc.
| #define PROJ_FACE_DEGENERATE (1 << 12) |
Definition at line 170 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 161 of file paint_image_proj.cc.
Referenced by project_face_seams_init().
| #define PROJ_FACE_NOSEAM1 (1 << 5) |
Definition at line 162 of file paint_image_proj.cc.
| #define PROJ_FACE_NOSEAM2 (1 << 6) |
Definition at line 163 of file paint_image_proj.cc.
| #define PROJ_FACE_SCALE_SEAM 0.99f |
Definition at line 179 of file paint_image_proj.cc.
Referenced by project_paint_face_init().
| #define PROJ_FACE_SEAM0 (1 << 0) |
Definition at line 157 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 158 of file paint_image_proj.cc.
Referenced by project_paint_face_init().
| #define PROJ_FACE_SEAM2 (1 << 2) |
Definition at line 159 of file paint_image_proj.cc.
Referenced by project_paint_face_init().
| #define PROJ_FACE_SEAM_INIT0 (1 << 8) |
Definition at line 166 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 167 of file paint_image_proj.cc.
Referenced by project_paint_face_init().
| #define PROJ_FACE_SEAM_INIT2 (1 << 10) |
Definition at line 168 of file paint_image_proj.cc.
Referenced by project_paint_face_init().
| #define PROJ_FACE_WINDING_CW 2 |
Definition at line 174 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 173 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 196 of file paint_image_proj.cc.
Referenced by cmp_uv(), and project_bucket_clip_face().
| #define PROJ_PAINT_STATE_SHARED_CLEAR | ( | ps | ) |
Definition at line 412 of file paint_image_proj.cc.
Referenced by paint_proj_stroke_done().
| #define PROJ_PAINT_STATE_SHARED_MEMCPY | ( | ps_dst, | |
| ps_src ) |
This data is owned by ProjStrokeHandle.ps_views[0], all other views re-use the data.
Definition at line 409 of file paint_image_proj.cc.
Referenced by paint_proj_new_stroke().
| #define PROJ_PIXEL_TOLERANCE 0.01f |
Definition at line 197 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 183 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 184 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 182 of file paint_image_proj.cc.
Referenced by do_projectpaint_thread(), paint_proj_new_stroke(), 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 185 of file paint_image_proj.cc.
Referenced by do_projectpaint_thread(), paint_proj_new_stroke(), proj_paint_state_viewport_init(), project_paint_op(), and project_paint_winclip().
| #define PROJ_VERT_CULL 1 |
Definition at line 200 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 187 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 189 of file paint_image_proj.cc.
Referenced by texture_paint_camera_project_exec().
| #define PS_CORNER_TRI_AS_UV_3 | ( | uvlayer, | |
| face_i, | |||
| tri ) |
Definition at line 541 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 ) |
Definition at line 538 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 544 of file paint_image_proj.cc.
Referenced by project_paint_PickColor().
| #define TILE_PENDING POINTER_FROM_INT(-1) |
Definition at line 203 of file paint_image_proj.cc.
Referenced by project_paint_undo_subtiles(), and project_paint_uvpixel_init().
| using blender::int3 |
Definition at line 602 of file BLI_math_vector_types.hh.
| anonymous enum |
| Enumerator | |
|---|---|
| LAYER_BASE_COLOR | |
| LAYER_SPECULAR | |
| LAYER_ROUGHNESS | |
| LAYER_METALLIC | |
| LAYER_NORMAL | |
| LAYER_BUMP | |
| LAYER_DISPLACEMENT | |
Definition at line 6501 of file paint_image_proj.cc.
|
static |
Definition at line 6999 of file paint_image_proj.cc.
References add_simple_uvs_exec(), C, 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 add_simple_uvs_exec(), and PAINT_OT_add_simple_uvs().
|
static |
Definition at line 7016 of file paint_image_proj.cc.
References add_simple_uvs_poll(), C, CTX_data_active_object(), Object::mode, OB_MESH, OB_MODE_TEXTURE_PAINT, and Object::type.
Referenced by add_simple_uvs_poll(), and PAINT_OT_add_simple_uvs().
|
static |
Definition at line 1124 of file paint_image_proj.cc.
References BKE_MESH_TESSTRI_VINDEX_ORDER, BLI_assert, check_seam(), cmp_uv(), ProjPaintState::corner_tri_faces_eval, ProjPaintState::corner_tris_eval, ProjPaintState::corner_verts_eval, ProjPaintState::faceWindingFlags, LinkNode::link, LinkNode::next, 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 check_seam(), and project_face_seams_init().
|
static |
Definition at line 1012 of file paint_image_proj.cc.
References cmp_uv(), fabsf, fmodf, PROJ_GEOM_TOLERANCE, and true.
Referenced by check_seam(), cmp_uv(), and find_adjacent_seam().
Definition at line 1250 of file paint_image_proj.cc.
References angle(), VertSeam::angle, compute_seam_normal(), cosf, M_PI, VertSeam::normal_cw, and sinf.
Referenced by compute_seam_normal(), and uv_image_outset().
|
static |
Definition at line 5171 of file paint_image_proj.cc.
References PixelPointer::ch_pt, copy_original_alpha_channel(), PixelPointer::f_pt, ProjPixel::origColor, ProjPixel::pixel, premul_to_straight_v4_v4(), and straight_to_premul_v4_v4().
Referenced by copy_original_alpha_channel(), and do_projectpaint_thread().
|
static |
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 6616 of file paint_image_proj.cc.
References BLI_assert_unreachable, copy_v3_fl(), copy_v3_v3(), default_paint_slot_color_get(), 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, nullptr, rgba_float_args_set(), SH_NODE_BSDF_PRINCIPLED, SOCK_FLOAT, SOCK_IN, SOCK_RGBA, SOCK_VECTOR, bNodeSocket::type, bNodeSocketValueFloat::value, and bNodeSocketValueRGBA::value.
Referenced by default_paint_slot_color_get(), and texture_paint_add_texture_paint_slot_invoke().
|
static |
Definition at line 4852 of file paint_image_proj.cc.
References ProjPaintState::blend, PixelPointer::ch_pt, ProjPaintState::do_masking, do_projectpaint_clone(), IMB_blend_color_byte(), mask(), ProjPixel::origColor, and ProjPixel::pixel.
Referenced by do_projectpaint_clone(), and do_projectpaint_thread().
|
static |
Definition at line 4877 of file paint_image_proj.cc.
References ProjPaintState::blend, ProjPaintState::do_masking, do_projectpaint_clone_f(), PixelPointer::f_pt, IMB_blend_color_float(), mask(), mul_v4_v4fl(), ProjPixel::origColor, and ProjPixel::pixel.
Referenced by do_projectpaint_clone_f(), and do_projectpaint_thread().
|
static |
Definition at line 5066 of file paint_image_proj.cc.
References ProjPaintState::blend, PixelPointer::ch_pt, copy_v3_v3(), ProjPaintState::do_masking, do_projectpaint_draw(), f_to_char(), float_to_byte_dither_v3(), IMB_blend_color_byte(), ProjPaintState::is_texbrush, linearrgb_to_srgb_v3_v3(), mask(), 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_draw(), and do_projectpaint_thread().
|
static |
Definition at line 5104 of file paint_image_proj.cc.
References ProjPaintState::blend, copy_v3_v3(), ProjPaintState::do_masking, do_projectpaint_draw_f(), 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_draw_f(), and do_projectpaint_thread().
|
static |
Definition at line 5130 of file paint_image_proj.cc.
References ProjPaintState::blend, PixelPointer::ch_pt, ProjPaintState::do_masking, do_projectpaint_mask(), f_to_char(), IMB_blend_color_byte(), mask(), ProjPixel::origColor, ProjPixel::pixel, and ProjPaintState::stencil_value.
Referenced by do_projectpaint_mask(), and do_projectpaint_thread().
|
static |
Definition at line 5146 of file paint_image_proj.cc.
References ProjPaintState::blend, ProjPaintState::do_masking, do_projectpaint_mask_f(), PixelPointer::f_pt, IMB_blend_color_float(), mask(), ProjPixel::origColor, ProjPixel::pixel, and ProjPaintState::stencil_value.
Referenced by do_projectpaint_mask_f(), and do_projectpaint_thread().
|
static |
Definition at line 4902 of file paint_image_proj.cc.
References blend_color_interpolate_byte(), BLI_linklist_prepend_arena(), PixelPointer::ch_pt, do_projectpaint_smear(), mask(), ProjPixel::pixel, and project_paint_PickColor().
Referenced by do_projectpaint_smear(), and do_projectpaint_thread().
|
static |
Definition at line 4920 of file paint_image_proj.cc.
References blend_color_interpolate_float(), BLI_linklist_prepend_arena(), do_projectpaint_smear_f(), PixelPointer::f_pt, mask(), ProjPixel::pixel, and project_paint_PickColor().
Referenced by do_projectpaint_smear_f(), and do_projectpaint_thread().
|
static |
Definition at line 4998 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, do_projectpaint_soften(), 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_soften(), and do_projectpaint_thread().
|
static |
Definition at line 4938 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, do_projectpaint_soften_f(), 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_soften_f(), and do_projectpaint_thread().
|
static |
Definition at line 5188 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(), do_projectpaint_thread(), dot_v2v2(), ELEM, PixelStore::f, PixelPointer::f_pt, false, Brush::flag, 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(), LinkNode::link, 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, OB_MODE_TEXTURE_PAINT, ProjPixel::origColor, ProjPaintState::paint_color, ProjPaintState::paint_color_linear, ProjPaintImage::partRedrawRect, ProjPixel::pixel, 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 do_projectpaint_thread(), and 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 6387 of file paint_image_proj.cc.
References BKE_reportf(), ED_paint_data_warning(), reports, RPT_, and RPT_WARNING.
Referenced by ED_paint_data_warning(), 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 6399 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, Mesh::corner_data, CustomData_number_of_layers(), ED_paint_proj_mesh_data_check(), ImagePaintSettings::flag, i, 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, ToolSettings::imapaint, ImagePaintSettings::missing_data, ImagePaintSettings::mode, OB_MESH, ImagePaintSettings::paint, Material::paint_active_slot, ImagePaintSettings::stencil, Material::texpaintslot, Scene::toolsettings, Object::totcol, and Object::type.
Referenced by add_simple_uvs_exec(), ED_editors_init_for_undo(), ED_object_texture_paint_mode_enter_ex(), ED_paint_proj_mesh_data_check(), material_slot_add_exec(), material_slot_remove_all_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 125 of file paint_image_proj.cc.
References BLI_INLINE, f_to_char(), and unit_float_to_uchar_clamp().
Referenced by do_projectpaint_draw(), do_projectpaint_mask(), and f_to_char().
|
static |
Definition at line 1207 of file paint_image_proj.cc.
References BLI_assert, cmp_uv(), find_adjacent_seam(), ListBase::first, LISTBASE_CIRCULAR_BACKWARD_BEGIN, LISTBASE_CIRCULAR_BACKWARD_END, LISTBASE_CIRCULAR_FORWARD_BEGIN, LISTBASE_CIRCULAR_FORWARD_END, VertSeam::loop, VertSeam::next, VertSeam::normal_cw, VertSeam::uv, and ProjPaintState::vertSeams.
Referenced by find_adjacent_seam(), and uv_image_outset().
|
static |
Definition at line 2431 of file paint_image_proj.cc.
References float_z_sort().
Referenced by float_z_sort(), and 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 2426 of file paint_image_proj.cc.
References float_z_sort_flip().
Referenced by float_z_sort_flip(), and project_bucket_clip_face().
|
static |
Definition at line 6840 of file paint_image_proj.cc.
References Object::actcol, BKE_object_material_get(), BLI_snprintf(), DATA_, get_default_texture_layer_name_for_object(), Material::id, Object::id, layer_type_items, and ID::name.
Referenced by get_default_texture_layer_name_for_object(), and texture_paint_add_texture_paint_slot_invoke().
Definition at line 6522 of file paint_image_proj.cc.
References Object::actcol, BKE_MAT_ASSIGN_USERPREF, BKE_material_add(), BKE_object_material_assign(), BKE_object_material_get(), C, CTX_data_main(), and get_or_create_current_material().
Referenced by get_or_create_current_material(), and proj_paint_add_slot().
|
static |
Definition at line 6824 of file paint_image_proj.cc.
References BLI_assert, get_texture_layer_type(), layer_type_items, wmOperator::ptr, RNA_enum_from_value(), and RNA_enum_get().
Referenced by get_texture_layer_type(), and texture_paint_add_texture_paint_slot_invoke().
|
static |
Definition at line 5162 of file paint_image_proj.cc.
References BLI_rcti_do_minmax_rcti(), BLI_rcti_init(), ImagePaintPartialRedraw::dirty_region, image_paint_partial_redraw_expand(), ProjPixel::x_px, and ProjPixel::y_px.
Referenced by do_projectpaint_thread(), and image_paint_partial_redraw_expand().
|
static |
Definition at line 1374 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, ListBase::first, i, insert_seam_vert_array(), 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 insert_seam_vert_array(), and project_face_seams_init().
|
static |
Definition at line 2940 of file paint_image_proj.cc.
References i, IsectPoly2Df(), and line_point_side_v2().
Referenced by IsectPoly2Df(), and project_paint_face_init().
|
static |
Definition at line 2955 of file paint_image_proj.cc.
References i, IsectPoly2Df_twoside(), and line_point_side_v2().
Referenced by IsectPoly2Df_twoside(), and project_paint_face_init().
|
static |
Definition at line 2415 of file paint_image_proj.cc.
References area_tri_v2(), IsectPT2Df_limit(), and v2.
Referenced by IsectPT2Df_limit(), and project_bucket_clip_face().
|
static |
Definition at line 2235 of file paint_image_proj.cc.
References len_squared_v2v2_alt(), x, and y.
Referenced by len_squared_v2v2_alt(), and project_bucket_isect_circle().
|
static |
Definition at line 2042 of file paint_image_proj.cc.
References BLI_rctf_isect_pt_v(), CLAMP, copy_v2_v2(), fabsf, line_clip_rect2f(), line_isect_x(), line_isect_y(), PROJ_PIXEL_TOLERANCE, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by line_clip_rect2f(), project_bucket_clip_face(), and project_paint_face_init().
|
static |
Definition at line 972 of file paint_image_proj.cc.
References fabsf, ISECT_TRUE, ISECT_TRUE_P1, ISECT_TRUE_P2, and line_isect_x().
Referenced by line_clip_rect2f(), and line_isect_x().
|
static |
yuck, horizontal line, we can't do much here.
Definition at line 936 of file paint_image_proj.cc.
References fabsf, ISECT_TRUE, ISECT_TRUE_P1, ISECT_TRUE_P2, and line_isect_y().
Referenced by line_clip_rect2f(), and line_isect_y().
|
static |
Definition at line 2437 of file paint_image_proj.cc.
References FLT_MAX, line_rect_clip(), min, min_ff(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by line_rect_clip(), and project_bucket_clip_face().
| void PAINT_OT_add_simple_uvs | ( | wmOperatorType * | ot | ) |
Definition at line 7026 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, PAINT_OT_add_simple_uvs(), and wmOperatorType::poll.
Referenced by ED_operatortypes_paint(), and PAINT_OT_add_simple_uvs().
| void PAINT_OT_add_texture_paint_slot | ( | wmOperatorType * | ot | ) |
Definition at line 6914 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, PAINT_CANVAS_SOURCE_COLOR_ATTRIBUTE, PAINT_CANVAS_SOURCE_IMAGE, PAINT_OT_add_texture_paint_slot(), blender::bke::Point, 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(), and PAINT_OT_add_texture_paint_slot().
| void PAINT_OT_image_from_view | ( | wmOperatorType * | ot | ) |
Definition at line 6365 of file paint_image_proj.cc.
References wmOperatorType::description, wmOperatorType::exec, FILE_MAX, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, PAINT_OT_image_from_view(), 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(), and PAINT_OT_image_from_view().
| void PAINT_OT_project_image | ( | wmOperatorType * | ot | ) |
Definition at line 6226 of file paint_image_proj.cc.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, PAINT_OT_project_image(), 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(), and PAINT_OT_project_image().
|
static |
Definition at line 4600 of file paint_image_proj.cc.
References ProjPaintState::brush_type, ProjPaintState::cloneOffset, copy_v3_v3(), Scene::cursor, IMAGE_PAINT_BRUSH_TYPE_CLONE, View3DCursor::location, mul_m4_v3(), mul_m4_v4(), ProjPaintState::obmat_imat, paint_proj_begin_clone(), ProjPaintState::projectMat, ProjPaintState::scene, ProjPaintState::winx, and ProjPaintState::winy.
Referenced by paint_proj_begin_clone(), and paint_proj_new_stroke().
Definition at line 5956 of file paint_image_proj.cc.
References BKE_brush_color_jitter_get_settings(), 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, C, count_bits_i(), CTX_data_scene(), i, Brush::image_brush_type, IMAGE_PAINT_BRUSH_TYPE_CLONE, IMAGE_PAINT_BRUSH_TYPE_FILL, ToolSettings::imapaint, ProjStrokeHandle::initial_hsv_jitter, ProjStrokeHandle::is_clone_cursor_pick, ProjPaintState::is_shared_user, ProjPaintState::mesh_eval, ProjPaintState::ob, ProjStrokeHandle::orig_brush_size, ImagePaintSettings::paint, paint_brush_init_tex(), paint_proj_begin_clone(), paint_proj_new_stroke(), 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, seed_hsv_jitter(), ProjPaintState::source, Mesh::symmetry, ProjStrokeHandle::symmetry_flags, Scene::toolsettings, U, view3d_operator_needs_gpu(), x, y, and z().
Referenced by blender::ed::sculpt_paint::image::ops::paint::ProjectionPaintMode::paint_new_stroke(), and paint_proj_new_stroke().
| void paint_proj_redraw | ( | const bContext * | C, |
| void * | ps_handle_p, | ||
| bool | final ) |
Definition at line 6061 of file paint_image_proj.cc.
References C, CTX_wm_region(), ED_region_tag_redraw(), NA_EDITED, NC_IMAGE, ProjStrokeHandle::need_redraw, paint_proj_redraw(), and WM_event_add_notifier().
Referenced by paint_proj_redraw(), and 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 5801 of file paint_image_proj.cc.
References C, CTX_data_ensure_evaluated_depsgraph(), CTX_wm_region(), CTX_wm_view3d(), Scene::cursor, DEG_id_tag_update(), distance(), ED_region_tag_redraw(), ED_view3d_autodist(), ED_view3d_depth_override(), i, Scene::id, ID_RECALC_SYNC_TO_EVAL, ProjStrokeHandle::is_clone_cursor_pick, View3DCursor::location, paint_proj_stroke(), paint_proj_stroke_ps(), ProjStrokeHandle::ps_views, ProjStrokeHandle::ps_views_tot, ProjStrokeHandle::scene, V3D_DEPTH_NO_GPENCIL, and view3d_operator_needs_gpu().
Referenced by paint_proj_stroke(), and blender::ed::sculpt_paint::image::ops::paint::ProjectionPaintMode::paint_stroke().
| void paint_proj_stroke_done | ( | void * | ps_handle_p | ) |
Definition at line 6081 of file paint_image_proj.cc.
References BKE_brush_size_set(), ProjStrokeHandle::brush, i, ProjStrokeHandle::is_clone_cursor_pick, ProjStrokeHandle::orig_brush_size, paint_brush_exit_tex(), paint_proj_stroke_done(), PROJ_PAINT_STATE_SHARED_CLEAR, project_paint_end(), ProjStrokeHandle::ps_views, ProjStrokeHandle::ps_views_tot, and ProjStrokeHandle::scene.
Referenced by paint_proj_stroke_done(), and blender::ed::sculpt_paint::image::ops::paint::ProjectionPaintMode::paint_stroke_done().
|
static |
Definition at line 5749 of file paint_image_proj.cc.
References Brush::blend, ProjPaintState::blend, ProjPaintState::brush, ProjPaintState::brush_size, BRUSH_STROKE_INVERT, ProjPaintState::brush_type, distance(), ELEM, ImagePaintSettings::flag, IMAGE_PAINT_BRUSH_TYPE_DRAW, IMAGE_PAINT_BRUSH_TYPE_FILL, IMAGE_PAINT_BRUSH_TYPE_MASK, IMAGEPAINT_PROJECT_LAYER_STENCIL_INV, ToolSettings::imapaint, IMB_BLEND_ERASE_ALPHA, ProjStrokeHandle::initial_hsv_jitter, ProjPaintState::mode, ProjStrokeHandle::need_redraw, ProjPaintState::paint, paint_brush_color_get(), ProjPaintState::paint_color, ProjPaintState::paint_color_linear, paint_proj_stroke_ps(), project_image_refresh_tagged(), project_paint_op(), ProjPaintState::scene, srgb_to_linearrgb_v3_v3(), ProjPaintState::stencil_value, Scene::toolsettings, and Brush::weight.
Referenced by paint_proj_stroke(), and paint_proj_stroke_ps().
|
static |
Definition at line 4702 of file paint_image_proj.cc.
References partial_redraw_array_init(), partial_redraw_single_init(), and PROJ_BOUNDBOX_SQUARED.
Referenced by partial_redraw_array_init(), and project_paint_build_proj_ima().
|
static |
Definition at line 4711 of file paint_image_proj.cc.
References BLI_rcti_do_minmax_rcti(), BLI_rcti_is_empty(), ImagePaintPartialRedraw::dirty_region, and partial_redraw_array_merge().
Referenced by partial_redraw_array_merge(), and project_paint_op().
|
static |
Definition at line 4697 of file paint_image_proj.cc.
References BLI_rcti_init_minmax(), ImagePaintPartialRedraw::dirty_region, and partial_redraw_single_init().
Referenced by partial_redraw_array_init(), partial_redraw_single_init(), and project_image_refresh_tagged().
|
static |
Definition at line 1074 of file paint_image_proj.cc.
References false, INIT_MINMAX2, minmax_v2v2_v2(), pixel_bounds_array(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by pixel_bounds_array(), and project_paint_face_init().
|
static |
Definition at line 1044 of file paint_image_proj.cc.
References false, INIT_MINMAX2, minmax_v2v2_v2(), pixel_bounds_uv(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by pixel_bounds_uv(), and project_paint_face_init().
|
static |
Definition at line 6680 of file paint_image_proj.cc.
References BKE_image_signal(), BKE_main_ensure_invariants(), BKE_texpaint_slot_refresh_cache(), BLI_assert_unreachable, C, blender::ed::object::context_active_object(), CTX_data_main(), CTX_data_scene(), CTX_wm_area(), Object::data, DEG_id_tag_update(), DEG_relations_tag_update(), ED_area_tag_redraw(), ED_node_shader_default(), 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, nullptr, OB_MODE_SCULPT, PAINT_CANVAS_SOURCE_COLOR_ATTRIBUTE, PAINT_CANVAS_SOURCE_IMAGE, PAINT_CANVAS_SOURCE_MATERIAL, proj_paint_add_slot(), proj_paint_color_attribute_create(), proj_paint_image_create(), wmOperator::ptr, RNA_enum_get(), SH_NODE_ATTRIBUTE, 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 proj_paint_add_slot(), and texture_paint_add_texture_paint_slot_exec().
|
static |
Definition at line 6577 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, Mesh::default_color_attribute, AttributeOwner::from_id(), Mesh::id, MAX_NAME, CustomDataLayer::name, blender::ed::sculpt_paint::object_active_color_fill(), blender::bke::Point, proj_paint_color_attribute_create(), wmOperator::ptr, wmOperator::reports, RNA_enum_get(), RNA_float_get_array(), and RNA_string_get().
Referenced by proj_paint_add_slot(), and proj_paint_color_attribute_create().
|
static |
Definition at line 4223 of file paint_image_proj.cc.
References proj_paint_face_coSS_init(), PS_CORNER_TRI_AS_VERT_INDEX_3, ProjPaintState::screenCoords, ProjPaintFaceCoSS::v1, ProjPaintFaceCoSS::v2, and ProjPaintFaceCoSS::v3.
Referenced by proj_paint_face_coSS_init(), and project_paint_prepare_all_faces().
|
static |
Definition at line 4178 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, proj_paint_face_lookup_init(), and ProjPaintFaceLookup::select_poly_orig.
Referenced by proj_paint_face_lookup_init(), and project_paint_begin().
|
static |
Definition at line 6533 of file paint_image_proj.cc.
References BKE_image_add_generated(), IMA_GENTYPE_BLANK, MAX_ID_NAME, proj_paint_image_create(), 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(), and proj_paint_image_create().
|
static |
Definition at line 4107 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, MEM_mallocN(), ProjPaintState::mesh_eval, ProjPaintLayerClone::mloopuv_clone_base, ProjPaintState::ob, ProjPaintState::poly_to_loop_uv_clone, and proj_paint_layer_clone_init().
Referenced by proj_paint_layer_clone_init(), and project_paint_begin().
|
static |
Definition at line 3893 of file paint_image_proj.cc.
References add_v3_v3(), ProjPaintState::cavities, ProjPaintState::do_mask_cavity, dot_v3v3(), e, ProjPaintState::edges_eval, i, M_1_PI, MEM_calloc_arrayN(), MEM_callocN(), MEM_freeN(), MEM_malloc_arrayN(), mul_v3_fl(), normalize_v3(), proj_paint_state_cavity_init(), safe_acosf(), sub_v3_v3(), sub_v3_v3v3(), ProjPaintState::totvert_eval, ProjPaintState::vert_normals, and ProjPaintState::vert_positions_eval.
Referenced by proj_paint_state_cavity_init(), and project_paint_begin().
|
static |
Definition at line 4045 of file paint_image_proj.cc.
References BKE_object_get_evaluated_mesh(), BKE_object_material_get(), C, 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(), ProjPaintState::edges_eval, Mesh::face_data, ProjPaintState::faces_eval, Mesh::faces_num, ProjPaintState::faces_num_eval, ProjPaintState::hide_poly_eval, i, ProjPaintState::mat_array, ProjPaintState::material_indices, MEM_malloc_arrayN(), MEM_mallocN(), ProjPaintState::mesh_eval, ProjPaintState::ob, ProjPaintState::poly_to_loop_uv, proj_paint_state_mesh_eval_init(), 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 proj_paint_state_mesh_eval_init(), and project_paint_begin().
|
static |
Definition at line 3814 of file paint_image_proj.cc.
References INIT_MINMAX2, ProjPaintState::is_ortho, MEM_mallocN(), proj_paint_state_screen_coords_init(), ProjPaintState::screenCoords, ProjPaintState::screenMax, ProjPaintState::screenMin, and ProjPaintState::totvert_eval.
Referenced by proj_paint_state_screen_coords_init(), and project_paint_begin().
|
static |
Definition at line 3932 of file paint_image_proj.cc.
References ProjPaintState::corner_tris_eval, ProjPaintState::faceSeamFlags, ProjPaintState::faceWindingFlags, ProjPaintState::loopSeamData, MEM_calloc_arrayN(), MEM_malloc_arrayN(), proj_paint_state_seam_bleed_init(), ProjPaintState::seam_bleed_px, ProjPaintState::totloop_eval, ProjPaintState::totvert_eval, ProjPaintState::vertFaces, and ProjPaintState::vertSeams.
Referenced by proj_paint_state_seam_bleed_init(), and project_paint_begin().
|
static |
Definition at line 3944 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, proj_paint_state_thread_init(), ProjPaintState::scene, ProjPaintState::thread_tot, and ProjPaintState::tile_lock.
Referenced by proj_paint_state_thread_init(), and project_paint_begin().
|
static |
Definition at line 3974 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, MEM_calloc_arrayN(), negate_v3(), ProjPaintState::normal_angle__cos, normalize_v3(), proj_paint_state_vert_flags_init(), 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 proj_paint_state_vert_flags_init(), and project_paint_begin().
|
static |
Definition at line 3700 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, CameraParams::clip_end, ProjPaintState::clip_end, CameraParams::clip_start, ProjPaintState::clip_start, copy_m3_m4(), copy_m4_m4(), copy_v3_v3(), DEG_get_evaluated(), ProjPaintState::depsgraph, ED_view3d_clip_range_get(), ED_view3d_ob_project_mat_get_from_obmat(), ELEM, i, Image::id, IDP_Array, IDP_GetProperties(), IDP_GetPropertyFromGroup(), invert_m4_m4(), ProjPaintState::is_flip_object, CameraParams::is_ortho, ProjPaintState::is_ortho, mul_m3_v3(), mul_m4_m4m4(), negate_v3(), normalize_m4(), normalize_v3(), ProjPaintState::ob, ProjPaintState::obmat, ProjPaintState::obmat_imat, proj_paint_state_viewport_init(), 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, CameraParams::winmat, ARegion::winx, ProjPaintState::winx, ARegion::winy, ProjPaintState::winy, ImBuf::x, and ImBuf::y.
Referenced by proj_paint_state_viewport_init(), and project_paint_begin().
|
static |
Definition at line 3482 of file paint_image_proj.cc.
References ProjPaintState::buckets_x, ProjPaintState::buckets_y, project_bucket_bounds(), ProjPaintState::screen_height, ProjPaintState::screen_width, ProjPaintState::screenMin, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_bucket_bounds(), project_bucket_face_isect(), and project_bucket_iter_next().
|
static |
Definition at line 2484 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, float_z_sort(), float_z_sort_flip(), i, 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, project_bucket_clip_face(), rect_to_uvspace_ortho(), rect_to_uvspace_persp(), w(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_bucket_clip_face(), and project_paint_face_init().
|
static |
Definition at line 3586 of file paint_image_proj.cc.
References BLI_rctf_isect_pt_v(), isect_point_tri_v2(), isect_seg_seg_v2(), project_bucket_bounds(), project_bucket_face_isect(), PS_CORNER_TRI_AS_VERT_INDEX_3, ProjPaintState::screenCoords, v, v2, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_bucket_face_isect(), and project_paint_delayed_face_init().
|
static |
Definition at line 3503 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, LinkNode::link, LinkNode::next, POINTER_AS_INT, ProjPaintState::poly_to_loop_uv, PROJ_BUCKET_INIT, project_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(), and project_bucket_init().
|
static |
Only give bucket_bounds as an arg because we need it elsewhere.
Definition at line 2250 of file paint_image_proj.cc.
References BLI_rctf_isect_pt_v(), len_squared_v2v2_alt(), project_bucket_isect_circle(), true, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_bucket_isect_circle(), and project_bucket_iter_next().
|
static |
Definition at line 4760 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_bucket_iter_init(), project_paint_bucket_bounds(), and ProjPaintState::source.
Referenced by project_bucket_iter_init(), and project_paint_op().
|
static |
Definition at line 4800 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(), project_bucket_iter_next(), and ProjPaintState::source.
Referenced by do_projectpaint_thread(), and project_bucket_iter_next().
|
static |
Fast projection bucket array lookup, use the safe version for bound checking.
Definition at line 615 of file paint_image_proj.cc.
References ProjPaintState::buckets_x, ProjPaintState::buckets_y, project_bucket_offset(), ProjPaintState::screen_height, ProjPaintState::screen_width, and ProjPaintState::screenMin.
Referenced by project_bucket_offset(), and project_bucket_offset_safe().
|
static |
Definition at line 632 of file paint_image_proj.cc.
References ProjPaintState::buckets_x, ProjPaintState::buckets_y, project_bucket_offset(), and project_bucket_offset_safe().
Referenced by project_bucket_offset_safe(), and project_paint_PickFace().
|
static |
Definition at line 885 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_bucket_point_occluded(), 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_bucket_point_occluded(), and project_paint_face_init().
|
static |
Definition at line 1628 of file paint_image_proj.cc.
References blender::math::clamp(), ImBufFloatBuffer::data, ImBuf::float_buffer, interp_v2_v2v2v2(), blender::imbuf::interpolate_bilinear_wrap_byte(), blender::imbuf::interpolate_bilinear_wrap_fl(), project_face_pixel(), UNPACK3, w(), ImBuf::x, x, ImBuf::y, and y.
Referenced by project_face_pixel(), 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 1430 of file paint_image_proj.cc.
References check_seam(), ProjPaintState::corner_tris_eval, ProjPaintState::corner_verts_eval, ProjPaintState::faceSeamFlags, ProjPaintState::faceWindingFlags, i, insert_seam_vert_array(), LinkNode::link, LinkNode::next, 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 1107 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, project_face_winding_init(), and PS_CORNER_TRI_AS_UV_3.
Referenced by check_seam(), project_face_seams_init(), and project_face_winding_init().
|
static |
Definition at line 4730 of file paint_image_proj.cc.
References BLI_rcti_is_valid(), ImagePaintPartialRedraw::dirty_region, i, ProjPaintImage::ibuf, ProjPaintImage::ima, imapaint_image_update(), ProjPaintImage::iuser, partial_redraw_single_init(), ProjPaintImage::partRedrawRect, PROJ_BOUNDBOX_SQUARED, project_image_refresh_tagged(), ProjPaintState::projImages, set_imapaintpartial(), and ProjPaintImage::touch.
Referenced by paint_proj_new_stroke(), paint_proj_stroke_ps(), project_image_refresh_tagged(), and texture_paint_camera_project_exec().
|
static |
Definition at line 4493 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, C, 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(), ProjPaintState::is_flip_object, ProjPaintState::is_shared_user, ME_EDIT_PAINT_FACE_SEL, MEM_calloc_arrayN(), 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_begin(), 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(), project_paint_begin(), and texture_paint_camera_project_exec().
|
static |
Definition at line 4014 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, project_paint_bleed_add_face_user(), 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_bleed_add_face_user(), and 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 3451 of file paint_image_proj.cc.
References ProjPaintState::buckets_x, ProjPaintState::buckets_y, CLAMP, max, min, project_paint_bucket_bounds(), ProjPaintState::screen_height, ProjPaintState::screen_width, and ProjPaintState::screenMin.
Referenced by project_bucket_iter_init(), project_paint_bucket_bounds(), and project_paint_delayed_face_init().
|
static |
Definition at line 4270 of file paint_image_proj.cc.
References BKE_image_acquire_ibuf(), BLI_assert, BLI_memarena_alloc(), ED_IMAGE_UNDO_TILE_NUMBER, ListBase::first, i, 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, project_paint_build_proj_ima(), ProjPaintState::projImages, ImageUser::tile, ProjPaintImage::touch, ProjPaintImage::undoRect, ProjPaintImage::valid, ImBuf::x, and ImBuf::y.
Referenced by project_paint_build_proj_ima(), and project_paint_prepare_all_faces().
|
static |
Definition at line 4193 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, project_paint_check_face_paintable(), ProjPaintState::select_poly_eval, and ProjPaintFaceLookup::select_poly_orig.
Referenced by project_paint_check_face_paintable(), and project_paint_prepare_all_faces().
|
static |
Definition at line 4136 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_clone_face_skip(), project_paint_face_clone_slot(), ProjPaintLayerClone::slot_clone, ProjPaintLayerClone::slot_last_clone, and TexPaintSlot::uvname.
Referenced by project_paint_clone_face_skip(), and project_paint_prepare_all_faces().
|
static |
Definition at line 3641 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, max, min, minmax_v2v2_v2(), POINTER_FROM_INT, project_bucket_face_isect(), project_paint_bucket_bounds(), project_paint_delayed_face_init(), PS_CORNER_TRI_AS_VERT_INDEX_3, ProjPaintState::screenCoords, ProjPaintState::seam_bleed_px, and LoopSeamData::seam_uvs.
Referenced by project_paint_delayed_face_init(), and project_paint_prepare_all_faces().
|
static |
Definition at line 4617 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, IMB_free_byte_pixels(), IMB_free_float_pixels(), 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, project_paint_end(), 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(), project_paint_end(), and texture_paint_camera_project_exec().
|
static |
Definition at line 604 of file paint_image_proj.cc.
References ProjPaintState::clone_ima, ProjPaintState::corner_tri_faces_eval, TexPaintSlot::ima, Material::paint_clone_slot, project_paint_face_clone_image(), tex_get_material(), and Material::texpaintslot.
Referenced by project_paint_face_clone_image(), and project_paint_uvpixel_init().
|
static |
Definition at line 597 of file paint_image_proj.cc.
References ProjPaintState::corner_tri_faces_eval, Material::paint_clone_slot, project_paint_face_clone_slot(), tex_get_material(), and Material::texpaintslot.
Referenced by project_paint_clone_face_skip(), and project_paint_face_clone_slot().
|
static |
Definition at line 2973 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, 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_face_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(), and project_paint_face_init().
|
static |
Definition at line 585 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, project_paint_face_paint_image(), ProjPaintState::stencil_ima, tex_get_material(), and Material::texpaintslot.
Referenced by check_seam(), project_bucket_init(), project_paint_face_paint_image(), and project_paint_PickColor().
|
static |
Definition at line 578 of file paint_image_proj.cc.
References ProjPaintState::corner_tri_faces_eval, Material::paint_active_slot, project_paint_face_paint_slot(), tex_get_material(), and Material::texpaintslot.
Referenced by project_paint_face_paint_slot(), and project_paint_prepare_all_faces().
|
static |
Definition at line 556 of file paint_image_proj.cc.
References IMA_SRC_TILED, project_paint_face_paint_tile(), and Image::source.
Referenced by check_seam(), project_bucket_init(), project_paint_face_paint_tile(), project_paint_PickColor(), and project_paint_prepare_all_faces().
|
static |
Definition at line 4234 of file paint_image_proj.cc.
References FLT_MAX, ProjPaintState::is_ortho, project_paint_flt_max_cull(), ProjPaintFaceCoSS::v1, ProjPaintFaceCoSS::v2, and ProjPaintFaceCoSS::v3.
Referenced by project_paint_flt_max_cull(), and 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)
Definition at line 806 of file paint_image_proj.cc.
References isect_point_tri_v2(), project_paint_occlude_ptv(), v2, VecZDepthOrtho(), VecZDepthPersp(), and w().
Referenced by project_bucket_point_occluded(), project_paint_occlude_ptv(), and project_paint_occlude_ptv_clip().
|
static |
Definition at line 844 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(), project_paint_occlude_ptv_clip(), ret, v2, and w().
Referenced by project_bucket_point_occluded(), and project_paint_occlude_ptv_clip().
|
static |
Definition at line 5612 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, i, ProjPaintImage::ibuf, ProjPaintState::image_tot, IMB_byte_from_float(), IMB_float_from_byte(), interp_v3_v3v3v3(), UnifiedPaintSettings::last_stroke_valid, mul_m4_v3(), ProjPaintState::obmat, partial_redraw_array_merge(), ProjPaintImage::partRedrawRect, ProjectHandle::pool, PROJ_BOUNDBOX_SQUARED, PROJ_SRC_VIEW, PROJ_SRC_VIEW_FILL, project_bucket_iter_init(), project_paint_op(), project_paint_PickFace(), ProjectHandle::projImages, ProjPaintState::projImages, ProjectHandle::ps, 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_PRIORITY_HIGH, ProjectHandle::thread_index, ProjPaintState::thread_tot, Scene::toolsettings, ProjPaintImage::touch, U, ToolSettings::unified_paint_settings, USER_ORBIT_SELECTION, ProjPaintState::vert_positions_eval, and w().
Referenced by paint_proj_stroke_ps(), project_paint_op(), and texture_paint_camera_project_exec().
|
static |
we must have got the imbuf before getting here.
Definition at line 731 of file paint_image_proj.cc.
References BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), BKE_imageuser_default(), blender::math::clamp(), ProjPaintState::corner_tri_faces_eval, ProjPaintState::corner_tris_eval, ImBufFloatBuffer::data, ImBuf::float_buffer, ImageUser::framenr, interp(), interp_v2_v2v2v2(), blender::imbuf::interpolate_bilinear_wrap_byte(), blender::imbuf::interpolate_bilinear_wrap_fl(), blender::imbuf::interpolate_nearest_wrap_byte(), blender::imbuf::interpolate_nearest_wrap_fl(), Image::lastframe, ProjPaintState::poly_to_loop_uv, premul_float_to_straight_uchar(), project_paint_face_paint_image(), project_paint_face_paint_tile(), project_paint_PickColor(), project_paint_PickFace(), PS_CORNER_TRI_ASSIGN_UV_3, straight_uchar_to_premul_float(), ImageUser::tile, UNPACK3, w(), ImBuf::x, x, ImBuf::y, and y.
Referenced by do_projectpaint_smear(), do_projectpaint_smear_f(), do_projectpaint_soften(), do_projectpaint_soften_f(), project_paint_PickColor(), and project_paint_uvpixel_init().
|
static |
will be -1 or a valid face.
Definition at line 684 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(), LinkNode::link, LinkNode::next, POINTER_AS_INT, project_bucket_offset_safe(), project_paint_PickFace(), ProjPaintState::screenCoords, UNPACK3, VecZDepthOrtho(), VecZDepthPersp(), and w().
Referenced by project_paint_op(), project_paint_PickColor(), and project_paint_PickFace().
|
static |
Definition at line 1792 of file paint_image_proj.cc.
References ELEM, IMAGE_PAINT_BRUSH_TYPE_CLONE, IMAGE_PAINT_BRUSH_TYPE_SMEAR, and project_paint_pixel_sizeof().
Referenced by project_paint_pixel_sizeof(), project_paint_uvpixel_init(), and project_state_init().
|
static |
Definition at line 4309 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(), MEM_callocN(), 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_prepare_all_faces(), project_paint_winclip(), blender::IndexRange::size(), ProjPaintState::stencil_ima, ImageUser::tile, tile, TexPaintSlot::uvname, ProjPaintFaceCoSS::v1, ProjPaintFaceCoSS::v2, ProjPaintFaceCoSS::v3, and ProjPaintState::vertFlags.
Referenced by project_paint_begin(), and project_paint_prepare_all_faces().
|
static |
Definition at line 1800 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, project_paint_undo_subtiles(), tile_index, TILE_PENDING, TileInfo::tile_width, TileInfo::tmpibuf, ProjPaintImage::undoRect, UNLIKELY, and ProjPaintImage::valid.
Referenced by project_paint_undo_subtiles(), and project_paint_uvpixel_init().
|
static |
Definition at line 1866 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, linearrgb_to_srgb_uchar3(), mask(), 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(), project_paint_uvpixel_init(), 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(), and project_paint_uvpixel_init().
|
static |
Definition at line 1651 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(), project_paint_uvpixel_mask(), 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(), and project_paint_uvpixel_mask().
|
static |
Definition at line 4246 of file paint_image_proj.cc.
References PROJ_SRC_VIEW_FILL, project_paint_winclip(), ProjPaintState::screenMax, ProjPaintState::screenMin, ProjPaintState::source, ProjPaintFaceCoSS::v1, ProjPaintFaceCoSS::v2, and ProjPaintFaceCoSS::v3.
Referenced by project_paint_prepare_all_faces(), and project_paint_winclip().
|
static |
Definition at line 5845 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, C, ImagePaintSettings::canvas, ProjPaintState::canvas_ima, Paint::cavity_curve, ProjPaintState::cavity_curve, ImagePaintSettings::clone, ProjPaintState::clone_ima, cosf, CTX_data_ensure_evaluated_depsgraph(), CTX_data_scene(), CTX_wm_region(), CTX_wm_region_view3d(), CTX_wm_view3d(), ProjPaintState::depsgraph, ImagePaintSettings::dither, 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, ImagePaintSettings::flag, Paint::flags, 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, ToolSettings::imapaint, ProjPaintState::is_maskbrush, ProjPaintState::is_texbrush, M_PI_2, Brush::mask_mtex, ImagePaintSettings::mode, ProjPaintState::mode, Brush::mtex, ImagePaintSettings::normal_angle, ProjPaintState::normal_angle, ProjPaintState::normal_angle__cos, ProjPaintState::normal_angle_inner, ProjPaintState::normal_angle_inner__cos, ProjPaintState::normal_angle_range, ProjPaintState::ob, ImagePaintSettings::paint, ProjPaintState::paint, paint_new_blur_kernel(), PAINT_USE_CAVITY_MASK, paint_use_opacity_masking(), ProjPaintState::pixel_sizeof, project_paint_pixel_sizeof(), project_state_init(), ProjPaintState::region, ProjPaintState::rv3d, ProjPaintState::scene, ImagePaintSettings::seam_bleed, ProjPaintState::seam_bleed_px, ProjPaintState::seam_bleed_px_sq, square_s(), ImagePaintSettings::stencil, ProjPaintState::stencil_ima, MTex::tex, Scene::toolsettings, and ProjPaintState::v3d.
Referenced by paint_proj_new_stroke(), project_state_init(), and texture_paint_camera_project_exec().
|
static |
Definition at line 2318 of file paint_image_proj.cc.
References barycentric_weights_v2(), interp_v2_v2v2v2(), rect_to_uvspace_ortho(), w(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_bucket_clip_face(), and rect_to_uvspace_ortho().
|
static |
Same as rect_to_uvspace_ortho but use barycentric_weights_v2_persp.
Definition at line 2356 of file paint_image_proj.cc.
References barycentric_weights_v2_persp(), interp_v2_v2v2v2(), rect_to_uvspace_persp(), w(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_bucket_clip_face(), and rect_to_uvspace_persp().
|
static |
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 2214 of file paint_image_proj.cc.
References add_v3_v3(), mul_v3_fl(), scale_tri(), and sub_v3_v3v3().
Referenced by project_paint_face_init(), and scale_tri().
|
static |
Definition at line 1525 of file paint_image_proj.cc.
References barycentric_weights_v2(), interp_v3_v3v3v3(), screen_px_from_ortho(), and w().
Referenced by project_paint_face_init(), and screen_px_from_ortho().
|
static |
Definition at line 1541 of file paint_image_proj.cc.
References barycentric_weights_v2(), interp_v3_v3v3v3(), screen_px_from_persp(), and w().
Referenced by project_paint_face_init(), and screen_px_from_persp().
|
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 1608 of file paint_image_proj.cc.
References line_point_factor_v2(), project_plane_v3_v3v3(), ProjPaintState::projectMatInv, screen_px_line_point_factor_v2_persp(), screen_px_to_vector_persp(), sub_v3_v3v3(), v2, ProjPaintState::viewPos, ProjPaintState::winx, and ProjPaintState::winy.
Referenced by project_paint_face_init(), and screen_px_line_point_factor_v2_persp().
|
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 1586 of file paint_image_proj.cc.
References mul_project_m4_v3(), screen_px_to_vector_persp(), and sub_v3_v3().
Referenced by screen_px_line_point_factor_v2_persp(), and screen_px_to_vector_persp().
|
static |
Definition at line 568 of file paint_image_proj.cc.
References ProjPaintState::mat_array, ProjPaintState::material_indices, and tex_get_material().
Referenced by project_paint_face_clone_image(), project_paint_face_clone_slot(), project_paint_face_paint_image(), project_paint_face_paint_slot(), and tex_get_material().
|
static |
Definition at line 6832 of file paint_image_proj.cc.
References C, OPERATOR_CANCELLED, OPERATOR_FINISHED, proj_paint_add_slot(), and texture_paint_add_texture_paint_slot_exec().
Referenced by PAINT_OT_add_texture_paint_slot(), and texture_paint_add_texture_paint_slot_exec().
|
static |
Definition at line 6850 of file paint_image_proj.cc.
References Object::actcol, BKE_object_material_get(), BLT_I18NCONTEXT_OPERATOR_DEFAULT, C, 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(), texture_paint_add_texture_paint_slot_invoke(), and WM_operator_props_dialog_popup().
Referenced by PAINT_OT_add_texture_paint_slot(), and texture_paint_add_texture_paint_slot_invoke().
|
static |
Definition at line 6874 of file paint_image_proj.cc.
References BLI_assert_unreachable, C, uiLayout::column(), 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, uiLayout::prop(), wmOperator::ptr, RNA_enum_get(), texture_paint_add_texture_paint_slot_ui(), UI_ITEM_NONE, UI_ITEM_R_EXPAND, uiLayoutSetPropDecorate(), and uiLayoutSetPropSep().
Referenced by PAINT_OT_add_texture_paint_slot(), and texture_paint_add_texture_paint_slot_ui().
|
static |
Definition at line 6109 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, C, Scene::camera, 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(), ImagePaintSettings::flag, ImBuf::float_buffer, Image::id, IDP_ARRAY, IDP_FLOAT, IDP_GetProperties(), IDP_GetPropertyTypeFromGroup(), ProjPaintImage::ima, IMAGE_PAINT_BRUSH_TYPE_DRAW, ProjPaintState::image_tot, IMAGEPAINT_DRAWING, Main::images, ToolSettings::imapaint, 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, 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, Texture3D, texture_paint_camera_project_exec(), Scene::toolsettings, Object::type, wmOperator::type, U, and WM_event_add_notifier().
Referenced by PAINT_OT_project_image(), and texture_paint_camera_project_exec().
|
static |
Definition at line 6261 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(), C, blender::bke::idprop::create(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_wm_screen(), ED_view3d_clip_range_get(), ED_view3d_draw_offscreen_imbuf(), FILE_MAX, ImBuf::filepath, ListBase::first, View3D::flag, View3DOverlay::flag, View3D::flag2, View3D::gizmo_flag, GPU_max_texture_size(), View3D::gridflag, IB_byte_data, Image::id, IDP_AddToGroup(), IDP_EnsureProperties(), ToolSettings::imapaint, IMB_freeImBuf(), OPERATOR_CANCELLED, OPERATOR_FINISHED, View3D::overlay, PROJ_VIEW_DATA_ID, wmOperator::ptr, R_ALPHAPREMUL, ARegion::regiondata, wmOperator::reports, RNA_string_get(), RPT_ERROR, ImagePaintSettings::screen_grab_size, View3D::shading, SPACE_VIEW3D, ScrArea::spacedata, Span< T >::Span(), STRNCPY(), texture_paint_image_from_view_exec(), View3DOverlay::texture_paint_mode_opacity, Scene::toolsettings, 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(), and texture_paint_image_from_view_exec().
|
static |
Definition at line 6248 of file paint_image_proj.cc.
References BKE_screen_find_big_area(), C, CTX_wm_operator_poll_msg_set(), CTX_wm_screen(), G, GPU_is_init(), SPACE_VIEW3D, and texture_paint_image_from_view_poll().
Referenced by PAINT_OT_image_from_view(), and texture_paint_image_from_view_poll().
|
static |
Definition at line 1288 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(), FLT_MAX, i, 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, UNLIKELY, and uv_image_outset().
Referenced by project_paint_face_init(), and uv_image_outset().
|
static |
Definition at line 642 of file paint_image_proj.cc.
References barycentric_weights_v2(), v2, VecZDepthOrtho(), and w().
Referenced by project_paint_occlude_ptv(), project_paint_PickFace(), and VecZDepthOrtho().
|
static |
Definition at line 649 of file paint_image_proj.cc.
References barycentric_weights_v2_persp(), v2, VecZDepthPersp(), and w().
Referenced by project_paint_occlude_ptv(), project_paint_PickFace(), and VecZDepthPersp().
|
static |
Definition at line 6511 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().