IECoreUSD : Add SceneAlgo::sceneFromStage
#1123
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This utility can be used to wrap a live in-memory
pxr::UsdStage
into anIECoreScene::SceneInterface
(as though the stage was already written to a file).I'm putting this up as a draft for now. It follows some discussion @johnhaddon and I had already, but I'm not convinced I like the utility method... As a client of
SceneInterfaces
, its confusing to not just callSceneInterface.create
orSharedSceneInterfaces.get
as normal...I wonder if it'd be worth the extra effort of adding
SceneInterface.create( const CompoundData *args )
(as we've discussed for other uses) and havingUSDScene
checkargs
for astage
, so we can replace the python access fromscene = IECoreUSD.SceneAlgo.sceneFromStage( stage )
to
scene = IECoreScene.SceneInterface.create( { "stage" : stage } )
Note also I've currently hard-coded to Read mode only when providing a stage. I'm not sure if that's a good idea, but it was easier to get the draft PR up today without testing write mode...