36 static float3 colors[9] = {
69 if (drwctx->
evil_C !=
nullptr) {
80 for (
int i :
IndexRange(draw_frustum_planes.size())) {
81 draw_frustum_planes[i] = tmat * draw_frustum_planes[i];
85 bool fast_mode =
false;
87 fast_mode = navigating;
94 update_only_visible =
true;
108 const IndexMask nodes_to_update = update_only_visible ? visible_nodes :
123 visible_nodes.
foreach_index([&](
const int i,
const int pos) {
124 result_batches[pos] = {};
125 result_batches[pos].batch = batches[i];
126 result_batches[pos].material_slot = material_indices.
is_empty() ?
128 std::clamp(material_indices[i], 0, max_material);
129 result_batches[pos].debug_index = pos;
132 return result_batches;
150 if (
const char *name =
mesh->active_color_attribute) {
180 for (
const StringRef name : draw_attrs) {
CustomData interface, see also DNA_customdata_types.h.
General operations, lookup, etc. for materials.
General operations, lookup, etc. for blender objects.
constexpr IndexRange()=default
constexpr bool is_empty() const
void append(const T &value)
constexpr bool is_empty() const
static View & default_get()
std::array< float4, 6 > frustum_planes_get(int view_id=0) const
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, Mode mode=exec_mode::serial) const
Utilities for rendering attributes.
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)
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
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)
MatBase< T, NumCol, NumRow > transpose(const MatBase< T, NumRow, NumCol > &mat)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
int BKE_object_material_count_eval(const Object *ob)
@ PAINT_SCULPT_DELAY_UPDATES
MatBase< float, 4, 4 > float4x4
T & DRW_object_get_data_for_drawing(const Object &object)
const DRWContext * DRW_context_get()
Paint * BKE_paint_get_active_from_context(const bContext *C)
bool BKE_pbvh_node_fully_hidden_get(const bke::pbvh::Node &node)
Mesh * BKE_object_get_original_mesh(const Object *object)
VecBase< float, 3 > float3
bke::ObjectRuntime * runtime
SculptSession * sculpt_session
VectorSet< std::string > uv