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

feat(model3d): Basic React controls #1368

Merged
merged 6 commits into from
May 4, 2021

Conversation

ConradJChan
Copy link
Contributor

@ConradJChan ConradJChan commented May 3, 2021

Initial React rewrite of Model3DViewer controls

TODO:

  • Unit tests

Before:
Screen Shot 2021-05-03 at 11 12 40 AM

After:
Screen Shot 2021-05-03 at 11 12 56 AM

@ConradJChan ConradJChan requested a review from a team as a code owner May 3, 2021 18:16
src/lib/Preview.js Outdated Show resolved Hide resolved
src/lib/viewers/box3d/Box3DViewer.js Outdated Show resolved Hide resolved
src/lib/viewers/box3d/model3d/Model3DViewer.js Outdated Show resolved Hide resolved
};
});

this.renderer.setAnimationClip(this.animationClips[0].id);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be acting on renderer inside of a controls-specific method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally not, but it was being done previously in a more roundabout way -- L282 sets the animation clip => Model3DControls would emit a EVENT_SELECT_ANIMATION_CLIP event => handleSelectAnimationClip which acts on the renderer

src/lib/viewers/box3d/model3d/Model3DViewer.js Outdated Show resolved Hide resolved
src/lib/viewers/controls/icons/IconAnimation24.tsx Outdated Show resolved Hide resolved
src/lib/viewers/controls/icons/IconReset24.tsx Outdated Show resolved Hide resolved
src/lib/viewers/controls/icons/IconAnimation24.tsx Outdated Show resolved Hide resolved
src/lib/viewers/controls/model3d/AnimationClipsToggle.scss Outdated Show resolved Hide resolved
src/lib/viewers/controls/model3d/ResetControl.tsx Outdated Show resolved Hide resolved
jstoffan
jstoffan previously approved these changes May 3, 2021
src/lib/viewers/controls/model3d/ResetControl.scss Outdated Show resolved Hide resolved
src/lib/viewers/controls/icons/IconAnimation24.tsx Outdated Show resolved Hide resolved
src/lib/viewers/controls/icons/IconAnimation24.tsx Outdated Show resolved Hide resolved
@jstoffan jstoffan self-requested a review May 3, 2021 19:47
jstoffan
jstoffan previously approved these changes May 3, 2021
@ConradJChan ConradJChan merged commit 528b065 into box:master May 4, 2021
@ConradJChan ConradJChan deleted the react-model3d-basic-controls branch May 4, 2021 01:28
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.

2 participants