Blender V5.0
ProjPaintState Struct Reference

Public Attributes

View3Dv3d
RegionView3Drv3d
ARegionregion
Depsgraph * depsgraph
Scenescene
int source
float paint_color_linear [3]
float dither
Paintpaint
Brushbrush
short brush_type
short blend
BrushStrokeMode mode
float brush_size
Objectob
float obmat [4][4]
float obmat_imat [4][4]
Imagestencil_ima
Imagecanvas_ima
Imageclone_ima
float stencil_value
MemArenaarena_mt [BLENDER_MAX_THREADS]
LinkNode ** bucketRect
LinkNode ** bucketFaces
ucharbucketFlags
char * vertFlags
int buckets_x
int buckets_y
int pixel_sizeof
int image_tot
float(* screenCoords )[4]
float screenMin [2]
float screenMax [2]
float screen_width
float screen_height
int winx
int winy
bool do_layer_clone
bool do_layer_stencil
bool do_layer_stencil_inv
bool do_stencil_brush
bool do_material_slots
bool do_occlude
bool do_backfacecull
bool do_mask_normal
bool do_mask_cavity
float normal_angle
float normal_angle__cos
float normal_angle_inner
float normal_angle_inner__cos
float normal_angle_range
bool do_face_sel
bool is_ortho
bool is_flip_object
bool do_masking
bool is_texbrush
bool is_maskbrush
float seam_bleed_px
float seam_bleed_px_sq
float cloneOffset [2]
float projectMat [4][4]
float projectMatInv [4][4]
float viewDir [3]
float viewPos [3]
float clip_start
float clip_end
Imagereproject_image
ImBufreproject_ibuf
bool reproject_ibuf_free_float
bool reproject_ibuf_free_uchar
int thread_tot
int bucketMin [2]
int bucketMax [2]
int context_bucket_index
CurveMappingcavity_curve
BlurKernelblurkernel
bool is_shared_user
ProjPaintImageprojImages
floatcavities
ushortfaceSeamFlags
char * faceWindingFlags
LoopSeamDataloopSeamData
LinkNode ** vertFaces
ListBasevertSeams
SpinLocktile_lock
Meshmesh_eval
int totloop_eval
int faces_num_eval
int totvert_eval
blender::Span< blender::float3vert_positions_eval
blender::Span< blender::float3vert_normals
blender::Span< blender::int2edges_eval
blender::OffsetIndices< int > faces_eval
blender::Span< int > corner_verts_eval
const bool * select_poly_eval
const bool * hide_poly_eval
const int * material_indices
const bool * sharp_faces_eval
blender::Span< int3corner_tris_eval
blender::Span< int > corner_tri_faces_eval
const float(* uv_map_stencil_eval )[2]
const float(** poly_to_loop_uv )[2]
const float(** poly_to_loop_uv_clone )[2]
Material ** mat_array

Detailed Description

Definition at line 268 of file paint_image_proj.cc.

Member Data Documentation

◆ arena_mt

MemArena* ProjPaintState::arena_mt[BLENDER_MAX_THREADS]

For multi-threading, the first item is sometimes used for non threaded cases too.

Definition at line 306 of file paint_image_proj.cc.

Referenced by proj_paint_state_thread_init(), project_paint_begin(), project_paint_delayed_face_init(), project_paint_end(), project_paint_face_init(), and project_paint_op().

◆ blend

◆ blurkernel

BlurKernel* ProjPaintState::blurkernel

◆ brush

◆ brush_size

float ProjPaintState::brush_size

◆ brush_type

short ProjPaintState::brush_type

Based on Brush::image_brush_type but may be overridden by mode (BrushStrokeMode). So check this value instead of brush->image_brush_type.

Definition at line 288 of file paint_image_proj.cc.

Referenced by do_projectpaint_thread(), paint_proj_begin_clone(), paint_proj_new_stroke(), paint_proj_stroke_ps(), project_paint_uvpixel_init(), project_state_init(), and texture_paint_camera_project_exec().

◆ bucketFaces

LinkNode** ProjPaintState::bucketFaces

bucketRect aligned array linkList of faces overlapping each bucket.

Definition at line 310 of file paint_image_proj.cc.

Referenced by project_bucket_init(), project_paint_begin(), project_paint_delayed_face_init(), project_paint_end(), project_paint_face_init(), and project_paint_PickFace().

◆ bucketFlags

uchar* ProjPaintState::bucketFlags

store if the bucks have been initialized.

Definition at line 312 of file paint_image_proj.cc.

Referenced by do_projectpaint_thread(), project_bucket_init(), project_paint_begin(), and project_paint_end().

◆ bucketMax

int ProjPaintState::bucketMax[2]

Definition at line 400 of file paint_image_proj.cc.

Referenced by project_bucket_iter_init(), and project_bucket_iter_next().

◆ bucketMin

int ProjPaintState::bucketMin[2]

Definition at line 399 of file paint_image_proj.cc.

Referenced by project_bucket_iter_init(), and project_bucket_iter_next().

◆ bucketRect

LinkNode** ProjPaintState::bucketRect

screen sized 2D array, each pixel has a linked list of ProjPixel's

Definition at line 308 of file paint_image_proj.cc.

Referenced by do_projectpaint_thread(), project_paint_begin(), project_paint_end(), and project_paint_face_init().

◆ buckets_x

int ProjPaintState::buckets_x

The size of the bucket grid, the grid span's screenMin/screenMax so you can paint outsize the screen or with 2 brushes at once.

Definition at line 318 of file paint_image_proj.cc.

Referenced by project_bucket_bounds(), project_bucket_iter_init(), project_bucket_iter_next(), project_bucket_offset(), project_bucket_offset_safe(), project_paint_begin(), project_paint_bucket_bounds(), and project_paint_delayed_face_init().

◆ buckets_y

◆ canvas_ima

◆ cavities

float* ProjPaintState::cavities

cavity amount for vertices.

Definition at line 423 of file paint_image_proj.cc.

Referenced by proj_paint_state_cavity_init(), project_paint_end(), and project_paint_uvpixel_mask().

◆ cavity_curve

CurveMapping* ProjPaintState::cavity_curve

Definition at line 404 of file paint_image_proj.cc.

Referenced by project_paint_uvpixel_mask(), and project_state_init().

◆ clip_end

float ProjPaintState::clip_end

Definition at line 389 of file paint_image_proj.cc.

Referenced by proj_paint_state_viewport_init().

◆ clip_start

float ProjPaintState::clip_start

Definition at line 389 of file paint_image_proj.cc.

Referenced by proj_paint_state_viewport_init().

◆ clone_ima

Image* ProjPaintState::clone_ima

◆ cloneOffset

float ProjPaintState::cloneOffset[2]

Definition at line 379 of file paint_image_proj.cc.

Referenced by paint_proj_begin_clone(), and project_paint_uvpixel_init().

◆ context_bucket_index

int ProjPaintState::context_bucket_index

must lock threads while accessing these.

Definition at line 402 of file paint_image_proj.cc.

Referenced by project_bucket_iter_init(), and project_bucket_iter_next().

◆ corner_tri_faces_eval

◆ corner_tris_eval

◆ corner_verts_eval

◆ depsgraph

Depsgraph* ProjPaintState::depsgraph

Definition at line 272 of file paint_image_proj.cc.

Referenced by proj_paint_state_viewport_init(), and project_state_init().

◆ dither

float ProjPaintState::dither

Definition at line 279 of file paint_image_proj.cc.

Referenced by do_projectpaint_thread(), and project_state_init().

◆ do_backfacecull

bool ProjPaintState::do_backfacecull

ignore faces with normals pointing away, skips a lot of ray-casts if your normals are correctly flipped.

Definition at line 349 of file paint_image_proj.cc.

Referenced by proj_paint_state_vert_flags_init(), project_paint_face_init(), project_paint_prepare_all_faces(), project_paint_uvpixel_mask(), and project_state_init().

◆ do_face_sel

bool ProjPaintState::do_face_sel

quick access to (me->editflag & ME_EDIT_PAINT_FACE_SEL)

Definition at line 364 of file paint_image_proj.cc.

Referenced by proj_paint_face_lookup_init(), project_paint_begin(), and project_paint_check_face_paintable().

◆ do_layer_clone

bool ProjPaintState::do_layer_clone

◆ do_layer_stencil

bool ProjPaintState::do_layer_stencil

◆ do_layer_stencil_inv

bool ProjPaintState::do_layer_stencil_inv

Definition at line 341 of file paint_image_proj.cc.

Referenced by project_paint_uvpixel_mask(), and project_state_init().

◆ do_mask_cavity

bool ProjPaintState::do_mask_cavity

mask out pixels based on cavity.

Definition at line 353 of file paint_image_proj.cc.

Referenced by proj_paint_state_cavity_init(), project_paint_end(), project_paint_uvpixel_mask(), and project_state_init().

◆ do_mask_normal

bool ProjPaintState::do_mask_normal

mask out pixels based on their normals.

Definition at line 351 of file paint_image_proj.cc.

Referenced by proj_paint_state_vert_flags_init(), project_paint_prepare_all_faces(), project_paint_uvpixel_mask(), and project_state_init().

◆ do_masking

◆ do_material_slots

bool ProjPaintState::do_material_slots

Definition at line 343 of file paint_image_proj.cc.

Referenced by project_paint_clone_face_skip(), and project_state_init().

◆ do_occlude

bool ProjPaintState::do_occlude

Use ray-traced occlusion? - otherwise will paint right through to the back.

Definition at line 346 of file paint_image_proj.cc.

Referenced by project_paint_face_init(), and project_state_init().

◆ do_stencil_brush

bool ProjPaintState::do_stencil_brush

◆ edges_eval

blender::Span<blender::int2> ProjPaintState::edges_eval

◆ faces_eval

blender::OffsetIndices<int> ProjPaintState::faces_eval

◆ faces_num_eval

int ProjPaintState::faces_num_eval

◆ faceSeamFlags

ushort* ProjPaintState::faceSeamFlags

◆ faceWindingFlags

char* ProjPaintState::faceWindingFlags

save the winding of the face in uv space, helps as an extra validation step for seam detection.

Definition at line 430 of file paint_image_proj.cc.

Referenced by check_seam(), insert_seam_vert_array(), proj_paint_state_seam_bleed_init(), project_face_seams_init(), project_face_winding_init(), and project_paint_end().

◆ hide_poly_eval

const bool* ProjPaintState::hide_poly_eval

◆ image_tot

◆ is_flip_object

◆ is_maskbrush

bool ProjPaintState::is_maskbrush

mask brush is applied before masking.

Definition at line 373 of file paint_image_proj.cc.

Referenced by do_projectpaint_thread(), project_state_init(), and texture_paint_camera_project_exec().

◆ is_ortho

◆ is_shared_user

◆ is_texbrush

bool ProjPaintState::is_texbrush

◆ loopSeamData

LoopSeamData* ProjPaintState::loopSeamData

◆ mat_array

Material** ProjPaintState::mat_array

◆ material_indices

const int* ProjPaintState::material_indices

Definition at line 453 of file paint_image_proj.cc.

Referenced by proj_paint_state_mesh_eval_init(), and tex_get_material().

◆ mesh_eval

◆ mode

◆ normal_angle

float ProjPaintState::normal_angle

what angle to mask at.

Definition at line 355 of file paint_image_proj.cc.

Referenced by project_paint_uvpixel_mask(), and project_state_init().

◆ normal_angle__cos

float ProjPaintState::normal_angle__cos

cos(normal_angle), faster to compare.

Definition at line 357 of file paint_image_proj.cc.

Referenced by proj_paint_state_vert_flags_init(), and project_state_init().

◆ normal_angle_inner

float ProjPaintState::normal_angle_inner

Definition at line 358 of file paint_image_proj.cc.

Referenced by project_state_init().

◆ normal_angle_inner__cos

float ProjPaintState::normal_angle_inner__cos

Definition at line 359 of file paint_image_proj.cc.

Referenced by project_state_init().

◆ normal_angle_range

float ProjPaintState::normal_angle_range

difference between normal_angle and normal_angle_inner, for easy access.

Definition at line 361 of file paint_image_proj.cc.

Referenced by project_paint_uvpixel_mask(), and project_state_init().

◆ ob

◆ obmat

float ProjPaintState::obmat[4][4]

Definition at line 295 of file paint_image_proj.cc.

Referenced by proj_paint_state_viewport_init(), and project_paint_op().

◆ obmat_imat

float ProjPaintState::obmat_imat[4][4]

Definition at line 296 of file paint_image_proj.cc.

Referenced by paint_proj_begin_clone(), and proj_paint_state_viewport_init().

◆ paint

◆ paint_color_linear

float ProjPaintState::paint_color_linear[3]

◆ pixel_sizeof

int ProjPaintState::pixel_sizeof

result of project_paint_pixel_sizeof(), constant per stroke.

Definition at line 322 of file paint_image_proj.cc.

Referenced by project_paint_uvpixel_init(), and project_state_init().

◆ poly_to_loop_uv

const float(** ProjPaintState::poly_to_loop_uv)[2]
Note
These UV layers are aligned to faces_eval but each pointer references the start of the layer, so a loop indirection is needed as well.

Definition at line 465 of file paint_image_proj.cc.

Referenced by check_seam(), insert_seam_vert_array(), proj_paint_state_mesh_eval_init(), project_bucket_init(), project_face_winding_init(), project_paint_bleed_add_face_user(), project_paint_end(), project_paint_face_init(), project_paint_PickColor(), and project_paint_prepare_all_faces().

◆ poly_to_loop_uv_clone

const float(** ProjPaintState::poly_to_loop_uv_clone)[2]

other UV map, use for cloning between layers.

Definition at line 467 of file paint_image_proj.cc.

Referenced by proj_paint_layer_clone_init(), project_paint_clone_face_skip(), project_paint_end(), and project_paint_uvpixel_init().

◆ projectMat

float ProjPaintState::projectMat[4][4]

Projection matrix, use for getting screen coords.

Definition at line 382 of file paint_image_proj.cc.

Referenced by paint_proj_begin_clone(), proj_paint_state_viewport_init(), and project_paint_face_init().

◆ projectMatInv

float ProjPaintState::projectMatInv[4][4]

inverse of projectMat.

Definition at line 384 of file paint_image_proj.cc.

Referenced by proj_paint_state_viewport_init(), and screen_px_line_point_factor_v2_persp().

◆ projImages

◆ region

ARegion* ProjPaintState::region

Definition at line 271 of file paint_image_proj.cc.

Referenced by proj_paint_state_viewport_init(), and project_state_init().

◆ reproject_ibuf

◆ reproject_ibuf_free_float

bool ProjPaintState::reproject_ibuf_free_float

Definition at line 394 of file paint_image_proj.cc.

Referenced by project_paint_end(), and project_paint_op().

◆ reproject_ibuf_free_uchar

bool ProjPaintState::reproject_ibuf_free_uchar

Definition at line 395 of file paint_image_proj.cc.

Referenced by project_paint_end(), and project_paint_op().

◆ reproject_image

Image* ProjPaintState::reproject_image

◆ rv3d

◆ scene

◆ screen_height

float ProjPaintState::screen_height

◆ screen_width

float ProjPaintState::screen_width

Calculated from screenMin & screenMax.

Definition at line 333 of file paint_image_proj.cc.

Referenced by project_bucket_bounds(), project_bucket_offset(), project_paint_begin(), and project_paint_bucket_bounds().

◆ screenCoords

◆ screenMax

float ProjPaintState::screenMax[2]

◆ screenMin

float ProjPaintState::screenMin[2]

2D bounds for mesh verts on the screen's plane (screen-space).

Definition at line 330 of file paint_image_proj.cc.

Referenced by proj_paint_state_screen_coords_init(), project_bucket_bounds(), project_bucket_offset(), project_paint_begin(), project_paint_bucket_bounds(), and project_paint_winclip().

◆ seam_bleed_px

◆ seam_bleed_px_sq

float ProjPaintState::seam_bleed_px_sq

Definition at line 376 of file paint_image_proj.cc.

Referenced by project_paint_face_init(), and project_state_init().

◆ select_poly_eval

const bool* ProjPaintState::select_poly_eval

◆ sharp_faces_eval

const bool* ProjPaintState::sharp_faces_eval

◆ source

◆ stencil_ima

◆ stencil_value

float ProjPaintState::stencil_value

◆ thread_tot

int ProjPaintState::thread_tot

◆ tile_lock

SpinLock* ProjPaintState::tile_lock

◆ totloop_eval

int ProjPaintState::totloop_eval

◆ totvert_eval

◆ uv_map_stencil_eval

const float(* ProjPaintState::uv_map_stencil_eval)[2]

Definition at line 458 of file paint_image_proj.cc.

Referenced by project_paint_begin(), and project_paint_uvpixel_mask().

◆ v3d

◆ vert_normals

◆ vert_positions_eval

◆ vertFaces

LinkNode** ProjPaintState::vertFaces

Only needed for when seam_bleed_px is enabled, use to find UV seams.

Definition at line 434 of file paint_image_proj.cc.

Referenced by check_seam(), proj_paint_state_seam_bleed_init(), project_face_seams_init(), project_paint_bleed_add_face_user(), and project_paint_end().

◆ vertFlags

char* ProjPaintState::vertFlags

store options per vert, now only store if the vert is pointing away from the view.

Definition at line 315 of file paint_image_proj.cc.

Referenced by proj_paint_state_vert_flags_init(), project_paint_end(), and project_paint_prepare_all_faces().

◆ vertSeams

ListBase* ProjPaintState::vertSeams

Seams per vert, to find adjacent seams.

Definition at line 436 of file paint_image_proj.cc.

Referenced by find_adjacent_seam(), insert_seam_vert_array(), proj_paint_state_seam_bleed_init(), and project_paint_end().

◆ viewDir

float ProjPaintState::viewDir[3]

View vector, use for do_backfacecull and for ray casting with an ortho viewport.

Definition at line 386 of file paint_image_proj.cc.

Referenced by proj_paint_state_vert_flags_init(), proj_paint_state_viewport_init(), and project_paint_uvpixel_mask().

◆ viewPos

float ProjPaintState::viewPos[3]

View location in object relative 3D space, so can compare to verts.

Definition at line 388 of file paint_image_proj.cc.

Referenced by proj_paint_state_vert_flags_init(), proj_paint_state_viewport_init(), project_paint_uvpixel_mask(), and screen_px_line_point_factor_v2_persp().

◆ winx

int ProjPaintState::winx

From the area or from the projection render.

Definition at line 336 of file paint_image_proj.cc.

Referenced by paint_proj_begin_clone(), proj_paint_state_viewport_init(), project_paint_face_init(), and screen_px_line_point_factor_v2_persp().

◆ winy


The documentation for this struct was generated from the following file: