[Bf-blender-cvs] [090c1b7ddac] xr-actions-D9124: Disable XR object saving and (for now) creation

Peter Kim noreply at git.blender.org
Tue Oct 13 14:45:02 CEST 2020


Commit: 090c1b7ddacdb2498e1838662db0441faa409649
Author: Peter Kim
Date:   Mon Oct 12 22:44:39 2020 +0900
Branches: xr-actions-D9124
https://developer.blender.org/rB090c1b7ddacdb2498e1838662db0441faa409649

Disable XR object saving and (for now) creation

===================================================================

M	source/blender/blenloader/intern/writefile.c
M	source/blender/makesdna/DNA_object_types.h
M	source/blender/windowmanager/xr/intern/wm_xr_session.c

===================================================================

diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index a37ec2d9f0a..199628467ab 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1312,6 +1312,13 @@ static void write_shaderfxs(BlendWriter *writer, ListBase *fxbase)
 
 static void write_object(BlendWriter *writer, Object *ob, const void *id_address)
 {
+#if 1
+  /* Don't write XR objects. */
+  if (ob->runtime.is_xr) {
+    return;
+  }
+#endif
+
   const bool is_undo = BLO_write_is_undo(writer);
   if (ob->id.us > 0 || is_undo) {
     /* Clean up, important in undo case to reduce false detection of changed data-blocks. */
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index 25bda62de7a..128d5b98d40 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -136,7 +136,10 @@ typedef struct Object_Runtime {
    */
   char is_data_eval_owned;
 
-  /** Identifies whether the object is an XR object (used for drawing). */
+  /**
+   * Denotes whether the object is tied to the lifetime of an XR session. This is used for
+   * drawing and also to prevent temporary XR objects from being saved in files.
+   */
   char is_xr;
 
   /** Axis aligned boundbox (in localspace). */
diff --git a/source/blender/windowmanager/xr/intern/wm_xr_session.c b/source/blender/windowmanager/xr/intern/wm_xr_session.c
index dfdb832a1f2..08e60e8baae 100644
--- a/source/blender/windowmanager/xr/intern/wm_xr_session.c
+++ b/source/blender/windowmanager/xr/intern/wm_xr_session.c
@@ -746,7 +746,7 @@ void wm_xr_session_controller_data_populate(const wmXrAction *controller_pose_ac
     strcpy(c->subaction_path, controller_pose_action->subaction_paths[i]);
     memset(&c->pose, 0, sizeof(c->pose));
     memset(c->mat, 0, sizeof(c->mat));
-#if 1
+#if 0
     if (!c->ob) {
       /* Just use zeroed-out pose.position for loc and rot. */
       c->ob = ED_object_add_type(



More information about the Bf-blender-cvs mailing list