24#include "RNA_prototypes.hh"
53 std::optional<bke::AttrDomain>
domain;
80 return IFACE_(
"Face Corner");
91 return IFACE_(
"Control Point");
104 return ICON_VERTEXSEL;
110 return ICON_FACE_CORNER;
121 return ICON_CURVE_BEZCIRCLE;
123 return ICON_CURVE_PATH;
157 int reference_index_;
172 if (
name.is_empty()) {
181 return reference_index_;
196 : root_geometry_set_(std::move(geometry_set)),
205 root_item.uncollapse_by_default();
206 if (
const bke::Instances *instances = root_geometry_set_.get_instances()) {
214 for (
const int reference_i : references.
index_range()) {
219 reference.to_geometry_set(reference_geometry);
282 const int count = mesh_ ? mesh_->attributes().domain_size(domain_) : 0;
313 : curves_(
curves), domain_(domain)
328 const int count = curves_ ? curves_->geometry.wrap().attributes().domain_size(domain_) : 0;
334 bool has_grease_pencil_;
344 if (!has_grease_pencil_) {
347 row.
label(
label_, ICON_OUTLINER_DATA_GREASEPENCIL);
369 const int count = grease_pencil_ ? grease_pencil_->layers().size() : 0;
381 : layer_(grease_pencil.layer(layer_index))
383 label_ = std::to_string(layer_index);
389 if (
name.is_empty()) {
404 const int layer_index,
406 : grease_pencil_(grease_pencil), layer_index_(layer_index), domain_(domain)
423 grease_pencil_.layer(layer_index_));
431 bool has_pointcloud_;
441 if (!has_pointcloud_) {
467 const int count = pointcloud_ ? pointcloud_->totpoint : 0;
523 draw_count(*
this, instances_->instances_num());
538 : geometry_set_(std::move(geometry_set)),
602 if (!grease_pencil) {
609 for (
const int layer_i : layers.index_range()) {
655 r_instance_ids.
append({reference_item->reference_index()});
659 r_instance_ids.
append({reference_item->reference_index()});
662 std::reverse(r_instance_ids.
begin(), r_instance_ids.
end());
694 instance_ids.
size(), __func__);
710 if (
const auto *data_set_view_item =
dynamic_cast<const DataSetViewItem *
>(&item)) {
711 data_id = data_set_view_item->get_geometry_data_id();
723 if (data_id->domain) {
726 if (data_id->layer_index) {
746 data_id->component_type)
750 if (data_id->domain) {
755 if (data_id->layer_index) {
765 int viewer_path_index_;
808 row.
label(modifier_elem_.base.ui_name, ICON_MODIFIER);
825 row.
label(group_node_elem_.base.ui_name, ICON_NODE);
842 row.
label(viewer_node_elem_.base.ui_name, ICON_RESTRICT_VIEW_OFF);
886 const int viewer_path_index,
920 friend ViewerPathTreeViewItem;
1032 this->bundles.append(elem.identifier);
1053 this->bundles[
i].
size());
1063 friend ViewerDataPath;
1073 row.
label(item_.name, ICON_NONE);
1078 friend ViewerDataPath;
1096 friend ViewerDataPath;
1113 if (
const auto *viewer_node_item =
dynamic_cast<const ViewerNodeItem *
>(item)) {
1114 this->
viewer_item = viewer_node_item->item_.identifier;
1116 else if (
const auto *bundle_item =
dynamic_cast<const BundleItem *
>(item)) {
1117 this->
bundles.append(bundle_item->label_);
1129 friend ViewerDataTreeItem;
1171 const auto *stored_value = std::get_if<nodes::BundleItemSocketValue>(&item.value.value);
1172 if (!stored_value) {
1175 this->
build_value(child_item, stored_value->value);
1182 if (!signature.
inputs.is_empty()) {
1185 if (!signature.
outputs.is_empty()) {
1210 layout.
label(
IFACE_(
"No Active Context"), ICON_NONE);
1226 *block,
"Viewer Path", std::make_unique<ViewerPathTreeView>(
C));
1235 *block,
"Viewer Data", std::make_unique<ViewerDataTreeView>(
C));
1257 &screen.
id, &RNA_SpaceSpreadsheet, sspreadsheet);
1259 layout.
prop(&sspreadsheet_ptr,
"object_eval_state",
UI_ITEM_NONE,
"", ICON_NONE);
1281 if (!context_panel.
body) {
1284 label +=
" (Evaluated)";
1287 label +=
" (Original)";
1290 label +=
" (Viewer)";
1294 context_panel.
header->
label(label, ICON_OBJECT_DATA);
1299 context_panel.
header->
op(
"spreadsheet.toggle_pin",
1303 if (context_panel.
body) {
1329 "Instances Tree View",
1330 std::make_unique<GeometryInstancesTreeView>(*root_geometry, *
C));
1334 if (
uiLayout *panel = layout->
panel(
C,
"geometry_domain_tree_view",
false,
IFACE_(
"Domain"))) {
1340 "Data Set Tree View",
1341 std::make_unique<GeometryDataSetTreeView>(std::move(instance_geometry), *
C));
1342 tree_view->set_context_menu_title(
"Domain");
bScreen * CTX_wm_screen(const bContext *C)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
SpaceSpreadsheet * CTX_wm_space_spreadsheet(const bContext *C)
Low-level operations for curves.
Low-level operations for grease pencil.
const char * BKE_id_name(const ID &id)
int BKE_volume_num_grids(const Volume *volume)
#define BLI_assert_unreachable()
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
char * BLI_strdupn(const char *str, size_t len) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define BLI_STR_FORMAT_INT32_DECIMAL_UNIT_SIZE
void BLI_str_format_decimal_unit(char dst[BLI_STR_FORMAT_INT32_DECIMAL_UNIT_SIZE], int number_to_format) ATTR_NONNULL(1)
@ SPREADSHEET_OBJECT_EVAL_STATE_VIEWER_NODE
@ SPREADSHEET_OBJECT_EVAL_STATE_EVALUATED
@ SPREADSHEET_OBJECT_EVAL_STATE_ORIGINAL
@ SPREADSHEET_FLAG_PINNED
SpreadsheetClosureInputOutput
@ SPREADSHEET_CLOSURE_INPUT
@ SPREADSHEET_CLOSURE_OUTPUT
@ SPREADSHEET_CLOSURE_NONE
@ VIEWER_PATH_ELEM_TYPE_GROUP_NODE
@ VIEWER_PATH_ELEM_TYPE_SIMULATION_ZONE
@ VIEWER_PATH_ELEM_TYPE_FOREACH_GEOMETRY_ELEMENT_ZONE
@ VIEWER_PATH_ELEM_TYPE_VIEWER_NODE
@ VIEWER_PATH_ELEM_TYPE_REPEAT_ZONE
@ VIEWER_PATH_ELEM_TYPE_MODIFIER
@ VIEWER_PATH_ELEM_TYPE_EVALUATE_CLOSURE
@ VIEWER_PATH_ELEM_TYPE_ID
int ED_outliner_icon_from_id(const ID &id)
blender::ui::AbstractGridView * UI_block_add_view(uiBlock &block, blender::StringRef idname, std::unique_ptr< blender::ui::AbstractGridView > grid_view)
void UI_but_hint_drawstr_set(uiBut *but, const char *string)
#define ND_SPACE_SPREADSHEET
BMesh const char void * data
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
constexpr IndexRange index_range() const
void append(const T &value)
IndexRange index_range() const
MutableSpan< T > as_mutable_span()
int domain_size(const AttrDomain domain) const
AttributeAccessor attributes() const
Span< InstanceReference > references() const
Span< int > reference_user_counts() const
GPointer get_single_ptr() const
const bke::CurvesGeometry & strokes() const
BundleItem(const StringRef key)
void build_row(uiLayout &row) override
void build_row(uiLayout &row) override
CurvesDomainViewItem(const Curves *curves, const bke::AttrDomain domain)
std::optional< GeometryDataIdentifier > get_geometry_data_id() const override
CurvesViewItem(const bool has_curves)
void build_row(uiLayout &row) override
virtual std::optional< GeometryDataIdentifier > get_geometry_data_id() const
std::optional< bool > should_be_active() const override
void on_activate(bContext &C) override
GeometryDataSetTreeView & get_tree() const
EvaluteClosureViewerPathItem(const int viewer_path_index, const EvaluateClosureNodeViewerPathElem &)
void build_row(uiLayout &row) override
ForeachElementViewerPathItem(const int viewer_path_index, const ForeachGeometryElementZoneViewerPathElem &foreach_geo_elem_zone)
void build_row(uiLayout &row) override
friend class DataSetViewItem
void build_tree_for_pointcloud(const PointCloud *pointcloud, ui::TreeViewItemContainer &parent)
void build_tree_for_grease_pencil(const GreasePencil *grease_pencil, ui::TreeViewItemContainer &parent)
GeometryDataSetTreeView(bke::GeometrySet geometry_set, const bContext &C)
void build_tree_for_instances(const bke::Instances *instances, ui::TreeViewItemContainer &parent)
void build_tree_for_curves(const Curves *curves, ui::TreeViewItemContainer &parent)
void build_tree_for_volume(const Volume *volume, ui::TreeViewItemContainer &parent)
void build_tree_for_mesh(const Mesh *mesh, ui::TreeViewItemContainer &parent)
void build_tree() override
void build_tree_for_geometry(const bke::GeometrySet &geometry, ui::TreeViewItemContainer &parent)
GeometryInstancesTreeView(bke::GeometrySet geometry_set, const bContext &C)
friend class InstancesTreeViewItem
void build_tree_for_instances(ui::TreeViewItemContainer &parent, const bke::Instances &instances)
void build_tree() override
GreasePencilLayerCurvesDomainViewItem(const GreasePencil &grease_pencil, const int layer_index, const bke::AttrDomain domain)
std::optional< GeometryDataIdentifier > get_geometry_data_id() const override
void build_row(uiLayout &row) override
GreasePencilLayerViewItem(const GreasePencil &grease_pencil, const int layer_index)
void build_row(uiLayout &row) override
std::optional< GeometryDataIdentifier > get_geometry_data_id() const override
GreasePencilLayersViewItem(const GreasePencil *grease_pencil)
void build_row(uiLayout &row) override
GreasePencilViewItem(const bool has_grease_pencil)
void build_row(uiLayout &row) override
GroupNodeViewerPathItem(const int viewer_path_index, const GroupNodeViewerPathElem &group_node_elem)
void build_row(uiLayout &row) override
IDViewerPathItem(const int viewer_path_index, const IDViewerPathElem &id_elem)
void build_row(uiLayout &row) override
int reference_index() const
void build_row(uiLayout &row) override
InstanceReferenceViewItem(const bke::Instances &instances, const int reference_index)
void get_parent_instance_ids(Vector< SpreadsheetInstanceID > &r_instance_ids) const
GeometryInstancesTreeView & get_tree() const
std::optional< bool > should_be_active() const override
void on_activate(bContext &C) override
std::optional< GeometryDataIdentifier > get_geometry_data_id() const override
InstancesViewItem(const bke::Instances *instances)
void build_row(uiLayout &row) override
std::optional< GeometryDataIdentifier > get_geometry_data_id() const override
MeshDomainViewItem(const Mesh *mesh, const bke::AttrDomain domain)
void build_row(uiLayout &row) override
MeshViewItem(const bool has_mesh)
void build_row(uiLayout &row) override
void build_row(uiLayout &row) override
ModifierViewerPathItem(const int viewer_path_index, const ModifierViewerPathElem &modifier_elem)
PointCloudViewItem(const bool has_pointcloud)
void build_row(uiLayout &row) override
void build_row(uiLayout &row) override
PointsViewItem(const PointCloud *pointcloud)
std::optional< GeometryDataIdentifier > get_geometry_data_id() const override
RepeatViewerPathItem(const int viewer_path_index, const RepeatZoneViewerPathElem &repeat_zone)
void build_row(uiLayout &row) override
void build_row(uiLayout &row) override
RootGeometryViewItem(const bke::GeometrySet &geometry)
SimulationViewerPathPathItem(const int viewer_path_index, const SimulationZoneViewerPathElem &)
void build_row(uiLayout &row) override
std::optional< bool > should_be_active() const override
Vector< const ViewerDataTreeItem * > items_path() const
void on_activate(bContext &C) override
void build_tree() override
void build_closure_children(ui::AbstractTreeViewItem &parent, const nodes::ClosurePtr &closure)
ViewerDataTreeView(const bContext &C)
void build_bundle_children(ui::AbstractTreeViewItem &parent, const nodes::Bundle &bundle)
void build_value(ui::AbstractTreeViewItem &parent, const bke::SocketValueVariant &value)
ViewerNodeItem(const nodes::geo_eval_log::ViewerNodeLog::Item &item)
void build_row(uiLayout &row) override
ViewerNodeViewerPathItem(const int viewer_path_index, const ViewerNodeViewerPathElem &viewer_node_elem)
void build_row(uiLayout &row) override
std::optional< bool > should_be_active() const override
ViewerPathTreeViewItem(int viewer_path_index)
void on_activate(bContext &C) override
void add_viewer_path_elem(const int index, const ViewerPathElem &elem)
void build_tree() override
ViewerPathTreeView(const bContext &C)
void build_row(uiLayout &row) override
VolumeGridsViewItem(const Volume *volume)
std::optional< GeometryDataIdentifier > get_geometry_data_id() const override
Span< StoredItem > items() const
CustomIDVectorSet< Item, ItemKeyGetter > inputs
CustomIDVectorSet< Item, ItemKeyGetter > outputs
Abstract base class for defining a customizable tree-view item.
AbstractTreeView & get_tree_view() const
void uncollapse_by_default()
uiButViewItem * view_item_button() const
void set_context_menu_title(const std::string &title)
static void build_tree_view(const bContext &C, AbstractTreeView &tree_view, uiLayout &layout, bool add_box=true)
ItemT & add_tree_item(Args &&...args)
void foreach_item_recursive(ItemIterFn iter_fn, IterOptions options=IterOptions::None) const
void foreach_parent(ItemIterFn iter_fn) const
void * MEM_calloc_arrayN(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
static StringRefNull mesh_domain_to_label(const bke::AttrDomain domain)
static void draw_count(ui::AbstractTreeViewItem &view_item, const int count)
void spreadsheet_data_set_panel_draw(const bContext *C, Panel *panel)
static StringRefNull curves_domain_to_label(const bke::AttrDomain domain)
const nodes::geo_eval_log::ViewerNodeLog * viewer_node_log_lookup(const SpaceSpreadsheet &sspreadsheet)
bke::GeometrySet get_geometry_set_for_instance_ids(const bke::GeometrySet &root_geometry, const Span< SpreadsheetInstanceID > instance_ids)
static void draw_viewer_path_panel(const bContext &C, uiLayout &layout)
static void draw_row_suffix(ui::AbstractTreeViewItem &view_item, const StringRefNull str)
int get_instance_reference_icon(const bke::InstanceReference &reference)
static void draw_viewer_data_panel(const bContext &C, uiLayout &layout)
Object * spreadsheet_get_object_eval(const SpaceSpreadsheet *sspreadsheet, const Depsgraph *depsgraph)
ID * get_current_id(const SpaceSpreadsheet *sspreadsheet)
static bool viewer_path_ends_with_viewer_node(const ViewerPath &viewer_path)
static void draw_context_panel_content(const bContext &C, uiLayout &layout)
static void draw_context_panel_without_context(uiLayout &layout)
std::optional< bke::GeometrySet > root_geometry_set_get(const SpaceSpreadsheet *sspreadsheet, Object *object_eval)
static BIFIconID curves_domain_to_icon(const bke::AttrDomain domain)
static BIFIconID mesh_domain_to_icon(const bke::AttrDomain domain)
static void draw_context_panel(const bContext &C, uiLayout &layout)
ImplicitSharingPtr< Bundle > BundlePtr
ImplicitSharingPtr< Closure > ClosurePtr
void block_layout_set_current(uiBlock *block, uiLayout *layout)
void initialized_copy_n(const T *src, int64_t n, T *dst)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
SpreadsheetTableIDGeometry geometry_id
int active_viewer_path_index
int8_t closure_input_output
SpreadsheetBundlePathElem * bundle_path
uint8_t object_eval_state
int viewer_item_identifier
SpreadsheetInstanceID * instance_ids
uint8_t geometry_component_type
const Instances * get_instances() const
bke::GeometryComponent::Type component_type
std::optional< bke::AttrDomain > domain
std::optional< int > layer_index
ViewerDataPath(const SpreadsheetTableIDGeometry &table_id)
SpreadsheetClosureInputOutput closure_input_output
BLI_STRUCT_EQUALITY_OPERATORS_3(ViewerDataPath, viewer_item, bundles, closure_input_output)
Vector< StringRef > bundles
void store(SpreadsheetTableIDGeometry &table_id)
bke::SocketValueVariant value
PanelLayout panel(const bContext *C, blender::StringRef idname, bool default_closed)
void label(blender::StringRef name, int icon)
void active_set(bool active)
void emboss_set(blender::ui::EmbossType emboss)
PointerRNA op(wmOperatorType *ot, std::optional< blender::StringRef > name, int icon, blender::wm::OpCallContext context, eUI_Item_Flag flag)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< blender::StringRef > name_opt, int icon, std::optional< blender::StringRef > placeholder=std::nullopt)
void WM_main_add_notifier(uint type, void *reference)