Add node hookpoint to GLTFLoader and move the lights extension handler to the new system #19892
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.
This PR adds hookpoint for
node
inGLTFLoader
and moves the lights extension handler to the new system.Background of this PR is #19144 (comment)
In #19144, we use
invokeOne()
forloadXxx()
. But it doesn't fit to Light extension. A node can have mesh, camera, and light extension at a time and all the objects should be created under the node.invokeOne()
doesn't fit to it becauseinvokeOne()
stops to call the coreloadXxx()
if extension'sloadXxx()
creates an object. Then mesh and camera objects will not be created.A solution idea is adding
invokeAll()
hookpoint hereIt is a hookpoint where extension handlers create their special objects in addition to core spec mesh and camera. A good thing is the latter transform and node group initializations can be reused. It very fits to the light extension and @feiss 's text extension.
What do you think of?
Some notes.
loadNode()
hookpoint withinvokeOne()
asloadMaterial
,loadTexture
, or others does).createNode
for the new hookpoint. Better name idea is welcome. (I know I'm bad at naming in English...)NodeRef
thenmarkDef()
also needs to be extended and the handlers need to callget/addNodeRef()
.