Skip to content
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

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from

Conversation

internetcharles
Copy link
Contributor

Summary

Scene duplication added on publish.

Subtasks Checklist

Breaking Changes

References

closes #insert number here

QA Steps

Copy link

cla-bot bot commented May 22, 2024

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: root.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

Copy link

cla-bot bot commented May 22, 2024

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: root.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

Copy link

cla-bot bot commented May 24, 2024

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: root.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

const { sceneAssetID, projectName, sceneName, scenePath } = getState(EditorState)

if (projectName && sceneName && scenePath) {
const sceneQuery = useFind(assetPath, { query: { assetURL: scenePath ?? '' } }).data
Copy link
Member

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)
Copy link
Member

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)
}

Copy link
Member

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)
Copy link
Member

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

Copy link
Member

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)) {
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants