-
-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimized publishing duplication #10220
base: dev
Are you sure you want to change the base?
Conversation
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: root.
|
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: root.
|
…into optimized-publishing-duplication
…into optimized-publishing-duplication
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: root.
|
const { sceneAssetID, projectName, sceneName, scenePath } = getState(EditorState) | ||
|
||
if (projectName && sceneName && scenePath) { | ||
const sceneQuery = useFind(assetPath, { query: { assetURL: scenePath ?? '' } }).data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This throws an invalid hook call. Must use useFind in a reactive context
await saveSceneGLTF(sceneAssetID, projectName, sceneName + '-optimized', abortController.signal) | ||
} | ||
|
||
setCurrentEditorScene(sceneURL, sceneQuery[0].id! as EntityUUID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sets the current editor scene to the same scene it is currently in. Need to set current scene to the newly created copy
|
||
setCurrentEditorScene(sceneURL, sceneQuery[0].id! as EntityUUID) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything after this point needs to wait for the scene change to complete and the new scene to finish loading. Use a useEffect and wait on the root scene entity to complete loading before proceeding with mesh baking
await saveSceneGLTF(sceneAssetID, projectName, sceneName + '-optimized', abortController.signal) | ||
} | ||
|
||
setCurrentEditorScene(sceneURL, sceneQuery[0].id! as EntityUUID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this needs to be in the "bake" conditional as well, because if we're not baking we have no need to change editor scene
|
||
// TODO: In duplicated scene, perform mesh baking to de-reference all models in the scene (saving scene as GLTF & fuse/compress scenes) | ||
// TODO: Publish the duplicated scene | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is where the "bake" conditional should end
|
||
if (validateForm(state.value, state.formErrors.value)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't delete the validateForm function, this removes notifications about incorrectly entered fields
Summary
Scene duplication added on publish.
Subtasks Checklist
Breaking Changes
References
closes #insert number here
QA Steps