45 if (meta_data.
domain != domain_) {
58 std::lock_guard lock{mutex_};
65 if (attribute->
domain() != domain_) {
68 int domain_size = attribute->
size();
72 column_id.
name, domain_size, [attribute](
int index,
CellValue &r_cell_value) {
74 attribute->get(index, &value);
75 r_cell_value.value_float = value;
79 column_id.
name, domain_size, [attribute](
int index,
CellValue &r_cell_value) {
81 attribute->get(index, &value);
82 r_cell_value.value_int = value;
86 column_id.
name, domain_size, [attribute](
int index,
CellValue &r_cell_value) {
88 attribute->get(index, &value);
89 r_cell_value.value_bool = value;
95 [attribute](
int index,
CellValue &r_cell_value) {
97 attribute->get(index, &value);
98 r_cell_value.value_float2 = value;
106 [attribute](
int index,
CellValue &r_cell_value) {
108 attribute->get(index, &value);
109 r_cell_value.value_float3 = value;
117 [attribute](
int index,
CellValue &r_cell_value) {
119 attribute->get(index, &value);
120 r_cell_value.value_color = value;
142 if (is_vertex_selected_fn(i)) {
143 r_vertex_indices.
append(i);
154 if (is_vertex_selected_fn(loop.
v)) {
155 r_corner_indices.
append(i);
166 bool is_selected =
true;
169 if (!is_vertex_selected_fn(loop.
v)) {
175 r_face_indices.
append(poly_index);
186 if (is_vertex_selected_fn(edge.
v1) && is_vertex_selected_fn(edge.
v2)) {
213 std::lock_guard lock{mutex_};
220 const Mesh *mesh_eval = mesh_component->get_for_read();
226 if (orig_indices !=
nullptr) {
228 auto is_vertex_selected = [&](
int vertex_index) ->
bool {
229 const int i_orig = orig_indices[vertex_index];
243 auto is_vertex_selected = [&](
int vertex_index) ->
bool {
261 column_id.
name = (
char *)
"Name";
263 for (
const char *name : {
"Position",
"Rotation",
"Scale"}) {
264 column_id.
name = (
char *)name;
280 "Name",
size, [instance_data](
int index,
CellValue &r_cell_value) {
283 if (data.data.object != nullptr) {
284 r_cell_value.value_object = ObjectCellValue{data.data.object};
288 if (data.data.collection != nullptr) {
289 r_cell_value.value_collection = CollectionCellValue{data.data.collection};
293 values->default_width = 8.0f;
297 if (
STREQ(column_id.name,
"Position")) {
301 [transforms](
int index, CellValue &r_cell_value) {
302 r_cell_value.value_float3 = transforms[index].translation();
306 if (
STREQ(column_id.name,
"Rotation")) {
310 [transforms](
int index, CellValue &r_cell_value) {
311 r_cell_value.value_float3 = transforms[index].to_euler();
315 if (
STREQ(column_id.name,
"Scale")) {
319 [transforms](
int index, CellValue &r_cell_value) {
320 r_cell_value.value_float3 = transforms[index].scale();
327 int InstancesDataSource::tot_rows()
const
329 return component_->instances_amount();
369 if (
mesh ==
nullptr) {
390 if (geometry_set_preview !=
nullptr) {
391 geometry_set = *geometry_set_preview;
419 if (!geometry_set.
has(component_type)) {
424 return std::make_unique<InstancesDataSource>(geometry_set);
426 return std::make_unique<GeometryDataSource>(object_eval, geometry_set, component_type, domain);
struct SpaceSpreadsheet * CTX_wm_space_spreadsheet(const bContext *C)
void * CustomData_get_layer(const struct CustomData *data, int type)
@ GEO_COMPONENT_TYPE_MESH
@ GEO_COMPONENT_TYPE_POINT_CLOUD
@ GEO_COMPONENT_TYPE_INSTANCES
@ INSTANCE_DATA_TYPE_OBJECT
@ INSTANCE_DATA_TYPE_COLLECTION
void * BKE_id_new_nomain(const short type, const char *name)
void BKE_mesh_wrapper_ensure_mdata(struct Mesh *me)
struct Mesh * BKE_modifier_get_evaluated_mesh_from_evaluated_object(struct Object *ob_eval, const bool get_cage_mesh)
void * BLI_ghash_lookup_default(GHash *gh, const void *key, void *val_default) ATTR_WARN_UNUSED_RESULT
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define POINTER_FROM_UINT(i)
struct Object * DEG_get_original_object(struct Object *object)
ID and Library types, which are fundamental for sdna.
@ SPREADSHEET_OBJECT_EVAL_STATE_EVALUATED
@ SPREADSHEET_OBJECT_EVAL_STATE_ORIGINAL
uint64_t ED_spreadsheet_context_path_hash(struct SpaceSpreadsheet *sspreadsheet)
#define BM_elem_flag_test(ele, hflag)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_mesh_elem_table_ensure(BMesh *bm, const char htype)
void BM_mesh_bm_to_me_for_eval(BMesh *bm, Mesh *me, const CustomData_MeshMasks *cd_mask_extra)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
virtual int attribute_domain_size(const AttributeDomain domain) const
blender::bke::ReadAttributePtr attribute_try_get_for_read(const blender::StringRef attribute_name) const
bool attribute_foreach(const AttributeForeachCallback callback) const
GeometryComponentType type() const
int instances_amount() const
blender::Span< InstancedData > instanced_data() const
void replace(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void copy_vertex_group_names_from_object(const struct Object &object)
void replace(PointCloud *pointcloud, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
T & construct(const char *name, Args &&... args)
T * add(std::unique_ptr< T > resource, const char *name)
constexpr const char * c_str() const
void append(const T &value)
CustomDataType custom_data_type() const
AttributeDomain domain() const
void foreach_default_column_ids(FunctionRef< void(const SpreadsheetColumnID &)> fn) const override
std::unique_ptr< ColumnValues > get_column_values(const SpreadsheetColumnID &column_id) const override
int tot_rows() const override
Span< int64_t > get_selected_element_indices() const
std::unique_ptr< ColumnValues > get_column_values(const SpreadsheetColumnID &column_id) const override
int tot_rows() const override
void foreach_default_column_ids(FunctionRef< void(const SpreadsheetColumnID &)> fn) const override
std::unique_ptr< ReadAttribute > ReadAttributePtr
static void get_selected_face_indices(const Mesh &mesh, const IsVertexSelectedFn is_vertex_selected_fn, Vector< int64_t > &r_face_indices)
std::unique_ptr< ColumnValues > column_values_from_function(std::string name, const int size, GetValueF get_value, const float default_width=0.0f)
static GeometrySet get_display_geometry_set(SpaceSpreadsheet *sspreadsheet, Object *object_eval, const GeometryComponentType used_component_type)
static GeometryComponentType get_display_component_type(const bContext *C, Object *object_eval)
static void get_selected_corner_indices(const Mesh &mesh, const IsVertexSelectedFn is_vertex_selected_fn, Vector< int64_t > &r_corner_indices)
std::unique_ptr< DataSource > data_source_from_geometry(const bContext *C, Object *object_eval)
static constexpr float default_float2_column_width
static void get_selected_edge_indices(const Mesh &mesh, const IsVertexSelectedFn is_vertex_selected_fn, Vector< int64_t > &r_edge_indices)
static void get_selected_indices_on_domain(const Mesh &mesh, const AttributeDomain domain, const IsVertexSelectedFn is_vertex_selected_fn, Vector< int64_t > &r_indices)
static void get_selected_vertex_indices(const Mesh &mesh, const IsVertexSelectedFn is_vertex_selected_fn, Vector< int64_t > &r_vertex_indices)
static constexpr float default_color_column_width
static constexpr float default_float3_column_width
unsigned __int64 uint64_t
GeometryComponent & get_component_for_write(GeometryComponentType component_type)
bool has(const GeometryComponentType component_type) const
struct BMEditMesh * edit_mesh
void * geometry_set_previews
struct GeometrySet * geometry_set_eval
uint8_t object_eval_state
uint8_t geometry_component_type