[Bf-blender-cvs] [07c35a743a6] xr-dev: Merge branch 'master' into xr-dev

Peter Kim noreply at git.blender.org
Tue May 3 03:39:57 CEST 2022


Commit: 07c35a743a6c157e01a056ce12944648d8cd4d8a
Author: Peter Kim
Date:   Tue May 3 10:39:15 2022 +0900
Branches: xr-dev
https://developer.blender.org/rB07c35a743a6c157e01a056ce12944648d8cd4d8a

Merge branch 'master' into xr-dev

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



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

diff --cc source/blender/editors/include/ED_transform.h
index d68873dddd6,82cc518f029..2d3a3bc6f0a
--- a/source/blender/editors/include/ED_transform.h
+++ b/source/blender/editors/include/ED_transform.h
@@@ -204,19 -202,21 +204,34 @@@ int ED_transform_calc_gizmo_stats(cons
                                    const struct TransformCalcParams *params,
                                    struct TransformBounds *tbounds);
  
 +/* transform_convert.c */
 +void ED_transform_animrecord_check_state(struct Scene *scene,
 +                                         struct wmTimer *animtimer,
 +                                         struct Object *ob);
 +
 +/* transform_convert_object.c */
 +void ED_transform_autokeyframe_object(struct bContext *C,
 +                                      struct Scene *scene,
 +                                      struct ViewLayer *view_layer,
 +                                      struct Object *ob,
 +                                      int tmode);
 +bool ED_transform_motionpath_need_update_object(struct Scene *scene, struct Object *ob);
 +
+ /**
+  * Iterates over all the strips and finds the closest snapping candidate of either \a frame_1 or \a
+  * frame_2. The closest snapping candidate will be the closest start or end frame of an existing
+  * strip.
+  * \returns True if there was anything to snap to.
+  */
+ bool ED_transform_snap_sequencer_to_closest_strip_calc(struct Scene *scene,
+                                                        struct ARegion *region,
+                                                        int frame_1,
+                                                        int frame_2,
+                                                        int *r_snap_distance,
+                                                        float *r_snap_frame);
+ 
+ void ED_draw_sequencer_snap_point(struct bContext *C, float snap_point);
+ 
  #ifdef __cplusplus
  }
  #endif
diff --cc source/blender/makesdna/DNA_xr_types.h
index e4b92fe885b,44419c9763f..fa590c69728
--- a/source/blender/makesdna/DNA_xr_types.h
+++ b/source/blender/makesdna/DNA_xr_types.h
@@@ -37,14 -37,9 +37,18 @@@ typedef struct XrSessionSettings 
  
    int flag;
  
+   /** Object type settings to apply to VR view (unlike shading, not shared with window 3D-View). */
+   int object_type_exclude_viewport;
+   int object_type_exclude_select;
++
 +  ListBase actionmaps; /* XrActionMap */
 +  short act_actionmap;
 +  short sel_actionmap;
 +  char _pad3[2];
 +
 +  /** Objects to bind to headset/controller poses. */
 +  short sel_mocap_object;
 +  ListBase mocap_objects; /* #XrMotionCaptureObject */
  } XrSessionSettings;
  
  typedef enum eXrSessionFlag {
diff --cc source/blender/makesrna/intern/rna_xr.c
index 65f99166e51,a04b29b8815..9f88f568204
--- a/source/blender/makesrna/intern/rna_xr.c
+++ b/source/blender/makesrna/intern/rna_xr.c
@@@ -845,71 -691,25 +845,90 @@@ static void rna_XrSessionSettings_use_a
  #  endif
  }
  
 +static bool rna_XrSessionSettings_enable_vive_tracker_extension_get(PointerRNA *ptr)
 +{
 +#  ifdef WITH_XR_OPENXR
 +  const wmXrData *xr = rna_XrSession_wm_xr_data_get(ptr);
 +  return (xr->session_settings.flag & XR_SESSION_ENABLE_VIVE_TRACKER_EXTENSION) != 0;
 +#  else
 +  UNUSED_VARS(ptr);
 +  return false;
 +#  endif
 +}
 +
 +static void rna_XrSessionSettings_enable_vive_tracker_extension_set(PointerRNA *ptr, bool value)
 +{
 +#  ifdef WITH_XR_OPENXR
 +  wmXrData *xr = rna_XrSession_wm_xr_data_get(ptr);
 +  SET_FLAG_FROM_TEST(xr->session_settings.flag, value, XR_SESSION_ENABLE_VIVE_TRACKER_EXTENSION);
 +#  else
 +  UNUSED_VARS(ptr, value);
 +#  endif
 +}
 +
+ static int rna_XrSessionSettings_icon_from_show_object_viewport_get(PointerRNA *ptr)
+ {
+ #  ifdef WITH_XR_OPENXR
+   const wmXrData *xr = rna_XrSession_wm_xr_data_get(ptr);
+   return rna_object_type_visibility_icon_get_common(
+       xr->session_settings.object_type_exclude_viewport,
+ #    if 0
+     /* For the future when selection in VR is reliably supported. */
+     &xr->session_settings.object_type_exclude_select
+ #    else
+       NULL
+ #    endif
+   );
+ #  else
+   UNUSED_VARS(ptr);
+   return ICON_NONE;
+ #  endif
+ }
+ 
 +static void rna_XrSessionSettings_actionmaps_begin(CollectionPropertyIterator *iter,
 +                                                   PointerRNA *ptr)
 +{
 +#  ifdef WITH_XR_OPENXR
 +  wmXrData *xr = rna_XrSession_wm_xr_data_get(ptr);
 +  rna_iterator_listbase_begin(iter, &xr->session_settings.actionmaps, NULL);
 +#  else
 +  UNUSED_VARS(iter, ptr);
 +#  endif
 +}
 +
 +static int rna_XrSessionSettings_actionmaps_length(PointerRNA *ptr)
 +{
 +#  ifdef WITH_XR_OPENXR
 +  wmXrData *xr = rna_XrSession_wm_xr_data_get(ptr);
 +  return BLI_listbase_count(&xr->session_settings.actionmaps);
 +#  else
 +  UNUSED_VARS(ptr);
 +  return 0;
 +#  endif
 +}
 +
 +static void rna_XrSessionSettings_mocap_objects_begin(CollectionPropertyIterator *iter,
 +                                                      PointerRNA *ptr)
 +{
 +#  ifdef WITH_XR_OPENXR
 +  wmXrData *xr = rna_XrSession_wm_xr_data_get(ptr);
 +  rna_iterator_listbase_begin(iter, &xr->session_settings.mocap_objects, NULL);
 +#  else
 +  UNUSED_VARS(iter, ptr);
 +#  endif
 +}
 +
 +static int rna_XrSessionSettings_mocap_objects_length(PointerRNA *ptr)
 +{
 +#  ifdef WITH_XR_OPENXR
 +  wmXrData *xr = rna_XrSession_wm_xr_data_get(ptr);
 +  return BLI_listbase_count(&xr->session_settings.mocap_objects);
 +#  else
 +  UNUSED_VARS(ptr);
 +  return 0;
 +#  endif
 +}
 +
  /** \} */
  
  /* -------------------------------------------------------------------- */
@@@ -2283,57 -2008,14 +2308,66 @@@ static void rna_def_xr_session_settings
        "Allow the VR tracking origin to be defined independently of the headset location");
    RNA_def_property_update(prop, NC_WM | ND_XR_DATA_CHANGED, NULL);
  
 +  prop = RNA_def_property(srna, "enable_vive_tracker_extension", PROP_BOOLEAN, PROP_NONE);
 +  RNA_def_property_boolean_funcs(prop,
 +                                 "rna_XrSessionSettings_enable_vive_tracker_extension_get",
 +                                 "rna_XrSessionSettings_enable_vive_tracker_extension_set");
 +  RNA_def_property_ui_text(prop,
 +                           "Enable Vive Tracker Extension",
 +                           "Enable bindings for the HTC Vive Trackers. Note that this may not be "
 +                           "supported by all OpenXR runtimes");
 +  RNA_def_property_update(prop, NC_WM | ND_XR_DATA_CHANGED, NULL);
 +
+   rna_def_object_type_visibility_flags_common(srna, NC_WM | ND_XR_DATA_CHANGED);
+ 
+   /* Helper for drawing the icon. */
+   prop = RNA_def_property(srna, "icon_from_show_object_viewport", PROP_INT, PROP_NONE);
+   RNA_def_property_int_funcs(
+       prop, "rna_XrSessionSettings_icon_from_show_object_viewport_get", NULL, NULL);
+   RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+   RNA_def_property_ui_text(prop, "Visibility Icon", "");
++
 +  prop = RNA_def_property(srna, "actionmaps", PROP_COLLECTION, PROP_NONE);
 +  RNA_def_property_collection_funcs(prop,
 +                                    "rna_XrSessionSettings_actionmaps_begin",
 +                                    "rna_iterator_listbase_next",
 +                                    "rna_iterator_listbase_end",
 +                                    "rna_iterator_listbase_get",
 +                                    "rna_XrSessionSettings_actionmaps_length",
 +                                    NULL,
 +                                    NULL,
 +                                    NULL);
 +  RNA_def_property_struct_type(prop, "XrActionMap");
 +  RNA_def_property_ui_text(prop, "XR Action Maps", "");
 +  rna_def_xr_actionmaps(brna, prop);
 +
 +  prop = RNA_def_property(srna, "active_actionmap", PROP_INT, PROP_NONE);
 +  RNA_def_property_int_sdna(prop, NULL, "act_actionmap");
 +  RNA_def_property_ui_text(prop, "Active Action Map", "");
 +
 +  prop = RNA_def_property(srna, "selected_actionmap", PROP_INT, PROP_NONE);
 +  RNA_def_property_int_sdna(prop, NULL, "sel_actionmap");
 +  RNA_def_property_ui_text(prop, "Selected Action Map", "");
 +
 +  prop = RNA_def_property(srna, "mocap_objects", PROP_COLLECTION, PROP_NONE);
 +  RNA_def_property_struct_type(prop, "XrMotionCaptureObject");
 +  RNA_def_property_collection_funcs(prop,
 +                                    "rna_XrSessionSettings_mocap_objects_begin",
 +                                    "rna_iterator_listbase_next",
 +                                    "rna_iterator_listbase_end",
 +                                    "rna_iterator_listbase_get",
 +                                    "rna_XrSessionSettings_mocap_objects_length",
 +                                    NULL,
 +                                    NULL,
 +                                    NULL);
 +  RNA_def_property_ui_text(
 +      prop, "XR Motion Capture Objects", "Objects to bind to headset/controller poses");
 +  rna_def_xr_motioncapture_objects(brna, prop);
 +
 +  prop = RNA_def_property(srna, "selected_mocap_object", PROP_INT, PROP_NONE);
 +  RNA_def_property_int_sdna(prop, NULL, "sel_mocap_object");
 +  RNA_def_property_ui_text(
 +      prop, "Selected Motion Capture Object", "Currently selected motion capture object");
  }
  
  /** \} */



More information about the Bf-blender-cvs mailing list