-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Lite: Wasm-compatible Model3D #7315
Conversation
🪼 branch checks and previews
|
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
394218c
to
f0564ee
Compare
A better design would be to create a new Svelte component like
Will work on it, so still keep this PR as draft a while. |
03cf40d
to
2855d06
Compare
2855d06
to
8ccffff
Compare
8ccffff
to
bee71ae
Compare
() => create_camera(scene, camera_position, zoom_speed, pan_speed), | ||
undefined, | ||
undefined, | ||
"." + value.path.split(".")[1] |
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 bug fixed.
With the current code, if the path contains more than one dot, the plugin name is not properly inferred.
Great PR @whitphx! Very nice to have |
Just did a quick test and everything looks good! Nice work @whitphx 😁 |
Nice! Thanks @whitphx and @hannahblair! |
* Make Model3DUpload.svelte Wasm-compatible * Make Model3D.svelte Wasm-compatible * add changeset * Create <Canvas3D /> and use it from <Model3D /> and <Model3DUpload /> --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Description
Closes: #7235
During the work, I also add some non-Wasm-related modifications as well.
Model3D.svelte
andModel3DUpload
Wasm-compatible, with minimum code changes.Canvas3D.svelte
component and move the Babylon code to it.Canvas3D
.engine
variable's lifecycle became more natural, which matches the Svelte componentCanvas3D
.Model3D.svelte
andModel3DUpload.svelte
are removed.scene
, remove the existing meshes, and load a new model file, instead of disposing of the oldscene
. The reason is it's easier to makescene
's lifecycle sync to the component's one, but it can be changed if desired.Sample