35 static float3 colors[9] = {
66 Paint *paint =
nullptr;
67 if (drwctx->
evil_C !=
nullptr) {
78 for (
int i :
IndexRange(draw_frustum_planes.size())) {
79 draw_frustum_planes[
i] = tmat * draw_frustum_planes[
i];
83 bool fast_mode =
false;
85 fast_mode = navigating;
92 update_only_visible =
true;
106 const IndexMask nodes_to_update = update_only_visible ? visible_nodes :
122 result_batches[
pos] = {};
123 result_batches[
pos].batch = batches[
i];
124 result_batches[
pos].material_slot = material_indices.
is_empty() ?
126 std::clamp(material_indices[
i], 0, max_material);
127 result_batches[
pos].debug_index =
pos;
130 return result_batches;
177 if (
const std::optional<bke::AttributeMetaData> meta_data = attributes.
lookup_meta_data(
222 for (
uint i = 0;
i < 32;
i++) {
223 if (cd_needed.
uv & (1 <<
i)) {
CustomData interface, see also DNA_customdata_types.h.
int CustomData_get_layer_index_n(const CustomData *data, eCustomDataType type, int n)
int CustomData_get_offset_named(const CustomData *data, eCustomDataType type, blender::StringRef name)
const char * CustomData_get_active_layer_name(const CustomData *data, eCustomDataType type)
General operations, lookup, etc. for materials.
int BKE_object_material_count_eval(const Object *ob)
General operations, lookup, etc. for blender objects.
Mesh * BKE_object_get_original_mesh(const Object *object)
Paint * BKE_paint_get_active_from_context(const bContext *C)
bool BKE_pbvh_node_fully_hidden_get(const blender::bke::pbvh::Node &node)
@ PAINT_SCULPT_DELAY_UPDATES
T & DRW_object_get_data_for_drawing(const Object &object)
constexpr bool is_empty() const
void append(const T &value)
std::optional< AttributeMetaData > lookup_meta_data(StringRef attribute_id) const
static View & default_get()
std::array< float4, 6 > frustum_planes_get(int view_id=0)
virtual Span< int > ensure_material_indices(const Object &object)=0
virtual Span< gpu::Batch * > ensure_lines_batches(const Object &object, const ViewportRequest &request, const IndexMask &nodes_to_update)=0
virtual Span< gpu::Batch * > ensure_tris_batches(const Object &object, const ViewportRequest &request, const IndexMask &nodes_to_update)=0
void foreach_index(Fn &&fn) const
Utilities for rendering attributes.
const DRWContext * DRW_context_get()
pbvh::Tree * pbvh_get(Object &object)
IndexMask search_nodes(const Tree &pbvh, IndexMaskMemory &memory, FunctionRef< bool(const Node &)> filter_fn)
IndexMask all_leaf_nodes(const Tree &pbvh, IndexMaskMemory &memory)
void update_normals_from_eval(Object &object_eval, Tree &pbvh)
bool node_frustum_contain_aabb(const Node &node, Span< float4 > frustum_planes)
std::optional< eCustomDataType > attr_type_to_custom_data_type(AttrType attr_type)
DrawCache & ensure_draw_data(std::unique_ptr< bke::pbvh::DrawCache > &ptr)
std::string GenericRequest
Vector< SculptBatch > sculpt_batches_get(const Object *ob, SculptBatchFeature features)
static Vector< SculptBatch > sculpt_batches_get_ex(const Object *ob, const bool use_wire, const Span< pbvh::AttributeRequest > attrs)
@ SCULPT_BATCH_VERTEX_COLOR
static bool bmesh_attribute_exists(const BMesh &bm, const bke::AttributeMetaData &meta_data, const StringRef name)
void DRW_mesh_get_attributes(const Object &object, const Mesh &mesh, const Span< const GPUMaterial * > materials, VectorSet< std::string > *r_attrs, DRW_MeshCDMask *r_cd_needed)
Vector< SculptBatch > sculpt_batches_per_material_get(const Object *ob, Span< const GPUMaterial * > materials)
static const CustomData * get_cdata(const BMesh &bm, const bke::AttrDomain domain)
MatBase< T, NumCol, NumRow > transpose(const MatBase< T, NumRow, NumCol > &mat)
MatBase< float, 4, 4 > float4x4
VecBase< float, 3 > float3
char * active_color_attribute
struct SculptSession * sculpt