Blender  V3.3
Classes | Macros | Typedefs | Enumerations | Functions | Variables
paint_image_proj.c File Reference

Functions to paint images in 2D and 3D. More...

#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_linklist.h"
#include "BLI_math.h"
#include "BLI_math_bits.h"
#include "BLI_math_color_blend.h"
#include "BLI_memarena.h"
#include "BLI_task.h"
#include "BLI_threads.h"
#include "BLI_utildefines.h"
#include "atomic_ops.h"
#include "BLT_translation.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#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_meshdata_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.h"
#include "BKE_brush.h"
#include "BKE_camera.h"
#include "BKE_colorband.h"
#include "BKE_colortools.h"
#include "BKE_context.h"
#include "BKE_customdata.h"
#include "BKE_global.h"
#include "BKE_idprop.h"
#include "BKE_image.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_mesh.h"
#include "BKE_mesh_mapping.h"
#include "BKE_mesh_runtime.h"
#include "BKE_node.h"
#include "BKE_paint.h"
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_screen.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
#include "ED_node.h"
#include "ED_object.h"
#include "ED_paint.h"
#include "ED_screen.h"
#include "ED_uvedit.h"
#include "ED_view3d.h"
#include "ED_view3d_offscreen.h"
#include "GPU_capabilities.h"
#include "GPU_init_exit.h"
#include "NOD_shader.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "RNA_types.h"
#include "IMB_colormanagement.h"
#include "paint_intern.h"

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
 

Macros

#define PROJ_BUCKET_BRUSH_DIV   4
 
#define PROJ_BUCKET_RECT_MIN   4
 
#define PROJ_BUCKET_RECT_MAX   256
 
#define PROJ_BOUNDBOX_DIV   8
 
#define PROJ_BOUNDBOX_SQUARED   (PROJ_BOUNDBOX_DIV * PROJ_BOUNDBOX_DIV)
 
#define PROJ_DEBUG_WINCLIP   1
 
#define PROJ_FACE_SEAM0   (1 << 0)
 
#define PROJ_FACE_SEAM1   (1 << 1)
 
#define PROJ_FACE_SEAM2   (1 << 2)
 
#define PROJ_FACE_NOSEAM0   (1 << 4)
 
#define PROJ_FACE_NOSEAM1   (1 << 5)
 
#define PROJ_FACE_NOSEAM2   (1 << 6)
 
#define PROJ_FACE_SEAM_INIT0   (1 << 8)
 
#define PROJ_FACE_SEAM_INIT1   (1 << 9)
 
#define PROJ_FACE_SEAM_INIT2   (1 << 10)
 
#define PROJ_FACE_DEGENERATE   (1 << 12)
 
#define PROJ_FACE_WINDING_INIT   1
 
#define PROJ_FACE_WINDING_CW   2
 
#define PROJ_FACE_SCALE_SEAM   0.99f
 
#define PROJ_SRC_VIEW   1
 
#define PROJ_SRC_IMAGE_CAM   2
 
#define PROJ_SRC_IMAGE_VIEW   3
 
#define PROJ_SRC_VIEW_FILL   4
 
#define PROJ_VIEW_DATA_ID   "view_data"
 
#define PROJ_VIEW_DATA_SIZE   (4 * 4 + 4 * 4 + 3)
 
#define PROJ_BUCKET_NULL   0
 
#define PROJ_BUCKET_INIT   (1 << 0)
 
#define PROJ_GEOM_TOLERANCE   0.00075f
 
#define PROJ_PIXEL_TOLERANCE   0.01f
 
#define PROJ_VERT_CULL   1
 
#define TILE_PENDING   POINTER_FROM_INT(-1)
 
#define PROJ_PAINT_STATE_SHARED_MEMCPY(ps_dst, ps_src)    MEMCPY_STRUCT_AFTER(ps_dst, ps_src, is_shared_user)
 
#define PROJ_PAINT_STATE_SHARED_CLEAR(ps)   MEMSET_STRUCT_AFTER(ps, 0, is_shared_user)
 
#define ISECT_TRUE   1
 
#define ISECT_TRUE_P1   2
 
#define ISECT_TRUE_P2   3
 
#define ISECT_1   (1)
 
#define ISECT_2   (1 << 1)
 
#define ISECT_3   (1 << 2)
 
#define ISECT_4   (1 << 3)
 
#define ISECT_ALL3   ((1 << 3) - 1)
 
#define ISECT_ALL4   ((1 << 4) - 1)
 
#define IMA_DEF_NAME   N_("Untitled")
 

Typedefs

typedef struct ProjPaintImage ProjPaintImage
 
typedef struct ProjStrokeHandle ProjStrokeHandle
 
typedef struct LoopSeamData LoopSeamData
 
typedef struct ProjPaintState ProjPaintState
 
typedef union pixelPointer PixelPointer
 
typedef union pixelStore PixelStore
 
typedef struct ProjPixel ProjPixel
 
typedef struct ProjPixelClone ProjPixelClone
 
typedef struct VertSeam VertSeam
 
typedef struct PrepareImageEntry PrepareImageEntry
 
typedef struct ProjectHandle ProjectHandle
 

Enumerations

enum  {
  LAYER_BASE_COLOR , LAYER_SPECULAR , LAYER_ROUGHNESS , LAYER_METALLIC ,
  LAYER_NORMAL , LAYER_BUMP , LAYER_DISPLACEMENT
}
 

Functions

static void partial_redraw_array_init (ImagePaintPartialRedraw *pr)
 
BLI_INLINE uchar f_to_char (const float val)
 
static int project_paint_face_paint_tile (Image *ima, const float *uv)
 
static TexPaintSlotproject_paint_face_paint_slot (const ProjPaintState *ps, int tri_index)
 
static Imageproject_paint_face_paint_image (const ProjPaintState *ps, int tri_index)
 
static TexPaintSlotproject_paint_face_clone_slot (const ProjPaintState *ps, int tri_index)
 
static Imageproject_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 void uvco_to_wrapped_pxco (const float uv[2], int ibuf_x, int ibuf_y, float *x, float *y)
 
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], rcti *bounds_px, const int ibuf_x, const int ibuf_y)
 
static bool pixel_bounds_array (float(*uv)[2], rcti *bounds_px, const int ibuf_x, const int ibuf_y, int tot)
 
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 VertSeamfind_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 *lt_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 tool)
 
static int project_paint_undo_subtiles (const TileInfo *tinf, int tx, int ty)
 
static ProjPixelproject_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 *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 MLoopTri *lt)
 
static void project_paint_delayed_face_init (ProjPaintState *ps, const MLoopTri *lt, 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 MLoopTri *lt, 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_sel (const ProjPaintState *ps, const ProjPaintFaceLookup *face_lookup, const MLoopTri *lt)
 
static void proj_paint_face_coSS_init (const ProjPaintState *ps, const MLoopTri *lt, 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 MLoopUV *mloopuv_base, const bool is_multi_view)
 
static void project_paint_begin (const bContext *C, ProjPaintState *ps, const bool is_multi_view, const char symmetry_flag)
 
static void paint_proj_begin_clone (ProjPaintState *ps, const float mouse[2])
 
static void project_paint_end (ProjPaintState *ps)
 
static void partial_redraw_single_init (ImagePaintPartialRedraw *pr)
 
static bool partial_redraw_array_merge (ImagePaintPartialRedraw *pr, ImagePaintPartialRedraw *pr_other, int tot)
 
static bool project_image_refresh_tagged (ProjPaintState *ps)
 
static bool project_bucket_iter_init (ProjPaintState *ps, const float mval_f[2])
 
static bool project_bucket_iter_next (ProjPaintState *ps, int *bucket_index, rctf *bucket_bounds, const float mval[2])
 
static void do_projectpaint_clone (ProjPaintState *ps, ProjPixel *projPixel, float mask)
 
static void do_projectpaint_clone_f (ProjPaintState *ps, ProjPixel *projPixel, float mask)
 
static void do_projectpaint_smear (ProjPaintState *ps, ProjPixel *projPixel, float mask, MemArena *smearArena, LinkNode **smearPixels, const float co[2])
 
static void do_projectpaint_smear_f (ProjPaintState *ps, ProjPixel *projPixel, float mask, MemArena *smearArena, LinkNode **smearPixels_f, const float co[2])
 
static void do_projectpaint_soften_f (ProjPaintState *ps, ProjPixel *projPixel, float mask, MemArena *softenArena, LinkNode **softenPixels)
 
static void do_projectpaint_soften (ProjPaintState *ps, ProjPixel *projPixel, float mask, MemArena *softenArena, LinkNode **softenPixels)
 
static void do_projectpaint_draw (ProjPaintState *ps, ProjPixel *projPixel, const float texrgb[3], float mask, float dither, float u, float v)
 
static void do_projectpaint_draw_f (ProjPaintState *ps, ProjPixel *projPixel, const float texrgb[3], float mask)
 
static void do_projectpaint_mask (ProjPaintState *ps, ProjPixel *projPixel, float mask)
 
static void do_projectpaint_mask_f (ProjPaintState *ps, ProjPixel *projPixel, float mask)
 
static void image_paint_partial_redraw_expand (ImagePaintPartialRedraw *cell, const ProjPixel *projPixel)
 
static void copy_original_alpha_channel (ProjPixel *pixel, bool is_floatbuf)
 
static void do_projectpaint_thread (TaskPool *__restrict UNUSED(pool), 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 *UNUSED(C), 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)
 
voidpaint_proj_new_stroke (bContext *C, Object *ob, const float mouse[2], int mode)
 
void paint_proj_redraw (const bContext *C, void *ps_handle_p, bool final)
 
void paint_proj_stroke_done (void *ps_handle_p)
 
static int texture_paint_camera_project_exec (bContext *C, wmOperator *op)
 
void PAINT_OT_project_image (wmOperatorType *ot)
 
static bool texture_paint_image_from_view_poll (bContext *C)
 
static int texture_paint_image_from_view_exec (bContext *C, wmOperator *op)
 
void PAINT_OT_image_from_view (wmOperatorType *ot)
 
void ED_paint_data_warning (struct ReportList *reports, bool uvs, bool mat, bool tex, bool stencil)
 
bool ED_paint_proj_mesh_data_check (Scene *scene, Object *ob, bool *uvs, bool *mat, bool *tex, bool *stencil)
 
static Materialget_or_create_current_material (bContext *C, Object *ob)
 
static Imageproj_paint_image_create (wmOperator *op, Main *bmain, bool is_data)
 
static CustomDataLayerproj_paint_color_attribute_create (wmOperator *op, Object *ob)
 
static void default_paint_slot_color_get (int layer_type, Material *ma, float color[4])
 
static bool proj_paint_add_slot (bContext *C, wmOperator *op)
 
static int get_texture_layer_type (wmOperator *op, const char *prop_name)
 
static int texture_paint_add_texture_paint_slot_exec (bContext *C, wmOperator *op)
 
static void get_default_texture_layer_name_for_object (Object *ob, int texture_type, char *dst, int dst_length)
 
static int texture_paint_add_texture_paint_slot_invoke (bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 
static void texture_paint_add_texture_paint_slot_ui (bContext *C, wmOperator *op)
 
void PAINT_OT_add_texture_paint_slot (wmOperatorType *ot)
 
static int add_simple_uvs_exec (bContext *C, wmOperator *UNUSED(op))
 
static bool add_simple_uvs_poll (bContext *C)
 
void PAINT_OT_add_simple_uvs (wmOperatorType *ot)
 

Variables

static const EnumPropertyItem layer_type_items []
 

MLoopTri accessor functions.

#define PS_LOOPTRI_AS_VERT_INDEX_3(ps, lt)    ps->mloop_eval[lt->tri[0]].v, ps->mloop_eval[lt->tri[1]].v, ps->mloop_eval[lt->tri[2]].v,
 
#define PS_LOOPTRI_AS_UV_3(uvlayer, lt)
 
#define PS_LOOPTRI_ASSIGN_UV_3(uv_tri, uvlayer, lt)
 
BLI_INLINE const MPolyps_tri_index_to_mpoly (const ProjPaintState *ps, int tri_index)
 

Detailed Description

Functions to paint images in 2D and 3D.

Definition in file paint_image_proj.c.

Macro Definition Documentation

◆ IMA_DEF_NAME

#define IMA_DEF_NAME   N_("Untitled")

Definition at line 6806 of file paint_image_proj.c.

◆ ISECT_1

#define ISECT_1   (1)

Definition at line 2400 of file paint_image_proj.c.

◆ ISECT_2

#define ISECT_2   (1 << 1)

Definition at line 2401 of file paint_image_proj.c.

◆ ISECT_3

#define ISECT_3   (1 << 2)

Definition at line 2402 of file paint_image_proj.c.

◆ ISECT_4

#define ISECT_4   (1 << 3)

Definition at line 2403 of file paint_image_proj.c.

◆ ISECT_ALL3

#define ISECT_ALL3   ((1 << 3) - 1)

Definition at line 2404 of file paint_image_proj.c.

◆ ISECT_ALL4

#define ISECT_ALL4   ((1 << 4) - 1)

Definition at line 2405 of file paint_image_proj.c.

◆ ISECT_TRUE

#define ISECT_TRUE   1

Definition at line 942 of file paint_image_proj.c.

◆ ISECT_TRUE_P1

#define ISECT_TRUE_P1   2

Definition at line 943 of file paint_image_proj.c.

◆ ISECT_TRUE_P2

#define ISECT_TRUE_P2   3

Definition at line 944 of file paint_image_proj.c.

◆ PROJ_BOUNDBOX_DIV

#define PROJ_BOUNDBOX_DIV   8

Definition at line 128 of file paint_image_proj.c.

◆ PROJ_BOUNDBOX_SQUARED

#define PROJ_BOUNDBOX_SQUARED   (PROJ_BOUNDBOX_DIV * PROJ_BOUNDBOX_DIV)

Definition at line 129 of file paint_image_proj.c.

◆ PROJ_BUCKET_BRUSH_DIV

#define PROJ_BUCKET_BRUSH_DIV   4

Definition at line 123 of file paint_image_proj.c.

◆ PROJ_BUCKET_INIT

#define PROJ_BUCKET_INIT   (1 << 0)

Definition at line 177 of file paint_image_proj.c.

◆ PROJ_BUCKET_NULL

#define PROJ_BUCKET_NULL   0

Definition at line 176 of file paint_image_proj.c.

◆ PROJ_BUCKET_RECT_MAX

#define PROJ_BUCKET_RECT_MAX   256

Definition at line 126 of file paint_image_proj.c.

◆ PROJ_BUCKET_RECT_MIN

#define PROJ_BUCKET_RECT_MIN   4

Definition at line 125 of file paint_image_proj.c.

◆ PROJ_DEBUG_WINCLIP

#define PROJ_DEBUG_WINCLIP   1

Definition at line 134 of file paint_image_proj.c.

◆ PROJ_FACE_DEGENERATE

#define PROJ_FACE_DEGENERATE   (1 << 12)

Definition at line 155 of file paint_image_proj.c.

◆ PROJ_FACE_NOSEAM0

#define PROJ_FACE_NOSEAM0   (1 << 4)

Definition at line 146 of file paint_image_proj.c.

◆ PROJ_FACE_NOSEAM1

#define PROJ_FACE_NOSEAM1   (1 << 5)

Definition at line 147 of file paint_image_proj.c.

◆ PROJ_FACE_NOSEAM2

#define PROJ_FACE_NOSEAM2   (1 << 6)

Definition at line 148 of file paint_image_proj.c.

◆ PROJ_FACE_SCALE_SEAM

#define PROJ_FACE_SCALE_SEAM   0.99f

Definition at line 164 of file paint_image_proj.c.

◆ PROJ_FACE_SEAM0

#define PROJ_FACE_SEAM0   (1 << 0)

Definition at line 142 of file paint_image_proj.c.

◆ PROJ_FACE_SEAM1

#define PROJ_FACE_SEAM1   (1 << 1)

Definition at line 143 of file paint_image_proj.c.

◆ PROJ_FACE_SEAM2

#define PROJ_FACE_SEAM2   (1 << 2)

Definition at line 144 of file paint_image_proj.c.

◆ PROJ_FACE_SEAM_INIT0

#define PROJ_FACE_SEAM_INIT0   (1 << 8)

Definition at line 151 of file paint_image_proj.c.

◆ PROJ_FACE_SEAM_INIT1

#define PROJ_FACE_SEAM_INIT1   (1 << 9)

Definition at line 152 of file paint_image_proj.c.

◆ PROJ_FACE_SEAM_INIT2

#define PROJ_FACE_SEAM_INIT2   (1 << 10)

Definition at line 153 of file paint_image_proj.c.

◆ PROJ_FACE_WINDING_CW

#define PROJ_FACE_WINDING_CW   2

Definition at line 159 of file paint_image_proj.c.

◆ PROJ_FACE_WINDING_INIT

#define PROJ_FACE_WINDING_INIT   1

Definition at line 158 of file paint_image_proj.c.

◆ PROJ_GEOM_TOLERANCE

#define PROJ_GEOM_TOLERANCE   0.00075f

Definition at line 181 of file paint_image_proj.c.

◆ PROJ_PAINT_STATE_SHARED_CLEAR

#define PROJ_PAINT_STATE_SHARED_CLEAR (   ps)    MEMSET_STRUCT_AFTER(ps, 0, is_shared_user)

Definition at line 382 of file paint_image_proj.c.

◆ PROJ_PAINT_STATE_SHARED_MEMCPY

#define PROJ_PAINT_STATE_SHARED_MEMCPY (   ps_dst,
  ps_src 
)     MEMCPY_STRUCT_AFTER(ps_dst, ps_src, is_shared_user)

This data is owned by ProjStrokeHandle.ps_views[0], all other views re-use the data.

Definition at line 379 of file paint_image_proj.c.

◆ PROJ_PIXEL_TOLERANCE

#define PROJ_PIXEL_TOLERANCE   0.01f

Definition at line 182 of file paint_image_proj.c.

◆ PROJ_SRC_IMAGE_CAM

#define PROJ_SRC_IMAGE_CAM   2

Definition at line 168 of file paint_image_proj.c.

◆ PROJ_SRC_IMAGE_VIEW

#define PROJ_SRC_IMAGE_VIEW   3

Definition at line 169 of file paint_image_proj.c.

◆ PROJ_SRC_VIEW

#define PROJ_SRC_VIEW   1

Definition at line 167 of file paint_image_proj.c.

◆ PROJ_SRC_VIEW_FILL

#define PROJ_SRC_VIEW_FILL   4

Definition at line 170 of file paint_image_proj.c.

◆ PROJ_VERT_CULL

#define PROJ_VERT_CULL   1

Definition at line 185 of file paint_image_proj.c.

◆ PROJ_VIEW_DATA_ID

#define PROJ_VIEW_DATA_ID   "view_data"

Definition at line 172 of file paint_image_proj.c.

◆ PROJ_VIEW_DATA_SIZE

#define PROJ_VIEW_DATA_SIZE   (4 * 4 + 4 * 4 + 3)

Definition at line 174 of file paint_image_proj.c.

◆ PS_LOOPTRI_AS_UV_3

#define PS_LOOPTRI_AS_UV_3 (   uvlayer,
  lt 
)
Value:
uvlayer[lt->poly][lt->tri[0]].uv, uvlayer[lt->poly][lt->tri[1]].uv, \
uvlayer[lt->poly][lt->tri[2]].uv,

Definition at line 515 of file paint_image_proj.c.

◆ PS_LOOPTRI_AS_VERT_INDEX_3

#define PS_LOOPTRI_AS_VERT_INDEX_3 (   ps,
  lt 
)     ps->mloop_eval[lt->tri[0]].v, ps->mloop_eval[lt->tri[1]].v, ps->mloop_eval[lt->tri[2]].v,

Definition at line 512 of file paint_image_proj.c.

◆ PS_LOOPTRI_ASSIGN_UV_3

#define PS_LOOPTRI_ASSIGN_UV_3 (   uv_tri,
  uvlayer,
  lt 
)
Value:
{ \
(uv_tri)[0] = uvlayer[lt->poly][lt->tri[0]].uv; \
(uv_tri)[1] = uvlayer[lt->poly][lt->tri[1]].uv; \
(uv_tri)[2] = uvlayer[lt->poly][lt->tri[2]].uv; \
} \
((void)0)
SyclQueue void void size_t num_bytes void

Definition at line 519 of file paint_image_proj.c.

◆ TILE_PENDING

#define TILE_PENDING   POINTER_FROM_INT(-1)

Definition at line 188 of file paint_image_proj.c.

Typedef Documentation

◆ LoopSeamData

typedef struct LoopSeamData LoopSeamData

◆ PixelPointer

typedef union pixelPointer PixelPointer

◆ PixelStore

typedef union pixelStore PixelStore

◆ PrepareImageEntry

◆ ProjectHandle

typedef struct ProjectHandle ProjectHandle

◆ ProjPaintImage

This is mainly a convenience struct used so we can keep an array of images we use - their imbufs, etc, in 1 array, When using threads this array is copied for each thread because 'partRedrawRect' and 'touch' values would not be thread safe.

◆ ProjPaintState

◆ ProjPixel

typedef struct ProjPixel ProjPixel

◆ ProjPixelClone

◆ ProjStrokeHandle

Handle for stroke (operator customdata)

◆ VertSeam

typedef struct VertSeam VertSeam

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
LAYER_BASE_COLOR 
LAYER_SPECULAR 
LAYER_ROUGHNESS 
LAYER_METALLIC 
LAYER_NORMAL 
LAYER_BUMP 
LAYER_DISPLACEMENT 

Definition at line 6419 of file paint_image_proj.c.

Function Documentation

◆ add_simple_uvs_exec()

static int add_simple_uvs_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ add_simple_uvs_poll()

static bool add_simple_uvs_poll ( bContext C)
static

◆ check_seam()

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

◆ cmp_uv()

static bool cmp_uv ( const float  vec2a[2],
const float  vec2b[2] 
)
static

Definition at line 1021 of file paint_image_proj.c.

References fabsf, fmodf, and PROJ_GEOM_TOLERANCE.

Referenced by check_seam(), and find_adjacent_seam().

◆ compute_seam_normal()

static float compute_seam_normal ( VertSeam seam,
VertSeam adj,
float  r_no[2] 
)
static

Definition at line 1249 of file paint_image_proj.c.

References angle(), VertSeam::angle, cosf, M_PI, VertSeam::normal_cw, and sinf.

Referenced by uv_image_outset().

◆ copy_original_alpha_channel()

static void copy_original_alpha_channel ( ProjPixel pixel,
bool  is_floatbuf 
)
static

◆ default_paint_slot_color_get()

static void default_paint_slot_color_get ( int  layer_type,
Material ma,
float  color[4] 
)
static

Get a default color for the paint slot layer from a material's Principled BSDF.

Parameters
layer_typeThe layer type of the paint slot
maThe 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 6527 of file paint_image_proj.c.

References BLI_assert_unreachable, color, copy_v3_fl(), copy_v3_v3(), bNodeSocket::default_value, bNodeTreeType::idname, LAYER_BASE_COLOR, LAYER_BUMP, LAYER_DISPLACEMENT, LAYER_METALLIC, LAYER_NORMAL, LAYER_ROUGHNESS, LAYER_SPECULAR, layer_type_items, MEM_freeN, nodeAddStaticNode(), nodeFindSocket(), Material::nodetree, ntree, ntreeAddTree(), ntreeFindType(), ntreeFreeTree(), ntreeType_Shader, NULL, 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 texture_paint_add_texture_paint_slot_invoke().

◆ do_projectpaint_clone()

static void do_projectpaint_clone ( ProjPaintState ps,
ProjPixel projPixel,
float  mask 
)
static

◆ do_projectpaint_clone_f()

static void do_projectpaint_clone_f ( ProjPaintState ps,
ProjPixel projPixel,
float  mask 
)
static

◆ do_projectpaint_draw()

static void do_projectpaint_draw ( ProjPaintState ps,
ProjPixel projPixel,
const float  texrgb[3],
float  mask,
float  dither,
float  u,
float  v 
)
static

◆ do_projectpaint_draw_f()

static void do_projectpaint_draw_f ( ProjPaintState ps,
ProjPixel projPixel,
const float  texrgb[3],
float  mask 
)
static

◆ do_projectpaint_mask()

static void do_projectpaint_mask ( ProjPaintState ps,
ProjPixel projPixel,
float  mask 
)
static

◆ do_projectpaint_mask_f()

static void do_projectpaint_mask_f ( ProjPaintState ps,
ProjPixel projPixel,
float  mask 
)
static

◆ do_projectpaint_smear()

static void do_projectpaint_smear ( ProjPaintState ps,
ProjPixel projPixel,
float  mask,
MemArena smearArena,
LinkNode **  smearPixels,
const float  co[2] 
)
static
Note
mask is used to modify the alpha here, this is not correct since it allows accumulation of color greater than 'projPixel->mask' however in the case of smear its not really that important to be correct as it is with clone and painting

Definition at line 4841 of file paint_image_proj.c.

References blend_color_interpolate_byte(), BLI_linklist_prepend_arena(), pixelPointer::ch_pt, mask(), NULL, ProjPixel::pixel, and project_paint_PickColor().

Referenced by do_projectpaint_thread().

◆ do_projectpaint_smear_f()

static void do_projectpaint_smear_f ( ProjPaintState ps,
ProjPixel projPixel,
float  mask,
MemArena smearArena,
LinkNode **  smearPixels_f,
const float  co[2] 
)
static

◆ do_projectpaint_soften()

static void do_projectpaint_soften ( ProjPaintState ps,
ProjPixel projPixel,
float  mask,
MemArena softenArena,
LinkNode **  softenPixels 
)
static

◆ do_projectpaint_soften_f()

static void do_projectpaint_soften_f ( ProjPaintState ps,
ProjPixel projPixel,
float  mask,
MemArena softenArena,
LinkNode **  softenPixels 
)
static

◆ do_projectpaint_thread()

static void do_projectpaint_thread ( TaskPool *__restrict   UNUSEDpool,
void ph_v 
)
static

Definition at line 5124 of file paint_image_proj.c.

References ProjPixel::bb_cell_index, bicubic_interpolation_color(), BKE_brush_alpha_get(), BKE_brush_curve_strength_clamped(), BKE_brush_sample_masktex(), BKE_brush_sample_tex_3d(), BKE_colorband_evaluate(), ProjPaintState::blend, Brush::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, BRUSH_USE_GRADIENT, ProjPaintState::bucketFlags, ProjPaintState::bucketRect, pixelStore::ch, pixelPointer::ch_pt, CLAMP, copy_original_alpha_channel(), copy_v2_v2(), copy_v3_v3(), copy_v4_v4(), ProjPaintState::dither, ProjPaintState::do_masking, do_projectpaint_clone(), do_projectpaint_clone_f(), do_projectpaint_draw(), do_projectpaint_draw_f(), do_projectpaint_mask(), do_projectpaint_mask_f(), do_projectpaint_smear(), do_projectpaint_smear_f(), do_projectpaint_soften(), do_projectpaint_soften_f(), dot_v2v2(), ELEM, pixelStore::f, pixelPointer::f_pt, Brush::flag, float(), float_to_byte_dither_v3(), Brush::gradient, Brush::gradient_fill_mode, ProjPaintImage::ibuf, if(), ProjPixel::image_index, image_paint_partial_redraw_expand(), IMB_BLEND_ADD_ALPHA, IMB_blend_color_byte(), IMB_blend_color_float(), IMB_BLEND_ERASE_ALPHA, ProjPaintState::is_maskbrush, ProjPaintState::is_texbrush, len_squared_v2(), len_squared_v2v2(), len_v2(), linearrgb_to_srgb_v3_v3(), mask(), ProjPixel::mask, ProjPixel::mask_accum, MEM_SIZE_OPTIMAL, min_ff(), Brush::mtex, MTEX_MAP_MODE_3D, mul_v3_fl(), mul_v4_v4fl(), ProjPixel::newColor, node, NULL, ProjPixel::origColor, ProjPaintState::paint_color, ProjPaintState::paint_color_linear, PAINT_TOOL_CLONE, PAINT_TOOL_MASK, PAINT_TOOL_SMEAR, PAINT_TOOL_SOFTEN, ProjPaintImage::partRedrawRect, ProjPixel::pixel, blender::compositor::pool, pos, PROJ_BUCKET_NULL, PROJ_PIXEL_TOLERANCE, PROJ_SRC_VIEW, PROJ_SRC_VIEW_FILL, ProjPixel::projCoSS, project_bucket_init(), project_bucket_iter_next(), ImBuf::rect, ImBuf::rect_float, ProjPaintState::reproject_ibuf, rgb_float_to_uchar(), ProjPaintState::scene, ProjPaintState::source, sqrtf, sub_v2_v2v2(), ProjPaintState::tool, ProjPaintImage::touch, pixelStore::uint, pixelPointer::uint_pt, unit_float_to_uchar_clamp(), unit_float_to_uchar_clamp_v3, ProjPixel::valid, ProjPixel::worldCoSS, ProjPixel::x_px, rctf::xmax, rctf::xmin, ProjPixel::y_px, rctf::ymax, rctf::ymin, and zero_v3().

Referenced by project_paint_op().

◆ ED_paint_data_warning()

void ED_paint_data_warning ( struct ReportList reports,
bool  uvs,
bool  mat,
bool  tex,
bool  stencil 
)

◆ ED_paint_proj_mesh_data_check()

bool ED_paint_proj_mesh_data_check ( struct Scene scene,
struct Object ob,
bool uvs,
bool mat,
bool tex,
bool stencil 
)

◆ f_to_char()

BLI_INLINE uchar f_to_char ( const float  val)

Definition at line 110 of file paint_image_proj.c.

References unit_float_to_uchar_clamp().

Referenced by do_projectpaint_draw(), and do_projectpaint_mask().

◆ find_adjacent_seam()

static VertSeam* find_adjacent_seam ( const ProjPaintState ps,
uint  loop_index,
uint  vert_index,
VertSeam **  r_seam 
)
static

◆ float_z_sort()

static int float_z_sort ( const void p1,
const void p2 
)
static

Definition at line 2424 of file paint_image_proj.c.

Referenced by project_bucket_clip_face().

◆ float_z_sort_flip()

static int float_z_sort_flip ( const void p1,
const void p2 
)
static

Clip the face by a bucket and set the uv-space bucket_bounds_uv so we have the clipped UV's to do pixel intersection tests with

Definition at line 2419 of file paint_image_proj.c.

Referenced by project_bucket_clip_face().

◆ get_default_texture_layer_name_for_object()

static void get_default_texture_layer_name_for_object ( Object ob,
int  texture_type,
char *  dst,
int  dst_length 
)
static

◆ get_or_create_current_material()

static Material* get_or_create_current_material ( bContext C,
Object ob 
)
static

◆ get_texture_layer_type()

static int get_texture_layer_type ( wmOperator op,
const char *  prop_name 
)
static

◆ image_paint_partial_redraw_expand()

static void image_paint_partial_redraw_expand ( ImagePaintPartialRedraw cell,
const ProjPixel projPixel 
)
static

◆ insert_seam_vert_array()

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

◆ IsectPoly2Df()

static bool IsectPoly2Df ( const float  pt[2],
const float  uv[][2],
const int  tot 
)
static

Definition at line 2926 of file paint_image_proj.c.

References line_point_side_v2().

Referenced by project_paint_face_init().

◆ IsectPoly2Df_twoside()

static bool IsectPoly2Df_twoside ( const float  pt[2],
const float  uv[][2],
const int  tot 
)
static

Definition at line 2941 of file paint_image_proj.c.

References line_point_side_v2().

Referenced by project_paint_face_init().

◆ IsectPT2Df_limit()

static bool IsectPT2Df_limit ( const float  pt[2],
const float  v1[2],
const float  v2[2],
const float  v3[2],
const float  limit 
)
static

Definition at line 2408 of file paint_image_proj.c.

References area_tri_v2(), v1, and v2.

Referenced by project_bucket_clip_face().

◆ len_squared_v2v2_alt()

static float len_squared_v2v2_alt ( const float  v1[2],
const float  v2_1,
const float  v2_2 
)
static

Definition at line 2231 of file paint_image_proj.c.

References v1, x, and y.

Referenced by project_bucket_isect_circle().

◆ line_clip_rect2f()

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

◆ line_isect_x()

static int line_isect_x ( const float  p1[2],
const float  p2[2],
const float  x_level,
float y_isect 
)
static

Definition at line 981 of file paint_image_proj.c.

References fabsf, ISECT_TRUE, ISECT_TRUE_P1, and ISECT_TRUE_P2.

Referenced by line_clip_rect2f().

◆ line_isect_y()

static int line_isect_y ( const float  p1[2],
const float  p2[2],
const float  y_level,
float x_isect 
)
static

yuck, horizontal line, we can't do much here.

Definition at line 945 of file paint_image_proj.c.

References fabsf, ISECT_TRUE, ISECT_TRUE_P1, and ISECT_TRUE_P2.

Referenced by line_clip_rect2f().

◆ line_rect_clip()

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

Definition at line 2430 of file paint_image_proj.c.

References min, min_ff(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.

Referenced by project_bucket_clip_face().

◆ PAINT_OT_add_simple_uvs()

void PAINT_OT_add_simple_uvs ( wmOperatorType ot)

◆ PAINT_OT_add_texture_paint_slot()

void PAINT_OT_add_texture_paint_slot ( wmOperatorType ot)

◆ PAINT_OT_image_from_view()

void PAINT_OT_image_from_view ( wmOperatorType ot)

◆ PAINT_OT_project_image()

void PAINT_OT_project_image ( wmOperatorType ot)

◆ paint_proj_begin_clone()

static void paint_proj_begin_clone ( ProjPaintState ps,
const float  mouse[2] 
)
static

◆ paint_proj_new_stroke()

void* paint_proj_new_stroke ( bContext C,
Object ob,
const float  mouse[2],
int  mode 
)

◆ paint_proj_redraw()

void paint_proj_redraw ( const bContext C,
void ps_handle_p,
bool  final 
)

◆ paint_proj_stroke()

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 
)

◆ paint_proj_stroke_done()

void paint_proj_stroke_done ( void ps_handle_p)

◆ paint_proj_stroke_ps()

static void paint_proj_stroke_ps ( const bContext UNUSEDC,
void ps_handle_p,
const float  prev_pos[2],
const float  pos[2],
const bool  eraser,
float  pressure,
float  distance,
float  size,
ProjPaintState ps 
)
static

◆ partial_redraw_array_init()

static void partial_redraw_array_init ( ImagePaintPartialRedraw pr)
static

◆ partial_redraw_array_merge()

static bool partial_redraw_array_merge ( ImagePaintPartialRedraw pr,
ImagePaintPartialRedraw pr_other,
int  tot 
)
static

◆ partial_redraw_single_init()

static void partial_redraw_single_init ( ImagePaintPartialRedraw pr)
static

◆ pixel_bounds_array()

static bool pixel_bounds_array ( float(*)  uv[2],
rcti bounds_px,
const int  ibuf_x,
const int  ibuf_y,
int  tot 
)
static

◆ pixel_bounds_uv()

static bool pixel_bounds_uv ( const float  uv_quad[4][2],
rcti bounds_px,
const int  ibuf_x,
const int  ibuf_y 
)
static

◆ proj_paint_add_slot()

static bool proj_paint_add_slot ( bContext C,
wmOperator op 
)
static

◆ proj_paint_color_attribute_create()

static CustomDataLayer* proj_paint_color_attribute_create ( wmOperator op,
Object ob 
)
static

◆ proj_paint_face_coSS_init()

static void proj_paint_face_coSS_init ( const ProjPaintState ps,
const MLoopTri lt,
ProjPaintFaceCoSS coSS 
)
static

◆ proj_paint_face_lookup_init()

static void proj_paint_face_lookup_init ( const ProjPaintState ps,
ProjPaintFaceLookup face_lookup 
)
static

◆ proj_paint_image_create()

static Image* proj_paint_image_create ( wmOperator op,
Main bmain,
bool  is_data 
)
static

◆ proj_paint_layer_clone_init()

static void proj_paint_layer_clone_init ( ProjPaintState ps,
ProjPaintLayerClone layer_clone 
)
static

◆ proj_paint_state_cavity_init()

static void proj_paint_state_cavity_init ( ProjPaintState ps)
static

◆ proj_paint_state_mesh_eval_init()

static bool proj_paint_state_mesh_eval_init ( const bContext C,
ProjPaintState ps 
)
static

◆ proj_paint_state_screen_coords_init()

static void proj_paint_state_screen_coords_init ( ProjPaintState ps,
const int  diameter 
)
static

◆ proj_paint_state_seam_bleed_init()

static void proj_paint_state_seam_bleed_init ( ProjPaintState ps)
static

◆ proj_paint_state_thread_init()

static void proj_paint_state_thread_init ( ProjPaintState ps,
const bool  reset_threads 
)
static

◆ proj_paint_state_vert_flags_init()

static void proj_paint_state_vert_flags_init ( ProjPaintState ps)
static

◆ proj_paint_state_viewport_init()

static void proj_paint_state_viewport_init ( ProjPaintState ps,
const char  symmetry_flag 
)
static

◆ project_bucket_bounds()

static void project_bucket_bounds ( const ProjPaintState ps,
const int  bucket_x,
const int  bucket_y,
rctf bucket_bounds 
)
static

◆ project_bucket_clip_face()

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

◆ project_bucket_face_isect()

static bool project_bucket_face_isect ( ProjPaintState ps,
int  bucket_x,
int  bucket_y,
const MLoopTri lt 
)
static

◆ project_bucket_init()

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

◆ project_bucket_isect_circle()

static bool project_bucket_isect_circle ( const float  cent[2],
const float  radius_squared,
const rctf bucket_bounds 
)
static
Note
Use a squared value so we can use len_squared_v2v2 be sure that you have done a bounds check first or this may fail.

Only give bucket_bounds as an arg because we need it elsewhere.

Definition at line 2246 of file paint_image_proj.c.

References BLI_rctf_isect_pt_v(), len_squared_v2v2_alt(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.

Referenced by project_bucket_iter_next().

◆ project_bucket_iter_init()

static bool project_bucket_iter_init ( ProjPaintState ps,
const float  mval_f[2] 
)
static

◆ project_bucket_iter_next()

static bool project_bucket_iter_next ( ProjPaintState ps,
int *  bucket_index,
rctf bucket_bounds,
const float  mval[2] 
)
static

◆ project_bucket_offset()

static int project_bucket_offset ( const ProjPaintState ps,
const float  projCoSS[2] 
)
static

Fast projection bucket array lookup, use the safe version for bound checking.

Definition at line 580 of file paint_image_proj.c.

References ProjPaintState::buckets_x, ProjPaintState::buckets_y, ProjPaintState::screen_height, ProjPaintState::screen_width, and ProjPaintState::screenMin.

Referenced by project_bucket_offset_safe().

◆ project_bucket_offset_safe()

static int project_bucket_offset_safe ( const ProjPaintState ps,
const float  projCoSS[2] 
)
static

◆ project_bucket_point_occluded()

static bool project_bucket_point_occluded ( const ProjPaintState ps,
LinkNode bucketFace,
const int  orig_face,
const float  pixelScreenCo[4] 
)
static

◆ project_face_pixel()

static void project_face_pixel ( const float lt_tri_uv[3],
ImBuf ibuf_other,
const float  w[3],
uchar  rgba_ub[4],
float  rgba_f[4] 
)
static

◆ project_face_seams_init()

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

◆ project_face_winding_init()

static void project_face_winding_init ( const ProjPaintState ps,
const int  tri_index 
)
static

◆ project_image_refresh_tagged()

static bool project_image_refresh_tagged ( ProjPaintState ps)
static

◆ project_paint_begin()

static void project_paint_begin ( const bContext C,
ProjPaintState ps,
const bool  is_multi_view,
const char  symmetry_flag 
)
static

◆ project_paint_bleed_add_face_user()

static void project_paint_bleed_add_face_user ( const ProjPaintState ps,
MemArena arena,
const MLoopTri lt,
const int  tri_index 
)
static

◆ project_paint_bucket_bounds()

static void project_paint_bucket_bounds ( const ProjPaintState ps,
const float  min[2],
const float  max[2],
int  bucketMin[2],
int  bucketMax[2] 
)
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 3426 of file paint_image_proj.c.

References ProjPaintState::buckets_x, ProjPaintState::buckets_y, CLAMP, float(), max, min, ProjPaintState::screen_height, ProjPaintState::screen_width, and ProjPaintState::screenMin.

Referenced by project_bucket_iter_init(), and project_paint_delayed_face_init().

◆ project_paint_build_proj_ima()

static void project_paint_build_proj_ima ( ProjPaintState ps,
MemArena arena,
ListBase used_images 
)
static

◆ project_paint_check_face_sel()

static bool project_paint_check_face_sel ( const ProjPaintState ps,
const ProjPaintFaceLookup face_lookup,
const MLoopTri lt 
)
static

◆ project_paint_clone_face_skip()

static bool project_paint_clone_face_skip ( ProjPaintState ps,
ProjPaintLayerClone lc,
const TexPaintSlot slot,
const int  tri_index 
)
static

◆ project_paint_delayed_face_init()

static void project_paint_delayed_face_init ( ProjPaintState ps,
const MLoopTri lt,
const int  tri_index 
)
static

◆ project_paint_end()

static void project_paint_end ( ProjPaintState ps)
static

◆ project_paint_face_clone_image()

static Image* project_paint_face_clone_image ( const ProjPaintState ps,
int  tri_index 
)
static

◆ project_paint_face_clone_slot()

static TexPaintSlot* project_paint_face_clone_slot ( const ProjPaintState ps,
int  tri_index 
)
static

◆ project_paint_face_init()

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

Definition at line 2959 of file paint_image_proj.c.

References ProjPaintState::arena_mt, BLI_linklist_prepend_arena(), BLI_thread_lock(), BLI_thread_unlock(), ProjPaintState::brush, MTex::brush_map_mode, ProjPaintState::bucketFaces, ProjPaintState::bucketRect, MVert::co, LoopSeamData::corner_dist_sq, ProjPaintState::do_backfacecull, ProjPaintState::do_masking, ProjPaintState::do_occlude, ED_IMAGE_UNDO_TILE_NUMBER, ED_view3d_clipping_test(), equals_v2v2(), ProjPaintState::faceSeamFlags, float(), interp_v2_v2v2(), interp_v3_v3v3(), interp_v3_v3v3v3(), ProjPaintState::is_flip_object, ProjPaintState::is_ortho, isect_point_quad_v2(), isect_point_tri_v2(), IsectPoly2Df(), IsectPoly2Df_twoside(), len_squared_v2v2(), line_clip_rect2f(), line_point_factor_v2(), LOCK_CUSTOM1, ProjPaintState::loopSeamData, mask(), ProjPaintState::mlooptri_eval, Brush::mtex, MTEX_MAP_MODE_3D, mul_m4_v4(), ProjPaintState::mvert_eval, pixel_bounds_array(), pixel_bounds_uv(), ProjPaintState::poly_to_loop_uv, PROJ_FACE_DEGENERATE, PROJ_FACE_SCALE_SEAM, PROJ_FACE_SEAM0, PROJ_FACE_SEAM1, PROJ_FACE_SEAM2, PROJ_FACE_SEAM_INIT0, PROJ_FACE_SEAM_INIT1, PROJ_FACE_SEAM_INIT2, PROJ_PIXEL_TOLERANCE, project_bucket_clip_face(), project_bucket_point_occluded(), project_face_seams_init(), project_paint_uvpixel_init(), project_paint_uvpixel_mask(), ProjPaintState::projectMat, ProjPaintState::projImages, PS_LOOPTRI_AS_UV_3, PS_LOOPTRI_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, MLoopTri::tri, UNPACK3, UNPACK4, UNUSED_VARS, uv_image_outset(), ProjPaintState::v3d, w(), ProjPaintState::winx, ProjPaintState::winy, x, ImBuf::x, rcti::xmax, rcti::xmin, y, ImBuf::y, rcti::ymax, and rcti::ymin.

Referenced by project_bucket_init().

◆ project_paint_face_paint_image()

static Image* project_paint_face_paint_image ( const ProjPaintState ps,
int  tri_index 
)
static

◆ project_paint_face_paint_slot()

static TexPaintSlot* project_paint_face_paint_slot ( const ProjPaintState ps,
int  tri_index 
)
static

◆ project_paint_face_paint_tile()

static int project_paint_face_paint_tile ( Image ima,
const float uv 
)
static

◆ project_paint_flt_max_cull()

static bool project_paint_flt_max_cull ( const ProjPaintState ps,
const ProjPaintFaceCoSS coSS 
)
static

◆ project_paint_occlude_ptv()

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

Check if 'pt' is in front of the 3 verts on the Z axis (used for screen-space occlusion test)

Returns
  • 0: no occlusion
  • -1: no occlusion but 2D intersection is true
  • 1: occluded
  • 2: occluded with w[3] weights set (need to know in some cases)

Definition at line 815 of file paint_image_proj.c.

References isect_point_tri_v2(), v1, v2, VecZDepthOrtho(), VecZDepthPersp(), and w().

Referenced by project_bucket_point_occluded(), and project_paint_occlude_ptv_clip().

◆ project_paint_occlude_ptv_clip()

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

◆ project_paint_op()

static bool project_paint_op ( void state,
const float  lastpos[2],
const float  pos[2] 
)
static

◆ project_paint_PickColor()

static bool project_paint_PickColor ( const ProjPaintState ps,
const float  pt[2],
float rgba_fp,
uchar rgba,
const bool  interp 
)
static

◆ project_paint_PickFace()

static int project_paint_PickFace ( const ProjPaintState ps,
const float  pt[2],
float  w[3] 
)
static

◆ project_paint_pixel_sizeof()

static int project_paint_pixel_sizeof ( const short  tool)
static

Definition at line 1787 of file paint_image_proj.c.

References ELEM, PAINT_TOOL_CLONE, and PAINT_TOOL_SMEAR.

Referenced by project_paint_uvpixel_init(), and project_state_init().

◆ project_paint_prepare_all_faces()

static void project_paint_prepare_all_faces ( ProjPaintState ps,
MemArena arena,
const ProjPaintFaceLookup face_lookup,
ProjPaintLayerClone layer_clone,
const MLoopUV mloopuv_base,
const bool  is_multi_view 
)
static

◆ project_paint_undo_subtiles()

static int project_paint_undo_subtiles ( const TileInfo tinf,
int  tx,
int  ty 
)
static

◆ project_paint_uvpixel_init()

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

Definition at line 1861 of file paint_image_proj.c.

References ProjPixel::bb_cell_index, BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), BLI_assert, BLI_memarena_alloc(), ProjPaintState::brush, MTex::brush_map_mode, pixelPointer::ch_pt, ProjPaintState::cloneOffset, copy_v2_v2(), copy_v3_v3(), ProjPaintState::do_masking, ED_IMAGE_UNDO_TILE_BITS, ED_IMAGE_UNDO_TILE_NUMBER, ED_IMAGE_UNDO_TILE_SIZE, pixelStore::f, pixelPointer::f_pt, float(), ProjPaintImage::ibuf, ProjPixel::image_index, linearrgb_to_srgb_uchar3(), mask(), ProjPixel::mask, ProjPixel::mask_accum, ProjPaintImage::maskRect, ProjPaintState::mlooptri_eval, mod_i(), Brush::mtex, MTEX_MAP_MODE_3D, ProjPixel::newColor, NULL, ProjPixel::origColor, PAINT_TOOL_CLONE, ProjPixel::pixel, ProjPaintState::pixel_sizeof, TileInfo::pjima, ProjPaintState::poly_to_loop_uv_clone, premul_to_straight_v4(), PROJ_BOUNDBOX_DIV, ProjPixel::projCoSS, project_face_pixel(), project_paint_face_clone_image(), project_paint_PickColor(), project_paint_pixel_sizeof(), project_paint_undo_subtiles(), ProjPaintState::projImages, PS_LOOPTRI_AS_UV_3, ImBuf::rect, ImBuf::rect_float, rgb_float_to_uchar(), usdtokens::rgba(), rgba_uchar_to_float(), srgb_to_linearrgb_uchar4(), straight_to_premul_v4_v4(), sub_v2_v2v2(), tile_index, TILE_PENDING, ProjPaintState::tool, pixelStore::uint, pixelPointer::uint_pt, ProjPaintImage::undoRect, ProjPaintState::use_colormanagement, 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().

◆ project_paint_uvpixel_mask()

static float project_paint_uvpixel_mask ( const ProjPaintState ps,
const int  tri_index,
const float  w[3] 
)
static

◆ project_paint_winclip()

static bool project_paint_winclip ( const ProjPaintState ps,
const ProjPaintFaceCoSS coSS 
)
static

◆ project_state_init()

static void project_state_init ( bContext C,
Object ob,
ProjPaintState ps,
int  mode 
)
static

Definition at line 5775 of file paint_image_proj.c.

References BKE_paint_brush(), BKE_scene_check_color_management_enabled(), ProjPaintState::blend, Brush::blend, BLI_assert, ProjPaintState::blurkernel, ProjPaintState::brush, BRUSH_DIR_IN, BRUSH_STROKE_INVERT, BRUSH_STROKE_NORMAL, C, ImagePaintSettings::canvas, ProjPaintState::canvas_ima, ProjPaintState::cavity_curve, Paint::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, ProjPaintState::dither, ImagePaintSettings::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, float(), 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, Brush::imagepaint_tool, ToolSettings::imapaint, ProjPaintState::is_maskbrush, ProjPaintState::is_texbrush, M_PI_2, Brush::mask_mtex, ProjPaintState::mode, ImagePaintSettings::mode, Brush::mtex, ProjPaintState::normal_angle, ImagePaintSettings::normal_angle, ProjPaintState::normal_angle__cos, ProjPaintState::normal_angle_inner, ProjPaintState::normal_angle_inner__cos, ProjPaintState::normal_angle_range, NULL, ProjPaintState::ob, ImagePaintSettings::paint, paint_new_blur_kernel(), PAINT_TOOL_CLONE, PAINT_TOOL_DRAW, PAINT_TOOL_FILL, PAINT_TOOL_MASK, PAINT_TOOL_SOFTEN, PAINT_USE_CAVITY_MASK, paint_use_opacity_masking(), ProjPaintState::pixel_sizeof, project_paint_pixel_sizeof(), ProjPaintState::region, ProjPaintState::rv3d, scene, ProjPaintState::scene, ImagePaintSettings::seam_bleed, ProjPaintState::seam_bleed_px, ProjPaintState::seam_bleed_px_sq, square_s(), ImagePaintSettings::stencil, ProjPaintState::stencil_ima, MTex::tex, ProjPaintState::tool, Scene::toolsettings, ProjPaintState::use_colormanagement, and ProjPaintState::v3d.

Referenced by paint_proj_new_stroke(), and texture_paint_camera_project_exec().

◆ ps_tri_index_to_mpoly()

BLI_INLINE const MPoly* ps_tri_index_to_mpoly ( const ProjPaintState ps,
int  tri_index 
)

◆ rect_to_uvspace_ortho()

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

◆ rect_to_uvspace_persp()

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

◆ scale_tri()

static void scale_tri ( float  insetCos[3][3],
const float origCos[3],
const float  inset 
)
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 2210 of file paint_image_proj.c.

References add_v3_v3(), mul_v3_fl(), and sub_v3_v3v3().

Referenced by project_paint_face_init().

◆ screen_px_from_ortho()

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

Definition at line 1521 of file paint_image_proj.c.

References barycentric_weights_v2(), interp_v3_v3v3v3(), VertSeam::uv, and w().

Referenced by project_paint_face_init().

◆ screen_px_from_persp()

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

Definition at line 1537 of file paint_image_proj.c.

References barycentric_weights_v2(), interp_v3_v3v3v3(), VertSeam::uv, and w().

Referenced by project_paint_face_init().

◆ screen_px_line_point_factor_v2_persp()

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

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.

Parameters
p2D screen-space location.
v1,v23D object-space locations.

Definition at line 1604 of file paint_image_proj.c.

References line_point_factor_v2(), project_plane_v3_v3v3(), ProjPaintState::projectMatInv, screen_px_to_vector_persp(), sub_v3_v3v3(), v1, v2, ProjPaintState::viewPos, ProjPaintState::winx, and ProjPaintState::winy.

Referenced by project_paint_face_init().

◆ screen_px_to_vector_persp()

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

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

Parameters
r_dirResulting direction (length is undefined).

Definition at line 1582 of file paint_image_proj.c.

References mul_project_m4_v3(), and sub_v3_v3().

Referenced by screen_px_line_point_factor_v2_persp().

◆ texture_paint_add_texture_paint_slot_exec()

static int texture_paint_add_texture_paint_slot_exec ( bContext C,
wmOperator op 
)
static

◆ texture_paint_add_texture_paint_slot_invoke()

static int texture_paint_add_texture_paint_slot_invoke ( bContext C,
wmOperator op,
const wmEvent UNUSEDevent 
)
static

◆ texture_paint_add_texture_paint_slot_ui()

static void texture_paint_add_texture_paint_slot_ui ( bContext C,
wmOperator op 
)
static

◆ texture_paint_camera_project_exec()

static int texture_paint_camera_project_exec ( bContext C,
wmOperator op 
)
static

Definition at line 6031 of file paint_image_proj.c.

References Freestyle::a, BKE_brush_size_get(), BKE_brush_size_set(), BKE_image_acquire_ibuf(), BKE_image_free_gputextures(), BKE_report(), BLI_findlink(), ProjPaintState::brush, BRUSH_STROKE_NORMAL, C, Scene::camera, CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), 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, IDP_ARRAY, IDP_FLOAT, IDP_GetProperties(), IDP_GetPropertyTypeFromGroup(), ProjPaintImage::ima, image(), ProjPaintState::image_tot, IMAGEPAINT_DRAWING, Main::images, ToolSettings::imapaint, ProjPaintState::is_maskbrush, ProjPaintState::is_texbrush, IDProperty::len, ProjPaintState::me_eval, NA_EDITED, wmOperatorType::name, NC_IMAGE, NC_SCENE, ND_TOOLSETTINGS, NULL, OB_MESH, OBACT, OPERATOR_CANCELLED, OPERATOR_FINISHED, PAINT_MODE_TEXTURE_3D, PAINT_TOOL_DRAW, pos, PROJ_SRC_IMAGE_CAM, PROJ_SRC_IMAGE_VIEW, PROJ_VIEW_DATA_ID, PROJ_VIEW_DATA_SIZE, project_image_refresh_tagged(), project_paint_begin(), project_paint_end(), project_paint_op(), project_state_init(), ProjPaintState::projImages, wmOperator::ptr, ImBuf::rect, ImBuf::rect_float, wmOperator::reports, ProjPaintState::reproject_ibuf, ProjPaintState::reproject_image, RNA_enum_get(), RPT_ERROR, scene, ProjPaintState::source, IDProperty::subtype, tex, ProjPaintState::tool, Scene::toolsettings, Object::type, wmOperator::type, and WM_event_add_notifier().

Referenced by PAINT_OT_project_image().

◆ texture_paint_image_from_view_exec()

static int texture_paint_image_from_view_exec ( bContext C,
wmOperator op 
)
static

◆ texture_paint_image_from_view_poll()

static bool texture_paint_image_from_view_poll ( bContext C)
static

◆ uv_image_outset()

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

◆ uvco_to_wrapped_pxco()

static void uvco_to_wrapped_pxco ( const float  uv[2],
int  ibuf_x,
int  ibuf_y,
float x,
float y 
)
static

Definition at line 695 of file paint_image_proj.c.

References fmodf, VertSeam::uv, x, and y.

Referenced by project_face_pixel(), and project_paint_PickColor().

◆ VecZDepthOrtho()

static float VecZDepthOrtho ( const float  pt[2],
const float  v1[3],
const float  v2[3],
const float  v3[3],
float  w[3] 
)
static

Definition at line 607 of file paint_image_proj.c.

References barycentric_weights_v2(), v1, v2, and w().

Referenced by project_paint_occlude_ptv(), and project_paint_PickFace().

◆ VecZDepthPersp()

static float VecZDepthPersp ( const float  pt[2],
const float  v1[4],
const float  v2[4],
const float  v3[4],
float  w[3] 
)
static

Definition at line 614 of file paint_image_proj.c.

References barycentric_weights_v2_persp(), v1, v2, and w().

Referenced by project_paint_occlude_ptv(), and project_paint_PickFace().

Variable Documentation

◆ layer_type_items

const EnumPropertyItem layer_type_items[]
static
Initial value:
= {
{LAYER_BASE_COLOR, "BASE_COLOR", 0, "Base Color", ""},
{LAYER_SPECULAR, "SPECULAR", 0, "Specular", ""},
{LAYER_ROUGHNESS, "ROUGHNESS", 0, "Roughness", ""},
{LAYER_METALLIC, "METALLIC", 0, "Metallic", ""},
{LAYER_NORMAL, "NORMAL", 0, "Normal", ""},
{LAYER_BUMP, "BUMP", 0, "Bump", ""},
{LAYER_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", ""},
{0, NULL, 0, NULL, NULL},
}
@ LAYER_NORMAL
@ LAYER_DISPLACEMENT
@ LAYER_ROUGHNESS
@ LAYER_METALLIC
@ LAYER_BUMP
@ LAYER_BASE_COLOR
@ LAYER_SPECULAR

Definition at line 6429 of file paint_image_proj.c.

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().