37 if (a.
type !=
b.type) {
43 if (a.
flag !=
b.flag) {
108 View3D *v3d = context->v3d;
145 if (new_clip_state != old_clip_state) {
174 if (
shading != previous_shading) {
208 bool is_playback = context->is_playback();
209 bool is_navigating = context->is_navigating();
214 if (is_playback || is_navigating) {
219 int _samples_len =
U.viewport_aa;
223 else if (context->is_scene_render()) {
226 if (is_navigating || is_playback) {
228 _samples_len =
min_ii(_samples_len, 1);
232 _samples_len =
max_ii(_samples_len, 1);
279 const StringRef name =
mesh.active_color_attribute ?
mesh.active_color_attribute :
280 mesh.default_color_attribute;
295 StringRef active_uv_map =
mesh.active_or_default_uv_map_name();
311 const bool is_active = (ob == draw_ctx->
obact);
313 const auto is_gsplat = [&]() {
329 const auto has_color = [&]() {
337 const auto has_uv = [&]() {
364 if (is_vertpaint_mode && has_color()) {
367 else if (is_texpaint_mode && has_uv()) {
Camera data-block and utility functions.
CustomData interface, see also DNA_customdata_types.h.
A BVH for high poly meshes.
#define IMAGEPAINT_MODE_IMAGE
#define RV3D_LOCK_FLAGS(rv3d)
#define RV3D_CLIPPING_ENABLED(v3d, rv3d)
#define SHADING_XRAY_ALPHA(shading)
#define SHADING_XRAY_ENABLED(shading)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
constexpr IndexRange()=default
constexpr StringRefNull()
std::optional< AttributeMetaData > lookup_meta_data(StringRef name) const
constexpr bool is_empty() const
static View & default_get()
const float4x4 persmat(int view_id=0) const
const float3 & forward(int view_id=0) const
bool is_uv_map(const AttributeMetaData &meta_data)
bool is_color_attribute(const AttributeMetaData &meta_data)
pbvh::Tree * pbvh_get(Object &object)
bool operator!=(const CameraData &a, const CameraData &b)
static bool mesh_has_color_attribute(const Mesh &mesh)
static bool mesh_has_uv_map_attribute(const Mesh &mesh)
bool assign_if_different(T &old_value, T &&new_value)
@ IMAGEPAINT_INTERP_LINEAR
@ GPU_SAMPLER_EXTEND_MODE_REPEAT
@ GPU_SAMPLER_FILTERING_LINEAR
MINLINE int max_ii(int a, int b)
bool GPU_ray_query_support()
MatBase< float, 4, 4 > float4x4
@ V3D_SHADING_BACKFACE_CULLING
@ V3D_SHADING_OBJECT_OUTLINE
@ V3D_SHADING_DEPTH_OF_FIELD
VecBase< float, 4 > float4
@ V3D_SHADING_CAVITY_SSAO
@ V3D_SHADING_CAVITY_CURVATURE
@ V3D_SHADING_CAVITY_BOTH
VecBase< int32_t, 2 > int2
T & DRW_object_get_data_for_drawing(const Object &object)
@ USER_GPU_FLAG_WORKBENCH_RT_SHADOWS
bool DRW_object_use_hide_faces(const Object *ob)
BMDataLayerLookup BM_data_layer_lookup(const BMesh &bm, const StringRef name)
@ V3D_SHADING_MATERIAL_COLOR
@ V3D_SHADING_VERTEX_COLOR
@ V3D_SHADING_TEXTURE_COLOR
@ V3D_SHADING_OBJECT_COLOR
@ V3D_SHADING_BACKGROUND_VIEWPORT
bool BKE_sculptsession_use_pbvh_draw(const Object *ob, const RegionView3D *rv3d)
const BMesh * BKE_editmesh_bmesh_get(const Object *ob)
VecBase< float, 3 > float3
Scene * DEG_get_evaluated_scene(const Depsgraph *graph)
MINLINE int min_ii(int a, int b)
@ PAINT_DEBUG_SHOW_BVH_NODES
enum eContextObjectMode CTX_data_mode_enum_ex(const Object *obedit, const Object *ob, eObjectMode object_mode)
bool is_image_render() const
bool is_scene_render() const
GPUSamplerExtendMode extend_yz
void set_filtering_flag_from_test(GPUSamplerFiltering filtering_flags, bool test)
GPUSamplerExtendMode extend_x
eImagePaint_Interpolation interp
eObject_DrawExtraFlag dtx
ePaintDebugFlags debug_flags
eRegionView3D_Persp persp
eSceneDisplay_AA render_aa
eSceneDisplay_AA viewport_aa
struct SceneDisplay display
struct ToolSettings * toolsettings
float curvature_valley_factor
eV3DShadingColorType color_type
float object_outline_color[3]
float cavity_valley_factor
float curvature_ridge_factor
eV3DShadingColorType wire_color_type
eV3DShadingBackgroundType background_type
eV3DShadingLightingMode light
eView3DShading_CavityType cavity_type
float cavity_ridge_factor
float background_color[3]
GPUSamplerState sampler_state
MaterialTexture()=default
bool use_per_material_batches
MaterialTexture image_paint_override
ObjectState(const DRWContext *draw_ctx, const SceneState &scene_state, const SceneResources &resources, Object *ob, Manager &manager)
eV3DShadingColorType color_type
bool show_missing_texture
MaterialTexture missing_texture
bool show_paint_bvh_debug
eLightingType lighting_type
bool reset_taa_next_sample
void init(const DRWContext *context, bool scene_updated, Object *camera_ob=nullptr)
float4x4 view_projection_matrix
Vector< float4 > clip_planes
Material material_override
eContextObjectMode object_mode