10#define DNA_DEPRECATED_ALLOW
93 ARegion *region_unlock_user =
nullptr;
94 ARegion *region_unlock =
nullptr;
95 const ListBaseT<ARegion> *region_list = (v3d == area->
spacedata.first_) ? &area->
regionbase :
100 for (
ARegion ®ion : *region_list) {
105 region_unlock = ®ion;
107 region_unlock_user = ®ion;
115 if (region_unlock_user) {
116 *r_region = region_unlock_user;
121 *r_region = region_unlock;
201 View3D *v3d = MEM_new<View3D>(__func__);
258 RegionView3D *rv3d = MEM_new<RegionView3D>(
"region view3d");
265 return reinterpret_cast<SpaceLink *
>(v3d);
305 View3D *v3dn = MEM_dupalloc(v3do);
330 return reinterpret_cast<SpaceLink *
>(v3dn);
336 ListBaseT<wmDropBox> *lb;
343 "Paint Face Mask (Weight, Vertex, Texture)",
349 "Paint Vertex Selection (Weight, Vertex)",
545 new_rv3d = MEM_dupalloc(rv3d);
554 new_rv3d->
sms =
nullptr;
563static std::optional<ARegionIMECursorState> view3d_main_region_cursor_ime(
564 wmWindow *win,
const ScrArea * ,
const ARegion *region, ARegionIMECursor *r_cursor)
567 const RegionView3D *rv3d =
static_cast<RegionView3D *
>(region->regiondata);
581 const Curve *cu = id_cast<Curve *>(ob->data);
590 const float3 cursor_local = {ef->textcurs[0].x, ef->textcurs[0].y, 0.0f};
601 const int x = int(cursor_screen[0]);
602 const int y = int(cursor_screen[1]);
860 ED_view3d_xr_shading_update(
G_MAIN->wm.first(), v3d, scene);
966 msg_sub_value_region_tag_redraw.
owner = region;
967 msg_sub_value_region_tag_redraw.
user_data = region;
970 for (
int i = 0; i <
ARRAY_SIZE(type_array); i++) {
971 msg_key_params.
ptr.
type = type_array[i];
980 mbus, RenderSettings, resolution_x, &msg_sub_value_region_tag_redraw);
982 mbus, RenderSettings, resolution_y, &msg_sub_value_region_tag_redraw);
984 mbus, RenderSettings, pixel_aspect_x, &msg_sub_value_region_tag_redraw);
986 mbus, RenderSettings, pixel_aspect_y, &msg_sub_value_region_tag_redraw);
989 mbus, RenderSettings, use_border, &msg_sub_value_region_tag_redraw);
1001 if (obact !=
nullptr) {
1002 switch (obact->
mode) {
1013 msg_sub_value_region_tag_refresh.
owner = region;
1014 msg_sub_value_region_tag_refresh.
user_data = area;
1066 switch (wmn->
data) {
1081 switch (wmn->
data) {
1091 switch (wmn->
data) {
1104 switch (wmn->
data) {
1176 msg_sub_value_region_tag_redraw.
owner = region;
1177 msg_sub_value_region_tag_redraw.
user_data = region;
1180 for (
int i = 0; i <
ARRAY_SIZE(type_array); i++) {
1181 msg_key_params.
ptr.
type = type_array[i];
1204 std::array<const char *, 4> contexts_base = {
nullptr};
1207 const char **contexts = &contexts_base[1];
1312 return contexts_base;
1317 const char *category_override)
1324 if (category_override !=
nullptr) {
1351 switch (wmn->
data) {
1365 switch (wmn->
data) {
1385 switch (wmn->
data) {
1400 switch (wmn->
data) {
1502 switch (wmn->
data) {
1513 switch (wmn->
data) {
1523 switch (wmn->
data) {
1567 const bool is_local)
1575 for (
ARegion ®ion : *regionbase) {
1598 if (
view3d->localvd !=
nullptr) {
1660 View3D &shallow_v3d = struct_writer.shallow_data;
1661 memset((void *)&shallow_v3d.runtime, 0, sizeof(shallow_v3d.runtime));
1673 std::unique_ptr<SpaceType> st = std::make_unique<SpaceType>();
1678 st->struct_size =
sizeof(
View3D);
1695 st->blend_read_after_liblink =
nullptr;
1707#ifdef WITH_INPUT_IME
1708 art->
cursor_ime = view3d_main_region_cursor_ime;
#define BKE_LIB_FOREACHID_PROCESS_IDSUPER(data_, id_super_, cb_flag_)
General operations, lookup, etc. for blender objects.
#define BLI_ASSERT_ZERO_M4(m)
#define STRNCPY_UTF8(dst, src)
#define BLO_read_struct_nonnull(reader, struct_name, ptr_p)
#define BLO_read_struct(reader, struct_name, ptr_p)
#define BPy_BEGIN_ALLOW_THREADS
#define BPy_END_ALLOW_THREADS
Object groups, one object can be in many groups at once.
Object is a sort of wrapper for general info.
#define RGN_ALIGN_ENUM_FROM_MASK(align)
#define V3D_USES_SCENE_WORLD(v3d)
Read Blender memory allocation and freeing.
#define UI_SIDEBAR_PANEL_WIDTH
#define ND_ASSET_LIST_READING
#define ND_GPENCIL_EDITMODE
#define ND_RENDER_OPTIONS
#define ND_SPACE_ASSET_PARAMS
#define ND_BONE_COLLECTION
#define ND_ASSET_CATALOGS
#define ND_XR_DATA_CHANGED
#define NS_VIEW3D_SHADING
#define ND_NODE_ASSET_DATA
#define ND_DRAW_RENDER_VIEWPORT
#define ARRAY_SET_ITEMS(...)
IDRemapperApplyResult apply(ID **r_id_ptr, IDRemapperApplyOptions options, ID *id_self=nullptr) const
bool contains_mappings_for_any(IDTypeFilter filter) const
bool is_viewport_compositor_enabled(const View3D &view_3d, const RegionView3D ®ion_view_3d)
void header_region(const bContext *C, ARegion *region)
void region_init(wmWindowManager *wm, ARegion *region)
void types_register(ARegionType *region_type, const int space_type)
void region_listen(const wmRegionListenerParams *params)
void region_on_poll_success(const bContext *C, ARegion *region)
void header_region_listen(const wmRegionListenerParams *params)
void region_on_user_resize(const ARegion *region)
int context(const bContext *C, const char *member, bContextDataResult *result)
int region_snap(const ARegion *region, int size, int axis)
void * region_duplicate(void *regiondata)
bool regions_poll(const RegionPollParams *params)
void header_region_init(wmWindowManager *wm, ARegion *region)
void region_draw(const bContext *C, ARegion *region)
void region_message_subscribe(const wmRegionMessageSubscribeParams *params)
void region_layout(const bContext *C, ARegion *region)
void region_free(ARegion *region)
MenuType node_group_operator_assets_menu()
MenuType node_group_operator_assets_menu_unassigned()
VecBase< T, 3 > transform_point(const CartesianBasis &basis, const VecBase< T, 3 > &v)
ARegionType * ED_area_type_hud(int space_type)
@ ID_REMAP_RESULT_SOURCE_UNASSIGNED
void view3d_operatortypes()
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
const char * CTX_data_mode_string(const bContext *C)
@ V3D_RUNTIME_LOCAL_MAYBE_EMPTY
static void view3d_header_region_draw(const bContext *C, ARegion *region)
ScrArea * CTX_wm_area(const bContext *C)
void BKE_viewer_path_id_remap(ViewerPath *viewer_path, const bke::id::IDRemapper &mappings)
static void view3d_tools_header_region_draw(const bContext *C, ARegion *region)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
void ED_view3d_clipping_local(RegionView3D *rv3d, const float mat[4][4])
static void view3d_buttons_region_init(wmWindowManager *wm, ARegion *region)
void ED_region_generic_tools_region_message_subscribe(const wmRegionMessageSubscribeParams *params)
static void view3d_foreach_id(SpaceLink *space_link, LibraryForeachIDData *data)
static void view3d_buttons_region_layout(const bContext *C, ARegion *region)
Depsgraph * BKE_scene_get_depsgraph(const Scene *scene, const ViewLayer *view_layer)
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
static void view3d_space_blend_write(BlendWriter *writer, SpaceLink *sl)
bool WM_cursor_set_from_tool(wmWindow *win, const ScrArea *area, const ARegion *region)
void VIEW3D_GT_navigate_rotate(wmGizmoType *gzt)
void WM_gizmotype_append(void(*gtfunc)(wmGizmoType *))
@ RGN_TYPE_ASSET_SHELF_HEADER
void ED_view3d_clear_mats_rv3d(RegionView3D *rv3d)
static void view3d_header_region_init(wmWindowManager *wm, ARegion *region)
void BKE_viewer_path_blend_read_data(BlendDataReader *reader, ViewerPath *viewer_path)
IDProperty * IDP_CopyProperty(const IDProperty *prop) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
static void view3d_main_region_listener(const wmRegionListenerParams *params)
@ WM_JOB_TYPE_RENDER_PREVIEW
void VIEW3D_GGT_force_field(wmGizmoGroupType *gzgt)
static void view3d_id_remap(ScrArea *area, SpaceLink *slink, const bke::id::IDRemapper &mappings)
void VIEW3D_GGT_geometry_nodes(wmGizmoGroupType *gzgt)
void ED_region_panels_ex(const bContext *C, ARegion *region, wm::OpCallContext op_context, const char *contexts[])
void VIEW3D_GGT_mesh_preselect_edgering(wmGizmoGroupType *gzgt)
void WM_draw_region_free(ARegion *region)
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
wmWindow * CTX_wm_window(const bContext *C)
static SpaceLink * view3d_duplicate(SpaceLink *sl)
enum eContextObjectMode CTX_data_mode_enum(const bContext *C)
void VIEW3D_GGT_empty_image(wmGizmoGroupType *gzgt)
void BKE_screen_view3d_shading_blend_read_data(BlendDataReader *reader, View3DShading *shading)
void VIEW3D_GGT_light_point(wmGizmoGroupType *gzgt)
void WM_msg_subscribe_rna_params(wmMsgBus *mbus, const wmMsgParams_RNA *msg_key_params, const wmMsgSubscribeValue *msg_val_params, const char *id_repr)
void WM_gizmomap_tag_refresh(wmGizmoMap *gzmap)
void ED_region_tag_redraw_cursor(ARegion *region)
ViewLayer * WM_window_get_active_view_layer(const wmWindow *win)
void ED_region_tag_redraw(ARegion *region)
LibraryForeachIDFlag BKE_lib_query_foreachid_process_flags_get(const LibraryForeachIDData *data)
void VIEW3D_GGT_camera(wmGizmoGroupType *gzgt)
static void view3d_main_region_cursor(wmWindow *win, ScrArea *area, ARegion *region)
@ CTX_MODE_VERTEX_GREASE_PENCIL
@ CTX_MODE_EDIT_GPENCIL_LEGACY
@ CTX_MODE_VERTEX_GPENCIL_LEGACY
@ CTX_MODE_WEIGHT_GPENCIL_LEGACY
@ CTX_MODE_PAINT_GREASE_PENCIL
@ CTX_MODE_PAINT_GPENCIL_LEGACY
@ CTX_MODE_SCULPT_GREASE_PENCIL
@ CTX_MODE_EDIT_POINTCLOUD
@ CTX_MODE_SCULPT_GPENCIL_LEGACY
@ CTX_MODE_EDIT_GREASE_PENCIL
@ CTX_MODE_WEIGHT_GREASE_PENCIL
ViewLayer * CTX_data_view_layer(const bContext *C)
void ED_area_tag_redraw_regiontype(ScrArea *area, int regiontype)
void GPU_matrix_mul(const float m[4][4])
@ RGN_ALIGN_HIDE_WITH_PREV
static void view3d_main_region_exit(wmWindowManager *wm, ARegion *region)
static void view3d_free(SpaceLink *sl)
void VIEW3D_GGT_camera_view(wmGizmoGroupType *gzgt)
void BKE_viewer_path_foreach_id(LibraryForeachIDData *data, ViewerPath *viewer_path)
int view3d_context(const bContext *C, const char *member, bContextDataResult *result)
static void view3d_id_remap_v3d(ScrArea *area, SpaceLink *slink, View3D *v3d, const bke::id::IDRemapper &mappings, const bool is_local)
void DRW_engine_external_free(RegionView3D *rv3d)
static void view3d_main_region_message_subscribe(const wmRegionMessageSubscribeParams *params)
static void view3d_id_remap_v3d_ob_centers(View3D *v3d, const bke::id::IDRemapper &mappings)
wmEventHandler_Dropbox * WM_event_add_dropbox_handler(ListBaseT< wmEventHandler > *handlers, ListBaseT< wmDropBox > *dropboxes)
Scene * WM_window_get_active_scene(const wmWindow *win)
VecBase< float, 2 > float2
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
int ED_region_generic_panel_region_snap_size(const ARegion *region, int size, int axis)
wmGizmoGroupTypeRef * WM_gizmogrouptype_append_and_link(wmGizmoMapType *gzmap_type, void(*wtfunc)(wmGizmoGroupType *))
void WM_toolsystem_do_msg_notify_tag_refresh(bContext *C, wmMsgSubscribeKey *, wmMsgSubscribeValue *msg_val)
Object * BKE_view_layer_edit_object_get(const ViewLayer *view_layer)
BMesh const char void * data
static void view3d_header_region_listener(const wmRegionListenerParams *params)
void VIEW3D_GGT_tool_generic_handle_free(wmGizmoGroupType *gzgt)
void ED_view3d_local_stats_free(View3D *v3d)
void ED_region_header_with_button_sections(const bContext *C, ARegion *region, ui::ButtonSectionsAlign align)
wmWindowManager * CTX_wm_manager(const bContext *C)
void VIEW3D_GGT_placement(wmGizmoGroupType *gzgt)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C, bool rna_write_check=false)
void VIEW3D_GGT_mesh_preselect_elem(wmGizmoGroupType *gzgt)
void view3d_keymap(wmKeyConfig *keyconf)
void BKE_viewer_path_copy(ViewerPath *dst, const ViewerPath *src)
eV3DProjStatus ED_view3d_project_float_global(const ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
void BKE_annotations_blend_read_data(struct BlendDataReader *reader, struct bGPdata *gpd)
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
void view3d_smooth_free(RegionView3D *rv3d)
bool BKE_view_layer_synced_ensure(const Main &bmain, const Scene *scene, ViewLayer *view_layer)
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
static void view3d_buttons_region_listener(const wmRegionListenerParams *params)
static void view3d_space_blend_read_data(BlendDataReader *reader, SpaceLink *sl)
void VIEW3D_GGT_light_spot(wmGizmoGroupType *gzgt)
void ED_view3d_init_mats_rv3d_gl(const Object *ob, RegionView3D *rv3d)
static void space_view3d_refresh(const bContext *C, ScrArea *area)
static void * view3d_main_region_duplicate(void *poin)
ARegionType * BKE_regiontype_from_id(const SpaceType *st, int regionid)
SpaceType * BKE_spacetype_from_id(int spaceid)
void ED_view3d_stop_render_preview(wmWindowManager *wm, ARegion *region)
void VIEW3D_GGT_light_target(wmGizmoGroupType *gzgt)
void ED_area_do_mgs_subscribe_for_tool_ui(const wmRegionMessageSubscribeParams *params)
void BKE_screen_view3d_sync(View3D *v3d, Scene *scene)
wmEventHandler_Keymap * WM_event_add_keymap_handler(ListBaseT< wmEventHandler > *handlers, wmKeyMap *keymap)
static void view3d_header_region_message_subscribe(const wmRegionMessageSubscribeParams *params)
ARegion * BKE_area_region_new()
void ED_view3d_init_mats_rv3d(const Object *ob, RegionView3D *rv3d)
int ED_region_generic_tools_region_snap_size(const ARegion *region, int size, int axis)
void ED_region_panels_layout_ex(const bContext *C, ARegion *region, ListBaseT< PanelType > *paneltypes, wm::OpCallContext op_context, const char *contexts[], const char *category_override)
static void view3d_exit(wmWindowManager *, ScrArea *area)
void BKE_viewer_path_blend_write(BlendWriter *writer, const ViewerPath *viewer_path)
static void view3d_tools_region_init(wmWindowManager *wm, ARegion *region)
void ED_view3d_buttons_region_layout_ex(const bContext *C, ARegion *region, const char *category_override)
void ED_render_view3d_update(Depsgraph *depsgraph, wmWindow *window, ScrArea *area, bool updated)
void BKE_screen_view3d_do_versions_250(View3D *v3d, ListBaseT< ARegion > *regions)
bool ED_localview_exit_if_empty(const Depsgraph *depsgraph, Scene *scene, ViewLayer *view_layer, wmWindowManager *wm, wmWindow *win, View3D *v3d, ScrArea *area, bool frame_selected=true, int smooth_viewtx=0)
@ V3D_SHADING_BACKGROUND_WORLD
void VIEW3D_GGT_armature_spline(wmGizmoGroupType *gzgt)
void VIEW3D_GGT_tool_generic_handle_normal(wmGizmoGroupType *gzgt)
void WM_jobs_kill_type(wmWindowManager *wm, const void *owner, int job_type)
static void view3d_tools_region_draw(const bContext *C, ARegion *region)
void VIEW3D_GGT_light_area(wmGizmoGroupType *gzgt)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Main * CTX_data_main(const bContext *C)
void IDP_FreeProperty(IDProperty *prop)
bool WM_menutype_add(MenuType *mt)
void ED_spacetype_view3d()
void BKE_spacetype_register(std::unique_ptr< SpaceType > st)
std::array< const char *, 4 > ED_view3d_buttons_contexts(const bContext *C)
static void view3d_widgets()
void VIEW3D_GGT_ruler(wmGizmoGroupType *gzgt)
@ V3D_PROJ_TEST_CLIP_NEAR
void ED_region_header_init(ARegion *region)
void VIEW3D_GT_ruler_item(wmGizmoType *gzt)
wmGizmoMapType * WM_gizmomaptype_ensure(const wmGizmoMapType_Params *gzmap_params)
@ UsePanelCategoriesSearch
void zero_m4(float m[4][4])
static SpaceLink * view3d_create(const ScrArea *, const Scene *scene)
void ED_view3d_check_mats_rv3d(RegionView3D *rv3d)
Scene * CTX_data_scene(const bContext *C)
void WM_cursor_set(wmWindow *win, int curs)
static void space_view3d_listener(const wmSpaceTypeListenerParams *params)
void VIEW3D_GGT_navigate(wmGizmoGroupType *gzgt)
void ED_area_do_mgs_subscribe_for_tool_header(const wmRegionMessageSubscribeParams *params)
void BKE_screen_view3d_shading_blend_write(BlendWriter *writer, View3DShading *shading)
@ RGN_FLAG_INDICATE_OVERFLOW
@ RGN_FLAG_HIDDEN_BY_USER
void ED_area_tag_refresh(ScrArea *area)
@ IDWALK_CB_DIRECT_WEAK_LINK
VecBase< float, 3 > float3
bool ED_view3d_area_user_region(const ScrArea *area, const View3D *v3d, ARegion **r_region)
void ED_region_do_msg_notify_tag_redraw(bContext *C, wmMsgSubscribeKey *msg_key, wmMsgSubscribeValue *msg_val)
static void view3d_main_region_init(wmWindowManager *wm, ARegion *region)
ListBaseT< wmDropBox > * WM_dropboxmap_find(const char *idname, int spaceid, int regionid)
void BKE_viewer_path_clear(ViewerPath *viewer_path)
void view3d_main_region_draw(const bContext *C, ARegion *region)
void ED_region_header(const bContext *C, ARegion *region)
static void view3d_init(wmWindowManager *, ScrArea *)
void view3d_buttons_register(ARegionType *art)
void ED_region_panels_draw(const bContext *C, ARegion *region)
void ED_region_panels_init(wmWindowManager *wm, ARegion *region)
static void view3d_asset_shelf_region_init(wmWindowManager *wm, ARegion *region)
wmGizmoGroupType * WM_gizmogrouptype_append(void(*wtfunc)(wmGizmoGroupType *))
void ED_view3d_shade_update(Main *bmain, View3D *v3d, ScrArea *area)
static void view3d_main_region_free(ARegion *region)
void(*) exit(wmWindowManager *wm, ARegion *region)
void(*) on_user_resize(const ARegion *region)
void(*) cursor(wmWindow *win, ScrArea *area, ARegion *region)
int(*) snap_size(const ARegion *region, int size, int axis)
void *(*) duplicate(void *poin)
void(*) on_poll_success(const bContext *C, ARegion *region)
void(*) message_subscribe(const wmRegionMessageSubscribeParams *params)
bContextDataCallback context
void(*) draw(const bContext *C, ARegion *region)
void(*) listener(const wmRegionListenerParams *params)
void(*) layout(const bContext *C, ARegion *region)
bool(*) poll(const RegionPollParams *params)
std::optional< ARegionIMECursorState >(*) cursor_ime(wmWindow *win, const ScrArea *area, const ARegion *region, ARegionIMECursor *r_cursor)
ListBaseT< PanelType > paneltypes
void(*) init(wmWindowManager *wm, ARegion *region)
bke::ARegionRuntime * runtime
eRegion_Alignment alignment
void write_struct(const T *data, BlendStructWriterTypedFn< T > fn=nullptr)
ListBaseT< wmWindowManager > wm
struct RegionView3D * localvd
struct ViewRender * view_render
struct wmTimer * smooth_timer
eRegionView3D_Persp persp
struct SmoothView3DStore * sms
eRegionView3D_ViewLock viewlock
ListBaseT< ARegion > regionbase
ListBaseT< SpaceLink > spacedata
ListBaseT< ARegion > regionbase
eV3DShadingBackgroundType background_type
void(*) properties_storage_free(void *properties_storage)
void * properties_storage
struct Object * ob_center
ListBaseT< ARegion > regionbase
unsigned short local_collections_uid
DNA_DEPRECATED struct bGPdata * gpd
ListBaseT< wmEventHandler > handlers
struct ARegionType * type
const wmNotifier * notifier
const wmNotifier * notifier
#define WM_msg_subscribe_rna_anon_prop(mbus, type_, prop_, value)
#define WM_msg_subscribe_rna_anon_type(mbus, type_, value)