[Bf-blender-cvs] [5333441eb1a] vr_scene_inspection: Cleanup, naming, comments, etc
Julian Eisel
noreply at git.blender.org
Wed Mar 11 20:36:26 CET 2020
Commit: 5333441eb1a050f9fe92c63253e29f3c775bfaba
Author: Julian Eisel
Date: Wed Mar 11 19:32:40 2020 +0100
Branches: vr_scene_inspection
https://developer.blender.org/rB5333441eb1a050f9fe92c63253e29f3c775bfaba
Cleanup, naming, comments, etc
===================================================================
M source/blender/blenloader/intern/readfile.c
M source/blender/editors/space_view3d/space_view3d.c
M source/blender/makesdna/DNA_windowmanager_types.h
M source/blender/makesrna/RNA_access.h
M source/blender/makesrna/intern/rna_space.c
M source/blender/makesrna/intern/rna_wm.c
M source/blender/makesrna/intern/rna_wm_gizmo.c
M source/blender/makesrna/intern/rna_xr.c
M source/blender/windowmanager/intern/wm.c
M source/blender/windowmanager/intern/wm_operators.c
M source/blender/windowmanager/intern/wm_xr.c
M source/blender/windowmanager/wm.h
===================================================================
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 8a9c05a846c..65962702219 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -7581,8 +7581,6 @@ static bool direct_link_area_map(FileData *fd, ScrAreaMap *area_map)
/** \name XR-data
* \{ */
-#ifdef WITH_XR_OPENXR
-
static void direct_link_wm_xr_data(FileData *fd, wmXrData *xr_data)
{
direct_link_view3dshading(fd, &xr_data->session_settings.shading);
@@ -7594,8 +7592,6 @@ static void lib_link_wm_xr_data(FileData *fd, ID *parent_id, wmXrData *xr_data)
fd, parent_id->lib, xr_data->session_settings.base_pose_object);
}
-#endif
-
/** \} */
/* -------------------------------------------------------------------- */
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 43b0c0ec461..ab9257e8470 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -700,7 +700,6 @@ static void view3d_main_region_listener(
if (ELEM(wmn->data, ND_UNDO)) {
WM_gizmomap_tag_refresh(gzmap);
}
-#ifdef WITH_XR_OPENXR
else if (ELEM(wmn->data, ND_XR_DATA_CHANGED)) {
/* Only cause a redraw if this a VR session mirror. Should more features be added that
* require redraws, we could pass something to wmn->reference, e.g. the flag value. */
@@ -708,7 +707,6 @@ static void view3d_main_region_listener(
ED_region_tag_redraw(region);
}
}
-#endif
break;
case NC_ANIMATION:
switch (wmn->data) {
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index e02dee65b6c..03ee75c2da0 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -130,7 +130,7 @@ typedef struct wmXrData {
bXrSessionSettings session_settings;
/** Runtime state information for managing Blender specific behaviors. Not stored in files. */
- struct bXrRuntimeSessionState *session_state;
+ struct XrRuntimeSessionState *session_state;
} wmXrData;
//#endif
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index 1e07da23429..b6e77b1005c 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -695,7 +695,7 @@ extern StructRNA RNA_World;
extern StructRNA RNA_WorldLighting;
extern StructRNA RNA_WorldMistSettings;
extern StructRNA RNA_XrSessionSettings;
-extern StructRNA RNA_XrSessionState;
+extern StructRNA RNA_XrRuntimeSessionState;
extern StructRNA RNA_uiPopover;
extern StructRNA RNA_wmOwnerIDs;
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index b2f02b7452a..711b707d802 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -1333,7 +1333,7 @@ static const EnumPropertyItem *rna_SpaceView3D_stereo3d_camera_itemf(bContext *C
}
}
-static void rna_SpaceView3D_show_as_xr_session_mirror_set(PointerRNA *ptr, bool value)
+static void rna_SpaceView3D_mirror_xr_session_set(PointerRNA *ptr, bool value)
{
View3D *v3d = ptr->data;
@@ -4208,13 +4208,13 @@ static void rna_def_space_view3d(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Volume Alpha", "Opacity (alpha) of the cameras' frustum volume");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
- prop = RNA_def_property(srna, "show_as_xr_session_mirror", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "mirror_xr_session", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_XR_SESSION_MIRROR);
- RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_show_as_xr_session_mirror_set");
- RNA_def_property_ui_text(prop,
- "VR Session Mirror",
- "Use the 3D View to display the perspective of a virtual reality "
- "session, if one is running");
+ RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_mirror_xr_session_set");
+ RNA_def_property_ui_text(
+ prop,
+ "Mirror VR Session",
+ "Synchronize the viewer perspective of virtual reality sessions with this 3D viewport");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
{
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 80605655e02..6929238d67a 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -2490,7 +2490,7 @@ static void rna_def_windowmanager(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "XR Session Settings", "");
prop = RNA_def_property(srna, "xr_session_state", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "XrSessionState");
+ RNA_def_property_struct_type(prop, "XrRuntimeSessionState");
RNA_def_property_pointer_sdna(prop, NULL, "xr.session_state");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(
diff --git a/source/blender/makesrna/intern/rna_wm_gizmo.c b/source/blender/makesrna/intern/rna_wm_gizmo.c
index b0e7e3fff4c..4c278fb3f63 100644
--- a/source/blender/makesrna/intern/rna_wm_gizmo.c
+++ b/source/blender/makesrna/intern/rna_wm_gizmo.c
@@ -1380,7 +1380,8 @@ static void rna_def_gizmogroup(BlenderRNA *brna)
"CONTINUOUS_REDRAW",
0,
"Continuous Redraw",
- "Redraw the group all the time (on each main loop iteration)"},
+ "Force the group to be redrawn all the time (may have significantly negative impact on "
+ "performance)"},
{0, NULL, 0, NULL, NULL},
};
prop = RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_xr.c b/source/blender/makesrna/intern/rna_xr.c
index 1bf54baa787..9ef7d72028e 100644
--- a/source/blender/makesrna/intern/rna_xr.c
+++ b/source/blender/makesrna/intern/rna_xr.c
@@ -32,7 +32,7 @@
# include "WM_api.h"
-static bool rna_XrSessionState_is_running(bContext *C)
+static bool rna_XrRuntimeSessionState_is_running(bContext *C)
{
# ifdef WITH_XR_OPENXR
const wmWindowManager *wm = CTX_wm_manager(C);
@@ -44,12 +44,12 @@ static bool rna_XrSessionState_is_running(bContext *C)
}
# ifdef WITH_XR_OPENXR
-static wmXrData *rna_XrSessionState_wm_xr_data_get(PointerRNA *ptr)
+static wmXrData *rna_XrRuntimeSessionState_wm_xr_data_get(PointerRNA *ptr)
{
- /* Callers could also get bXrSessionState pointer through ptr->data, but prefer if we just
+ /* Callers could also get XrRuntimeSessionState pointer through ptr->data, but prefer if we just
* consistently pass wmXrData pointers to the WM_xr_xxx() API. */
- BLI_assert(ptr->type == &RNA_XrSessionState);
+ BLI_assert(ptr->type == &RNA_XrRuntimeSessionState);
wmWindowManager *wm = (wmWindowManager *)ptr->owner_id;
BLI_assert(wm && (GS(wm->id.name) == ID_WM));
@@ -58,20 +58,20 @@ static wmXrData *rna_XrSessionState_wm_xr_data_get(PointerRNA *ptr)
}
# endif
-static void rna_XrSessionState_viewer_location_get(PointerRNA *ptr, float *values)
+static void rna_XrRuntimeSessionState_viewer_location_get(PointerRNA *ptr, float *values)
{
# ifdef WITH_XR_OPENXR
- const wmXrData *xr = rna_XrSessionState_wm_xr_data_get(ptr);
+ const wmXrData *xr = rna_XrRuntimeSessionState_wm_xr_data_get(ptr);
WM_xr_session_state_viewer_location_get(xr, values);
# else
UNUSED_VARS(ptr, values);
# endif
}
-static void rna_XrSessionState_viewer_rotation_get(PointerRNA *ptr, float *values)
+static void rna_XrRuntimeSessionState_viewer_rotation_get(PointerRNA *ptr, float *values)
{
# ifdef WITH_XR_OPENXR
- const wmXrData *xr = rna_XrSessionState_wm_xr_data_get(ptr);
+ const wmXrData *xr = rna_XrRuntimeSessionState_wm_xr_data_get(ptr);
WM_xr_session_state_viewer_rotation_get(xr, values);
# else
UNUSED_VARS(ptr, values);
@@ -95,7 +95,7 @@ static void rna_def_xr_session_settings(BlenderRNA *brna)
"OBJECT",
0,
"Object",
- "Follow an transformation of an object to define the VR view's reference pose"},
+ "Follow the transformation of an object to define the VR view's reference pose"},
{XR_BASE_POSE_CUSTOM,
"CUSTOM",
0,
@@ -106,7 +106,7 @@ static void rna_def_xr_session_settings(BlenderRNA *brna)
srna = RNA_def_struct(brna, "XrSessionSettings", NULL);
RNA_def_struct_sdna(srna, "bXrSessionSettings");
- RNA_def_struct_ui_text(srna, "XR-Session Settings", "");
+ RNA_def_struct_ui_text(srna, "XR Session Settings", "");
prop = RNA_def_property(srna, "shading", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
@@ -122,19 +122,26 @@ static void rna_def_xr_session_settings(BlenderRNA *brna)
prop = RNA_def_property(srna, "base_pose_object", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop,
- "Base Pose Object",
- "Object to take the location and rotation as reference position from");
+ RNA_def_property_ui_text(
+ prop,
+ "Base Pose Object",
+ "Object to take the location and rotation for the centroid from, to which translation and "
+ "rotation deltas from the VR headset will be applied to");
RNA_def_property_update(prop, NC_WM | ND_XR_DATA_CHANGED, NULL);
prop = RNA_def_property(srna, "base_pose_location", PROP_FLOAT, PROP_TRANSLATION);
- RNA_def_property_ui_text(prop, "Base Pose Location", "");
+ RNA_def_property_ui_text(
+ prop,
+ "Base Pose Location",
+ "Coordinates for the centroid to apply translation deltas from the VR headset to");
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
RNA_def_property_update(prop, NC_WM | ND_XR_DATA_CHANGED, NULL);
prop = RNA_def_property(srna, "base_pose_angle", PROP_FLOAT, PROP_AXISANGLE);
RNA_def_property_ui_text(
- prop, "Base Pose Angle", "Rotation angle around the Z-Axis to apply to the referenc
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list