Commit graph

47 commits

Author SHA1 Message Date
Yann Lanthony
1c873508ef
[ui] Inspector3D: double click on media now sets node as "active"
To be consistent with the Graph Editor behavior, double clicking on a node sets it as the active node of its type. This, for example, enables to switch from one SfM to another from the media list.
2019-09-11 10:49:09 +02:00
Yann Lanthony
03e91bea49
[ui] Inspector3D: simplify handling of scene media items hovering
* add MouseArea at root of media
* use flow to display media info and avoid text clipping
2019-09-11 10:49:09 +02:00
Yann Lanthony
312b9f5e0b
[ui] Inspector3D: provide camera from Viewer3D 2019-09-11 10:09:27 +02:00
Yann Lanthony
2a3093b292
[ui] AlembicLoader: only select cameras on still left-clicks
don't trigger Camera selection if mouse has moved to rotate camera
2019-09-10 19:43:14 +02:00
Yann Lanthony
796517ccb1
[ui] AlembicLoader: use CuboidMesh extent to disable picking
Using an additional scale Transform changes Cuboid's size relatively to the Camera locator, which was unwanted.
2019-09-10 19:41:38 +02:00
Yann Lanthony
6e47235c9c
[ui] Viewer3D: don't display contextual menu on alt+right-click zoom
Only prompt right-click contextual menu when it was not used to zoom in the 3D view.
2019-09-10 19:37:54 +02:00
Yann Lanthony
8dce4fc72f
[ui] Viewer3D: add "Sync with Image Selection" camera mode
* Inspector
   * changed "SETTINGS" to "DISPLAY"
   * new "CAMERA" section: activate camera synchronization + control image overlay
* ImageOverlay: new component to display (undistorted) image on top of the 3D view
* ViewpointCamera: new component that sets up a Camera based on a Viewpoint internal parameter
* Viewer3D: additional ViewpointCamera to perform synchronization with image selection
* Viewer3DSettings: new properties related to camera synchronization mode
2019-09-10 19:33:55 +02:00
Yann Lanthony
774675bd65
[ui] Viewer3D: move Inspector3D outside Viewer3D
Inspector3D is not an overlay anymore to simplify 3D manipulations, by having view center at the center of the 3D view.
2019-09-10 19:28:14 +02:00
Yann Lanthony
606cfc39c2
[ui] Viewer3D: fix Alembic visibility issues
Binding the "enabled" property of AlembicLoader's ObjectPicker to the parent MediaLoader's own "enabled" property caused invalid state where the loaded AlembicEntity was partially visible when toggling object visibility (since Qt 5.13).
In order to disable camera picking when AlembicEntity is disable, scale the camSelector component to 0.
2019-08-12 17:58:43 +02:00
Yann Lanthony
aff5a98a4b
[ui] Viewer3D: use RenderSettings.Always renderPolicy
Since Qt-5.13, RenderSettings.OnDemand can lead to rendering issues due to non-triggered updates (e.g: when resizing the viewport or changing visibilities of objects displayed).
2019-07-24 18:04:39 +02:00
Yann Lanthony
cee8d1b612
[ui] Viewer3D: add support for vertex-colored meshes
Use PerVertexColorMaterial if any vertex color data is available on a mesh without textures.
2019-07-10 16:35:44 +02:00
Yann Lanthony
2b07699f65
[ui] Viewer3D: improved trackball parameters
Make trackball larger and adjust rotation speed to make 3D navigation easier.
2019-06-26 12:57:30 +02:00
Yann Lanthony
438622a14b
[ui] Introduce ClipboardHelper for copying to clipboard from QML
* add ClipboardHelper class that contains a QClipboard and exposes its method as Slots
* use Clipboard instead of hidden TextEdit where meaningful
2019-05-07 11:47:09 +02:00
Yann Lanthony
da1b842493 [ui] MediaLibrary: enable dynamicRoles on mediaModel
If an outside 3D media file is the first thing ever loaded, 'model.attribute' will be initialized to 'null' and will prevent an actual Attribute to be associated to this role. This breaks media loading from within Meshroom.
2019-02-07 19:55:05 +01:00
Yann Lanthony
6199de0b45 [ui] Inspector3D: improve pointSize/cameraScale sliders
* reduce pointSize maximum value for better precision
* replace texts by icon
* add tooltips with values
2019-02-07 19:11:06 +01:00
Yann Lanthony
a9cb4afe2a [ui] DepthMapLoader: update to DepthMapEntity 2.0
* map render modes to custom visualization modes
2019-02-07 18:27:29 +01:00
Yann Lanthony
9bd53c7c89 [ui] CameraController: check KeyboardHandler status for all actions with modifiers 2019-02-07 18:24:52 +01:00
Yann Lanthony
829aa24a4a [ui] CameraController: avoid allocating new objects on bindings
Change existing objects values instead of re-creating point/size objects, on bindings that can be evaluated very often.
2019-02-07 18:14:16 +01:00
Yann Lanthony
1793a30861 [ui][Viewer3D] Locator3D: properly initialize buffers with 'new'
Fix crash using PySide2 5.12: "calling a TypedArray constructor without new is invalid"
2019-02-06 14:37:53 +01:00
Yann Lanthony
971d4d7f0e [ui][Viewer3D] MediaCache: add debug mode
add 'debug' mode to ease debugging of 3D Media cache
2019-01-31 16:12:42 +01:00
Yann Lanthony
6a297d5bff [ui][Viewer3D] fix cache update and reparenting issues
* don't try to put object in cache on MediaLoader 'Component.onCompleted' callback ; only effect was to put back in cache a media retrieved from cache during 'onFinalSourceChanged'
* redesign 'updateModelAndCache' as 'updateModel' and 'updateCacheAndModel' for this purpose
* wait for MediaLoader full initialization (@ 'NodeInstiator.onObjectAdded' callback) to reparent an object retrieved from cache; otherwise it silently fails.
2019-01-31 16:07:33 +01:00
Yann Lanthony
10c3454bad [ui][3D] MediaLoader: bind 'enabled' property of AlembicEntity
Ensure AlembicEntity is properly disabled when parent is. Fix pickable hidden cameras issue.
2019-01-31 15:58:23 +01:00
Fabien Castan
0de3e49a7f
Merge pull request #349 from alicevision/dev_graphEditor_improvements
Graph editor improvements
2019-01-11 22:41:32 +01:00
Yann Lanthony
029c35cfcf [ui] Viewer3D: let QmlAlembic manage entities visibility
see https://github.com/alicevision/qmlAlembic/pull/11
2019-01-09 18:09:01 +01:00
Yann Lanthony
b5c985b3fb [ui] GraphEditor: solo 3D media with Double Click + Control modifier
* allow to solo a 3D media from the GraphEditor by double clicking on a node or an attribute with the Control modifier pressed
* consistent with Viewer3D.MediaLibrary behavior (solo on Ctrl+Click on visibility button)
* handle supported file extensions in Viewer3DSettings
2019-01-07 16:19:42 +01:00
Yann Lanthony
65ec2d3245 [ui] Viewer3D: disable pointclouds/cameras when scaled down to 0 2018-12-19 17:35:40 +01:00
Yann Lanthony
0db42e5acc [ui] Viewer3D: rename "Locator" to "Origin" 2018-12-13 17:42:00 +01:00
Yann Lanthony
05f0ae50fc [ui] Viewer3D: remove scene orientation controls
new trackball manipulator offers more intuitive 3D navigation regardless of the camera orientation
2018-12-13 17:39:28 +01:00
Yann Lanthony
5814a39e3e [ui] Viewer3D: add loading overlay with BusyIndicator 2018-12-13 17:15:24 +01:00
Yann Lanthony
edfc34fbd1 [ui] Viewer3D: remove media if no loader was found for a valid source 2018-12-13 17:15:19 +01:00
Yann Lanthony
b2e1743a6f [ui] Viewer3D: move TrackballController code to Python side
Port JS trackball camera controller code to Python for improved performance and stability.
2018-12-11 16:54:26 +01:00
Yann Lanthony
4d73013784 [ui] Add Colors singleton to start centralizing useful colors
+ use in 3D gizmos
2018-12-10 15:13:27 +01:00
Yann Lanthony
87d5a62846 [ui] Viewer3D: new Trackball camera manipulator 2018-12-10 15:13:27 +01:00
Yann Lanthony
6836f7fd93 [ui] MaterialSwitcher: use Scene3DHelper to add/remove entity components 2018-12-10 15:13:26 +01:00
Yann Lanthony
b56cf9e7cf [ui] Viewer3D: tweak initial camera position and Grid3D material
* centralize initial camera parameters + move camera closer to the scene center
* add motion smoothing when camera position is set
* improve grid material aspect
2018-12-10 15:13:26 +01:00
Yann Lanthony
72cd60fd0a [ui] AlembicLoader: use 'skipHidden' to avoid loading unreconstructed cams 2018-12-10 15:13:26 +01:00
Yann Lanthony
c3750a33c3 [ui] Inspector3D: add media contextual menu
Contextual menu to expose additional actions:
 * open media containing folder
 * copy media path
 * advanced manual control over media (un)loading
+ fix MediaLibrary to avoid binding loop on 'visible' when directly modifying 'request' property
2018-12-10 15:13:26 +01:00
Yann Lanthony
272cd24fb9 [ui] Viewer3D: Inspector3D cleanup
* Define 2 groups: "Settings" and "Scene"
* Settings
    * add camera scale slider control
    * move rendering modes back to an independent overlay outside the inspector
* Scene
    * add button to control visibility of media info
2018-12-10 15:13:25 +01:00
Yann Lanthony
fc857d5dc8 [ui] Viewer3D: add 'cameraScale' parameter to drive camera locator size 2018-12-07 16:07:43 +01:00
Yann Lanthony
2f307c16fb [ui] Viewer3D: synchronize media list and graph hover/selection
* ease bidirectional navigation between 3D media list and graph
* use same mechanism to indicate selected/hovered elements
* remove 'frame' button (space gain + action available on double click)
2018-12-07 16:07:42 +01:00
Yann Lanthony
2e06ad1b83 [ui] 3DViewer: make 'visible' property drive media load request
* remove the notion of manual media (un)loading from high-level UI
* visibility button now drives media loading:
   * if media is not available (not yet computed), it will be loaded once available if visibility is on
   * once loaded, media can't be explicitly unloaded 
* use an icon to indicate that the media is not available instead of colors
2018-12-07 16:07:41 +01:00
Yann Lanthony
97fcdf67bf [ui] Viewer3D: multi 3D media support
* use new media loading backend through MediaLibrary
* Inspector3D: new overlay UI that displays and allows to manipulate MediaLibrary content
2018-12-07 16:07:41 +01:00
Yann Lanthony
e35076ef97 [ui] Viewer3D: improved frame graph
* enable PrimitivePicking to enable picking on point clouds
* use OnDemand render policy
* activate FrustrumCulling + increase far plane
* add management of rasterized OpenGL points via a PointSize render
2018-12-07 15:57:58 +01:00
Yann Lanthony
e5fa9f1087 [ui] Viewer3D: centralize render modes model in Viewer3DSettings 2018-12-07 15:57:57 +01:00
Yann Lanthony
109b980ae5 [ui] Viewer3D: introduce new 3D media loading backend
This commit adds several components to centralize and extend 3D media loading. They are not yet integrated into Viewer3D. The entry point to this system is the MediaLibrary component that:
    * can load N medias based on a filepath or load-and-watch node attributes
    * provides a cache mechanism to instant-reload medias that were unloaded under certain conditions
    * gives access to statistics (vertex/face/camera/textureCount) through a unified interface
2018-12-07 15:57:57 +01:00
Yann Lanthony
f6365c5607 [ui] Viewer3D: fix wrong keyboard modifier state
Keyboard Actions are never deactivated when focus is lost, leading to picking being enabled on a single click when Control was pressed in the 3D viewer and focus was lost to another Item.
* keep track of focus loss inside the DefaultCameraController
* use it to disable picking while Keyboard has not been pressed back in the 3D viewer
* do the same for 'moving' state with Alt modifier
2018-12-07 15:54:46 +01:00
Yann Lanthony
7415c1d391 [ui] split 2D and 3D viewers into separate modules
+ remove historical MayaCameraController
2018-11-23 14:26:57 +01:00