Skip to content

Commit

Permalink
Merge branch 'dev' into tremblp/HYDRA-821/point_instance_pick
Browse files Browse the repository at this point in the history
  • Loading branch information
ppt-adsk committed Mar 22, 2024
2 parents 1e39197 + 731757f commit 7def2fe
Show file tree
Hide file tree
Showing 19 changed files with 904 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ HdSceneIndexBaseRefPtr FilteringSceneIndicesChainManager::createFilteringSceneIn
return nullptr;//Not an empty filtering scene indices chain
}

//Append the filtering scene indices chain tp the merging scene index from renderIndexProxy
//Append the filtering scene indices chain to the merging scene index from renderIndexProxy
_AppendFilteringSceneIndicesChain(viewportInformationAndSceneIndicesPerViewportData, inputSceneIndex);

if (viewportInformationAndSceneIndicesPerViewportData.GetLastFilteringSceneIndex() == nullptr){
Expand Down
19 changes: 19 additions & 0 deletions lib/flowViewport/API/samples/fvpDataProducerSceneIndexExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <pxr/imaging/hd/xformSchema.h>
#include <pxr/imaging/hd/instancerTopologySchema.h>
#include <pxr/imaging/hd/containerDataSourceEditor.h>
#include <pxr/imaging/hd/extentSchema.h>

//TBB headers to use multithreading
#include <tbb/parallel_for.h>
Expand Down Expand Up @@ -484,6 +485,9 @@ HdRetainedSceneIndex::AddedPrimEntry DataProducerSceneIndexExample::_CreateCubeP
.Build()
);

const GfRange3d cubeRange ({-halfSize, -halfSize, -halfSize},
{ halfSize, halfSize, halfSize});

//Add the cube primitive
HdRetainedSceneIndex::AddedPrimEntry addedPrim;
addedPrim.primPath = cubePath;
Expand All @@ -505,6 +509,14 @@ HdRetainedSceneIndex::AddedPrimEntry DataProducerSceneIndexExample::_CreateCubeP
.SetResetXformStack(HdRetainedTypedSampledDataSource<bool>::New(true)) //Mark the transform of prototype not inherit from parent
.Build(),

//Create an extent attribute to support the viewport bounding box display style,
//if no extent attribute is added, it will not be displayed at all in bounding box display style
HdExtentSchemaTokens->extent,
HdExtentSchema::Builder()
.SetMin(HdRetainedTypedSampledDataSource<GfVec3d>::New(cubeRange.GetMin()))
.SetMax(HdRetainedTypedSampledDataSource<GfVec3d>::New(cubeRange.GetMax()))
.Build(),

//create a mesh
HdMeshSchemaTokens->mesh,
meshDs,
Expand All @@ -524,6 +536,13 @@ HdRetainedSceneIndex::AddedPrimEntry DataProducerSceneIndexExample::_CreateCubeP
.SetMatrix(HdRetainedTypedSampledDataSource<GfMatrix4d>::New(
transform)).Build(),

//create an extent attribute to easily compute the bounding box from it
HdExtentSchemaTokens->extent,
HdExtentSchema::Builder()
.SetMin(HdRetainedTypedSampledDataSource<GfVec3d>::New(cubeRange.GetMin()))
.SetMax(HdRetainedTypedSampledDataSource<GfVec3d>::New(cubeRange.GetMax()))
.Build(),

//create a mesh
HdMeshSchemaTokens->mesh,
meshDs,
Expand Down
2 changes: 2 additions & 0 deletions lib/flowViewport/sceneIndex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ target_sources(${TARGET_NAME}
fvpSceneIndexUtils.cpp
fvpSelectionSceneIndex.cpp
fvpWireframeSelectionHighlightSceneIndex.cpp
fvpBBoxSceneIndex.cpp
)

set(HEADERS
Expand All @@ -21,6 +22,7 @@ set(HEADERS
fvpSceneIndexUtils.h
fvpSelectionSceneIndex.h
fvpWireframeSelectionHighlightSceneIndex.h
fvpBBoxSceneIndex.h
)

# -----------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 7def2fe

Please sign in to comment.