Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_operators.c
| Show First 20 Lines • Show All 763 Lines • ▼ Show 20 Lines | static bool operator_last_properties_init_impl(wmOperator *op, IDProperty *last_properties) | ||||
| return changed; | return changed; | ||||
| } | } | ||||
| bool WM_operator_last_properties_init(wmOperator *op) | bool WM_operator_last_properties_init(wmOperator *op) | ||||
| { | { | ||||
| bool changed = false; | bool changed = false; | ||||
| if (op->type->last_properties) { | if (op->type->last_properties) { | ||||
| changed |= operator_last_properties_init_impl(op, op->type->last_properties); | changed |= operator_last_properties_init_impl(op, op->type->last_properties); | ||||
| for (wmOperator *opm = op->macro.first; opm; opm = opm->next) { | LISTBASE_FOREACH (wmOperator *, opm, &op->macro) { | ||||
| IDProperty *idp_src = IDP_GetPropertyFromGroup(op->type->last_properties, opm->idname); | IDProperty *idp_src = IDP_GetPropertyFromGroup(op->type->last_properties, opm->idname); | ||||
| if (idp_src) { | if (idp_src) { | ||||
| changed |= operator_last_properties_init_impl(opm, idp_src); | changed |= operator_last_properties_init_impl(opm, idp_src); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| return changed; | return changed; | ||||
| } | } | ||||
| bool WM_operator_last_properties_store(wmOperator *op) | bool WM_operator_last_properties_store(wmOperator *op) | ||||
| { | { | ||||
| if (op->type->last_properties) { | if (op->type->last_properties) { | ||||
| IDP_FreeProperty(op->type->last_properties); | IDP_FreeProperty(op->type->last_properties); | ||||
| op->type->last_properties = NULL; | op->type->last_properties = NULL; | ||||
| } | } | ||||
| if (op->properties) { | if (op->properties) { | ||||
| CLOG_INFO(WM_LOG_OPERATORS, 1, "storing properties for '%s'", op->type->idname); | CLOG_INFO(WM_LOG_OPERATORS, 1, "storing properties for '%s'", op->type->idname); | ||||
| op->type->last_properties = IDP_CopyProperty(op->properties); | op->type->last_properties = IDP_CopyProperty(op->properties); | ||||
| } | } | ||||
| if (op->macro.first != NULL) { | if (op->macro.first != NULL) { | ||||
| for (wmOperator *opm = op->macro.first; opm; opm = opm->next) { | LISTBASE_FOREACH (wmOperator *, opm, &op->macro) { | ||||
| if (opm->properties) { | if (opm->properties) { | ||||
| if (op->type->last_properties == NULL) { | if (op->type->last_properties == NULL) { | ||||
| op->type->last_properties = IDP_New( | op->type->last_properties = IDP_New( | ||||
| IDP_GROUP, &(IDPropertyTemplate){0}, "wmOperatorProperties"); | IDP_GROUP, &(IDPropertyTemplate){0}, "wmOperatorProperties"); | ||||
| } | } | ||||
| IDProperty *idp_macro = IDP_CopyProperty(opm->properties); | IDProperty *idp_macro = IDP_CopyProperty(opm->properties); | ||||
| STRNCPY(idp_macro->name, opm->type->idname); | STRNCPY(idp_macro->name, opm->type->idname); | ||||
| IDP_ReplaceInGroup(op->type->last_properties, idp_macro); | IDP_ReplaceInGroup(op->type->last_properties, idp_macro); | ||||
| ▲ Show 20 Lines • Show All 2,880 Lines • ▼ Show 20 Lines | |||||
| #ifdef WITH_XR_OPENXR | #ifdef WITH_XR_OPENXR | ||||
| static void wm_xr_session_update_screen(Main *bmain, const wmXrData *xr_data) | static void wm_xr_session_update_screen(Main *bmain, const wmXrData *xr_data) | ||||
| { | { | ||||
| const bool session_exists = WM_xr_session_exists(xr_data); | const bool session_exists = WM_xr_session_exists(xr_data); | ||||
| for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { | for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { | ||||
| for (ScrArea *area = screen->areabase.first; area; area = area->next) { | LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { | ||||
| for (SpaceLink *slink = area->spacedata.first; slink; slink = slink->next) { | LISTBASE_FOREACH (SpaceLink *, slink, &area->spacedata) { | ||||
| if (slink->spacetype == SPACE_VIEW3D) { | if (slink->spacetype == SPACE_VIEW3D) { | ||||
| View3D *v3d = (View3D *)slink; | View3D *v3d = (View3D *)slink; | ||||
| if (v3d->flag & V3D_XR_SESSION_MIRROR) { | if (v3d->flag & V3D_XR_SESSION_MIRROR) { | ||||
| ED_view3d_xr_mirror_update(area, v3d, session_exists); | ED_view3d_xr_mirror_update(area, v3d, session_exists); | ||||
| } | } | ||||
| if (session_exists) { | if (session_exists) { | ||||
| ▲ Show 20 Lines • Show All 437 Lines • Show Last 20 Lines | |||||