Skip to content

Commit 7dc38af

Browse files
committed
Merge branch 'dev' into tremblp/HYDRA-1242/isolate_select_hang
2 parents 22cc8c0 + cc5f348 commit 7dc38af

File tree

86 files changed

+4322
-1070
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+4322
-1070
lines changed

doc/build.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Before building the project, consult the following table to ensure you use the r
1212
|:---------------------:|:-------------------------:|:------------------------------------------------------------:|:---------------------------:|
1313
| Operating System | Windows 10 <br> Windows 11 | High Sierra (10.13)<br>Mojave (10.14)<br>Catalina (10.15)<br>Big Sur (11.2.x) | Rocky Linux 8.6 / Linux® Red Hat® Enterprise 8.6 WS |
1414
| Compiler Requirement| Maya 2024 (VS 2022)<br>Maya 2025 (VS 2022) | Maya 2024 (Xcode 13.4 or higher)<br>Maya 2025 (Xcode 13.4 or higher) | Maya 2024 (gcc 11.2.1)<br>Maya 2025 (gcc 11.2.1) |
15-
| CMake Version (min/max) | 3.13...3.30 | 3.13...3.30 | 3.13...3.30 |
15+
| CMake Version (min/max) | 3.14...3.30 | 3.14...3.30 | 3.14...3.30 |
1616
| Python | 3.10.8, 3.11.4 | 3.10.8, 3.11.4 | 3.10.8, 3.11.4 |
1717
| Python Packages | PyYAML, PySide, PyOpenGL | PyYAML, PySide2, PyOpenGL | PyYAML, PySide, PyOpenGL |
1818
| Build generator | Visual Studio, Ninja (Recommended) | XCode, Ninja (Recommended) | Ninja (Recommended) |
@@ -25,19 +25,20 @@ Before building the project, consult the following table to ensure you use the r
2525

2626
#### 2. Download and Build Pixar USD
2727

28-
See Pixar's official github page for instructions on how to build USD: https://github.com/PixarAnimationStudios/USD. Pixar has removed support for building Maya USD libraries/plug-ins in their github repository and ```build_usd.py```.
28+
See Pixar's official github page for instructions on how to build USD: https://github.com/PixarAnimationStudios/USD.<BR>
29+
If you want to <B>be able to import usd data in maya through [MayaUSD](https://github.com/Autodesk/maya-usd) and use a hydra render delegate in the viewport, you have to rebuild MayaHydra with the same version used by MayaUSD </B>which is a customized version of OpenUSD, these versions are :
2930

30-
| | ![](images/pxr.png) |USD version used in Maya
31-
|:------------: |:---------------: |:---------------:
32-
| CommitID/Tags | [v22.11](https://github.com/PixarAnimationStudios/OpenUSD/releases/tag/v22.11), [v23.08](https://github.com/PixarAnimationStudios/OpenUSD/releases/tag/v23.08), [v23.11](https://github.com/PixarAnimationStudios/OpenUSD/releases/tag/v23.11) or [v24.05](https://github.com/PixarAnimationStudios/OpenUSD/releases/tag/v24.05) |Maya 2024 = v22.11<br>Maya 2025 = v23.11<br>Maya PR = v24.05
31+
| | ![](images/pxr.png) | USD version used in Maya | USD source for MayaUSD / MayaHydra |
32+
|:------------: |:---------------: |:------------------------:|:-------------------------:|
33+
| CommitID/Tags | [v22.11](https://github.com/PixarAnimationStudios/OpenUSD/releases/tag/v22.11)<BR>[v23.11](https://github.com/PixarAnimationStudios/OpenUSD/releases/tag/v23.11)<BR>[v24.11](https://github.com/PixarAnimationStudios/OpenUSD/releases/tag/v24.11) |Maya 2024 = v22.11<br>Maya 2025 = v23.11<br>Maya PR = v24.11| [v22.11-MayaUsd-Public](https://github.com/autodesk-forks/USD/tree/v22.11-MayaUsd-Public)<br>[v23.11-MayaUsd-Public](https://github.com/autodesk-forks/USD/tree/v23.11-MayaUsd-Public)<br>[v24.11-MayaUsd-Public](https://github.com/autodesk-forks/USD/tree/v24.11-MayaUsd-Public) |
3334

3435
For additional information on building Pixar USD, see the ***Additional Build Instruction*** section below.
3536

3637
***NOTE:*** Make sure that you don't have an older USD locations in your ```PATH``` and ```PYTHONPATH``` environment settings. ```PATH``` and ```PYTHONPATH``` are automatically adjusted inside the project to point to the correct USD location. See ```cmake/usd.cmake```.
3738

3839
#### 3. Download and Build MayaUSD
3940

40-
Starting from Maya 2025, the project requires MayaUSD to build. This enables more features for USD stages when using a Hydra render delegate, such as: hide/delete the stage when the proxy shape node is hidden/deleted, or applying a transform on the proxy shape node will apply it on the stage.
41+
Starting from Maya 2025, the project requires [MayaUSD](https://github.com/Autodesk/maya-usd) to build. This enables more features for USD stages when using a hydra render delegate, such as: hide/delete the stage when the proxy shape node is hidden/deleted, or applying a transform on the proxy shape node will apply it on the stage.
4142

4243
To build MayaUSD, see the github page https://github.com/Autodesk/maya-usd/blob/dev/doc/build.md
4344

@@ -47,7 +48,7 @@ The Universal Front End (UFE) is a DCC-agnostic component that allows Maya to br
4748

4849
| Ufe Version | Maya Version | Ufe Docs (external) |
4950
|----------------------------|--------------------------------------------------------|:-------------------:|
50-
| v4.0.0<br>v4.1.0<br>v4.2.0<br>v4.2.0 | Maya 2024<br>Maya 2024.1<br>Maya 2024.2<br>Maya 2025 | https://help.autodesk.com/view/MAYADEV/2025/ENU/?guid=MAYA_API_REF_ufe_ref_index_html |
51+
| v4.0.0<br>v4.1.0<br>v4.2.0<br>v4.2.0<br>v6.0.0 | Maya 2024<br>Maya 2024.1<br>Maya 2024.2<br>Maya 2025<br>Maya PR | https://help.autodesk.com/view/MAYADEV/2025/ENU/?guid=MAYA_API_REF_ufe_ref_index_html |
5152

5253
To build the project with UFE support, you will need to use the headers and libraries included in the ***Maya Devkit***:
5354

@@ -65,9 +66,14 @@ cd maya-hydra
6566

6667
| Location | Description |
6768
|------------- |--------------------------------------------------------------------------------------------- |
68-
| lib/mayaHydra/mayaPlugin | Contains Maya plugin definition and render override registration |
69-
| lib/mayaHydra/hydraExtensions | Contains extensions to and mechanism needed to interface with hydra classes |
70-
| lib/mayaHydra/ufeExtensions | Contains extensions to translate paths between UFE, USD SdfPath and Maya DAGPath |
69+
| [lib/adskHydraSceneBrowser](https://github.com/Autodesk/maya-hydra/tree/dev/lib/adskHydraSceneBrowser)| Contains the hydra scene browser to help you debugging the scene indices and usd data |
70+
| [lib/flowViewport](https://github.com/Autodesk/maya-hydra/tree/dev/lib/flowViewport)| Contains the [Flow Viewport Toolkit](https://github.com/Autodesk/maya-hydra/blob/dev/doc/flowViewportToolkit.md) to add hydra primitives scene indices or add filtering scene indices to the viewport.<BR>What you retrieve in this folder is <B>the code that is not maya dependent and could be re-used by another hydra project</B>|
71+
| [lib/mayaHydra/](https://github.com/Autodesk/maya-hydra/tree/dev/lib/mayaHydra)| Contains code that is dependent from Maya |
72+
| [lib/mayaHydra/flowViewportAPIExamples](https://github.com/Autodesk/maya-hydra/tree/dev/lib/mayaHydra/flowViewportAPIExamples) | Contains samples on how to use the [Flow Viewport Toolkit](https://github.com/Autodesk/maya-hydra/blob/dev/doc/flowViewportToolkit.md) to add hydra primitives scene indices or add filtering scene indices to the viewport|
73+
| [lib/mayaHydra/hydraExtensions](https://github.com/Autodesk/maya-hydra/tree/dev/lib/mayaHydra/hydraExtensions) | Contains extensions and mechanisms needed to interface with hydra classes |
74+
| [lib/mayaHydra/mayaPlugin](https://github.com/Autodesk/maya-hydra/tree/dev/lib/mayaHydra/mayaPlugin) | Contains MayaHydra plugin definition and render override registration |
75+
| [lib/mayaHydra/ufeExtensions](https://github.com/Autodesk/maya-hydra/tree/dev/lib/mayaHydra/ufeExtensions) | Contains extensions to translate paths between UFE, USD SdfPath and Maya DAGPath |
76+
7177

7278
#### 6. How To Use build.py Script
7379

doc/flowViewportToolkit.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Flow viewport toolkit
22

3-
The Flow viewport toolkit is an API for clients to customize the Hydra viewport.
3+
The Flow viewport toolkit is an API for clients to customize the Hydra viewport.
44

55
## About the API
66
- It is based on **Hydra 2.0** and leverages the scene index mechanisms, it was not designed to be used with a Hydra 1.0 (scene delegate).
@@ -97,5 +97,11 @@ To get an instance of the *VersionInterface* class, please use :
9797
You get the version as semantic versioning : majorVersion, minorVersion and patchLevel.
9898

9999
## Samples
100-
The API contains examples which are Maya projects on how to filter and add primitives and get viewport information, please see [Flow viewport API examples](../lib/mayaHydra/flowViewportAPIExamples).
101-
100+
The API contains examples which are Maya projects on how to filter and add primitives and get viewport information, please see [Flow viewport API examples](../lib/mayaHydra/flowViewportAPIExamples) :
101+
102+
| Location | Description |
103+
|------------- |--------------------------------------------------------------------------------------------- |
104+
| [lib/flowViewport/usdPlugins/shadersDiscoveryPlugin](https://github.com/Autodesk/maya-hydra/tree/dev/lib/flowViewport/usdPlugins/shadersDiscoveryPlugin) | Is an example on how to develop a custom GLSL shader for Hydra Storm which you can apply later on USD / Hydra primitives |
105+
| [lib/mayaHydra/flowViewportAPIExamples/customShadersNode](https://github.com/Autodesk/maya-hydra/tree/dev/lib/mayaHydra/flowViewportAPIExamples/customShadersNode) | Is a Maya node which creates an Hydra primitive and applies the custom GLSL shader for Hydra Storm |
106+
| [lib/mayaHydra/flowViewportAPIExamples/flowViewportAPILocator](https://github.com/Autodesk/maya-hydra/tree/dev/lib/mayaHydra/flowViewportAPIExamples/flowViewportAPILocator) | Is a Maya node which creates Hydra primitives to display a grid of cubes and applies a filtering scene index to remove primitives with more than a certain number of vertices.<BR>This example shows how to create a Hydra mesh primitive, how to use Hydra instancing and deal with selection picking from MayaHydra|
107+
| [lib/mayaHydra/flowViewportAPIExamples/footPrintNode](https://github.com/Autodesk/maya-hydra/tree/dev/lib/mayaHydra/flowViewportAPIExamples/footPrintNode) | Is a Maya node showing how to convert the Maya FootPrint node which is part of the samples from the Maya devkit. It shows how to create Hydra mesh primitives and deal with selection picking from MayaHydra|

doc/selectionHighlightingArchitecture.md

Lines changed: 44 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ supports Hydra rendering in this repository as the Flow Viewport Toolkit (name
88
subject to change).
99

1010
This document will describe the state of Flow Viewport Toolkit selection
11-
highlighting as of 31-May-2024.
11+
highlighting as of 5-Dec-2024.
1212

1313
## Behavior
1414

@@ -73,7 +73,8 @@ provide the following services:
7373
- A way to translate the application's selection path(s) into Hydra paths and data sources:
7474
- So that the appropriate prims in Hydra can be dirtied on selection change.
7575
- So that selected prims in Hydra can have a data source added.
76-
This is embodied in a **Path interface**.
76+
This is embodied in a **Path Mapper**. The plugin must therefore create
77+
a path mapper and register it in the **Path Mapper Registry**.
7778

7879
- A way for the plugin to query the Hydra version of the application
7980
selection:
@@ -85,20 +86,21 @@ provide the following services:
8586
### Selection Change
8687

8788
This
88-
[selection change code](../lib/flowViewport/sceneIndex/fvpSelectionSceneIndex.cpp#L152-L173)
89-
shows the use of the *Path Interface*, through the *UfePathToPrimSelections()* method,
90-
called on the input scene index. The path interface allows the selection scene
91-
index to translate selected application paths to selected Hydra scene index
92-
paths.
89+
[selection change code](../lib/flowViewport/sceneIndex/fvpSelectionSceneIndex.cpp)
90+
shows the use of the *ufePathToPrimSelections()* utility function. This
91+
utility accesses the **Path Mapper Registry** and retrieves a path mapper
92+
that implements the translation of selected application paths to selected
93+
Hydra scene index paths. *ufePathToPrimSelections()* then invokes the
94+
path mapper and returns the Hydra scene index paths.
9395

9496
### Wireframe Selection Highlighting
9597

9698
This
97-
[wireframe selection highlighting code](../lib/flowViewport/sceneIndex/fvpWireframeSelectionHighlightSceneIndex.cpp#L462-L465)
99+
[wireframe selection highlighting code](../lib/flowViewport/sceneIndex/fvpWireframeSelectionHighlightSceneIndex.cpp)
98100
shows the use of the *Selection*, through the
99-
*HasFullySelectedAncestorInclusive()* method, called on the input selection.
101+
*IsFullySelected()* method, called on the input selection.
100102
The selection allows a selection highlighting filtering scene index to query
101-
selected prims.
103+
selected prims. It can also query the *selections* data source on a prim to determine selection status.
102104

103105
## Design Option Discussion
104106

@@ -108,12 +110,24 @@ selected prims.
108110
to them described as `SdfPath`. This keeps plugins independent of any
109111
particular application's representation of selection.
110112

111-
- **Plugins access the Hydra selection through the scene index tree**: although
112-
the selection is conceptually a singleton, we will provide access to it for
113-
scene index selection highlighting plugins through the scene index tree, by
114-
adding a mixin interface to the plugins. This avoids creating another object
115-
to maintain and encapsulate the Hydra selection, since the selection scene
116-
index is already performing this job.
113+
- **Plugins create and register a path mapper object** to translate application
114+
selection paths to Hydra scene index prim selection paths. Application
115+
paths are described through the Universal Front End API, with
116+
`Ufe::Path`, and Hydra scene index prim paths are described with OpenUSD
117+
`SdfPath`. A selection in the application must be translated to a
118+
selection in the Hydra scene graph, using a path mapper.
119+
120+
For example, consider a USD stage rooted at application path
121+
`|stage1|stageShape1`, and a USD prim `/Cube1` in that stage. This is
122+
described in the application by the `Ufe::Path` `|stage1|stageShape1,/Cube1`.
123+
Its corresponding Hydra prim path might be
124+
`/MayaUsdProxyShape_PluginNode/mayaUsdProxyShape1/Cube1`. A Hydra USD data
125+
producer plugin can register a path mapper that converts all `Ufe::Path` that
126+
begin with path prefix `|stage1|stageShape1` to Hydra scene index
127+
prim paths that begin with the `SdfPath` prefix
128+
`/MayaUsdProxyShape_PluginNode/mayaUsdProxyShape1`, so that
129+
`|stage1|stageShape1,/Cube1` gets mapped into
130+
`/MayaUsdProxyShape_PluginNode/mayaUsdProxyShape1/Cube1`.
117131

118132
## Implementation
119133

@@ -161,15 +175,14 @@ graph BT;
161175
roSn-.->ph2;
162176
end
163177
snSi[Selection scene index]-->ph2;
164-
fvpm[Flow Viewport merge]-->snSi;
178+
dpm[Data producer merge]-->snSi;
165179
subgraph pd[Plugin data]
166180
p1[Plugin 1];
167181
p2[Plugin 2];
168182
end
169-
fvpm-. Path .->p1;
170-
p1-->fvpm;
171-
p2-->fvpm;
172-
snSi-. Path .->fvpm;
183+
dpm-. Path .->p1;
184+
p1-->dpm;
185+
p2-->dpm;
173186
sn[/Selection/]-.->snSi;
174187
```
175188
The plugin data and plugin highlighting subtrees are where plugins add their
@@ -186,10 +199,6 @@ The object modeling is the following:
186199
- **Selection scene index**: builtin provided by the Flow Viewport Toolkit.
187200
- Has a pointer to read and write the Hydra selection.
188201
- Translates the application selection to Hydra selection.
189-
- **Flow Viewport merging scene index**: builtin provided by the Flow Viewport
190-
library.
191-
- Receives data from data provider plugin scene indices.
192-
- Forward path interface queries to plugin scene indices
193202
- **Plugin data scene index**: provided by plugin.
194203
- Injects plugin data into Hydra
195204
- **Plugin selection highlighting scene index**: provided by plugin.
@@ -199,14 +208,14 @@ The object modeling is the following:
199208
- Adds required geometry or data sources to implement selection
200209
highlighting
201210

202-
### New Scene Index Mixin Interface Base Class
211+
### New Path Mapper Base Class
203212

204-
The Flow Viewport Toolkit has a new mixin interface class:
213+
The Flow Viewport Toolkit has a new base class:
205214

206-
- **Path Interface**: so that the builtin selection scene index can query
207-
plugins to translate selected object application paths to selected Hydra
215+
- **PathMapper**: must be provided by data provider plugins so that Hydra
216+
can translate selected object application paths to selected Hydra
208217
prim paths. The plugin provides the concrete implementation of this
209-
interface.
218+
base class, and registers it to the **path mapper registry***.
210219

211220
### Implementation Classes
212221

@@ -216,8 +225,9 @@ The Flow Viewport Toolkit has a new mixin interface class:
216225
- Requires selected ancestor query from selection.
217226
- Dirties descendants on selection dirty.
218227
- **Render index proxy**:
219-
- Provides encapsulated access to the builtin Flow Viewport merging scene
220-
index.
228+
- Provides encapsulated access to the data producer merging scene
229+
index. This is a standard Hydra merging scene index to which Flow
230+
Viewport data producers are connected.
221231
- Other responsibilities to be determined, for future extension, possibly a
222232
[facade design pattern](https://en.wikipedia.org/wiki/Facade_pattern).
223233

@@ -233,30 +243,20 @@ class Selection{
233243
+HasFullySelectedAncestorInclusive(SdfPath) bool
234244
}
235245
236-
class PathInterface{
237-
+UfePathToPrimSelections(Ufe::Path) SdfPath
238-
}
239-
240246
class SelectionSceneIndex
241-
class MergingSceneIndex
242247
class WireframeSelectionHighlightSceneIndex
243248
244249
class RenderIndexProxy{
245-
+MergingSceneIndex mergingSceneIndex
250+
+HdMergingSceneIndex mergingSceneIndex
246251
+InsertSceneIndex()
247252
+RemoveSceneIndex()
248253
}
249254
250255
HdSingleInputFilteringSceneIndexBase <|-- SelectionSceneIndex
251256
252-
HdMergingSceneIndex <|-- MergingSceneIndex
253-
PathInterface <|-- MergingSceneIndex
254-
255257
HdSingleInputFilteringSceneIndexBase <|-- WireframeSelectionHighlightSceneIndex
256258
257-
RenderIndexProxy *-- MergingSceneIndex : Owns
258-
259-
SelectionSceneIndex ..> MergingSceneIndex : Path
259+
RenderIndexProxy *-- HdMergingSceneIndex : Owns
260260
261261
SelectionSceneIndex o-- Selection : Read / Write
262262
@@ -271,11 +271,6 @@ WireframeSelectionHighlightSceneIndex o-- Selection : Read
271271
improved (to amortized O(k), for a k-element path) through the use of a
272272
prefix trie, such as `Ufe::Trie`.
273273

274-
- At time of writing, merging scene index path lookup is O(n), for n input
275-
scene indices. This could be improved by implementing a caching scheme based
276-
on application path, as for a given application path prefix the same
277-
input scene index will always provide the translation to scene index path.
278-
279274
## Limitations
280275

281276
- Little investigation of pixel-based selection highlighting capability.

0 commit comments

Comments
 (0)