Blender
V3.3
|
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 |
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 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 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 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 *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 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 *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) |
void * | paint_proj_new_stroke (bContext *C, Object *ob, const float mouse[2], int mode) |
void | paint_proj_redraw (const bContext *C, void *ps_handle_p, bool final) |
void | paint_proj_stroke_done (void *ps_handle_p) |
static int | texture_paint_camera_project_exec (bContext *C, wmOperator *op) |
void | PAINT_OT_project_image (wmOperatorType *ot) |
static bool | texture_paint_image_from_view_poll (bContext *C) |
static int | texture_paint_image_from_view_exec (bContext *C, wmOperator *op) |
void | PAINT_OT_image_from_view (wmOperatorType *ot) |
void | ED_paint_data_warning (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 Material * | get_or_create_current_material (bContext *C, Object *ob) |
static Image * | proj_paint_image_create (wmOperator *op, Main *bmain, bool is_data) |
static CustomDataLayer * | proj_paint_color_attribute_create (wmOperator *op, Object *ob) |
static void | default_paint_slot_color_get (int layer_type, Material *ma, float color[4]) |
static bool | proj_paint_add_slot (bContext *C, wmOperator *op) |
static int | get_texture_layer_type (wmOperator *op, const char *prop_name) |
static int | texture_paint_add_texture_paint_slot_exec (bContext *C, wmOperator *op) |
static void | get_default_texture_layer_name_for_object (Object *ob, int texture_type, char *dst, int dst_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 MPoly * | ps_tri_index_to_mpoly (const ProjPaintState *ps, int tri_index) |
Functions to paint images in 2D and 3D.
Definition in file paint_image_proj.c.
Definition at line 6806 of file paint_image_proj.c.
#define ISECT_1 (1) |
Definition at line 2400 of file paint_image_proj.c.
#define ISECT_2 (1 << 1) |
Definition at line 2401 of file paint_image_proj.c.
#define ISECT_3 (1 << 2) |
Definition at line 2402 of file paint_image_proj.c.
#define ISECT_4 (1 << 3) |
Definition at line 2403 of file paint_image_proj.c.
#define ISECT_ALL3 ((1 << 3) - 1) |
Definition at line 2404 of file paint_image_proj.c.
#define ISECT_ALL4 ((1 << 4) - 1) |
Definition at line 2405 of file paint_image_proj.c.
#define ISECT_TRUE 1 |
Definition at line 942 of file paint_image_proj.c.
#define ISECT_TRUE_P1 2 |
Definition at line 943 of file paint_image_proj.c.
#define ISECT_TRUE_P2 3 |
Definition at line 944 of file paint_image_proj.c.
#define PROJ_BOUNDBOX_DIV 8 |
Definition at line 128 of file paint_image_proj.c.
#define PROJ_BOUNDBOX_SQUARED (PROJ_BOUNDBOX_DIV * PROJ_BOUNDBOX_DIV) |
Definition at line 129 of file paint_image_proj.c.
#define PROJ_BUCKET_BRUSH_DIV 4 |
Definition at line 123 of file paint_image_proj.c.
#define PROJ_BUCKET_INIT (1 << 0) |
Definition at line 177 of file paint_image_proj.c.
#define PROJ_BUCKET_NULL 0 |
Definition at line 176 of file paint_image_proj.c.
#define PROJ_BUCKET_RECT_MAX 256 |
Definition at line 126 of file paint_image_proj.c.
#define PROJ_BUCKET_RECT_MIN 4 |
Definition at line 125 of file paint_image_proj.c.
#define PROJ_DEBUG_WINCLIP 1 |
Definition at line 134 of file paint_image_proj.c.
#define PROJ_FACE_DEGENERATE (1 << 12) |
Definition at line 155 of file paint_image_proj.c.
#define PROJ_FACE_NOSEAM0 (1 << 4) |
Definition at line 146 of file paint_image_proj.c.
#define PROJ_FACE_NOSEAM1 (1 << 5) |
Definition at line 147 of file paint_image_proj.c.
#define PROJ_FACE_NOSEAM2 (1 << 6) |
Definition at line 148 of file paint_image_proj.c.
#define PROJ_FACE_SCALE_SEAM 0.99f |
Definition at line 164 of file paint_image_proj.c.
#define PROJ_FACE_SEAM0 (1 << 0) |
Definition at line 142 of file paint_image_proj.c.
#define PROJ_FACE_SEAM1 (1 << 1) |
Definition at line 143 of file paint_image_proj.c.
#define PROJ_FACE_SEAM2 (1 << 2) |
Definition at line 144 of file paint_image_proj.c.
#define PROJ_FACE_SEAM_INIT0 (1 << 8) |
Definition at line 151 of file paint_image_proj.c.
#define PROJ_FACE_SEAM_INIT1 (1 << 9) |
Definition at line 152 of file paint_image_proj.c.
#define PROJ_FACE_SEAM_INIT2 (1 << 10) |
Definition at line 153 of file paint_image_proj.c.
#define PROJ_FACE_WINDING_CW 2 |
Definition at line 159 of file paint_image_proj.c.
#define PROJ_FACE_WINDING_INIT 1 |
Definition at line 158 of file paint_image_proj.c.
#define PROJ_GEOM_TOLERANCE 0.00075f |
Definition at line 181 of file paint_image_proj.c.
#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.
#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.
#define PROJ_PIXEL_TOLERANCE 0.01f |
Definition at line 182 of file paint_image_proj.c.
#define PROJ_SRC_IMAGE_CAM 2 |
Definition at line 168 of file paint_image_proj.c.
#define PROJ_SRC_IMAGE_VIEW 3 |
Definition at line 169 of file paint_image_proj.c.
#define PROJ_SRC_VIEW 1 |
Definition at line 167 of file paint_image_proj.c.
#define PROJ_SRC_VIEW_FILL 4 |
Definition at line 170 of file paint_image_proj.c.
#define PROJ_VERT_CULL 1 |
Definition at line 185 of file paint_image_proj.c.
#define PROJ_VIEW_DATA_ID "view_data" |
Definition at line 172 of file paint_image_proj.c.
#define PROJ_VIEW_DATA_SIZE (4 * 4 + 4 * 4 + 3) |
Definition at line 174 of file paint_image_proj.c.
#define PS_LOOPTRI_AS_UV_3 | ( | uvlayer, | |
lt | |||
) |
Definition at line 515 of file paint_image_proj.c.
#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.
#define PS_LOOPTRI_ASSIGN_UV_3 | ( | uv_tri, | |
uvlayer, | |||
lt | |||
) |
Definition at line 519 of file paint_image_proj.c.
#define TILE_PENDING POINTER_FROM_INT(-1) |
Definition at line 188 of file paint_image_proj.c.
typedef struct LoopSeamData LoopSeamData |
typedef union pixelPointer PixelPointer |
typedef union pixelStore PixelStore |
typedef struct PrepareImageEntry PrepareImageEntry |
typedef struct ProjectHandle ProjectHandle |
typedef struct ProjPaintImage 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.
typedef struct ProjPaintState ProjPaintState |
typedef struct ProjPixelClone ProjPixelClone |
typedef struct ProjStrokeHandle ProjStrokeHandle |
Handle for stroke (operator customdata)
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.
|
static |
Definition at line 6901 of file paint_image_proj.c.
References 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, NULL, OPERATOR_FINISHED, scene, and WM_event_add_notifier().
Referenced by PAINT_OT_add_simple_uvs().
Definition at line 6918 of file paint_image_proj.c.
References C, CTX_data_active_object(), Object::mode, OB_MESH, OB_MODE_TEXTURE_PAINT, and Object::type.
Referenced by PAINT_OT_add_simple_uvs().
|
static |
Definition at line 1128 of file paint_image_proj.c.
References BKE_MESH_TESSTRI_VINDEX_ORDER, BLI_assert, cmp_uv(), ProjPaintState::faceWindingFlags, i1, ProjPaintState::mloop_eval, ProjPaintState::mlooptri_eval, node, POINTER_AS_INT, ProjPaintState::poly_to_loop_uv, PROJ_FACE_WINDING_CW, PROJ_FACE_WINDING_INIT, project_face_winding_init(), project_paint_face_paint_image(), project_paint_face_paint_tile(), PS_LOOPTRI_AS_UV_3, PS_LOOPTRI_AS_VERT_INDEX_3, tile, MLoopTri::tri, MLoop::v, and ProjPaintState::vertFaces.
Referenced by project_face_seams_init().
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().
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().
Definition at line 5107 of file paint_image_proj.c.
References pixelPointer::ch_pt, pixelPointer::f_pt, ProjPixel::origColor, ProjPixel::pixel, premul_to_straight_v4_v4(), and straight_to_premul_v4_v4().
Referenced by do_projectpaint_thread().
Get a default color for the paint slot layer from a material's Principled BSDF.
layer_type | The layer type of the paint slot |
ma | The material to attempt using as the default color source. If this fails or ma is null, a default Principled BSDF is used instead. |
Definition at line 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().
|
static |
Definition at line 4795 of file paint_image_proj.c.
References ProjPaintState::blend, pixelPointer::ch_pt, ProjPaintState::do_masking, IMB_blend_color_byte(), mask(), ProjPixel::origColor, and ProjPixel::pixel.
Referenced by do_projectpaint_thread().
|
static |
Definition at line 4817 of file paint_image_proj.c.
References ProjPaintState::blend, ProjPaintState::do_masking, pixelPointer::f_pt, IMB_blend_color_float(), mask(), mul_v4_v4fl(), ProjPixel::origColor, and ProjPixel::pixel.
Referenced by do_projectpaint_thread().
|
static |
Definition at line 5005 of file paint_image_proj.c.
References ProjPaintState::blend, pixelPointer::ch_pt, copy_v3_v3(), ProjPaintState::do_masking, f_to_char(), float_to_byte_dither_v3(), IMB_blend_color_byte(), ProjPaintState::is_texbrush, linearrgb_to_srgb_v3_v3(), mask(), mul_v3_v3v3(), ProjPixel::origColor, ProjPaintState::paint_color, ProjPaintState::paint_color_linear, ProjPixel::pixel, usdtokens::rgb(), unit_float_to_uchar_clamp_v3, ProjPaintState::use_colormanagement, and v.
Referenced by do_projectpaint_thread().
|
static |
Definition at line 5046 of file paint_image_proj.c.
References ProjPaintState::blend, copy_v3_v3(), ProjPaintState::do_masking, pixelPointer::f_pt, IMB_blend_color_float(), ProjPaintState::is_texbrush, mask(), mul_v3_fl(), mul_v3_v3(), ProjPixel::origColor, ProjPaintState::paint_color_linear, ProjPixel::pixel, and usdtokens::rgba().
Referenced by do_projectpaint_thread().
|
static |
Definition at line 5070 of file paint_image_proj.c.
References ProjPaintState::blend, pixelPointer::ch_pt, ProjPaintState::do_masking, f_to_char(), IMB_blend_color_byte(), mask(), ProjPixel::origColor, ProjPixel::pixel, and ProjPaintState::stencil_value.
Referenced by do_projectpaint_thread().
|
static |
Definition at line 5084 of file paint_image_proj.c.
References ProjPaintState::blend, ProjPaintState::do_masking, pixelPointer::f_pt, IMB_blend_color_float(), mask(), ProjPixel::origColor, ProjPixel::pixel, usdtokens::rgba(), and ProjPaintState::stencil_value.
Referenced by do_projectpaint_thread().
|
static |
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().
|
static |
Definition at line 4859 of file paint_image_proj.c.
References blend_color_interpolate_float(), BLI_linklist_prepend_arena(), pixelPointer::f_pt, mask(), NULL, ProjPixel::pixel, project_paint_PickColor(), and usdtokens::rgba().
Referenced by do_projectpaint_thread().
|
static |
Definition at line 4937 of file paint_image_proj.c.
References add_v2_v2(), add_v4_v4(), blend_color_add_float(), blend_color_interpolate_byte(), BLI_linklist_prepend_arena(), ProjPaintState::blurkernel, ProjPaintState::brush, BRUSH_STROKE_INVERT, pixelStore::ch, pixelPointer::ch_pt, fabsf, IMB_colormanagement_get_luminance(), kernel, LIKELY, mask(), ProjPaintState::mode, mul_v4_fl(), ProjPixel::newColor, NULL, ProjPixel::pixel, premul_float_to_straight_uchar(), ProjPixel::projCoSS, project_paint_PickColor(), usdtokens::rgba(), Brush::sharp_threshold, straight_uchar_to_premul_float(), sub_v3_v3v3(), and zero_v4().
Referenced by do_projectpaint_thread().
|
static |
Definition at line 4877 of file paint_image_proj.c.
References add_v2_v2(), add_v4_v4(), blend_color_add_float(), blend_color_interpolate_float(), BLI_linklist_prepend_arena(), ProjPaintState::blurkernel, ProjPaintState::brush, BRUSH_STROKE_INVERT, pixelStore::f, pixelPointer::f_pt, fabsf, IMB_colormanagement_get_luminance(), kernel, LIKELY, mask(), ProjPaintState::mode, mul_v4_fl(), ProjPixel::newColor, NULL, ProjPixel::pixel, ProjPixel::projCoSS, project_paint_PickColor(), usdtokens::rgba(), Brush::sharp_threshold, sub_v3_v3v3(), and zero_v4().
Referenced by do_projectpaint_thread().
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().
void ED_paint_data_warning | ( | struct ReportList * | reports, |
bool | uvs, | ||
bool | mat, | ||
bool | tex, | ||
bool | stencil | ||
) |
Definition at line 6309 of file paint_image_proj.c.
References BKE_reportf(), RPT_WARNING, and tex.
Referenced by texture_paint_camera_project_exec(), and blender::ed::sculpt_paint::image::ops::paint::texture_paint_init().
bool ED_paint_proj_mesh_data_check | ( | struct Scene * | scene, |
struct Object * | ob, | ||
bool * | uvs, | ||
bool * | mat, | ||
bool * | tex, | ||
bool * | stencil | ||
) |
Make sure that active object has a material, and assign UVs and image layers if they do not exist.
Definition at line 6320 of file paint_image_proj.c.
References BKE_mesh_from_object(), BKE_object_material_get(), BKE_paint_brush(), BKE_texpaint_slot_refresh_cache(), BLI_assert, ImagePaintSettings::canvas, CD_MLOOPUV, CustomData_number_of_layers(), ImagePaintSettings::flag, ID_IS_LINKED, ID_IS_OVERRIDE_LIBRARY, TexPaintSlot::ima, IMAGEPAINT_MISSING_MATERIAL, IMAGEPAINT_MISSING_STENCIL, IMAGEPAINT_MISSING_TEX, IMAGEPAINT_MISSING_UVS, IMAGEPAINT_MODE_IMAGE, IMAGEPAINT_MODE_MATERIAL, IMAGEPAINT_PROJECT_LAYER_STENCIL, Brush::imagepaint_tool, ToolSettings::imapaint, Mesh::ldata, ImagePaintSettings::missing_data, ImagePaintSettings::mode, NULL, OB_MESH, ImagePaintSettings::paint, Material::paint_active_slot, PAINT_TOOL_MASK, scene, ImagePaintSettings::stencil, tex, 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(), material_slot_add_exec(), material_slot_remove_exec(), material_slot_remove_unused_exec(), mesh_uv_texture_add_exec(), mesh_uv_texture_remove_exec(), proj_paint_add_slot(), scene_changed(), texture_paint_camera_project_exec(), and blender::ed::sculpt_paint::image::ops::paint::texture_paint_init().
BLI_INLINE uchar f_to_char | ( | const float | val | ) |
Definition at line 110 of file paint_image_proj.c.
References unit_float_to_uchar_clamp().
Referenced by do_projectpaint_draw(), and do_projectpaint_mask().
|
static |
Definition at line 1206 of file paint_image_proj.c.
References BLI_assert, cmp_uv(), 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, NULL, VertSeam::uv, and ProjPaintState::vertSeams.
Referenced by uv_image_outset().
Definition at line 2424 of file paint_image_proj.c.
Referenced by project_bucket_clip_face().
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().
|
static |
Definition at line 6736 of file paint_image_proj.c.
References Object::actcol, BKE_object_material_get(), BLI_snprintf(), Material::id, Object::id, layer_type_items, and ID::name.
Referenced by texture_paint_add_texture_paint_slot_invoke().
Definition at line 6440 of file paint_image_proj.c.
References Object::actcol, BKE_MAT_ASSIGN_USERPREF, BKE_material_add(), BKE_object_material_assign(), BKE_object_material_get(), C, and CTX_data_main().
Referenced by proj_paint_add_slot().
|
static |
Definition at line 6720 of file paint_image_proj.c.
References BLI_assert, layer_type_items, wmOperator::ptr, RNA_enum_from_value(), RNA_enum_get(), and type.
Referenced by texture_paint_add_texture_paint_slot_invoke().
|
static |
Definition at line 5098 of file paint_image_proj.c.
References BLI_rcti_do_minmax_rcti(), BLI_rcti_init(), ImagePaintPartialRedraw::dirty_region, ProjPixel::x_px, and ProjPixel::y_px.
Referenced by do_projectpaint_thread().
|
static |
Definition at line 1373 of file paint_image_proj.c.
References VertSeam::angle, atan2f, BLI_assert, BLI_insertlinkbefore(), BLI_memarena_alloc(), copy_v2_v2(), ProjPaintState::faceWindingFlags, ListBase::first, VertSeam::loop, M_PI, ProjPaintState::mloop_eval, ProjPaintState::mlooptri_eval, VertSeam::next, VertSeam::normal_cw, NULL, ProjPaintState::poly_to_loop_uv, VertSeam::prev, PROJ_FACE_WINDING_CW, PROJ_FACE_WINDING_INIT, PS_LOOPTRI_AS_UV_3, sub_v2_v2v2(), VertSeam::tri, MLoopTri::tri, VertSeam::uv, MLoop::v, and ProjPaintState::vertSeams.
Referenced by project_face_seams_init().
Definition at line 2926 of file paint_image_proj.c.
References line_point_side_v2().
Referenced by project_paint_face_init().
Definition at line 2941 of file paint_image_proj.c.
References line_point_side_v2().
Referenced by project_paint_face_init().
|
static |
Definition at line 2408 of file paint_image_proj.c.
References area_tri_v2(), v1, and v2.
Referenced by project_bucket_clip_face().
Definition at line 2231 of file paint_image_proj.c.
Referenced by project_bucket_isect_circle().
|
static |
Definition at line 2042 of file paint_image_proj.c.
References BLI_rctf_isect_pt_v(), CLAMP, copy_v2_v2(), fabsf, line_isect_x(), line_isect_y(), PROJ_PIXEL_TOLERANCE, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_bucket_clip_face(), and project_paint_face_init().
|
static |
Definition at line 981 of file paint_image_proj.c.
References fabsf, ISECT_TRUE, ISECT_TRUE_P1, and ISECT_TRUE_P2.
Referenced by line_clip_rect2f().
|
static |
yuck, horizontal line, we can't do much here.
Definition at line 945 of file paint_image_proj.c.
References fabsf, ISECT_TRUE, ISECT_TRUE_P1, and ISECT_TRUE_P2.
Referenced by line_clip_rect2f().
|
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().
void PAINT_OT_add_simple_uvs | ( | wmOperatorType * | ot | ) |
Definition at line 6928 of file paint_image_proj.c.
References add_simple_uvs_exec(), add_simple_uvs_poll(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by ED_operatortypes_paint().
void PAINT_OT_add_texture_paint_slot | ( | wmOperatorType * | ot | ) |
Definition at line 6808 of file paint_image_proj.c.
References ATTR_DOMAIN_CORNER, ATTR_DOMAIN_POINT, CD_PROP_BYTE_COLOR, CD_PROP_COLOR, wmOperatorType::description, ED_operator_object_active_editable_mesh(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, IMA_DEF_NAME, IMA_GENTYPE_BLANK, wmOperatorType::invoke, layer_type_items, MAX_NAME, wmOperatorType::name, NULL, OPTYPE_UNDO, ot, PAINT_CANVAS_SOURCE_COLOR_ATTRIBUTE, PAINT_CANVAS_SOURCE_IMAGE, wmOperatorType::poll, PROP_COLOR_GAMMA, PROP_HIDDEN, PROP_PIXEL, PROP_SKIP_SAVE, RNA_def_boolean(), RNA_def_enum(), RNA_def_float_color(), RNA_def_int(), RNA_def_property_flag(), RNA_def_property_float_array_default(), RNA_def_property_subtype(), RNA_def_string(), rna_enum_image_generated_type_items, wmOperatorType::srna, texture_paint_add_texture_paint_slot_exec(), texture_paint_add_texture_paint_slot_invoke(), texture_paint_add_texture_paint_slot_ui(), and wmOperatorType::ui.
Referenced by ED_operatortypes_paint().
void PAINT_OT_image_from_view | ( | wmOperatorType * | ot | ) |
Definition at line 6288 of file paint_image_proj.c.
References wmOperatorType::description, wmOperatorType::exec, FILE_MAX, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, NULL, OPTYPE_REGISTER, ot, wmOperatorType::poll, RNA_def_string_file_name(), wmOperatorType::srna, texture_paint_image_from_view_exec(), and texture_paint_image_from_view_poll().
Referenced by ED_operatortypes_paint().
void PAINT_OT_project_image | ( | wmOperatorType * | ot | ) |
Definition at line 6144 of file paint_image_proj.c.
References wmOperatorType::description, DummyRNA_NULL_items, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::prop, PROP_ENUM_NO_TRANSLATE, RNA_def_enum(), RNA_def_enum_funcs(), RNA_def_property_flag(), RNA_image_itemf(), wmOperatorType::srna, texture_paint_camera_project_exec(), and WM_enum_search_invoke().
Referenced by ED_operatortypes_paint().
|
static |
Definition at line 4546 of file paint_image_proj.c.
References ProjPaintState::cloneOffset, copy_v3_v3(), Scene::cursor, float(), View3DCursor::location, mul_m4_v3(), mul_m4_v4(), ProjPaintState::obmat_imat, PAINT_TOOL_CLONE, ProjPaintState::projectMat, ProjPaintState::scene, ProjPaintState::tool, ProjPaintState::winx, and ProjPaintState::winy.
Referenced by paint_proj_new_stroke().
Definition at line 5884 of file paint_image_proj.c.
References ARRAY_SIZE, BKE_brush_size_get(), BKE_brush_size_set(), BKE_mesh_from_object(), BKE_paint_brush(), BLI_assert, ProjStrokeHandle::brush, BRUSH_STROKE_INVERT, C, count_bits_i(), CTX_data_scene(), Brush::imagepaint_tool, ToolSettings::imapaint, ProjStrokeHandle::is_clone_cursor_pick, ProjPaintState::is_shared_user, ProjPaintState::me_eval, MEM_callocN, MEM_freeN, mesh, NULL, ProjPaintState::ob, ProjStrokeHandle::orig_brush_size, ImagePaintSettings::paint, paint_brush_init_tex(), paint_proj_begin_clone(), PAINT_SYMM_X, PAINT_SYMM_Y, PAINT_SYMM_Z, PAINT_TOOL_CLONE, PAINT_TOOL_FILL, 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, scene, ProjStrokeHandle::scene, ProjPaintState::source, Mesh::symmetry, ProjStrokeHandle::symmetry_flags, ProjPaintState::tool, Scene::toolsettings, view3d_operator_needs_opengl(), x, y, and z.
Referenced by blender::ed::sculpt_paint::image::ops::paint::ProjectionPaintMode::paint_new_stroke().
Definition at line 5983 of file paint_image_proj.c.
References C, CTX_wm_region(), ED_region_tag_redraw(), NA_EDITED, NC_IMAGE, ProjStrokeHandle::need_redraw, NULL, and WM_event_add_notifier().
Referenced by blender::ed::sculpt_paint::image::ops::paint::ProjectionPaintMode::paint_stroke_redraw().
void paint_proj_stroke | ( | const bContext * | C, |
void * | ps_handle_p, | ||
const float | prev_pos[2], | ||
const float | pos[2], | ||
const bool | eraser, | ||
float | pressure, | ||
float | distance, | ||
float | size | ||
) |
Definition at line 5735 of file paint_image_proj.c.
References C, CTX_data_ensure_evaluated_depsgraph(), CTX_wm_region(), CTX_wm_view3d(), Scene::cursor, DEG_id_tag_update(), depsgraph, blender::math::distance(), ED_region_tag_redraw(), ED_view3d_autodist(), Scene::id, ID_RECALC_COPY_ON_WRITE, ProjStrokeHandle::is_clone_cursor_pick, View3DCursor::location, NULL, paint_proj_stroke_ps(), pos, ProjStrokeHandle::ps_views, ProjStrokeHandle::ps_views_tot, scene, ProjStrokeHandle::scene, size(), and view3d_operator_needs_opengl().
Referenced by blender::ed::sculpt_paint::image::ops::paint::ProjectionPaintMode::paint_stroke().
Definition at line 6003 of file paint_image_proj.c.
References BKE_brush_size_set(), ProjStrokeHandle::brush, ProjStrokeHandle::is_clone_cursor_pick, MEM_freeN, ProjStrokeHandle::orig_brush_size, paint_brush_exit_tex(), PROJ_PAINT_STATE_SHARED_CLEAR, project_paint_end(), ProjStrokeHandle::ps_views, ProjStrokeHandle::ps_views_tot, scene, and ProjStrokeHandle::scene.
Referenced by blender::ed::sculpt_paint::image::ops::paint::ProjectionPaintMode::paint_stroke_done().
|
static |
Definition at line 5682 of file paint_image_proj.c.
References ProjPaintState::blend, Brush::blend, ProjPaintState::brush, ProjPaintState::brush_size, BRUSH_STROKE_INVERT, copy_v3_v3(), blender::math::distance(), ELEM, ImagePaintSettings::flag, IMAGEPAINT_PROJECT_LAYER_STENCIL_INV, ToolSettings::imapaint, IMB_BLEND_ERASE_ALPHA, ProjPaintState::mode, ProjStrokeHandle::need_redraw, NULL, paint_brush_color_get(), ProjPaintState::paint_color, ProjPaintState::paint_color_linear, PAINT_TOOL_DRAW, PAINT_TOOL_FILL, PAINT_TOOL_MASK, pos, project_image_refresh_tagged(), project_paint_op(), scene, ProjPaintState::scene, size(), srgb_to_linearrgb_v3_v3(), ProjPaintState::stencil_value, ProjPaintState::tool, Scene::toolsettings, ProjPaintState::use_colormanagement, and Brush::weight.
Referenced by paint_proj_stroke().
|
static |
Definition at line 4647 of file paint_image_proj.c.
References partial_redraw_single_init(), and PROJ_BOUNDBOX_SQUARED.
Referenced by project_paint_build_proj_ima().
|
static |
Definition at line 4656 of file paint_image_proj.c.
References BLI_rcti_do_minmax_rcti(), BLI_rcti_is_empty(), and ImagePaintPartialRedraw::dirty_region.
Referenced by project_paint_op().
|
static |
Definition at line 4642 of file paint_image_proj.c.
References BLI_rcti_init_minmax(), and ImagePaintPartialRedraw::dirty_region.
Referenced by partial_redraw_array_init(), and project_image_refresh_tagged().
|
static |
Definition at line 1081 of file paint_image_proj.c.
References INIT_MINMAX2, minmax_v2v2_v2(), VertSeam::uv, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by project_paint_face_init().
|
static |
Definition at line 1053 of file paint_image_proj.c.
References INIT_MINMAX2, minmax_v2v2_v2(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by project_paint_face_init().
|
static |
Definition at line 6581 of file paint_image_proj.c.
References BKE_image_signal(), BKE_texpaint_slot_refresh_cache(), BLI_assert_unreachable, BLI_strncpy_utf8(), C, CTX_data_main(), CTX_data_scene(), CTX_wm_area(), Object::data, DEG_id_tag_update(), ED_area_tag_redraw(), ED_node_shader_default(), ED_node_tree_propagate_change(), ED_object_active_context(), ED_paint_proj_mesh_data_check(), get_or_create_current_material(), Image::id, Material::id, bNode::id, bNodeTree::id, ID_RECALC_GEOMETRY, ID_RECALC_SHADING, IMA_SIGNAL_USER_NEW_IMAGE, LAYER_BASE_COLOR, LAYER_BUMP, LAYER_DISPLACEMENT, LAYER_NORMAL, layer_type_items, bNodeSocket::link, MAX_NAME, Object::mode, NA_ADDED, CustomDataLayer::name, NC_GEOM, NC_IMAGE, ND_DATA, nodeAddLink(), nodeAddStaticNode(), nodeFindSocket(), nodePositionPropagate(), nodePositionRelative(), nodeSetActive(), Material::nodetree, ntree, ntreeFindType(), NULL, OB_MODE_SCULPT, PAINT_CANVAS_SOURCE_COLOR_ATTRIBUTE, PAINT_CANVAS_SOURCE_IMAGE, PAINT_CANVAS_SOURCE_MATERIAL, proj_paint_color_attribute_create(), proj_paint_image_create(), wmOperator::ptr, RNA_enum_get(), scene, SH_NODE_ATTRIBUTE, SH_NODE_BSDF_PRINCIPLED, SH_NODE_BUMP, SH_NODE_NORMAL_MAP, SH_NODE_OUTPUT_MATERIAL, SH_NODE_TEX_IMAGE, SOCK_IN, SOCK_OUT, bNode::storage, type, Material::use_nodes, WM_event_add_notifier(), and WM_main_add_notifier().
Referenced by texture_paint_add_texture_paint_slot_exec().
|
static |
Definition at line 6488 of file paint_image_proj.c.
References ATTR_DOMAIN_POINT, BKE_id_attribute_new(), BKE_id_attributes_active_color_set(), BKE_id_attributes_render_color_get(), BKE_id_attributes_render_color_set(), BKE_object_attributes_active_color_fill(), CD_PROP_COLOR, color, Object::data, MAX_NAME, NULL, wmOperator::ptr, wmOperator::reports, RNA_enum_get(), RNA_float_get_array(), RNA_string_get(), and type.
Referenced by proj_paint_add_slot().
|
static |
Definition at line 4186 of file paint_image_proj.c.
References PS_LOOPTRI_AS_VERT_INDEX_3, ProjPaintState::screenCoords, ProjPaintFaceCoSS::v1, ProjPaintFaceCoSS::v2, and ProjPaintFaceCoSS::v3.
Referenced by project_paint_prepare_all_faces().
|
static |
Definition at line 4149 of file paint_image_proj.c.
References CD_ORIGINDEX, CustomData_get_layer(), Object::data, ProjPaintState::do_face_sel, ProjPaintFaceLookup::index_mp_to_orig, ProjPaintState::me_eval, ProjPaintFaceLookup::mpoly_orig, ProjPaintState::ob, and Mesh::pdata.
Referenced by project_paint_begin().
|
static |
Definition at line 6451 of file paint_image_proj.c.
References BKE_image_add_generated(), color, height, IMA_GENTYPE_BLANK, MAX_ID_NAME, wmOperator::ptr, RNA_boolean_get(), RNA_enum_get(), RNA_float_get_array(), RNA_int_get(), RNA_string_get(), and width.
Referenced by proj_paint_add_slot().
|
static |
Definition at line 4083 of file paint_image_proj.c.
References CD_MLOOPUV, CustomData_get_clone_layer(), CustomData_get_layer(), CustomData_get_layer_n(), Object::data, ProjPaintState::do_layer_clone, Mesh::ldata, ProjPaintState::me_eval, MEM_mallocN, ProjPaintLayerClone::mloopuv_clone_base, NULL, ProjPaintState::ob, ProjPaintState::poly_to_loop_uv_clone, and ProjPaintState::totpoly_eval.
Referenced by project_paint_begin().
|
static |
Definition at line 3865 of file paint_image_proj.c.
References Freestyle::a, add_v3_v3(), ProjPaintState::cavities, MVert::co, counter, ProjPaintState::do_mask_cavity, dot_v3v3(), e, float(), M_1_PI, ProjPaintState::medge_eval, MEM_callocN, MEM_freeN, MEM_mallocN, mul_v3_fl(), ProjPaintState::mvert_eval, normalize_v3(), saacos(), sub_v3_v3(), sub_v3_v3v3(), ProjPaintState::totvert_eval, MEdge::v1, MEdge::v2, and ProjPaintState::vert_normals.
Referenced by project_paint_begin().
|
static |
Definition at line 4017 of file paint_image_proj.c.
References BKE_mesh_runtime_looptri_ensure(), BKE_mesh_vertex_normals_ensure(), BKE_object_material_get(), C, CD_MASK_MLOOPUV, CD_MASK_MTFACE, CD_MASK_ORIGINDEX, CD_MLOOPUV, CTX_data_ensure_evaluated_depsgraph(), CustomData_has_layer(), Scene::customdata_mask, DEG_get_evaluated_object(), DEG_get_evaluated_scene(), depsgraph, ProjPaintState::do_face_sel, ProjPaintState::do_mask_cavity, CustomData_MeshMasks::emask, CustomData_MeshMasks::fmask, Mesh::ldata, MLoopTri_Store::len, CustomData_MeshMasks::lmask, Mesh_Runtime::looptris, ProjPaintState::mat_array, ProjPaintState::me_eval, Mesh::medge, ProjPaintState::medge_eval, MEM_malloc_arrayN, MEM_mallocN, mesh_get_eval_final(), Mesh::mloop, ProjPaintState::mloop_eval, ProjPaintState::mlooptri_eval, Mesh::mpoly, ProjPaintState::mpoly_eval, Mesh::mvert, ProjPaintState::mvert_eval, NULL, ProjPaintState::ob, CustomData_MeshMasks::pmask, ProjPaintState::poly_to_loop_uv, Mesh::runtime, Object::totcol, Mesh::totedge, ProjPaintState::totedge_eval, Mesh::totloop, ProjPaintState::totloop_eval, ProjPaintState::totlooptri_eval, Mesh::totpoly, ProjPaintState::totpoly_eval, Mesh::totvert, ProjPaintState::totvert_eval, ProjPaintState::vert_normals, and CustomData_MeshMasks::vmask.
Referenced by project_paint_begin().
|
static |
Definition at line 3786 of file paint_image_proj.c.
References Freestyle::a, CLAMP, ProjPaintState::clip_start, copy_v3_v3(), float(), INIT_MINMAX2, ProjPaintState::is_ortho, MEM_mallocN, minmax_v2v2_v2(), mul_m4_v4(), mul_v3_m4v3(), ProjPaintState::mvert_eval, PROJ_SRC_VIEW, PROJ_SRC_VIEW_FILL, ProjPaintState::projectMat, ProjPaintState::screenCoords, ProjPaintState::screenMax, ProjPaintState::screenMin, ProjPaintState::source, ProjPaintState::totvert_eval, UNUSED_VARS, ProjPaintState::winx, and ProjPaintState::winy.
Referenced by project_paint_begin().
|
static |
Definition at line 3903 of file paint_image_proj.c.
References ProjPaintState::faceSeamFlags, ProjPaintState::faceWindingFlags, ProjPaintState::loopSeamData, MEM_callocN, MEM_mallocN, ProjPaintState::seam_bleed_px, ProjPaintState::totloop_eval, ProjPaintState::totlooptri_eval, ProjPaintState::totvert_eval, ProjPaintState::vertFaces, and ProjPaintState::vertSeams.
Referenced by project_paint_begin().
|
static |
Definition at line 3916 of file paint_image_proj.c.
References Freestyle::a, ProjPaintState::arena_mt, BKE_scene_num_threads(), BLI_memarena_new(), BLI_spin_init(), ED_image_paint_tile_lock_init(), ProjPaintState::is_shared_user, MEM_mallocN, MEM_SIZE_OPTIMAL, ProjPaintState::scene, ProjPaintState::thread_tot, and ProjPaintState::tile_lock.
Referenced by project_paint_begin().
|
static |
Definition at line 3946 of file paint_image_proj.c.
References Freestyle::a, copy_v3_v3(), ProjPaintState::do_backfacecull, ProjPaintState::do_mask_normal, dot_v3v3(), ProjPaintState::is_flip_object, ProjPaintState::is_ortho, MEM_callocN, ProjPaintState::mvert_eval, negate_v3(), ProjPaintState::normal_angle__cos, normalize_v3(), NULL, PROJ_VERT_CULL, sub_v3_v3v3(), ProjPaintState::totvert_eval, UNLIKELY, ProjPaintState::vert_normals, ProjPaintState::vertFlags, ProjPaintState::viewDir, and ProjPaintState::viewPos.
Referenced by project_paint_begin().
|
static |
Definition at line 3674 of file paint_image_proj.c.
References add_v3_v3(), BKE_camera_params_compute_matrix(), BKE_camera_params_compute_viewplane(), BKE_camera_params_from_object(), BKE_camera_params_init(), BLI_assert, Scene::camera, ProjPaintState::clip_end, ProjPaintState::clip_start, copy_m3_m4(), copy_m4_m4(), copy_v3_v3(), DEG_get_evaluated_object(), ProjPaintState::depsgraph, ED_view3d_clip_range_get(), ED_view3d_ob_project_mat_get_from_obmat(), ELEM, Image::id, IDP_Array, IDP_GetProperties(), IDP_GetPropertyFromGroup(), invert_m4_m4(), ProjPaintState::is_flip_object, ProjPaintState::is_ortho, mul_m3_v3(), mul_m4_m4m4(), negate_v3(), normalize_m4(), normalize_v3(), ProjPaintState::ob, ProjPaintState::obmat, Object::obmat, ProjPaintState::obmat_imat, params, PROJ_SRC_IMAGE_CAM, PROJ_SRC_IMAGE_VIEW, PROJ_SRC_VIEW, PROJ_SRC_VIEW_FILL, PROJ_VIEW_DATA_ID, ProjPaintState::projectMat, ProjPaintState::projectMatInv, 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, ProjPaintState::winx, ARegion::winx, ProjPaintState::winy, ARegion::winy, ImBuf::x, and ImBuf::y.
Referenced by project_paint_begin().
|
static |
Definition at line 3459 of file paint_image_proj.c.
References ProjPaintState::buckets_x, ProjPaintState::buckets_y, ProjPaintState::screen_height, ProjPaintState::screen_width, ProjPaintState::screenMin, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_bucket_face_isect(), and project_bucket_iter_next().
|
static |
Definition at line 2477 of file paint_image_proj.c.
References atan2f, barycentric_weights_v2(), barycentric_weights_v2_persp(), BLI_rctf_isect_pt_v(), copy_v2_v2(), dist_squared_to_line_v2(), fabsf, float(), float_z_sort(), float_z_sort_flip(), 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(), PROJ_GEOM_TOLERANCE, PROJ_PIXEL_TOLERANCE, rect_to_uvspace_ortho(), rect_to_uvspace_persp(), w(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_paint_face_init().
|
static |
Definition at line 3561 of file paint_image_proj.c.
References BLI_rctf_isect_pt_v(), isect_point_tri_v2(), isect_seg_seg_v2(), project_bucket_bounds(), PS_LOOPTRI_AS_VERT_INDEX_3, ProjPaintState::screenCoords, v, v1, v2, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_paint_delayed_face_init().
|
static |
Definition at line 3479 of file paint_image_proj.c.
References BLI_assert, ProjPaintState::bucketFaces, ProjPaintState::bucketFlags, ProjPaintImage::ibuf, ProjPaintImage::ima, ProjPaintState::image_tot, IMB_freeImBuf(), ProjPaintImage::iuser, ProjPaintState::mlooptri_eval, node, NULL, POINTER_AS_INT, ProjPaintState::poly_to_loop_uv, PROJ_BUCKET_INIT, project_paint_face_init(), project_paint_face_paint_image(), project_paint_face_paint_tile(), ProjPaintState::projImages, PS_LOOPTRI_AS_UV_3, tile, and ImageUser::tile.
Referenced by do_projectpaint_thread().
|
static |
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().
|
static |
Definition at line 4705 of file paint_image_proj.c.
References ProjPaintState::brush_size, ProjPaintState::bucketMax, ProjPaintState::bucketMin, ProjPaintState::buckets_x, ProjPaintState::buckets_y, ProjPaintState::context_bucket_index, PROJ_SRC_VIEW, project_paint_bucket_bounds(), and ProjPaintState::source.
Referenced by project_paint_op().
|
static |
Definition at line 4745 of file paint_image_proj.c.
References atomic_fetch_and_add_int32(), BLI_assert, ProjPaintState::brush_size, ProjPaintState::bucketMax, ProjPaintState::bucketMin, ProjPaintState::buckets_x, ProjPaintState::context_bucket_index, PROJ_SRC_VIEW, project_bucket_bounds(), project_bucket_isect_circle(), and ProjPaintState::source.
Referenced by do_projectpaint_thread().
|
static |
Fast projection bucket array lookup, use the safe version for bound checking.
Definition at line 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().
|
static |
Definition at line 597 of file paint_image_proj.c.
References ProjPaintState::buckets_x, ProjPaintState::buckets_y, and project_bucket_offset().
Referenced by project_paint_PickFace().
|
static |
Definition at line 894 of file paint_image_proj.c.
References MVert::co, ProjPaintState::is_ortho, LinkNode::link, ProjPaintState::mloop_eval, ProjPaintState::mlooptri_eval, ProjPaintState::mvert_eval, LinkNode::next, POINTER_AS_INT, project_paint_occlude_ptv(), project_paint_occlude_ptv_clip(), ProjPaintState::rv3d, RV3D_CLIPPING_ENABLED, ProjPaintState::screenCoords, MLoopTri::tri, UNPACK3, MLoop::v, ProjPaintState::v3d, and w().
Referenced by project_paint_face_init().
|
static |
Definition at line 1624 of file paint_image_proj.c.
References bilinear_interpolation_color_wrap(), interp_v2_v2v2v2(), NULL, ImBuf::rect_float, UNPACK3, uvco_to_wrapped_pxco(), w(), x, ImBuf::x, y, and ImBuf::y.
Referenced by project_paint_uvpixel_init(), and project_paint_uvpixel_mask().
|
static |
Be tricky with flags, first 4 bits are PROJ_FACE_SEAM0 to 4, last 4 bits are PROJ_FACE_NOSEAM0 to 4. 1 << i
- where i is (0..3)
.
If we're multi-threading, make sure threads are locked when this is called.
Definition at line 1428 of file paint_image_proj.c.
References check_seam(), ProjPaintState::faceSeamFlags, ProjPaintState::faceWindingFlags, insert_seam_vert_array(), ProjPaintState::mloop_eval, ProjPaintState::mlooptri_eval, node, POINTER_AS_INT, PROJ_FACE_NOSEAM0, PROJ_FACE_SEAM0, PROJ_FACE_SEAM_INIT0, PROJ_FACE_WINDING_INIT, project_face_winding_init(), VertSeam::tri, MLoopTri::tri, MLoop::v, and ProjPaintState::vertFaces.
Referenced by project_paint_face_init().
|
static |
Definition at line 1112 of file paint_image_proj.c.
References cross_tri_v2(), ProjPaintState::faceWindingFlags, ProjPaintState::mlooptri_eval, ProjPaintState::poly_to_loop_uv, PROJ_FACE_WINDING_CW, PROJ_FACE_WINDING_INIT, and PS_LOOPTRI_AS_UV_3.
Referenced by check_seam(), and project_face_seams_init().
|
static |
Definition at line 4675 of file paint_image_proj.c.
References Freestyle::a, BLI_rcti_is_valid(), ImagePaintPartialRedraw::dirty_region, ProjPaintImage::ibuf, ProjPaintImage::ima, imapaint_image_update(), ProjPaintImage::iuser, NULL, partial_redraw_single_init(), ProjPaintImage::partRedrawRect, PROJ_BOUNDBOX_SQUARED, ProjPaintState::projImages, set_imapaintpartial(), and ProjPaintImage::touch.
Referenced by paint_proj_new_stroke(), paint_proj_stroke_ps(), and texture_paint_camera_project_exec().
|
static |
Definition at line 4441 of file paint_image_proj.c.
References ProjPaintState::arena_mt, BKE_brush_size_get(), ProjPaintState::brush, ProjPaintState::bucketFaces, ProjPaintState::bucketFlags, ProjPaintState::bucketRect, ProjPaintState::buckets_x, ProjPaintState::buckets_y, C, CD_MLOOPUV, CLAMP, 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, Mesh::ldata, ME_EDIT_PAINT_FACE_SEL, ProjPaintState::me_eval, MEM_callocN, ProjPaintState::mloopuv_stencil_eval, NULL, ProjPaintState::ob, OB_NEG_SCALE, Object::obmat, PROJ_BUCKET_BRUSH_DIV, PROJ_BUCKET_RECT_MAX, PROJ_BUCKET_RECT_MIN, proj_paint_face_lookup_init(), proj_paint_layer_clone_init(), proj_paint_state_cavity_init(), proj_paint_state_mesh_eval_init(), proj_paint_state_screen_coords_init(), proj_paint_state_seam_bleed_init(), proj_paint_state_thread_init(), proj_paint_state_vert_flags_init(), proj_paint_state_viewport_init(), PROJ_SRC_VIEW, project_paint_prepare_all_faces(), ProjPaintState::rv3d, ProjPaintState::scene, ProjPaintState::screen_height, ProjPaintState::screen_width, ProjPaintState::screenMax, ProjPaintState::screenMin, ProjPaintState::source, and Object::transflag.
Referenced by paint_proj_new_stroke(), and texture_paint_camera_project_exec().
|
static |
Definition at line 3987 of file paint_image_proj.c.
References area_tri_v2(), BLI_linklist_prepend_arena(), ProjPaintState::faceSeamFlags, POINTER_FROM_INT, ProjPaintState::poly_to_loop_uv, PROJ_FACE_DEGENERATE, PS_LOOPTRI_AS_UV_3, PS_LOOPTRI_AS_VERT_INDEX_3, ProjPaintState::seam_bleed_px, UNPACK3, and ProjPaintState::vertFaces.
Referenced by project_paint_prepare_all_faces().
|
static |
Takes floating point screen-space min/max and returns int min/max to be used as indices for ps->bucketRect, ps->bucketFlags
Definition at line 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().
|
static |
Definition at line 4233 of file paint_image_proj.c.
References BKE_image_acquire_ibuf(), BLI_assert, BLI_memarena_alloc(), ED_IMAGE_UNDO_TILE_NUMBER, ListBase::first, ProjPaintImage::ibuf, ProjPaintImage::ima, PrepareImageEntry::ima, ProjPaintState::image_tot, ProjPaintImage::iuser, PrepareImageEntry::iuser, ProjPaintImage::maskRect, PrepareImageEntry::next, NULL, partial_redraw_array_init(), ProjPaintImage::partRedrawRect, PROJ_BOUNDBOX_SQUARED, ProjPaintState::projImages, size(), ImageUser::tile, ProjPaintImage::touch, ProjPaintImage::undoRect, ProjPaintImage::valid, ImBuf::x, and ImBuf::y.
Referenced by project_paint_prepare_all_faces().
|
static |
Definition at line 4159 of file paint_image_proj.c.
References ProjPaintState::do_face_sel, MPoly::flag, ProjPaintFaceLookup::index_mp_to_orig, ME_FACE_SEL, ProjPaintState::mpoly_eval, ProjPaintFaceLookup::mpoly_orig, NULL, ORIGINDEX_NONE, and MLoopTri::poly.
Referenced by project_paint_prepare_all_faces().
|
static |
Definition at line 4109 of file paint_image_proj.c.
References ProjPaintState::canvas_ima, CD_MLOOPUV, ProjPaintState::clone_ima, CustomData_get_layer(), CustomData_get_layer_named(), ProjPaintState::do_layer_clone, ProjPaintState::do_material_slots, ELEM, Mesh::ldata, ProjPaintState::me_eval, ProjPaintState::mlooptri_eval, ProjPaintLayerClone::mloopuv_clone_base, NULL, MLoopTri::poly, ProjPaintState::poly_to_loop_uv_clone, project_paint_face_clone_slot(), ProjPaintLayerClone::slot_clone, ProjPaintLayerClone::slot_last_clone, and TexPaintSlot::uvname.
Referenced by project_paint_prepare_all_faces().
|
static |
Definition at line 3615 of file paint_image_proj.c.
References ProjPaintState::arena_mt, BLI_linklist_prepend_arena(), ProjPaintState::bucketFaces, ProjPaintState::buckets_x, INIT_MINMAX2, ProjPaintState::loopSeamData, max, min, minmax_v2v2_v2(), POINTER_FROM_INT, project_bucket_face_isect(), project_paint_bucket_bounds(), PS_LOOPTRI_AS_VERT_INDEX_3, ProjPaintState::screenCoords, ProjPaintState::seam_bleed_px, LoopSeamData::seam_uvs, and MLoopTri::tri.
Referenced by project_paint_prepare_all_faces().
|
static |
Definition at line 4563 of file paint_image_proj.c.
References Freestyle::a, 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_freerectfloatImBuf(), imb_freerectImBuf(), ProjPaintState::is_shared_user, ProjPaintState::loopSeamData, ProjPaintState::mat_array, ProjPaintState::me_eval, MEM_freeN, NULL, paint_delete_blur_kernel(), ProjPaintState::poly_to_loop_uv, ProjPaintState::poly_to_loop_uv_clone, ProjPaintState::projImages, ProjPaintState::reproject_ibuf, ProjPaintState::reproject_ibuf_free_float, ProjPaintState::reproject_ibuf_free_uchar, ProjPaintState::reproject_image, ProjPaintState::screenCoords, ProjPaintState::seam_bleed_px, ProjPaintState::thread_tot, ProjPaintState::tile_lock, ProjPaintState::vertFaces, ProjPaintState::vertFlags, and ProjPaintState::vertSeams.
Referenced by paint_proj_stroke_done(), and texture_paint_camera_project_exec().
|
static |
Definition at line 569 of file paint_image_proj.c.
References ProjPaintState::clone_ima, TexPaintSlot::ima, ProjPaintState::mat_array, MPoly::mat_nr, NULL, Material::paint_clone_slot, ps_tri_index_to_mpoly(), and Material::texpaintslot.
Referenced by project_paint_uvpixel_init().
|
static |
Definition at line 562 of file paint_image_proj.c.
References ProjPaintState::mat_array, MPoly::mat_nr, NULL, Material::paint_clone_slot, ps_tri_index_to_mpoly(), and Material::texpaintslot.
Referenced by project_paint_clone_face_skip().
|
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().
|
static |
Definition at line 550 of file paint_image_proj.c.
References ProjPaintState::canvas_ima, ProjPaintState::do_stencil_brush, TexPaintSlot::ima, ProjPaintState::mat_array, MPoly::mat_nr, NULL, Material::paint_active_slot, ps_tri_index_to_mpoly(), ProjPaintState::stencil_ima, and Material::texpaintslot.
Referenced by check_seam(), project_bucket_init(), and project_paint_PickColor().
|
static |
Definition at line 543 of file paint_image_proj.c.
References ProjPaintState::mat_array, MPoly::mat_nr, NULL, Material::paint_active_slot, ps_tri_index_to_mpoly(), and Material::texpaintslot.
Referenced by project_paint_prepare_all_faces().
Definition at line 531 of file paint_image_proj.c.
References IMA_SRC_TILED, NULL, Image::source, and VertSeam::uv.
Referenced by check_seam(), project_bucket_init(), project_paint_PickColor(), and project_paint_prepare_all_faces().
|
static |
Definition at line 4197 of file paint_image_proj.c.
References ProjPaintState::is_ortho, ProjPaintFaceCoSS::v1, ProjPaintFaceCoSS::v2, and ProjPaintFaceCoSS::v3.
Referenced by project_paint_prepare_all_faces().
|
static |
Check if 'pt' is in front of the 3 verts on the Z axis (used for screen-space occlusion test)
0
: no occlusion-1
: no occlusion but 2D intersection is true1
: occluded2
: 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().
|
static |
Definition at line 853 of file paint_image_proj.c.
References barycentric_weights_v2(), barycentric_weights_v2_persp(), ED_view3d_clipping_test(), interp_v3_v3v3v3(), project_paint_occlude_ptv(), ret, v1, v2, and w().
Referenced by project_bucket_point_occluded().
Definition at line 5546 of file paint_image_proj.c.
References Freestyle::a, 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(), MVert::co, copy_v2_v2(), do_projectpaint_thread(), ELEM, handles, ProjPaintImage::ibuf, ProjPaintState::image_tot, IMB_float_from_rect(), IMB_rect_from_float(), interp_v3_v3v3v3(), UnifiedPaintSettings::last_stroke_valid, ProjPaintState::mlooptri_eval, mul_m4_v3(), ProjPaintState::mvert_eval, NULL, ProjPaintState::obmat, partial_redraw_array_merge(), ProjPaintImage::partRedrawRect, pos, PROJ_BOUNDBOX_SQUARED, PROJ_SRC_VIEW, PROJ_SRC_VIEW_FILL, project_bucket_iter_init(), project_paint_PickFace(), ProjPaintState::projImages, PS_LOOPTRI_AS_VERT_INDEX_3, ImBuf::rect, ImBuf::rect_float, ProjPaintState::reproject_ibuf, ProjPaintState::reproject_ibuf_free_float, ProjPaintState::reproject_ibuf_free_uchar, ProjPaintState::scene, ProjPaintState::source, state, task_pool, TASK_PRIORITY_HIGH, ProjPaintState::thread_tot, Scene::toolsettings, ProjPaintImage::touch, ToolSettings::unified_paint_settings, USER_ORBIT_SELECTION, w(), and world.
Referenced by paint_proj_stroke_ps(), and texture_paint_camera_project_exec().
|
static |
we must have got the imbuf before getting here.
Definition at line 714 of file paint_image_proj.c.
References bilinear_interpolation_color_wrap(), BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), BKE_imageuser_default(), copy_v4_v4(), ImageUser::framenr, interp(), interp_v2_v2v2v2(), Image::lastframe, ProjPaintState::mlooptri_eval, mod_i(), NULL, ProjPaintState::poly_to_loop_uv, premul_float_to_straight_uchar(), project_paint_face_paint_image(), project_paint_face_paint_tile(), project_paint_PickFace(), PS_LOOPTRI_ASSIGN_UV_3, ImBuf::rect, ImBuf::rect_float, usdtokens::rgba(), straight_uchar_to_premul_float(), ImageUser::tile, UNPACK3, VertSeam::uv, uvco_to_wrapped_pxco(), w(), x, ImBuf::x, y, and ImBuf::y.
Referenced by do_projectpaint_smear(), do_projectpaint_smear_f(), do_projectpaint_soften(), do_projectpaint_soften_f(), and project_paint_uvpixel_init().
|
static |
will be -1 or a valid face.
Definition at line 649 of file paint_image_proj.c.
References ProjPaintState::bucketFaces, copy_v3_v3(), ProjPaintState::is_ortho, isect_point_tri_v2(), ProjPaintState::mloop_eval, ProjPaintState::mlooptri_eval, node, POINTER_AS_INT, project_bucket_offset_safe(), ProjPaintState::screenCoords, MLoopTri::tri, UNPACK3, MLoop::v, VecZDepthOrtho(), VecZDepthPersp(), and w().
Referenced by project_paint_op(), and project_paint_PickColor().
|
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().
|
static |
Definition at line 4269 of file paint_image_proj.c.
References BKE_image_has_ibuf(), BKE_imageuser_default(), BLI_addtail(), BLI_assert, BLI_freelistN(), ProjPaintState::canvas_ima, CD_MLOOPUV, CustomData_get_layer(), CustomData_get_layer_named(), ProjPaintState::do_backfacecull, ProjPaintState::do_mask_normal, ProjPaintState::do_stencil_brush, e, ListBase::first, ImageUser::framenr, TexPaintSlot::ima, ProjPaintState::image_tot, ProjPaintState::is_flip_object, ProjPaintState::is_shared_user, PrepareImageEntry::iuser, Mesh::ldata, line_point_side_v2(), MPoly::loopstart, ProjPaintState::me_eval, MEM_callocN, ProjPaintState::mloop_eval, ProjPaintState::mlooptri_eval, ProjPaintState::mpoly_eval, NULL, MLoopTri::poly, 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_sel(), project_paint_clone_face_skip(), project_paint_delayed_face_init(), project_paint_face_paint_slot(), project_paint_face_paint_tile(), project_paint_flt_max_cull(), project_paint_winclip(), ProjPaintState::stencil_ima, tile, ImageUser::tile, MPoly::totloop, MLoopTri::tri, MLoopUV::uv, TexPaintSlot::uvname, MLoop::v, ProjPaintFaceCoSS::v1, ProjPaintFaceCoSS::v2, ProjPaintFaceCoSS::v3, and ProjPaintState::vertFlags.
Referenced by project_paint_begin().
|
static |
Definition at line 1795 of file paint_image_proj.c.
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, NULL, TileInfo::pjima, tile_index, TILE_PENDING, TileInfo::tile_width, TileInfo::tmpibuf, ProjPaintImage::undoRect, UNLIKELY, and ProjPaintImage::valid.
Referenced by project_paint_uvpixel_init().
|
static |
Definition at line 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().
|
static |
Definition at line 1646 of file paint_image_proj.c.
References acosf, BKE_curvemapping_evaluateF(), BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), ProjPaintState::cavities, ProjPaintState::cavity_curve, CLAMP, MVert::co, ProjPaintState::do_backfacecull, ProjPaintState::do_layer_stencil, ProjPaintState::do_layer_stencil_inv, ProjPaintState::do_mask_cavity, ProjPaintState::do_mask_normal, dot_v3v3(), fabsf, MPoly::flag, ProjPaintState::is_flip_object, ProjPaintState::is_ortho, mask(), ME_SMOOTH, ProjPaintState::mlooptri_eval, ProjPaintState::mloopuv_stencil_eval, ProjPaintState::mpoly_eval, ProjPaintState::mvert_eval, negate_v3(), ProjPaintState::normal_angle, ProjPaintState::normal_angle_range, normal_tri_v3(), normalize_v3(), NULL, MLoopTri::poly, project_face_pixel(), PS_LOOPTRI_AS_VERT_INDEX_3, ImBuf::rect_float, ProjPaintState::stencil_ima, MLoopTri::tri, UNLIKELY, MLoopUV::uv, ProjPaintState::vert_normals, ProjPaintState::viewDir, ProjPaintState::viewPos, and w().
Referenced by project_paint_face_init().
|
static |
Definition at line 4209 of file paint_image_proj.c.
References PROJ_SRC_VIEW_FILL, ProjPaintState::screenMax, ProjPaintState::screenMin, ProjPaintState::source, ProjPaintFaceCoSS::v1, ProjPaintFaceCoSS::v2, and ProjPaintFaceCoSS::v3.
Referenced by project_paint_prepare_all_faces().
|
static |
Definition at line 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().
BLI_INLINE const MPoly* ps_tri_index_to_mpoly | ( | const ProjPaintState * | ps, |
int | tri_index | ||
) |
Definition at line 507 of file paint_image_proj.c.
References ProjPaintState::mlooptri_eval, ProjPaintState::mpoly_eval, and MLoopTri::poly.
Referenced by project_paint_face_clone_image(), project_paint_face_clone_slot(), project_paint_face_paint_image(), and project_paint_face_paint_slot().
|
static |
Definition at line 2313 of file paint_image_proj.c.
References barycentric_weights_v2(), interp_v2_v2v2v2(), w(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_bucket_clip_face().
|
static |
Definition at line 2349 of file paint_image_proj.c.
References barycentric_weights_v2_persp(), interp_v2_v2v2v2(), w(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by project_bucket_clip_face().
Scale the tri about its center scaling by PROJ_FACE_SCALE_SEAM (0.99x) is used for getting fake UV pixel coords that are on the edge of the face but slightly inside it occlusion tests don't return hits on adjacent faces.
Definition at line 2210 of file paint_image_proj.c.
References add_v3_v3(), mul_v3_fl(), and sub_v3_v3v3().
Referenced by project_paint_face_init().
|
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().
|
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().
|
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 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().
|
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 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().
|
static |
Definition at line 6728 of file paint_image_proj.c.
References C, OPERATOR_CANCELLED, OPERATOR_FINISHED, and proj_paint_add_slot().
Referenced by PAINT_OT_add_texture_paint_slot().
|
static |
Definition at line 6746 of file paint_image_proj.c.
References Object::actcol, BKE_object_material_get(), C, color, default_paint_slot_color_get(), ED_object_active_context(), get_default_texture_layer_name_for_object(), get_texture_layer_type(), MAX_ID_NAME, wmOperator::ptr, RNA_float_set_array(), RNA_string_set(), type, and WM_operator_props_dialog_popup().
Referenced by PAINT_OT_add_texture_paint_slot().
|
static |
Definition at line 6768 of file paint_image_proj.c.
References BLI_assert_unreachable, C, col, ED_object_active_context(), wmOperator::layout, Object::mode, NULL, OB_MODE_SCULPT, PAINT_CANVAS_SOURCE_COLOR_ATTRIBUTE, PAINT_CANVAS_SOURCE_IMAGE, PAINT_CANVAS_SOURCE_MATERIAL, wmOperator::ptr, RNA_enum_get(), UI_ITEM_R_EXPAND, uiItemR(), uiLayoutColumn(), uiLayoutSetPropDecorate(), and uiLayoutSetPropSep().
Referenced by PAINT_OT_add_texture_paint_slot().
|
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().
|
static |
Definition at line 6179 of file paint_image_proj.c.
References blender::compositor::area(), IDPropertyTemplate::array, BKE_area_find_region_active_win(), BKE_image_add_from_imbuf(), BKE_report(), BKE_reportf(), BKE_screen_find_big_area(), C, CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_wm_screen(), depsgraph, ED_view3d_clip_range_get(), ED_view3d_draw_offscreen_imbuf(), FILE_MAX, View3DOverlay::flag, View3D::flag, View3D::flag2, View3D::gizmo_flag, GPU_max_texture_size(), View3D::gridflag, IB_rect, IDP_AddToGroup(), IDP_Array, IDP_ARRAY, IDP_FLOAT, IDP_GetProperties(), IDP_New(), image(), ToolSettings::imapaint, IMB_freeImBuf(), IDPropertyTemplate::len, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, View3D::overlay, PROJ_VIEW_DATA_ID, PROJ_VIEW_DATA_SIZE, wmOperator::ptr, R_ALPHAPREMUL, ARegion::regiondata, wmOperator::reports, RNA_string_get(), RPT_ERROR, scene, ImagePaintSettings::screen_grab_size, View3D::shading, SPACE_VIEW3D, View3DOverlay::texture_paint_mode_opacity, Scene::toolsettings, IDPropertyTemplate::type, 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().
Definition at line 6166 of file paint_image_proj.c.
References BKE_screen_find_big_area(), C, CTX_wm_operator_poll_msg_set(), CTX_wm_screen(), G, GPU_is_init(), and SPACE_VIEW3D.
Referenced by PAINT_OT_image_from_view().
|
static |
Definition at line 1287 of file paint_image_proj.c.
References add_v2_v2v2(), compute_seam_normal(), copy_v2_v2(), LoopSeamData::corner_dist_sq, cosf, ProjPaintState::faceSeamFlags, find_adjacent_seam(), float(), isect_seg_seg_v2_point(), isect_seg_seg_v2_simple(), ProjPaintState::loopSeamData, M_PI, M_PI_2, MIN2, ProjPaintState::mloop_eval, ProjPaintState::mlooptri_eval, mul_v2_fl(), mul_v2_v2v2(), PROJ_FACE_SEAM0, ProjPaintState::seam_bleed_px, LoopSeamData::seam_puvs, LoopSeamData::seam_uvs, square_f(), tanf, MLoopTri::tri, UNLIKELY, and MLoop::v.
Referenced by project_paint_face_init().
|
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().
|
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().
|
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().
|
static |
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().