2023-05-31 16:19:06 +02:00
|
|
|
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2019-02-17 22:08:12 +01:00
|
|
|
/** \file
|
|
|
|
* \ingroup DNA
|
2011-02-17 21:48:12 +01:00
|
|
|
*/
|
|
|
|
|
2012-02-17 19:59:41 +01:00
|
|
|
#pragma once
|
2011-12-30 08:25:49 +01:00
|
|
|
|
2005-08-20 21:18:35 +02:00
|
|
|
struct BoundBox;
|
2019-01-28 11:08:24 +01:00
|
|
|
struct Object;
|
2023-07-18 17:17:48 +02:00
|
|
|
struct ViewRender;
|
2012-08-12 03:07:31 +02:00
|
|
|
struct SmoothView3DStore;
|
2019-01-28 11:08:24 +01:00
|
|
|
struct SpaceLink;
|
|
|
|
struct bGPdata;
|
2008-12-26 19:15:46 +01:00
|
|
|
struct wmTimer;
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2011-12-04 07:05:48 +01:00
|
|
|
#include "DNA_defs.h"
|
2006-12-20 18:57:56 +01:00
|
|
|
#include "DNA_image_types.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "DNA_listBase.h"
|
2011-11-07 13:55:18 +01:00
|
|
|
#include "DNA_movieclip_types.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "DNA_object_types.h"
|
2020-03-06 12:59:09 +01:00
|
|
|
#include "DNA_view3d_enums.h"
|
Geometry Nodes: viewport preview
This adds support for showing geometry passed to the Viewer in the 3d
viewport (instead of just in the spreadsheet). The "viewer geometry"
bypasses the group output. So it is not necessary to change the final
output of the node group to be able to see the intermediate geometry.
**Activation and deactivation of a viewer node**
* A viewer node is activated by clicking on it.
* Ctrl+shift+click on any node/socket connects it to the viewer and
makes it active.
* Ctrl+shift+click in empty space deactivates the active viewer.
* When the active viewer is not visible anymore (e.g. another object
is selected, or the current node group is exit), it is deactivated.
* Clicking on the icon in the header of the Viewer node toggles whether
its active or not.
**Pinning**
* The spreadsheet still allows pinning the active viewer as before.
When pinned, the spreadsheet still references the viewer node even
when it becomes inactive.
* The viewport does not support pinning at the moment. It always shows
the active viewer.
**Attribute**
* When a field is linked to the second input of the viewer node it is
displayed as an overlay in the viewport.
* When possible the correct domain for the attribute is determined
automatically. This does not work in all cases. It falls back to the
face corner domain on meshes and the point domain on curves. When
necessary, the domain can be picked manually.
* The spreadsheet now only shows the "Viewer" column for the domain
that is selected in the Viewer node.
* Instance attributes are visualized as a constant color per instance.
**Viewport Options**
* The attribute overlay opacity can be controlled with the "Viewer Node"
setting in the overlays popover.
* A viewport can be configured not to show intermediate viewer-geometry
by disabling the "Viewer Node" option in the "View" menu.
**Implementation Details**
* The "spreadsheet context path" was generalized to a "viewer path" that
is used in more places now.
* The viewer node itself determines the attribute domain, evaluates the
field and stores the result in a `.viewer` attribute.
* A new "viewer attribute' overlay displays the data from the `.viewer`
attribute.
* The ground truth for the active viewer node is stored in the workspace
now. Node editors, spreadsheets and viewports retrieve the active
viewer from there unless they are pinned.
* The depsgraph object iterator has a new "viewer path" setting. When set,
the viewed geometry of the corresponding object is part of the iterator
instead of the final evaluated geometry.
* To support the instance attribute overlay `DupliObject` was extended
to contain the information necessary for drawing the overlay.
* The ctrl+shift+click operator has been refactored so that it can make
existing links to viewers active again.
* The auto-domain-detection in the Viewer node works by checking the
"preferred domain" for every field input. If there is not exactly one
preferred domain, the fallback is used.
Known limitations:
* Loose edges of meshes don't have the attribute overlay. This could be
added separately if necessary.
* Some attributes are hard to visualize as a color directly. For example,
the values might have to be normalized or some should be drawn as arrays.
For now, we encourage users to build node groups that generate appropriate
viewer-geometry. We might include some of that functionality in future versions.
Support for displaying attribute values as text in the viewport is planned as well.
* There seems to be an issue with the attribute overlay for pointclouds on
nvidia gpus, to be investigated.
Differential Revision: https://developer.blender.org/D15954
2022-09-28 17:54:59 +02:00
|
|
|
#include "DNA_viewer_path_types.h"
|
2005-07-13 21:42:08 +02:00
|
|
|
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 17:54:41 +01:00
|
|
|
typedef struct RegionView3D {
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** GL_PROJECTION matrix. */
|
|
|
|
float winmat[4][4];
|
|
|
|
/** GL_MODELVIEW matrix. */
|
|
|
|
float viewmat[4][4];
|
|
|
|
/** Inverse of viewmat. */
|
|
|
|
float viewinv[4][4];
|
|
|
|
/** Viewmat*winmat. */
|
|
|
|
float persmat[4][4];
|
|
|
|
/** Inverse of persmat. */
|
|
|
|
float persinv[4][4];
|
2023-08-21 02:05:45 +02:00
|
|
|
/** Offset/scale for camera GLSL texture-coordinates. */
|
2019-01-07 12:19:13 +01:00
|
|
|
float viewcamtexcofac[4];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** viewmat/persmat multiplied with object matrix, while drawing and selection. */
|
2009-05-18 18:42:34 +02:00
|
|
|
float viewmatob[4][4];
|
|
|
|
float persmatob[4][4];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** User defined clipping planes. */
|
2009-01-20 19:31:11 +01:00
|
|
|
float clip[6][4];
|
2021-11-13 03:07:13 +01:00
|
|
|
/**
|
|
|
|
* Clip in object space,
|
|
|
|
* means we can test for clipping in edit-mode without first going into world-space.
|
|
|
|
*/
|
2019-01-07 12:19:13 +01:00
|
|
|
float clip_local[6][4];
|
2012-03-07 20:42:22 +01:00
|
|
|
struct BoundBox *clipbb;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-01-24 05:34:56 +01:00
|
|
|
/** Allocated backup of itself while in local-view. */
|
2019-01-07 12:19:13 +01:00
|
|
|
struct RegionView3D *localvd;
|
2023-07-18 17:17:48 +02:00
|
|
|
struct ViewRender *view_render;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Animated smooth view. */
|
2012-08-12 03:07:31 +02:00
|
|
|
struct SmoothView3DStore *sms;
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 17:54:41 +01:00
|
|
|
struct wmTimer *smooth_timer;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Transform gizmo matrix. */
|
2012-03-07 20:42:22 +01:00
|
|
|
float twmat[4][4];
|
2019-01-07 12:19:13 +01:00
|
|
|
/** min/max dot product on twmat xyz axis. */
|
2017-10-09 18:08:53 +02:00
|
|
|
float tw_axis_min[3], tw_axis_max[3];
|
|
|
|
float tw_axis_matrix[3][3];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-08-27 17:16:34 +02:00
|
|
|
float gridview DNA_DEPRECATED;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** View rotation, must be kept normalized. */
|
|
|
|
float viewquat[4];
|
|
|
|
/** Distance from 'ofs' along -viewinv[2] vector, where result is negative as is 'ofs'. */
|
|
|
|
float dist;
|
|
|
|
/** Camera view offsets, 1.0 = viewplane moves entire width/height. */
|
|
|
|
float camdx, camdy;
|
|
|
|
/** Runtime only. */
|
|
|
|
float pixsize;
|
|
|
|
/**
|
2021-11-13 03:07:13 +01:00
|
|
|
* View center & orbit pivot, negative of world-space location,
|
|
|
|
* also matches `-viewinv[3][0:3]` in orthographic mode.
|
2019-01-07 12:19:13 +01:00
|
|
|
*/
|
|
|
|
float ofs[3];
|
|
|
|
/** Viewport zoom on the camera frame, see BKE_screen_view3d_zoom_to_fac. */
|
|
|
|
float camzoom;
|
|
|
|
/**
|
2021-06-22 19:42:32 +02:00
|
|
|
* Check if persp/ortho view, since 'persp' can't be used for this since
|
2019-01-07 12:19:13 +01:00
|
|
|
* it can have cameras assigned as well. (only set in #view3d_winmatrix_set)
|
|
|
|
*/
|
|
|
|
char is_persp;
|
2012-03-07 20:42:22 +01:00
|
|
|
char persp;
|
|
|
|
char view;
|
2020-02-09 01:50:25 +01:00
|
|
|
char view_axis_roll;
|
VR: Initial Virtual Reality support - Milestone 1, Scene Inspection
NOTE: While most of the milestone 1 goals are there, a few smaller features and
improvements are still to be done.
Big picture of this milestone: Initial, OpenXR-based virtual reality support
for users and foundation for advanced use cases.
Maniphest Task: https://developer.blender.org/T71347
The tasks contains more information about this milestone.
To be clear: This is not a feature rich VR implementation, it's focused on the
initial scene inspection use case. We intentionally focused on that, further
features like controller support are part of the next milestone.
- How to use?
Instructions on how to use this are here:
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/How_to_Test
These will be updated and moved to a more official place (likely the manual) soon.
Currently Windows Mixed Reality and Oculus devices are usable. Valve/HTC
headsets don't support the OpenXR standard yet and hence, do not work with this
implementation.
---------------
This is the C-side implementation of the features added for initial VR
support as per milestone 1. A "VR Scene Inspection" Add-on will be
committed separately, to expose the VR functionality in the UI. It also
adds some further features for milestone 1, namely a landmarking system
(stored view locations in the VR space)
Main additions/features:
* Support for rendering viewports to an HMD, with good performance.
* Option to sync the VR view perspective with a fully interactive,
regular 3D View (VR-Mirror).
* Option to disable positional tracking. Keeps the current position (calculated
based on the VR eye center pose) when enabled while a VR session is running.
* Some regular viewport settings for the VR view
* RNA/Python-API to query and set VR session state information.
* WM-XR: Layer tying Ghost-XR to the Blender specific APIs/data
* wmSurface API: drawable, non-window container (manages Ghost-OpenGL and GPU
context)
* DNA/RNA for management of VR session settings
* `--debug-xr` and `--debug-xr-time` commandline options
* Utility batch & config file for using the Oculus runtime on Windows.
* Most VR data is runtime only. The exception is user settings which are saved
to files (`XrSessionSettings`).
* VR support can be disabled through the `WITH_XR_OPENXR` compiler flag.
For architecture and code documentation, see
https://wiki.blender.org/wiki/Source/Interface/XR.
---------------
A few thank you's:
* A huge shoutout to Ray Molenkamp for his help during the project - it would
have not been that successful without him!
* Sebastian Koenig and Simeon Conzendorf for testing and feedback!
* The reviewers, especially Brecht Van Lommel!
* Dalai Felinto for pushing and managing me to get this done ;)
* The OpenXR working group for providing an open standard. I think we're the
first bigger application to adopt OpenXR. Congratulations to them and
ourselves :)
This project started as a Google Summer of Code 2019 project - "Core Support of
Virtual Reality Headsets through OpenXR" (see
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/).
Some further information, including ideas for further improvements can be found
in the final GSoC report:
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/Final_Report
Differential Revisions: D6193, D7098
Reviewed by: Brecht Van Lommel, Jeroen Bakker
2020-03-17 20:20:55 +01:00
|
|
|
char viewlock; /* Should usually be accessed with RV3D_LOCK_FLAGS()! */
|
|
|
|
/** Options for runtime only locking (cleared on file read) */
|
|
|
|
char runtime_viewlock; /* Should usually be accessed with RV3D_LOCK_FLAGS()! */
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Options for quadview (store while out of quad view). */
|
|
|
|
char viewlock_quad;
|
VR: Initial Virtual Reality support - Milestone 1, Scene Inspection
NOTE: While most of the milestone 1 goals are there, a few smaller features and
improvements are still to be done.
Big picture of this milestone: Initial, OpenXR-based virtual reality support
for users and foundation for advanced use cases.
Maniphest Task: https://developer.blender.org/T71347
The tasks contains more information about this milestone.
To be clear: This is not a feature rich VR implementation, it's focused on the
initial scene inspection use case. We intentionally focused on that, further
features like controller support are part of the next milestone.
- How to use?
Instructions on how to use this are here:
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/How_to_Test
These will be updated and moved to a more official place (likely the manual) soon.
Currently Windows Mixed Reality and Oculus devices are usable. Valve/HTC
headsets don't support the OpenXR standard yet and hence, do not work with this
implementation.
---------------
This is the C-side implementation of the features added for initial VR
support as per milestone 1. A "VR Scene Inspection" Add-on will be
committed separately, to expose the VR functionality in the UI. It also
adds some further features for milestone 1, namely a landmarking system
(stored view locations in the VR space)
Main additions/features:
* Support for rendering viewports to an HMD, with good performance.
* Option to sync the VR view perspective with a fully interactive,
regular 3D View (VR-Mirror).
* Option to disable positional tracking. Keeps the current position (calculated
based on the VR eye center pose) when enabled while a VR session is running.
* Some regular viewport settings for the VR view
* RNA/Python-API to query and set VR session state information.
* WM-XR: Layer tying Ghost-XR to the Blender specific APIs/data
* wmSurface API: drawable, non-window container (manages Ghost-OpenGL and GPU
context)
* DNA/RNA for management of VR session settings
* `--debug-xr` and `--debug-xr-time` commandline options
* Utility batch & config file for using the Oculus runtime on Windows.
* Most VR data is runtime only. The exception is user settings which are saved
to files (`XrSessionSettings`).
* VR support can be disabled through the `WITH_XR_OPENXR` compiler flag.
For architecture and code documentation, see
https://wiki.blender.org/wiki/Source/Interface/XR.
---------------
A few thank you's:
* A huge shoutout to Ray Molenkamp for his help during the project - it would
have not been that successful without him!
* Sebastian Koenig and Simeon Conzendorf for testing and feedback!
* The reviewers, especially Brecht Van Lommel!
* Dalai Felinto for pushing and managing me to get this done ;)
* The OpenXR working group for providing an open standard. I think we're the
first bigger application to adopt OpenXR. Congratulations to them and
ourselves :)
This project started as a Google Summer of Code 2019 project - "Core Support of
Virtual Reality Headsets through OpenXR" (see
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/).
Some further information, including ideas for further improvements can be found
in the final GSoC report:
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/Final_Report
Differential Revisions: D6193, D7098
Reviewed by: Brecht Van Lommel, Jeroen Bakker
2020-03-17 20:20:55 +01:00
|
|
|
char _pad[1];
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Normalized offset for locked view: (-1, -1) bottom left, (1, 1) upper right. */
|
|
|
|
float ofs_lock[2];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** XXX can easily get rid of this (Julian). */
|
|
|
|
short twdrawflag;
|
2012-03-07 20:42:22 +01:00
|
|
|
short rflag;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Last view (use when switching out of camera view). */
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 17:54:41 +01:00
|
|
|
float lviewquat[4];
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Lpersp can never be set to 'RV3D_CAMOB'. */
|
2020-02-09 01:50:25 +01:00
|
|
|
char lpersp;
|
|
|
|
char lview;
|
|
|
|
char lview_axis_roll;
|
|
|
|
char _pad8[1];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Active rotation from NDOF or elsewhere. */
|
2011-07-26 04:35:46 +02:00
|
|
|
float rot_angle;
|
|
|
|
float rot_axis[3];
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 17:54:41 +01:00
|
|
|
} RegionView3D;
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2018-05-08 14:18:09 +02:00
|
|
|
typedef struct View3DCursor {
|
|
|
|
float location[3];
|
2019-02-25 14:58:35 +01:00
|
|
|
|
|
|
|
float rotation_quaternion[4];
|
|
|
|
float rotation_euler[3];
|
|
|
|
float rotation_axis[3], rotation_angle;
|
|
|
|
short rotation_mode;
|
|
|
|
|
|
|
|
char _pad[6];
|
2018-05-08 14:18:09 +02:00
|
|
|
} View3DCursor;
|
|
|
|
|
2019-04-14 09:58:40 +02:00
|
|
|
/** 3D Viewport Shading settings. */
|
2018-05-05 10:45:15 +02:00
|
|
|
typedef struct View3DShading {
|
2019-07-25 08:51:59 +02:00
|
|
|
/** Shading type (OB_SOLID, ..). */
|
2019-01-07 12:19:13 +01:00
|
|
|
char type;
|
|
|
|
/** Runtime, for toggle between rendered viewport. */
|
|
|
|
char prev_type;
|
2018-11-23 06:25:00 +01:00
|
|
|
char prev_type_wire;
|
2018-07-11 14:20:39 +02:00
|
|
|
|
2018-11-14 13:30:20 +01:00
|
|
|
char color_type;
|
2018-11-23 06:25:00 +01:00
|
|
|
short flag;
|
2018-05-05 10:45:15 +02:00
|
|
|
|
2018-11-14 13:30:20 +01:00
|
|
|
char light;
|
|
|
|
char background_type;
|
2018-11-26 16:49:56 +01:00
|
|
|
char cavity_type;
|
2019-02-22 16:06:13 +01:00
|
|
|
char wire_color_type;
|
2022-11-23 12:26:46 +01:00
|
|
|
|
|
|
|
/** When to preview the compositor output in the viewport. View3DShadingUseCompositor. */
|
|
|
|
char use_compositor;
|
|
|
|
|
|
|
|
char _pad;
|
2018-07-27 15:05:46 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** FILE_MAXFILE. */
|
|
|
|
char studio_light[256];
|
|
|
|
/** FILE_MAXFILE. */
|
|
|
|
char lookdev_light[256];
|
|
|
|
/** FILE_MAXFILE. */
|
|
|
|
char matcap[256];
|
2018-05-05 10:45:15 +02:00
|
|
|
|
2018-05-05 15:09:21 +02:00
|
|
|
float shadow_intensity;
|
2018-05-05 10:45:15 +02:00
|
|
|
float single_color[3];
|
2018-05-16 16:42:30 +02:00
|
|
|
|
|
|
|
float studiolight_rot_z;
|
2018-05-29 13:45:57 +02:00
|
|
|
float studiolight_background;
|
2019-09-04 16:22:47 +02:00
|
|
|
float studiolight_intensity;
|
2020-02-25 13:25:49 +01:00
|
|
|
float studiolight_blur;
|
2018-05-22 14:12:47 +02:00
|
|
|
|
|
|
|
float object_outline_color[3];
|
2018-06-01 17:06:25 +02:00
|
|
|
float xray_alpha;
|
2018-09-26 20:31:14 +02:00
|
|
|
float xray_alpha_wire;
|
2018-06-06 14:47:54 +02:00
|
|
|
|
|
|
|
float cavity_valley_factor;
|
|
|
|
float cavity_ridge_factor;
|
2018-07-27 15:05:46 +02:00
|
|
|
|
|
|
|
float background_color[3];
|
|
|
|
|
2018-11-26 16:49:56 +01:00
|
|
|
float curvature_ridge_factor;
|
|
|
|
float curvature_valley_factor;
|
2019-09-05 12:47:20 +02:00
|
|
|
|
2019-11-08 16:47:33 +01:00
|
|
|
/* Render pass displayed in the viewport. Is an `eScenePassType` where one bit is set */
|
|
|
|
int render_pass;
|
2020-12-04 08:13:54 +01:00
|
|
|
char aov_name[64];
|
2019-11-08 16:47:33 +01:00
|
|
|
|
2019-09-05 12:47:20 +02:00
|
|
|
struct IDProperty *prop;
|
2020-07-06 14:53:39 +02:00
|
|
|
void *_pad2;
|
2018-05-05 10:45:15 +02:00
|
|
|
} View3DShading;
|
|
|
|
|
2019-04-14 09:58:40 +02:00
|
|
|
/** 3D Viewport Overlay settings. */
|
2018-05-05 10:45:15 +02:00
|
|
|
typedef struct View3DOverlay {
|
|
|
|
int flag;
|
2018-05-03 15:09:09 +02:00
|
|
|
|
2019-04-14 09:58:40 +02:00
|
|
|
/** Edit mode settings. */
|
2018-05-03 15:09:09 +02:00
|
|
|
int edit_flag;
|
|
|
|
float normals_length;
|
2021-08-04 10:52:51 +02:00
|
|
|
float normals_constant_screen_size;
|
2018-05-03 15:09:09 +02:00
|
|
|
|
2019-04-14 09:58:40 +02:00
|
|
|
/** Paint mode settings. */
|
2018-05-03 15:09:09 +02:00
|
|
|
int paint_flag;
|
2018-05-07 15:10:11 +02:00
|
|
|
|
2019-04-14 09:58:40 +02:00
|
|
|
/** Weight paint mode settings. */
|
2018-09-27 17:38:07 +02:00
|
|
|
int wpaint_flag;
|
|
|
|
|
2019-04-14 09:58:40 +02:00
|
|
|
/** Alpha for texture, weight, vertex paint overlay. */
|
2018-06-22 10:37:38 +02:00
|
|
|
float texture_paint_mode_opacity;
|
|
|
|
float vertex_paint_mode_opacity;
|
|
|
|
float weight_paint_mode_opacity;
|
2019-04-20 11:58:44 +02:00
|
|
|
float sculpt_mode_mask_opacity;
|
2020-03-05 14:53:23 +01:00
|
|
|
float sculpt_mode_face_sets_opacity;
|
Geometry Nodes: viewport preview
This adds support for showing geometry passed to the Viewer in the 3d
viewport (instead of just in the spreadsheet). The "viewer geometry"
bypasses the group output. So it is not necessary to change the final
output of the node group to be able to see the intermediate geometry.
**Activation and deactivation of a viewer node**
* A viewer node is activated by clicking on it.
* Ctrl+shift+click on any node/socket connects it to the viewer and
makes it active.
* Ctrl+shift+click in empty space deactivates the active viewer.
* When the active viewer is not visible anymore (e.g. another object
is selected, or the current node group is exit), it is deactivated.
* Clicking on the icon in the header of the Viewer node toggles whether
its active or not.
**Pinning**
* The spreadsheet still allows pinning the active viewer as before.
When pinned, the spreadsheet still references the viewer node even
when it becomes inactive.
* The viewport does not support pinning at the moment. It always shows
the active viewer.
**Attribute**
* When a field is linked to the second input of the viewer node it is
displayed as an overlay in the viewport.
* When possible the correct domain for the attribute is determined
automatically. This does not work in all cases. It falls back to the
face corner domain on meshes and the point domain on curves. When
necessary, the domain can be picked manually.
* The spreadsheet now only shows the "Viewer" column for the domain
that is selected in the Viewer node.
* Instance attributes are visualized as a constant color per instance.
**Viewport Options**
* The attribute overlay opacity can be controlled with the "Viewer Node"
setting in the overlays popover.
* A viewport can be configured not to show intermediate viewer-geometry
by disabling the "Viewer Node" option in the "View" menu.
**Implementation Details**
* The "spreadsheet context path" was generalized to a "viewer path" that
is used in more places now.
* The viewer node itself determines the attribute domain, evaluates the
field and stores the result in a `.viewer` attribute.
* A new "viewer attribute' overlay displays the data from the `.viewer`
attribute.
* The ground truth for the active viewer node is stored in the workspace
now. Node editors, spreadsheets and viewports retrieve the active
viewer from there unless they are pinned.
* The depsgraph object iterator has a new "viewer path" setting. When set,
the viewed geometry of the corresponding object is part of the iterator
instead of the final evaluated geometry.
* To support the instance attribute overlay `DupliObject` was extended
to contain the information necessary for drawing the overlay.
* The ctrl+shift+click operator has been refactored so that it can make
existing links to viewers active again.
* The auto-domain-detection in the Viewer node works by checking the
"preferred domain" for every field input. If there is not exactly one
preferred domain, the fallback is used.
Known limitations:
* Loose edges of meshes don't have the attribute overlay. This could be
added separately if necessary.
* Some attributes are hard to visualize as a color directly. For example,
the values might have to be normalized or some should be drawn as arrays.
For now, we encourage users to build node groups that generate appropriate
viewer-geometry. We might include some of that functionality in future versions.
Support for displaying attribute values as text in the viewport is planned as well.
* There seems to be an issue with the attribute overlay for pointclouds on
nvidia gpus, to be investigated.
Differential Revision: https://developer.blender.org/D15954
2022-09-28 17:54:59 +02:00
|
|
|
float viewer_attribute_opacity;
|
2018-06-22 10:37:38 +02:00
|
|
|
|
2019-04-14 09:58:40 +02:00
|
|
|
/** Armature edit/pose mode settings. */
|
2018-11-23 03:46:40 +01:00
|
|
|
float xray_alpha_bone;
|
2022-01-06 13:42:45 +01:00
|
|
|
float bone_wire_alpha;
|
2018-06-05 19:35:08 +02:00
|
|
|
|
2020-09-18 19:20:22 +02:00
|
|
|
/** Darken Inactive. */
|
|
|
|
float fade_alpha;
|
|
|
|
|
2019-04-14 09:58:40 +02:00
|
|
|
/** Other settings. */
|
2018-06-07 09:18:57 +02:00
|
|
|
float wireframe_threshold;
|
2020-11-13 08:07:07 +01:00
|
|
|
float wireframe_opacity;
|
2023-03-03 00:35:45 +01:00
|
|
|
float retopology_offset;
|
2018-06-22 10:37:38 +02:00
|
|
|
|
2019-04-14 09:58:40 +02:00
|
|
|
/** Grease pencil settings. */
|
2018-07-31 10:22:19 +02:00
|
|
|
float gpencil_paper_opacity;
|
|
|
|
float gpencil_grid_opacity;
|
2018-10-30 17:53:30 +01:00
|
|
|
float gpencil_fade_layer;
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
/** Factor for mixing vertex paint with original color */
|
|
|
|
float gpencil_vertex_paint_opacity;
|
2020-05-26 10:37:47 +02:00
|
|
|
/** Handles display type for curves. */
|
|
|
|
int handle_display;
|
2023-02-14 18:10:11 +01:00
|
|
|
|
|
|
|
/** Curves sculpt mode settings. */
|
|
|
|
float sculpt_curves_cage_opacity;
|
2018-05-05 10:45:15 +02:00
|
|
|
} View3DOverlay;
|
|
|
|
|
2021-12-20 08:58:37 +01:00
|
|
|
/** #View3DOverlay.handle_display */
|
2020-05-26 10:37:47 +02:00
|
|
|
typedef enum eHandleDisplay {
|
|
|
|
/* Display only selected points. */
|
|
|
|
CURVE_HANDLE_SELECTED = 0,
|
|
|
|
/* Display all handles. */
|
|
|
|
CURVE_HANDLE_ALL = 1,
|
|
|
|
/* No display handles. */
|
|
|
|
CURVE_HANDLE_NONE = 2,
|
|
|
|
} eHandleDisplay;
|
|
|
|
|
2019-04-13 15:20:15 +02:00
|
|
|
typedef struct View3D_Runtime {
|
|
|
|
/** Nkey panel stores stuff here. */
|
|
|
|
void *properties_storage;
|
2023-08-25 18:36:04 +02:00
|
|
|
void (*properties_storage_free)(void *properties_storage);
|
VR: Initial Virtual Reality support - Milestone 1, Scene Inspection
NOTE: While most of the milestone 1 goals are there, a few smaller features and
improvements are still to be done.
Big picture of this milestone: Initial, OpenXR-based virtual reality support
for users and foundation for advanced use cases.
Maniphest Task: https://developer.blender.org/T71347
The tasks contains more information about this milestone.
To be clear: This is not a feature rich VR implementation, it's focused on the
initial scene inspection use case. We intentionally focused on that, further
features like controller support are part of the next milestone.
- How to use?
Instructions on how to use this are here:
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/How_to_Test
These will be updated and moved to a more official place (likely the manual) soon.
Currently Windows Mixed Reality and Oculus devices are usable. Valve/HTC
headsets don't support the OpenXR standard yet and hence, do not work with this
implementation.
---------------
This is the C-side implementation of the features added for initial VR
support as per milestone 1. A "VR Scene Inspection" Add-on will be
committed separately, to expose the VR functionality in the UI. It also
adds some further features for milestone 1, namely a landmarking system
(stored view locations in the VR space)
Main additions/features:
* Support for rendering viewports to an HMD, with good performance.
* Option to sync the VR view perspective with a fully interactive,
regular 3D View (VR-Mirror).
* Option to disable positional tracking. Keeps the current position (calculated
based on the VR eye center pose) when enabled while a VR session is running.
* Some regular viewport settings for the VR view
* RNA/Python-API to query and set VR session state information.
* WM-XR: Layer tying Ghost-XR to the Blender specific APIs/data
* wmSurface API: drawable, non-window container (manages Ghost-OpenGL and GPU
context)
* DNA/RNA for management of VR session settings
* `--debug-xr` and `--debug-xr-time` commandline options
* Utility batch & config file for using the Oculus runtime on Windows.
* Most VR data is runtime only. The exception is user settings which are saved
to files (`XrSessionSettings`).
* VR support can be disabled through the `WITH_XR_OPENXR` compiler flag.
For architecture and code documentation, see
https://wiki.blender.org/wiki/Source/Interface/XR.
---------------
A few thank you's:
* A huge shoutout to Ray Molenkamp for his help during the project - it would
have not been that successful without him!
* Sebastian Koenig and Simeon Conzendorf for testing and feedback!
* The reviewers, especially Brecht Van Lommel!
* Dalai Felinto for pushing and managing me to get this done ;)
* The OpenXR working group for providing an open standard. I think we're the
first bigger application to adopt OpenXR. Congratulations to them and
ourselves :)
This project started as a Google Summer of Code 2019 project - "Core Support of
Virtual Reality Headsets through OpenXR" (see
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/).
Some further information, including ideas for further improvements can be found
in the final GSoC report:
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/Final_Report
Differential Revisions: D6193, D7098
Reviewed by: Brecht Van Lommel, Jeroen Bakker
2020-03-17 20:20:55 +01:00
|
|
|
/** Runtime only flags. */
|
|
|
|
int flag;
|
|
|
|
|
|
|
|
char _pad1[4];
|
2021-07-05 04:47:46 +02:00
|
|
|
/* Only used for overlay stats while in local-view. */
|
2021-06-16 04:01:53 +02:00
|
|
|
struct SceneStats *local_stats;
|
2019-04-13 15:20:15 +02:00
|
|
|
} View3D_Runtime;
|
|
|
|
|
2019-04-14 09:58:40 +02:00
|
|
|
/** 3D ViewPort Struct. */
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 17:54:41 +01:00
|
|
|
typedef struct View3D {
|
2022-11-23 17:15:33 +01:00
|
|
|
DNA_DEFINE_CXX_METHODS(View3D)
|
|
|
|
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 17:54:41 +01:00
|
|
|
struct SpaceLink *next, *prev;
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Storage of regions for inactive spaces. */
|
|
|
|
ListBase regionbase;
|
2018-06-03 10:59:48 +02:00
|
|
|
char spacetype;
|
|
|
|
char link_flag;
|
|
|
|
char _pad0[6];
|
|
|
|
/* End 'SpaceLink' header. */
|
2011-12-04 07:05:48 +01:00
|
|
|
|
|
|
|
float viewquat[4] DNA_DEPRECATED;
|
|
|
|
float dist DNA_DEPRECATED;
|
2011-11-07 13:55:18 +01:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Size of bundles in reconstructed data. */
|
|
|
|
float bundle_size;
|
|
|
|
/** Display style for bundle. */
|
|
|
|
char bundle_drawtype;
|
2019-04-13 20:36:53 +02:00
|
|
|
|
2019-04-14 13:11:17 +02:00
|
|
|
char drawtype DNA_DEPRECATED;
|
2019-04-13 20:36:53 +02:00
|
|
|
|
|
|
|
char _pad3[1];
|
2013-05-23 23:14:17 +02:00
|
|
|
|
2019-02-13 09:12:43 +01:00
|
|
|
/** Multiview current eye - for internal use. */
|
|
|
|
char multiview_eye;
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2018-07-06 17:43:53 +02:00
|
|
|
int object_type_exclude_viewport;
|
|
|
|
int object_type_exclude_select;
|
|
|
|
|
2011-12-04 07:05:48 +01:00
|
|
|
short persp DNA_DEPRECATED;
|
|
|
|
short view DNA_DEPRECATED;
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2020-03-17 01:32:03 +01:00
|
|
|
struct Object *camera, *ob_center;
|
2012-10-16 13:57:46 +02:00
|
|
|
rctf render_border;
|
2010-01-19 23:44:43 +01:00
|
|
|
|
2022-01-24 05:34:56 +01:00
|
|
|
/** Allocated backup of itself while in local-view. */
|
2019-01-07 12:19:13 +01:00
|
|
|
struct View3D *localvd;
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Optional string for armature bone to define center, MAXBONENAME. */
|
2020-03-17 01:32:03 +01:00
|
|
|
char ob_center_bone[64];
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2024-01-23 06:06:45 +01:00
|
|
|
unsigned short local_view_uid;
|
2019-04-14 13:11:17 +02:00
|
|
|
char _pad6[2];
|
2018-09-04 15:08:57 +02:00
|
|
|
int layact DNA_DEPRECATED;
|
2024-01-23 06:06:45 +01:00
|
|
|
unsigned short local_collections_uid;
|
2022-09-02 18:30:48 +02:00
|
|
|
short _pad7[2];
|
|
|
|
|
|
|
|
short debug_flag;
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Optional bool for 3d cursor to define center. */
|
2020-03-17 01:32:03 +01:00
|
|
|
short ob_center_cursor;
|
2018-08-01 00:42:00 +02:00
|
|
|
short scenelock;
|
|
|
|
short gp_flag;
|
2018-08-01 00:08:59 +02:00
|
|
|
short flag;
|
|
|
|
int flag2;
|
2018-06-17 17:04:09 +02:00
|
|
|
|
2009-12-27 19:09:17 +01:00
|
|
|
float lens, grid;
|
2019-02-16 02:21:44 +01:00
|
|
|
float clip_start, clip_end;
|
2019-01-07 12:19:13 +01:00
|
|
|
float ofs[3] DNA_DEPRECATED;
|
2018-05-08 14:18:09 +02:00
|
|
|
|
2019-04-14 13:11:17 +02:00
|
|
|
char _pad[1];
|
|
|
|
|
|
|
|
/** Transform gizmo info. */
|
|
|
|
/** #V3D_GIZMO_SHOW_* */
|
|
|
|
char gizmo_flag;
|
|
|
|
|
|
|
|
char gizmo_show_object;
|
|
|
|
char gizmo_show_armature;
|
|
|
|
char gizmo_show_empty;
|
|
|
|
char gizmo_show_light;
|
|
|
|
char gizmo_show_camera;
|
|
|
|
|
|
|
|
char gridflag;
|
2013-05-23 23:14:17 +02:00
|
|
|
|
2011-05-15 05:42:28 +02:00
|
|
|
short gridlines;
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Number of subdivisions in the grid between each highlighted grid line. */
|
|
|
|
short gridsubdiv;
|
2015-04-06 15:40:12 +02:00
|
|
|
|
2019-04-14 09:58:40 +02:00
|
|
|
/** Actually only used to define the opacity of the grease pencil vertex in edit mode. */
|
2018-08-01 00:42:00 +02:00
|
|
|
float vertex_opacity;
|
2011-07-21 23:40:04 +02:00
|
|
|
|
2011-12-04 07:05:48 +01:00
|
|
|
/* XXX deprecated? */
|
2019-01-07 12:19:13 +01:00
|
|
|
/** Grease-Pencil Data (annotation layers). */
|
|
|
|
struct bGPdata *gpd DNA_DEPRECATED;
|
2006-04-25 14:26:46 +02:00
|
|
|
|
2019-04-14 09:58:40 +02:00
|
|
|
/** Stereoscopy settings. */
|
2015-04-06 15:40:12 +02:00
|
|
|
short stereo3d_flag;
|
|
|
|
char stereo3d_camera;
|
2019-02-27 05:07:50 +01:00
|
|
|
char _pad4;
|
2015-04-06 15:40:12 +02:00
|
|
|
float stereo3d_convergence_factor;
|
|
|
|
float stereo3d_volume_alpha;
|
|
|
|
float stereo3d_convergence_alpha;
|
2016-05-22 15:44:18 +02:00
|
|
|
|
2019-04-14 09:58:40 +02:00
|
|
|
/** Display settings. */
|
2018-05-05 10:45:15 +02:00
|
|
|
View3DShading shading;
|
|
|
|
View3DOverlay overlay;
|
2019-04-13 15:20:15 +02:00
|
|
|
|
Geometry Nodes: viewport preview
This adds support for showing geometry passed to the Viewer in the 3d
viewport (instead of just in the spreadsheet). The "viewer geometry"
bypasses the group output. So it is not necessary to change the final
output of the node group to be able to see the intermediate geometry.
**Activation and deactivation of a viewer node**
* A viewer node is activated by clicking on it.
* Ctrl+shift+click on any node/socket connects it to the viewer and
makes it active.
* Ctrl+shift+click in empty space deactivates the active viewer.
* When the active viewer is not visible anymore (e.g. another object
is selected, or the current node group is exit), it is deactivated.
* Clicking on the icon in the header of the Viewer node toggles whether
its active or not.
**Pinning**
* The spreadsheet still allows pinning the active viewer as before.
When pinned, the spreadsheet still references the viewer node even
when it becomes inactive.
* The viewport does not support pinning at the moment. It always shows
the active viewer.
**Attribute**
* When a field is linked to the second input of the viewer node it is
displayed as an overlay in the viewport.
* When possible the correct domain for the attribute is determined
automatically. This does not work in all cases. It falls back to the
face corner domain on meshes and the point domain on curves. When
necessary, the domain can be picked manually.
* The spreadsheet now only shows the "Viewer" column for the domain
that is selected in the Viewer node.
* Instance attributes are visualized as a constant color per instance.
**Viewport Options**
* The attribute overlay opacity can be controlled with the "Viewer Node"
setting in the overlays popover.
* A viewport can be configured not to show intermediate viewer-geometry
by disabling the "Viewer Node" option in the "View" menu.
**Implementation Details**
* The "spreadsheet context path" was generalized to a "viewer path" that
is used in more places now.
* The viewer node itself determines the attribute domain, evaluates the
field and stores the result in a `.viewer` attribute.
* A new "viewer attribute' overlay displays the data from the `.viewer`
attribute.
* The ground truth for the active viewer node is stored in the workspace
now. Node editors, spreadsheets and viewports retrieve the active
viewer from there unless they are pinned.
* The depsgraph object iterator has a new "viewer path" setting. When set,
the viewed geometry of the corresponding object is part of the iterator
instead of the final evaluated geometry.
* To support the instance attribute overlay `DupliObject` was extended
to contain the information necessary for drawing the overlay.
* The ctrl+shift+click operator has been refactored so that it can make
existing links to viewers active again.
* The auto-domain-detection in the Viewer node works by checking the
"preferred domain" for every field input. If there is not exactly one
preferred domain, the fallback is used.
Known limitations:
* Loose edges of meshes don't have the attribute overlay. This could be
added separately if necessary.
* Some attributes are hard to visualize as a color directly. For example,
the values might have to be normalized or some should be drawn as arrays.
For now, we encourage users to build node groups that generate appropriate
viewer-geometry. We might include some of that functionality in future versions.
Support for displaying attribute values as text in the viewport is planned as well.
* There seems to be an issue with the attribute overlay for pointclouds on
nvidia gpus, to be investigated.
Differential Revision: https://developer.blender.org/D15954
2022-09-28 17:54:59 +02:00
|
|
|
/** Path to the viewer node that is currently previewed. This is retrieved from the workspace. */
|
|
|
|
ViewerPath viewer_path;
|
|
|
|
|
2019-04-13 15:20:15 +02:00
|
|
|
/** Runtime evaluation data (keep last). */
|
|
|
|
View3D_Runtime runtime;
|
2002-10-12 13:37:38 +02:00
|
|
|
} View3D;
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #View3D::stereo3d_flag */
|
|
|
|
enum {
|
|
|
|
V3D_S3D_DISPCAMERAS = 1 << 0,
|
|
|
|
V3D_S3D_DISPPLANE = 1 << 1,
|
|
|
|
V3D_S3D_DISPVOLUME = 1 << 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #View3D::flag */
|
|
|
|
enum {
|
|
|
|
V3D_LOCAL_COLLECTIONS = 1 << 0,
|
|
|
|
V3D_FLAG_UNUSED_1 = 1 << 1, /* cleared */
|
|
|
|
V3D_HIDE_HELPLINES = 1 << 2,
|
|
|
|
V3D_FLAG_UNUSED_2 = 1 << 3, /* cleared */
|
|
|
|
V3D_XR_SESSION_MIRROR = 1 << 4,
|
|
|
|
V3D_XR_SESSION_SURFACE = 1 << 5,
|
|
|
|
|
|
|
|
V3D_FLAG_UNUSED_10 = 1 << 10, /* cleared */
|
|
|
|
V3D_SELECT_OUTLINE = 1 << 11,
|
|
|
|
V3D_FLAG_UNUSED_12 = 1 << 12, /* cleared */
|
|
|
|
V3D_GLOBAL_STATS = 1 << 13,
|
|
|
|
V3D_DRAW_CENTERS = 1 << 15,
|
|
|
|
};
|
2002-10-12 13:37:38 +02:00
|
|
|
|
VR: Initial Virtual Reality support - Milestone 1, Scene Inspection
NOTE: While most of the milestone 1 goals are there, a few smaller features and
improvements are still to be done.
Big picture of this milestone: Initial, OpenXR-based virtual reality support
for users and foundation for advanced use cases.
Maniphest Task: https://developer.blender.org/T71347
The tasks contains more information about this milestone.
To be clear: This is not a feature rich VR implementation, it's focused on the
initial scene inspection use case. We intentionally focused on that, further
features like controller support are part of the next milestone.
- How to use?
Instructions on how to use this are here:
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/How_to_Test
These will be updated and moved to a more official place (likely the manual) soon.
Currently Windows Mixed Reality and Oculus devices are usable. Valve/HTC
headsets don't support the OpenXR standard yet and hence, do not work with this
implementation.
---------------
This is the C-side implementation of the features added for initial VR
support as per milestone 1. A "VR Scene Inspection" Add-on will be
committed separately, to expose the VR functionality in the UI. It also
adds some further features for milestone 1, namely a landmarking system
(stored view locations in the VR space)
Main additions/features:
* Support for rendering viewports to an HMD, with good performance.
* Option to sync the VR view perspective with a fully interactive,
regular 3D View (VR-Mirror).
* Option to disable positional tracking. Keeps the current position (calculated
based on the VR eye center pose) when enabled while a VR session is running.
* Some regular viewport settings for the VR view
* RNA/Python-API to query and set VR session state information.
* WM-XR: Layer tying Ghost-XR to the Blender specific APIs/data
* wmSurface API: drawable, non-window container (manages Ghost-OpenGL and GPU
context)
* DNA/RNA for management of VR session settings
* `--debug-xr` and `--debug-xr-time` commandline options
* Utility batch & config file for using the Oculus runtime on Windows.
* Most VR data is runtime only. The exception is user settings which are saved
to files (`XrSessionSettings`).
* VR support can be disabled through the `WITH_XR_OPENXR` compiler flag.
For architecture and code documentation, see
https://wiki.blender.org/wiki/Source/Interface/XR.
---------------
A few thank you's:
* A huge shoutout to Ray Molenkamp for his help during the project - it would
have not been that successful without him!
* Sebastian Koenig and Simeon Conzendorf for testing and feedback!
* The reviewers, especially Brecht Van Lommel!
* Dalai Felinto for pushing and managing me to get this done ;)
* The OpenXR working group for providing an open standard. I think we're the
first bigger application to adopt OpenXR. Congratulations to them and
ourselves :)
This project started as a Google Summer of Code 2019 project - "Core Support of
Virtual Reality Headsets through OpenXR" (see
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/).
Some further information, including ideas for further improvements can be found
in the final GSoC report:
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/Final_Report
Differential Revisions: D6193, D7098
Reviewed by: Brecht Van Lommel, Jeroen Bakker
2020-03-17 20:20:55 +01:00
|
|
|
/** #View3D_Runtime.flag */
|
|
|
|
enum {
|
|
|
|
/** The 3D view which the XR session was created in is flagged with this. */
|
|
|
|
V3D_RUNTIME_XR_SESSION_ROOT = (1 << 0),
|
2021-03-30 21:23:58 +02:00
|
|
|
/** Some operators override the depth buffer for dedicated occlusion operations. */
|
|
|
|
V3D_RUNTIME_DEPTHBUF_OVERRIDDEN = (1 << 1),
|
VR: Initial Virtual Reality support - Milestone 1, Scene Inspection
NOTE: While most of the milestone 1 goals are there, a few smaller features and
improvements are still to be done.
Big picture of this milestone: Initial, OpenXR-based virtual reality support
for users and foundation for advanced use cases.
Maniphest Task: https://developer.blender.org/T71347
The tasks contains more information about this milestone.
To be clear: This is not a feature rich VR implementation, it's focused on the
initial scene inspection use case. We intentionally focused on that, further
features like controller support are part of the next milestone.
- How to use?
Instructions on how to use this are here:
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/How_to_Test
These will be updated and moved to a more official place (likely the manual) soon.
Currently Windows Mixed Reality and Oculus devices are usable. Valve/HTC
headsets don't support the OpenXR standard yet and hence, do not work with this
implementation.
---------------
This is the C-side implementation of the features added for initial VR
support as per milestone 1. A "VR Scene Inspection" Add-on will be
committed separately, to expose the VR functionality in the UI. It also
adds some further features for milestone 1, namely a landmarking system
(stored view locations in the VR space)
Main additions/features:
* Support for rendering viewports to an HMD, with good performance.
* Option to sync the VR view perspective with a fully interactive,
regular 3D View (VR-Mirror).
* Option to disable positional tracking. Keeps the current position (calculated
based on the VR eye center pose) when enabled while a VR session is running.
* Some regular viewport settings for the VR view
* RNA/Python-API to query and set VR session state information.
* WM-XR: Layer tying Ghost-XR to the Blender specific APIs/data
* wmSurface API: drawable, non-window container (manages Ghost-OpenGL and GPU
context)
* DNA/RNA for management of VR session settings
* `--debug-xr` and `--debug-xr-time` commandline options
* Utility batch & config file for using the Oculus runtime on Windows.
* Most VR data is runtime only. The exception is user settings which are saved
to files (`XrSessionSettings`).
* VR support can be disabled through the `WITH_XR_OPENXR` compiler flag.
For architecture and code documentation, see
https://wiki.blender.org/wiki/Source/Interface/XR.
---------------
A few thank you's:
* A huge shoutout to Ray Molenkamp for his help during the project - it would
have not been that successful without him!
* Sebastian Koenig and Simeon Conzendorf for testing and feedback!
* The reviewers, especially Brecht Van Lommel!
* Dalai Felinto for pushing and managing me to get this done ;)
* The OpenXR working group for providing an open standard. I think we're the
first bigger application to adopt OpenXR. Congratulations to them and
ourselves :)
This project started as a Google Summer of Code 2019 project - "Core Support of
Virtual Reality Headsets through OpenXR" (see
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/).
Some further information, including ideas for further improvements can be found
in the final GSoC report:
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/Final_Report
Differential Revisions: D6193, D7098
Reviewed by: Brecht Van Lommel, Jeroen Bakker
2020-03-17 20:20:55 +01:00
|
|
|
};
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #RegionView3D::persp */
|
|
|
|
enum {
|
|
|
|
RV3D_ORTHO = 0,
|
|
|
|
RV3D_PERSP = 1,
|
|
|
|
RV3D_CAMOB = 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #RegionView3D::rflag */
|
|
|
|
enum {
|
|
|
|
RV3D_CLIPPING = 1 << 2,
|
|
|
|
RV3D_NAVIGATING = 1 << 3,
|
|
|
|
RV3D_GPULIGHT_UPDATE = 1 << 4,
|
|
|
|
RV3D_PAINTING = 1 << 5,
|
|
|
|
// RV3D_IS_GAME_ENGINE = 1 << 5, /* UNUSED */
|
|
|
|
/**
|
|
|
|
* Disable Z-buffer offset, skip calls to #ED_view3d_polygon_offset.
|
|
|
|
* Use when precise surface depth is needed and picking bias isn't, see #45434).
|
|
|
|
*/
|
|
|
|
RV3D_ZOFFSET_DISABLED = 1 << 6,
|
|
|
|
};
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 17:54:41 +01:00
|
|
|
|
2019-04-14 09:58:40 +02:00
|
|
|
/** #RegionView3D.viewlock */
|
VR: Initial Virtual Reality support - Milestone 1, Scene Inspection
NOTE: While most of the milestone 1 goals are there, a few smaller features and
improvements are still to be done.
Big picture of this milestone: Initial, OpenXR-based virtual reality support
for users and foundation for advanced use cases.
Maniphest Task: https://developer.blender.org/T71347
The tasks contains more information about this milestone.
To be clear: This is not a feature rich VR implementation, it's focused on the
initial scene inspection use case. We intentionally focused on that, further
features like controller support are part of the next milestone.
- How to use?
Instructions on how to use this are here:
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/How_to_Test
These will be updated and moved to a more official place (likely the manual) soon.
Currently Windows Mixed Reality and Oculus devices are usable. Valve/HTC
headsets don't support the OpenXR standard yet and hence, do not work with this
implementation.
---------------
This is the C-side implementation of the features added for initial VR
support as per milestone 1. A "VR Scene Inspection" Add-on will be
committed separately, to expose the VR functionality in the UI. It also
adds some further features for milestone 1, namely a landmarking system
(stored view locations in the VR space)
Main additions/features:
* Support for rendering viewports to an HMD, with good performance.
* Option to sync the VR view perspective with a fully interactive,
regular 3D View (VR-Mirror).
* Option to disable positional tracking. Keeps the current position (calculated
based on the VR eye center pose) when enabled while a VR session is running.
* Some regular viewport settings for the VR view
* RNA/Python-API to query and set VR session state information.
* WM-XR: Layer tying Ghost-XR to the Blender specific APIs/data
* wmSurface API: drawable, non-window container (manages Ghost-OpenGL and GPU
context)
* DNA/RNA for management of VR session settings
* `--debug-xr` and `--debug-xr-time` commandline options
* Utility batch & config file for using the Oculus runtime on Windows.
* Most VR data is runtime only. The exception is user settings which are saved
to files (`XrSessionSettings`).
* VR support can be disabled through the `WITH_XR_OPENXR` compiler flag.
For architecture and code documentation, see
https://wiki.blender.org/wiki/Source/Interface/XR.
---------------
A few thank you's:
* A huge shoutout to Ray Molenkamp for his help during the project - it would
have not been that successful without him!
* Sebastian Koenig and Simeon Conzendorf for testing and feedback!
* The reviewers, especially Brecht Van Lommel!
* Dalai Felinto for pushing and managing me to get this done ;)
* The OpenXR working group for providing an open standard. I think we're the
first bigger application to adopt OpenXR. Congratulations to them and
ourselves :)
This project started as a Google Summer of Code 2019 project - "Core Support of
Virtual Reality Headsets through OpenXR" (see
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/).
Some further information, including ideas for further improvements can be found
in the final GSoC report:
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/Final_Report
Differential Revisions: D6193, D7098
Reviewed by: Brecht Van Lommel, Jeroen Bakker
2020-03-17 20:20:55 +01:00
|
|
|
enum {
|
|
|
|
RV3D_LOCK_ROTATION = (1 << 0),
|
|
|
|
RV3D_BOXVIEW = (1 << 1),
|
|
|
|
RV3D_BOXCLIP = (1 << 2),
|
|
|
|
RV3D_LOCK_LOCATION = (1 << 3),
|
|
|
|
RV3D_LOCK_ZOOM_AND_DOLLY = (1 << 4),
|
|
|
|
|
|
|
|
RV3D_LOCK_ANY_TRANSFORM = (RV3D_LOCK_LOCATION | RV3D_LOCK_ROTATION | RV3D_LOCK_ZOOM_AND_DOLLY),
|
|
|
|
};
|
|
|
|
|
2022-01-06 03:54:52 +01:00
|
|
|
/** Bit-wise OR of the regular lock-flags with runtime only lock-flags. */
|
VR: Initial Virtual Reality support - Milestone 1, Scene Inspection
NOTE: While most of the milestone 1 goals are there, a few smaller features and
improvements are still to be done.
Big picture of this milestone: Initial, OpenXR-based virtual reality support
for users and foundation for advanced use cases.
Maniphest Task: https://developer.blender.org/T71347
The tasks contains more information about this milestone.
To be clear: This is not a feature rich VR implementation, it's focused on the
initial scene inspection use case. We intentionally focused on that, further
features like controller support are part of the next milestone.
- How to use?
Instructions on how to use this are here:
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/How_to_Test
These will be updated and moved to a more official place (likely the manual) soon.
Currently Windows Mixed Reality and Oculus devices are usable. Valve/HTC
headsets don't support the OpenXR standard yet and hence, do not work with this
implementation.
---------------
This is the C-side implementation of the features added for initial VR
support as per milestone 1. A "VR Scene Inspection" Add-on will be
committed separately, to expose the VR functionality in the UI. It also
adds some further features for milestone 1, namely a landmarking system
(stored view locations in the VR space)
Main additions/features:
* Support for rendering viewports to an HMD, with good performance.
* Option to sync the VR view perspective with a fully interactive,
regular 3D View (VR-Mirror).
* Option to disable positional tracking. Keeps the current position (calculated
based on the VR eye center pose) when enabled while a VR session is running.
* Some regular viewport settings for the VR view
* RNA/Python-API to query and set VR session state information.
* WM-XR: Layer tying Ghost-XR to the Blender specific APIs/data
* wmSurface API: drawable, non-window container (manages Ghost-OpenGL and GPU
context)
* DNA/RNA for management of VR session settings
* `--debug-xr` and `--debug-xr-time` commandline options
* Utility batch & config file for using the Oculus runtime on Windows.
* Most VR data is runtime only. The exception is user settings which are saved
to files (`XrSessionSettings`).
* VR support can be disabled through the `WITH_XR_OPENXR` compiler flag.
For architecture and code documentation, see
https://wiki.blender.org/wiki/Source/Interface/XR.
---------------
A few thank you's:
* A huge shoutout to Ray Molenkamp for his help during the project - it would
have not been that successful without him!
* Sebastian Koenig and Simeon Conzendorf for testing and feedback!
* The reviewers, especially Brecht Van Lommel!
* Dalai Felinto for pushing and managing me to get this done ;)
* The OpenXR working group for providing an open standard. I think we're the
first bigger application to adopt OpenXR. Congratulations to them and
ourselves :)
This project started as a Google Summer of Code 2019 project - "Core Support of
Virtual Reality Headsets through OpenXR" (see
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/).
Some further information, including ideas for further improvements can be found
in the final GSoC report:
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/Final_Report
Differential Revisions: D6193, D7098
Reviewed by: Brecht Van Lommel, Jeroen Bakker
2020-03-17 20:20:55 +01:00
|
|
|
#define RV3D_LOCK_FLAGS(rv3d) ((rv3d)->viewlock | ((rv3d)->runtime_viewlock))
|
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #RegionView3D::viewlock_quad */
|
|
|
|
enum {
|
|
|
|
RV3D_VIEWLOCK_INIT = 1 << 7,
|
|
|
|
};
|
2009-01-20 15:23:32 +01:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #RegionView3D::view */
|
|
|
|
enum {
|
|
|
|
RV3D_VIEW_USER = 0,
|
|
|
|
RV3D_VIEW_FRONT = 1,
|
|
|
|
RV3D_VIEW_BACK = 2,
|
|
|
|
RV3D_VIEW_LEFT = 3,
|
|
|
|
RV3D_VIEW_RIGHT = 4,
|
|
|
|
RV3D_VIEW_TOP = 5,
|
|
|
|
RV3D_VIEW_BOTTOM = 6,
|
|
|
|
RV3D_VIEW_CAMERA = 8,
|
|
|
|
};
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-05-31 16:19:01 +02:00
|
|
|
#define RV3D_VIEW_IS_AXIS(view) (((view) >= RV3D_VIEW_FRONT) && ((view) <= RV3D_VIEW_BOTTOM))
|
2020-02-09 01:50:25 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* #RegionView3D.view_axis_roll
|
|
|
|
*
|
|
|
|
* Clockwise rotation to use for axis-views, when #RV3D_VIEW_IS_AXIS is true.
|
|
|
|
*/
|
|
|
|
enum {
|
|
|
|
RV3D_VIEW_AXIS_ROLL_0 = 0,
|
|
|
|
RV3D_VIEW_AXIS_ROLL_90 = 1,
|
|
|
|
RV3D_VIEW_AXIS_ROLL_180 = 2,
|
|
|
|
RV3D_VIEW_AXIS_ROLL_270 = 3,
|
|
|
|
};
|
|
|
|
|
2019-12-10 15:18:16 +01:00
|
|
|
#define RV3D_CLIPPING_ENABLED(v3d, rv3d) \
|
2020-04-05 05:53:24 +02:00
|
|
|
((rv3d) && (v3d) && ((rv3d)->rflag & RV3D_CLIPPING) && \
|
|
|
|
ELEM((v3d)->shading.type, OB_WIRE, OB_SOLID) && (rv3d)->clipbb)
|
2013-11-25 02:53:40 +01:00
|
|
|
|
2023-06-26 04:09:49 +02:00
|
|
|
/** #View3D::flag2 (int) */
|
|
|
|
enum {
|
|
|
|
V3D_HIDE_OVERLAYS = 1 << 2,
|
|
|
|
V3D_SHOW_VIEWER = 1 << 3,
|
|
|
|
V3D_SHOW_ANNOTATION = 1 << 4,
|
|
|
|
V3D_LOCK_CAMERA = 1 << 5,
|
|
|
|
V3D_FLAG2_UNUSED_6 = 1 << 6, /* cleared */
|
|
|
|
V3D_SHOW_RECONSTRUCTION = 1 << 7,
|
|
|
|
V3D_SHOW_CAMERAPATH = 1 << 8,
|
|
|
|
V3D_SHOW_BUNDLENAME = 1 << 9,
|
|
|
|
V3D_FLAG2_UNUSED_10 = 1 << 10, /* cleared */
|
|
|
|
V3D_RENDER_BORDER = 1 << 11,
|
|
|
|
V3D_FLAG2_UNUSED_12 = 1 << 12, /* cleared */
|
|
|
|
V3D_FLAG2_UNUSED_13 = 1 << 13, /* cleared */
|
|
|
|
V3D_FLAG2_UNUSED_14 = 1 << 14, /* cleared */
|
|
|
|
V3D_FLAG2_UNUSED_15 = 1 << 15, /* cleared */
|
|
|
|
V3D_XR_SHOW_CONTROLLERS = 1 << 16,
|
|
|
|
V3D_XR_SHOW_CUSTOM_OVERLAYS = 1 << 17,
|
|
|
|
};
|
|
|
|
|
|
|
|
/** #View3D::gp_flag (short) */
|
|
|
|
enum {
|
|
|
|
/** Fade all non GP objects. */
|
|
|
|
V3D_GP_FADE_OBJECTS = 1 << 0,
|
|
|
|
/** Activate paper grid. */
|
|
|
|
V3D_GP_SHOW_GRID = 1 << 1,
|
|
|
|
V3D_GP_SHOW_EDIT_LINES = 1 << 2,
|
|
|
|
V3D_GP_SHOW_MULTIEDIT_LINES = 1 << 3,
|
|
|
|
/** main switch at view level. */
|
|
|
|
V3D_GP_SHOW_ONION_SKIN = 1 << 4,
|
|
|
|
/** fade layers not active. */
|
|
|
|
V3D_GP_FADE_NOACTIVE_LAYERS = 1 << 5,
|
|
|
|
/** Fade other GPencil objects. */
|
|
|
|
V3D_GP_FADE_NOACTIVE_GPENCIL = 1 << 6,
|
|
|
|
/** Show Strokes Directions. */
|
|
|
|
V3D_GP_SHOW_STROKE_DIRECTION = 1 << 7,
|
|
|
|
/** Show Material names. */
|
|
|
|
V3D_GP_SHOW_MATERIAL_NAME = 1 << 8,
|
|
|
|
/** Show Canvas Grid on Top. */
|
|
|
|
V3D_GP_SHOW_GRID_XRAY = 1 << 9,
|
|
|
|
};
|
2016-10-07 03:33:50 +02:00
|
|
|
|
2019-04-14 09:58:40 +02:00
|
|
|
/** #View3DShading.flag */
|
2018-05-05 10:45:15 +02:00
|
|
|
enum {
|
2018-05-30 14:40:57 +02:00
|
|
|
V3D_SHADING_OBJECT_OUTLINE = (1 << 0),
|
|
|
|
V3D_SHADING_XRAY = (1 << 1),
|
|
|
|
V3D_SHADING_SHADOW = (1 << 2),
|
2018-07-06 18:53:51 +02:00
|
|
|
V3D_SHADING_SCENE_LIGHTS = (1 << 3),
|
2018-05-30 15:32:08 +02:00
|
|
|
V3D_SHADING_SPECULAR_HIGHLIGHT = (1 << 4),
|
2018-06-06 14:47:54 +02:00
|
|
|
V3D_SHADING_CAVITY = (1 << 5),
|
2018-06-08 16:12:25 +02:00
|
|
|
V3D_SHADING_MATCAP_FLIP_X = (1 << 6),
|
2018-07-06 18:53:51 +02:00
|
|
|
V3D_SHADING_SCENE_WORLD = (1 << 7),
|
2019-06-13 09:33:51 +02:00
|
|
|
V3D_SHADING_XRAY_WIREFRAME = (1 << 8),
|
2018-11-29 20:57:09 +01:00
|
|
|
V3D_SHADING_WORLD_ORIENTATION = (1 << 9),
|
2018-12-19 00:55:53 +01:00
|
|
|
V3D_SHADING_BACKFACE_CULLING = (1 << 10),
|
2019-01-25 21:03:50 +01:00
|
|
|
V3D_SHADING_DEPTH_OF_FIELD = (1 << 11),
|
2019-08-27 15:47:30 +02:00
|
|
|
V3D_SHADING_SCENE_LIGHTS_RENDER = (1 << 12),
|
|
|
|
V3D_SHADING_SCENE_WORLD_RENDER = (1 << 13),
|
2020-09-18 00:42:24 +02:00
|
|
|
V3D_SHADING_STUDIOLIGHT_VIEW_ROTATION = (1 << 14),
|
2018-05-05 10:45:15 +02:00
|
|
|
};
|
|
|
|
|
2022-09-02 18:30:48 +02:00
|
|
|
/** #View3D.debug_flag */
|
|
|
|
enum {
|
|
|
|
V3D_DEBUG_FREEZE_CULLING = (1 << 0),
|
|
|
|
};
|
|
|
|
|
2021-10-15 11:42:21 +02:00
|
|
|
#define V3D_USES_SCENE_LIGHTS(v3d) \
|
2021-10-16 04:17:06 +02:00
|
|
|
((((v3d)->shading.type == OB_MATERIAL) && ((v3d)->shading.flag & V3D_SHADING_SCENE_LIGHTS)) || \
|
|
|
|
(((v3d)->shading.type == OB_RENDER) && \
|
|
|
|
((v3d)->shading.flag & V3D_SHADING_SCENE_LIGHTS_RENDER)))
|
2021-10-15 11:42:21 +02:00
|
|
|
|
|
|
|
#define V3D_USES_SCENE_WORLD(v3d) \
|
2021-10-16 04:17:06 +02:00
|
|
|
((((v3d)->shading.type == OB_MATERIAL) && ((v3d)->shading.flag & V3D_SHADING_SCENE_WORLD)) || \
|
|
|
|
(((v3d)->shading.type == OB_RENDER) && \
|
|
|
|
((v3d)->shading.flag & V3D_SHADING_SCENE_WORLD_RENDER)))
|
2021-10-15 11:42:21 +02:00
|
|
|
|
2019-04-14 09:58:40 +02:00
|
|
|
/** #View3DShading.cavity_type */
|
2018-11-26 16:49:56 +01:00
|
|
|
enum {
|
|
|
|
V3D_SHADING_CAVITY_SSAO = 0,
|
|
|
|
V3D_SHADING_CAVITY_CURVATURE = 1,
|
|
|
|
V3D_SHADING_CAVITY_BOTH = 2,
|
|
|
|
};
|
|
|
|
|
2022-11-23 12:26:46 +01:00
|
|
|
/** #View3DShading.use_compositor */
|
|
|
|
typedef enum View3DShadingUseCompositor {
|
|
|
|
V3D_SHADING_USE_COMPOSITOR_DISABLED = 0,
|
|
|
|
/** The compositor is enabled only in camera view. */
|
|
|
|
V3D_SHADING_USE_COMPOSITOR_CAMERA = 1,
|
|
|
|
/** The compositor is always enabled regardless of the view. */
|
|
|
|
V3D_SHADING_USE_COMPOSITOR_ALWAYS = 2,
|
|
|
|
} View3DShadingUseCompositor;
|
|
|
|
|
2019-04-14 09:58:40 +02:00
|
|
|
/** #View3DOverlay.flag */
|
2018-05-05 10:03:42 +02:00
|
|
|
enum {
|
2018-05-03 15:09:09 +02:00
|
|
|
V3D_OVERLAY_FACE_ORIENTATION = (1 << 0),
|
|
|
|
V3D_OVERLAY_HIDE_CURSOR = (1 << 1),
|
2018-07-11 13:02:22 +02:00
|
|
|
V3D_OVERLAY_BONE_SELECT = (1 << 2),
|
2018-05-29 09:08:32 +02:00
|
|
|
V3D_OVERLAY_LOOK_DEV = (1 << 3),
|
2018-05-31 19:19:27 +02:00
|
|
|
V3D_OVERLAY_WIREFRAMES = (1 << 4),
|
2018-06-01 08:26:55 +02:00
|
|
|
V3D_OVERLAY_HIDE_TEXT = (1 << 5),
|
2018-06-01 16:38:21 +02:00
|
|
|
V3D_OVERLAY_HIDE_MOTION_PATHS = (1 << 6),
|
2018-06-11 09:14:39 +02:00
|
|
|
V3D_OVERLAY_ONION_SKINS = (1 << 7),
|
2018-07-10 14:10:12 +02:00
|
|
|
V3D_OVERLAY_HIDE_BONES = (1 << 8),
|
2018-07-10 18:30:45 +02:00
|
|
|
V3D_OVERLAY_HIDE_OBJECT_XTRAS = (1 << 9),
|
2018-07-11 18:51:04 +02:00
|
|
|
V3D_OVERLAY_HIDE_OBJECT_ORIGINS = (1 << 10),
|
2020-04-24 20:05:40 +02:00
|
|
|
V3D_OVERLAY_STATS = (1 << 11),
|
2020-09-18 19:20:22 +02:00
|
|
|
V3D_OVERLAY_FADE_INACTIVE = (1 << 12),
|
Geometry Nodes: viewport preview
This adds support for showing geometry passed to the Viewer in the 3d
viewport (instead of just in the spreadsheet). The "viewer geometry"
bypasses the group output. So it is not necessary to change the final
output of the node group to be able to see the intermediate geometry.
**Activation and deactivation of a viewer node**
* A viewer node is activated by clicking on it.
* Ctrl+shift+click on any node/socket connects it to the viewer and
makes it active.
* Ctrl+shift+click in empty space deactivates the active viewer.
* When the active viewer is not visible anymore (e.g. another object
is selected, or the current node group is exit), it is deactivated.
* Clicking on the icon in the header of the Viewer node toggles whether
its active or not.
**Pinning**
* The spreadsheet still allows pinning the active viewer as before.
When pinned, the spreadsheet still references the viewer node even
when it becomes inactive.
* The viewport does not support pinning at the moment. It always shows
the active viewer.
**Attribute**
* When a field is linked to the second input of the viewer node it is
displayed as an overlay in the viewport.
* When possible the correct domain for the attribute is determined
automatically. This does not work in all cases. It falls back to the
face corner domain on meshes and the point domain on curves. When
necessary, the domain can be picked manually.
* The spreadsheet now only shows the "Viewer" column for the domain
that is selected in the Viewer node.
* Instance attributes are visualized as a constant color per instance.
**Viewport Options**
* The attribute overlay opacity can be controlled with the "Viewer Node"
setting in the overlays popover.
* A viewport can be configured not to show intermediate viewer-geometry
by disabling the "Viewer Node" option in the "View" menu.
**Implementation Details**
* The "spreadsheet context path" was generalized to a "viewer path" that
is used in more places now.
* The viewer node itself determines the attribute domain, evaluates the
field and stores the result in a `.viewer` attribute.
* A new "viewer attribute' overlay displays the data from the `.viewer`
attribute.
* The ground truth for the active viewer node is stored in the workspace
now. Node editors, spreadsheets and viewports retrieve the active
viewer from there unless they are pinned.
* The depsgraph object iterator has a new "viewer path" setting. When set,
the viewed geometry of the corresponding object is part of the iterator
instead of the final evaluated geometry.
* To support the instance attribute overlay `DupliObject` was extended
to contain the information necessary for drawing the overlay.
* The ctrl+shift+click operator has been refactored so that it can make
existing links to viewers active again.
* The auto-domain-detection in the Viewer node works by checking the
"preferred domain" for every field input. If there is not exactly one
preferred domain, the fallback is used.
Known limitations:
* Loose edges of meshes don't have the attribute overlay. This could be
added separately if necessary.
* Some attributes are hard to visualize as a color directly. For example,
the values might have to be normalized or some should be drawn as arrays.
For now, we encourage users to build node groups that generate appropriate
viewer-geometry. We might include some of that functionality in future versions.
Support for displaying attribute values as text in the viewport is planned as well.
* There seems to be an issue with the attribute overlay for pointclouds on
nvidia gpus, to be investigated.
Differential Revision: https://developer.blender.org/D15954
2022-09-28 17:54:59 +02:00
|
|
|
V3D_OVERLAY_VIEWER_ATTRIBUTE = (1 << 13),
|
2022-12-23 01:52:44 +01:00
|
|
|
V3D_OVERLAY_SCULPT_SHOW_MASK = (1 << 14),
|
|
|
|
V3D_OVERLAY_SCULPT_SHOW_FACE_SETS = (1 << 15),
|
2023-02-14 18:10:11 +01:00
|
|
|
V3D_OVERLAY_SCULPT_CURVES_CAGE = (1 << 16),
|
2023-03-07 15:12:35 +01:00
|
|
|
V3D_OVERLAY_SHOW_LIGHT_COLORS = (1 << 17),
|
2023-12-19 13:30:16 +01:00
|
|
|
V3D_OVERLAY_VIEWER_ATTRIBUTE_TEXT = (1 << 18),
|
2018-05-03 15:09:09 +02:00
|
|
|
};
|
|
|
|
|
2019-04-14 09:58:40 +02:00
|
|
|
/** #View3DOverlay.edit_flag */
|
2018-05-03 15:09:09 +02:00
|
|
|
enum {
|
|
|
|
V3D_OVERLAY_EDIT_VERT_NORMALS = (1 << 0),
|
|
|
|
V3D_OVERLAY_EDIT_LOOP_NORMALS = (1 << 1),
|
|
|
|
V3D_OVERLAY_EDIT_FACE_NORMALS = (1 << 2),
|
|
|
|
|
2023-03-03 00:35:45 +01:00
|
|
|
V3D_OVERLAY_EDIT_RETOPOLOGY = (1 << 3),
|
2018-05-03 15:09:09 +02:00
|
|
|
|
|
|
|
V3D_OVERLAY_EDIT_WEIGHT = (1 << 4),
|
2018-09-24 23:18:02 +02:00
|
|
|
|
2023-11-02 08:12:20 +01:00
|
|
|
V3D_OVERLAY_EDIT_EDGES_DEPRECATED = (1 << 5),
|
2018-09-24 23:18:02 +02:00
|
|
|
V3D_OVERLAY_EDIT_FACES = (1 << 6),
|
|
|
|
V3D_OVERLAY_EDIT_FACE_DOT = (1 << 7),
|
|
|
|
|
|
|
|
V3D_OVERLAY_EDIT_SEAMS = (1 << 8),
|
|
|
|
V3D_OVERLAY_EDIT_SHARP = (1 << 9),
|
|
|
|
V3D_OVERLAY_EDIT_CREASES = (1 << 10),
|
|
|
|
V3D_OVERLAY_EDIT_BWEIGHTS = (1 << 11),
|
|
|
|
|
|
|
|
V3D_OVERLAY_EDIT_FREESTYLE_EDGE = (1 << 12),
|
|
|
|
V3D_OVERLAY_EDIT_FREESTYLE_FACE = (1 << 13),
|
|
|
|
|
|
|
|
V3D_OVERLAY_EDIT_STATVIS = (1 << 14),
|
|
|
|
V3D_OVERLAY_EDIT_EDGE_LEN = (1 << 15),
|
|
|
|
V3D_OVERLAY_EDIT_EDGE_ANG = (1 << 16),
|
|
|
|
V3D_OVERLAY_EDIT_FACE_ANG = (1 << 17),
|
|
|
|
V3D_OVERLAY_EDIT_FACE_AREA = (1 << 18),
|
|
|
|
V3D_OVERLAY_EDIT_INDICES = (1 << 19),
|
2018-09-25 18:50:57 +02:00
|
|
|
|
2020-05-26 10:37:47 +02:00
|
|
|
/* Deprecated. */
|
2021-06-24 07:56:58 +02:00
|
|
|
// V3D_OVERLAY_EDIT_CU_HANDLES = (1 << 20),
|
2020-05-26 10:37:47 +02:00
|
|
|
|
2018-09-25 18:50:57 +02:00
|
|
|
V3D_OVERLAY_EDIT_CU_NORMALS = (1 << 21),
|
2021-08-04 10:52:51 +02:00
|
|
|
V3D_OVERLAY_EDIT_CONSTANT_SCREEN_SIZE_NORMALS = (1 << 22),
|
2018-05-03 15:09:09 +02:00
|
|
|
};
|
|
|
|
|
2019-04-14 09:58:40 +02:00
|
|
|
/** #View3DOverlay.paint_flag */
|
2018-05-03 15:09:09 +02:00
|
|
|
enum {
|
|
|
|
V3D_OVERLAY_PAINT_WIRE = (1 << 0),
|
2018-05-05 10:03:42 +02:00
|
|
|
};
|
|
|
|
|
2019-04-14 09:58:40 +02:00
|
|
|
/** #View3DOverlay.wpaint_flag */
|
2018-09-27 17:38:07 +02:00
|
|
|
enum {
|
|
|
|
V3D_OVERLAY_WPAINT_CONTOURS = (1 << 0),
|
|
|
|
};
|
|
|
|
|
2019-04-14 09:58:40 +02:00
|
|
|
/** #View3D.around */
|
2015-12-01 08:52:24 +01:00
|
|
|
enum {
|
|
|
|
/* center of the bounding box */
|
|
|
|
V3D_AROUND_CENTER_BOUNDS = 0,
|
|
|
|
/* center from the sum of all points divided by the total */
|
2018-12-14 01:01:01 +01:00
|
|
|
V3D_AROUND_CENTER_MEDIAN = 3,
|
2015-12-01 08:52:24 +01:00
|
|
|
/* pivot around the 2D/3D cursor */
|
|
|
|
V3D_AROUND_CURSOR = 1,
|
|
|
|
/* pivot around each items own origin */
|
|
|
|
V3D_AROUND_LOCAL_ORIGINS = 2,
|
|
|
|
/* pivot around the active items origin */
|
|
|
|
V3D_AROUND_ACTIVE = 4,
|
|
|
|
};
|
2004-07-15 19:42:04 +02:00
|
|
|
|
2020-05-15 04:47:47 +02:00
|
|
|
/** #View3D.gridflag */
|
2023-06-26 04:09:49 +02:00
|
|
|
enum {
|
|
|
|
V3D_SHOW_FLOOR = 1 << 0,
|
|
|
|
V3D_SHOW_X = 1 << 1,
|
|
|
|
V3D_SHOW_Y = 1 << 2,
|
|
|
|
V3D_SHOW_Z = 1 << 3,
|
|
|
|
V3D_SHOW_ORTHO_GRID = 1 << 4,
|
|
|
|
};
|
2004-01-24 06:06:12 +01:00
|
|
|
|
2018-12-19 10:51:04 +01:00
|
|
|
/** #TransformOrientationSlot.type */
|
2019-02-08 05:14:54 +01:00
|
|
|
enum {
|
|
|
|
V3D_ORIENT_GLOBAL = 0,
|
|
|
|
V3D_ORIENT_LOCAL = 1,
|
|
|
|
V3D_ORIENT_NORMAL = 2,
|
|
|
|
V3D_ORIENT_VIEW = 3,
|
|
|
|
V3D_ORIENT_GIMBAL = 4,
|
|
|
|
V3D_ORIENT_CURSOR = 5,
|
Animation: Add in Parent space alignment option to the Transform Orientation gizmo
Animation: Adds a new "Parent Space" Orientation option for the Transformation Gizmo.
---
For child targets (objects, bones, etc) being able to transform in parent space is a desired feature (especially when it comes to rigging / animation).
For objects:
* with a parent, the gizmo orients to it's parents orientation
* without a parent, the gizmo orients to Global space
For Armatures:
* Child bone shows parent's space regardless if "Local Location" is set for parent bone
* For root bone **without** "Local Location" set, use the armature objects space.
* For root bone **with** "Local Location" set, use local bone space.
---
No new transformation orientation code needs to be written, we can achieve the desired results be using the existing `transform_orientations_create_from_axis`, `ED_getTransformOrientationMatrix`, and `unit_m3` methods. To do this, we check to see if the bone has a parent, if so, we use the bones pose matrix (`pose_mat`). This is done similarly for objects using the parent's object matrix (`object_to_world`).
Pull Request: https://projects.blender.org/blender/blender/pulls/104724
2023-04-20 17:40:19 +02:00
|
|
|
V3D_ORIENT_PARENT = 6,
|
2019-02-08 05:14:54 +01:00
|
|
|
V3D_ORIENT_CUSTOM = 1024,
|
|
|
|
/** Runtime only, never saved to DNA. */
|
|
|
|
V3D_ORIENT_CUSTOM_MATRIX = (V3D_ORIENT_CUSTOM - 1),
|
|
|
|
};
|
So! Finally a show-off of the *power* of Martin P's work! :)
- Made framework for 3d Transform Manipulators (widgets)
- The Manipulators act like '2d buttons', by default with LeftMouse and with
while-hold-move-release
- Implemented now: Translation Widget, which allows:
- four hotspots for axis grab or view-aligned grab
- center defined by 'around' setting
- SHIFT+LMB gives planar constraint on other 2 axes
- works in Object mode and Edit mode (not posemode yet)
Enable it with (temporal) icon in 3D header. All other 'normal' transforms
then keeps working btw.
On the todo for this widget:
- choice for Global, Local or Normal orientation
The way the widgets are going to work is in review still. Commit is also for
Matt for his proposal/paper on topic.
Some notes regarding this project;
- no life updates (on mouse over) like 3DS, I think that's neurotic
- on click, dominant axis changes to theme defined "Transform" color, other axes disappear, like maya
- manipulater size is fixed preset, independent zoom.
- manipulator follows selection, and is located based on 'around' mode
Unresolved;
- in maya, when you select 2 or more objects, the manipulator draws on the 'active' object, also interesting
- what to do with G,R,S hotkeys? It could switch the manipulator "mode"...
- header button/menu for manipulator mode?
2005-03-17 22:31:49 +01:00
|
|
|
|
2019-04-13 20:36:53 +02:00
|
|
|
/** #View3d.gizmo_flag */
|
2017-06-19 09:47:04 +02:00
|
|
|
enum {
|
2018-07-14 23:49:00 +02:00
|
|
|
/** All gizmos. */
|
|
|
|
V3D_GIZMO_HIDE = (1 << 0),
|
|
|
|
V3D_GIZMO_HIDE_NAVIGATE = (1 << 1),
|
|
|
|
V3D_GIZMO_HIDE_CONTEXT = (1 << 2),
|
|
|
|
V3D_GIZMO_HIDE_TOOL = (1 << 3),
|
2017-06-19 09:47:04 +02:00
|
|
|
};
|
So! Finally a show-off of the *power* of Martin P's work! :)
- Made framework for 3d Transform Manipulators (widgets)
- The Manipulators act like '2d buttons', by default with LeftMouse and with
while-hold-move-release
- Implemented now: Translation Widget, which allows:
- four hotspots for axis grab or view-aligned grab
- center defined by 'around' setting
- SHIFT+LMB gives planar constraint on other 2 axes
- works in Object mode and Edit mode (not posemode yet)
Enable it with (temporal) icon in 3D header. All other 'normal' transforms
then keeps working btw.
On the todo for this widget:
- choice for Global, Local or Normal orientation
The way the widgets are going to work is in review still. Commit is also for
Matt for his proposal/paper on topic.
Some notes regarding this project;
- no life updates (on mouse over) like 3DS, I think that's neurotic
- on click, dominant axis changes to theme defined "Transform" color, other axes disappear, like maya
- manipulater size is fixed preset, independent zoom.
- manipulator follows selection, and is located based on 'around' mode
Unresolved;
- in maya, when you select 2 or more objects, the manipulator draws on the 'active' object, also interesting
- what to do with G,R,S hotkeys? It could switch the manipulator "mode"...
- header button/menu for manipulator mode?
2005-03-17 22:31:49 +01:00
|
|
|
|
2019-04-14 13:11:17 +02:00
|
|
|
/** #View3d.gizmo_show_object */
|
|
|
|
enum {
|
|
|
|
V3D_GIZMO_SHOW_OBJECT_TRANSLATE = (1 << 0),
|
|
|
|
V3D_GIZMO_SHOW_OBJECT_ROTATE = (1 << 1),
|
|
|
|
V3D_GIZMO_SHOW_OBJECT_SCALE = (1 << 2),
|
|
|
|
};
|
|
|
|
/** #View3d.gizmo_show_armature */
|
|
|
|
enum {
|
|
|
|
/** Currently unused (WIP gizmo). */
|
|
|
|
V3D_GIZMO_SHOW_ARMATURE_BBONE = (1 << 0),
|
|
|
|
/** Not yet implemented. */
|
|
|
|
V3D_GIZMO_SHOW_ARMATURE_ROLL = (1 << 1),
|
|
|
|
};
|
|
|
|
/** #View3d.gizmo_show_empty */
|
|
|
|
enum {
|
|
|
|
V3D_GIZMO_SHOW_EMPTY_IMAGE = (1 << 0),
|
|
|
|
V3D_GIZMO_SHOW_EMPTY_FORCE_FIELD = (1 << 1),
|
|
|
|
};
|
|
|
|
/** #View3d.gizmo_show_light */
|
|
|
|
enum {
|
|
|
|
/** Use for both spot & area size. */
|
|
|
|
V3D_GIZMO_SHOW_LIGHT_SIZE = (1 << 0),
|
|
|
|
V3D_GIZMO_SHOW_LIGHT_LOOK_AT = (1 << 1),
|
|
|
|
};
|
|
|
|
/** #View3d.gizmo_show_camera */
|
2019-04-13 20:36:53 +02:00
|
|
|
enum {
|
2019-04-14 13:11:17 +02:00
|
|
|
/** Also used for ortho size. */
|
|
|
|
V3D_GIZMO_SHOW_CAMERA_LENS = (1 << 0),
|
|
|
|
V3D_GIZMO_SHOW_CAMERA_DOF_DIST = (1 << 2),
|
2019-04-13 20:36:53 +02:00
|
|
|
};
|
|
|
|
|
2023-05-16 15:00:45 +02:00
|
|
|
/** #ToolSettings.plane_depth */
|
|
|
|
typedef enum {
|
|
|
|
V3D_PLACE_DEPTH_SURFACE = 0,
|
|
|
|
V3D_PLACE_DEPTH_CURSOR_PLANE = 1,
|
|
|
|
V3D_PLACE_DEPTH_CURSOR_VIEW = 2,
|
|
|
|
} eV3DPlaceDepth;
|
|
|
|
/** #ToolSettings.plane_orient */
|
|
|
|
typedef enum {
|
|
|
|
V3D_PLACE_ORIENT_SURFACE = 0,
|
|
|
|
V3D_PLACE_ORIENT_DEFAULT = 1,
|
|
|
|
} eV3DPlaceOrient;
|
|
|
|
|
2010-09-11 06:39:00 +02:00
|
|
|
#define RV3D_CAMZOOM_MIN -30
|
|
|
|
#define RV3D_CAMZOOM_MAX 600
|
|
|
|
|
2019-04-14 09:58:40 +02:00
|
|
|
/** #BKE_screen_view3d_zoom_to_fac() values above */
|
2015-04-23 16:12:16 +02:00
|
|
|
#define RV3D_CAMZOOM_MIN_FACTOR 0.1657359312880714853f
|
|
|
|
#define RV3D_CAMZOOM_MAX_FACTOR 44.9852813742385702928f
|