24 const int *object_type_exclude_select)
26 const int view_value = (object_type_exclude_viewport != 0);
28 if (object_type_exclude_select) {
31 const int select_value = (*object_type_exclude_select & ~object_type_exclude_viewport) != 0;
32 return ICON_VIS_SEL_11 + (view_value << 1) + select_value;
35 return view_value ? ICON_HIDE_ON : ICON_HIDE_OFF;
45 area_region_from_regiondata(screen, rv3d, &area, ®ion);
65static void rna_SpaceTextEditor_region_location_from_cursor(
66 ID *
id,
SpaceText *st,
int line,
int column,
int r_pixel_pos[2])
72 const int cursor_co[2] = {line, column};
74 r_pixel_pos[0] = r_pixel_pos[1] = -1;
81 if (sfile->
files ==
nullptr) {
107 srna,
"cursor_location_from_region",
"rna_SpaceNodeEditor_cursor_location_from_region");
110 parm =
RNA_def_int(func,
"x", 0, INT_MIN, INT_MAX,
"x",
"Region x coordinate", -10000, 10000);
112 parm =
RNA_def_int(func,
"y", 0, INT_MIN, INT_MAX,
"y",
"Region y coordinate", -10000, 10000);
122 srna,
"region_location_from_cursor",
"rna_SpaceTextEditor_region_location_from_cursor");
124 func,
"Retrieve the region position from the given line and character position");
126 parm =
RNA_def_int(func,
"line", 0, INT_MIN, INT_MAX,
"Line",
"Line index", 0, INT_MAX);
128 parm =
RNA_def_int(func,
"column", 0, INT_MIN, INT_MAX,
"Column",
"Column index", 0, INT_MAX);
131 func,
"result", 2,
nullptr, -1, INT_MAX,
"",
"Region coordinates", -1, INT_MAX);
137 const char *update_func)
144 const char *identifier[2];
145 const char *description[2];
149 {
"show_object_viewport_mesh",
"show_object_select_mesh"},
150 {
"Show mesh objects",
"Allow selection of mesh objects"}},
153 {
"show_object_viewport_curve",
"show_object_select_curve"},
154 {
"Show curves",
"Allow selection of curves"}},
157 {
"show_object_viewport_surf",
"show_object_select_surf"},
158 {
"Show surfaces",
"Allow selection of surfaces"}},
161 {
"show_object_viewport_meta",
"show_object_select_meta"},
162 {
"Show metaballs",
"Allow selection of metaballs"}},
165 {
"show_object_viewport_font",
"show_object_select_font"},
166 {
"Show text objects",
"Allow selection of text objects"}},
169 {
"show_object_viewport_curves",
"show_object_select_curves"},
170 {
"Show hair curves",
"Allow selection of hair curves"}},
173 {
"show_object_viewport_pointcloud",
"show_object_select_pointcloud"},
174 {
"Show point clouds",
"Allow selection of point clouds"}},
177 {
"show_object_viewport_volume",
"show_object_select_volume"},
178 {
"Show volumes",
"Allow selection of volumes"}},
181 {
"show_object_viewport_armature",
"show_object_select_armature"},
182 {
"Show armatures",
"Allow selection of armatures"}},
185 {
"show_object_viewport_lattice",
"show_object_select_lattice"},
186 {
"Show lattices",
"Allow selection of lattices"}},
189 {
"show_object_viewport_empty",
"show_object_select_empty"},
190 {
"Show empties",
"Allow selection of empties"}},
193 {
"show_object_viewport_grease_pencil",
"show_object_select_grease_pencil"},
194 {
"Show Grease Pencil objects",
"Allow selection of Grease Pencil objects"}},
197 {
"show_object_viewport_camera",
"show_object_select_camera"},
198 {
"Show cameras",
"Allow selection of cameras"}},
201 {
"show_object_viewport_light",
"show_object_select_light"},
202 {
"Show lights",
"Allow selection of lights"}},
205 {
"show_object_viewport_speaker",
"show_object_select_speaker"},
206 {
"Show speakers",
"Allow selection of speakers"}},
209 {
"show_object_viewport_light_probe",
"show_object_select_light_probe"},
210 {
"Show light probes",
"Allow selection of light probes"}},
213 const char *view_mask_member[2] = {
214 "object_type_exclude_viewport",
215 "object_type_exclude_select",
217 for (
int mask_index = 0; mask_index < 2; mask_index++) {
218 for (
int type_index = 0; type_index <
ARRAY_SIZE(info); type_index++) {
222 prop,
nullptr, view_mask_member[mask_index], info[type_index].type_mask);
224 prop, info[type_index].
name, info[type_index].description[mask_index]);
235 func =
RNA_def_function(srna,
"activate_asset_by_id",
"ED_fileselect_activate_by_id");
237 func,
"Activate and select the asset entry that represents the given ID");
248 "Whether to activate the ID immediately (false) or after the file browser refreshes (true)");
252 srna,
"activate_file_by_relative_path",
"ED_fileselect_activate_by_relpath");
254 "Set active file and add to selection based on relative path to "
255 "current File Browser directory");
259 func =
RNA_def_function(srna,
"deselect_all",
"rna_FileBrowser_deselect_all");
Main * CTX_data_main(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
void BKE_report(ReportList *reports, eReportType type, const char *message)
Depsgraph * BKE_scene_ensure_depsgraph(Main *bmain, Scene *scene, ViewLayer *view_layer)
ARegion ARegion ScrArea * BKE_screen_find_area_from_space(const bScreen *screen, const SpaceLink *sl) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
ARegion * BKE_area_find_region_type(const ScrArea *area, int region_type)
#define LISTBASE_FOREACH(type, var, list)
Object is a sort of wrapper for general info.
void ED_fileselect_deselect_all(SpaceFile *sfile)
bool ED_space_text_region_location_from_cursor(const SpaceText *st, const ARegion *region, const int cursor_co[2], int r_pixel_co[2])
void ED_view3d_update_viewmat(const Depsgraph *depsgraph, const Scene *scene, View3D *v3d, ARegion *region, const float viewmat[4][4], const float winmat[4][4], const rcti *rect, bool offscreen)
BPy_StructRNA * depsgraph
PropertyRNA * RNA_def_int_array(StructOrFunctionRNA *cont_, const char *identifier, const int len, const int *default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_function_flag(FunctionRNA *func, int flag)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_function_output(FunctionRNA *, PropertyRNA *ret)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
int rna_object_type_visibility_icon_get_common(int object_type_exclude_viewport, const int *object_type_exclude_select)
void rna_def_object_type_visibility_flags_common(StructRNA *srna, int noteflag, const char *update_func)
void RNA_api_region_view3d(StructRNA *srna)
void RNA_api_space_filebrowser(StructRNA *srna)
void RNA_api_space_node(StructRNA *srna)
void RNA_api_space_text(StructRNA *srna)
ViewLayer * WM_window_get_active_view_layer(const wmWindow *win)
Scene * WM_window_get_active_scene(const wmWindow *win)
bScreen * WM_window_get_active_screen(const wmWindow *win)