Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_space.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show All 19 Lines | |||||
| #include <stdlib.h> | #include <stdlib.h> | ||||
| #include <string.h> | #include <string.h> | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "BLT_translation.h" | #include "BLT_translation.h" | ||||
| #include "BKE_attribute.h" | |||||
| #include "BKE_geometry_set.h" | |||||
| #include "BKE_image.h" | #include "BKE_image.h" | ||||
| #include "BKE_key.h" | #include "BKE_key.h" | ||||
| #include "BKE_movieclip.h" | #include "BKE_movieclip.h" | ||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| #include "BKE_studiolight.h" | #include "BKE_studiolight.h" | ||||
| #include "ED_text.h" | #include "ED_text.h" | ||||
| ▲ Show 20 Lines • Show All 2,950 Lines • ▼ Show 20 Lines | |||||
| static void rna_SpaceSpreadsheet_pinned_id_set(PointerRNA *ptr, | static void rna_SpaceSpreadsheet_pinned_id_set(PointerRNA *ptr, | ||||
| PointerRNA value, | PointerRNA value, | ||||
| struct ReportList *UNUSED(reports)) | struct ReportList *UNUSED(reports)) | ||||
| { | { | ||||
| SpaceSpreadsheet *sspreadsheet = (SpaceSpreadsheet *)ptr->data; | SpaceSpreadsheet *sspreadsheet = (SpaceSpreadsheet *)ptr->data; | ||||
| sspreadsheet->pinned_id = value.data; | sspreadsheet->pinned_id = value.data; | ||||
| } | } | ||||
| static void rna_SpaceSpreadsheet_geometry_component_type_update(Main *UNUSED(bmain), | |||||
| Scene *UNUSED(scene), | |||||
| PointerRNA *ptr) | |||||
| { | |||||
| SpaceSpreadsheet *sspreadsheet = (SpaceSpreadsheet *)ptr->data; | |||||
| if (sspreadsheet->geometry_component_type == GEO_COMPONENT_TYPE_POINT_CLOUD) { | |||||
| sspreadsheet->attribute_domain = ATTR_DOMAIN_POINT; | |||||
| } | |||||
| } | |||||
| const EnumPropertyItem *rna_SpaceSpreadsheet_attribute_domain_itemf(bContext *UNUSED(C), | |||||
| PointerRNA *ptr, | |||||
| PropertyRNA *UNUSED(prop), | |||||
| bool *r_free) | |||||
| { | |||||
| SpaceSpreadsheet *sspreadsheet = (SpaceSpreadsheet *)ptr->data; | |||||
| EnumPropertyItem *item_array = NULL; | |||||
| int items_len = 0; | |||||
| for (const EnumPropertyItem *item = rna_enum_attribute_domain_items; item->identifier != NULL; | |||||
| item++) { | |||||
| if (sspreadsheet->geometry_component_type == GEO_COMPONENT_TYPE_MESH) { | |||||
| if (!ELEM(item->value, | |||||
| ATTR_DOMAIN_CORNER, | |||||
| ATTR_DOMAIN_EDGE, | |||||
| ATTR_DOMAIN_POINT, | |||||
| ATTR_DOMAIN_POLYGON)) { | |||||
| continue; | |||||
| } | |||||
| } | |||||
| if (sspreadsheet->geometry_component_type == GEO_COMPONENT_TYPE_POINT_CLOUD) { | |||||
| if (item->value != ATTR_DOMAIN_POINT) { | |||||
| continue; | |||||
| } | |||||
| } | |||||
| RNA_enum_item_add(&item_array, &items_len, item); | |||||
| } | |||||
| RNA_enum_item_end(&item_array, &items_len); | |||||
| *r_free = true; | |||||
| return item_array; | |||||
| } | |||||
| #else | #else | ||||
| static const EnumPropertyItem dt_uv_items[] = { | static const EnumPropertyItem dt_uv_items[] = { | ||||
| {SI_UVDT_OUTLINE, "OUTLINE", 0, "Outline", "Display white edges with black outline"}, | {SI_UVDT_OUTLINE, "OUTLINE", 0, "Outline", "Display white edges with black outline"}, | ||||
| {SI_UVDT_DASH, "DASH", 0, "Dash", "Display dashed black-white edges"}, | {SI_UVDT_DASH, "DASH", 0, "Dash", "Display dashed black-white edges"}, | ||||
| {SI_UVDT_BLACK, "BLACK", 0, "Black", "Display black edges"}, | {SI_UVDT_BLACK, "BLACK", 0, "Black", "Display black edges"}, | ||||
| {SI_UVDT_WHITE, "WHITE", 0, "White", "Display white edges"}, | {SI_UVDT_WHITE, "WHITE", 0, "White", "Display white edges"}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| ▲ Show 20 Lines • Show All 4,189 Lines • ▼ Show 20 Lines | static void rna_def_space_clip(BlenderRNA *brna) | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, NULL); | ||||
| } | } | ||||
| static void rna_def_space_spreadsheet(BlenderRNA *brna) | static void rna_def_space_spreadsheet(BlenderRNA *brna) | ||||
| { | { | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| static const EnumPropertyItem geometry_component_type_items[] = { | |||||
| {GEO_COMPONENT_TYPE_MESH, | |||||
| "MESH", | |||||
| ICON_MESH_DATA, | |||||
| "Mesh", | |||||
| "Mesh component containing point, corner, edge and polygon data"}, | |||||
| {GEO_COMPONENT_TYPE_POINT_CLOUD, | |||||
| "POINTCLOUD", | |||||
| ICON_POINTCLOUD_DATA, | |||||
| "Point Cloud", | |||||
| "Point cloud component containing only point data"}, | |||||
| {0, NULL, 0, NULL, NULL}, | |||||
| }; | |||||
| srna = RNA_def_struct(brna, "SpaceSpreadsheet", "Space"); | srna = RNA_def_struct(brna, "SpaceSpreadsheet", "Space"); | ||||
| RNA_def_struct_ui_text(srna, "Space Spreadsheet", "Spreadsheet space data"); | RNA_def_struct_ui_text(srna, "Space Spreadsheet", "Spreadsheet space data"); | ||||
| prop = RNA_def_property(srna, "pinned_id", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "pinned_id", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_flag(prop, PROP_EDITABLE); | RNA_def_property_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceSpreadsheet_pinned_id_set", NULL, NULL); | RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceSpreadsheet_pinned_id_set", NULL, NULL); | ||||
| RNA_def_property_ui_text(prop, "Pinned ID", "Data-block whose values are displayed"); | RNA_def_property_ui_text(prop, "Pinned ID", "Data-block whose values are displayed"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SPREADSHEET, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SPREADSHEET, NULL); | ||||
| prop = RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "filter_flag", SPREADSHEET_FILTER_SELECTED_ONLY); | RNA_def_property_boolean_sdna(prop, NULL, "filter_flag", SPREADSHEET_FILTER_SELECTED_ONLY); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Show Only Selected", "Only include rows that correspond to selected elements"); | prop, "Show Only Selected", "Only include rows that correspond to selected elements"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SPREADSHEET, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SPREADSHEET, NULL); | ||||
| prop = RNA_def_property(srna, "geometry_component_type", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_items(prop, geometry_component_type_items); | |||||
| RNA_def_property_ui_text(prop, "Geometry Component", "Part of the geometry whose data is shown"); | |||||
HooglyBoogly: A simpler phrasing is "Part of the geometry to show data from" | |||||
| RNA_def_property_update(prop, | |||||
| NC_SPACE | ND_SPACE_SPREADSHEET, | |||||
| "rna_SpaceSpreadsheet_geometry_component_type_update"); | |||||
| prop = RNA_def_property(srna, "attribute_domain", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_items(prop, rna_enum_attribute_domain_items); | |||||
| RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceSpreadsheet_attribute_domain_itemf"); | |||||
| RNA_def_property_ui_text(prop, "Attribute Domain", "Attribute domain to show"); | |||||
HooglyBooglyUnsubmitted Not Done Inline ActionsI think "display" is better than "show" (D10551) HooglyBoogly: I think "display" is better than "show" (D10551) | |||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SPREADSHEET, NULL); | |||||
| } | } | ||||
| void RNA_def_space(BlenderRNA *brna) | void RNA_def_space(BlenderRNA *brna) | ||||
| { | { | ||||
| rna_def_space(brna); | rna_def_space(brna); | ||||
| rna_def_space_image(brna); | rna_def_space_image(brna); | ||||
| rna_def_space_sequencer(brna); | rna_def_space_sequencer(brna); | ||||
| rna_def_space_text(brna); | rna_def_space_text(brna); | ||||
| Show All 23 Lines | |||||
A simpler phrasing is "Part of the geometry to show data from"