-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Scene Composer - Implement Sub Model Selection (#23)
- Save/Loading Works - Fixed issues with Compatibility with Enhanced Edit Feature - SubModels are compatbile with any tool that operates on an object 3D Co-authored-by: Mitchell Lee <mitchlee@amazon.com>
- Loading branch information
1 parent
c3525c7
commit 5805fa9
Showing
229 changed files
with
4,437 additions
and
4,202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
CYPRESS_INSTALL_BINARY=0 | ||
puppeteer_skip_chromium_download=true | ||
package-lock=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module.exports = { | ||
colorBackgroundContainerContent: 'colorBackgroundContainerContent', | ||
colorBackgroundContainerHeader: 'colorBackgroundContainerHeader', | ||
colorBackgroundDropdownItemDefault: 'colorBackgroundDropdownItemDefault', | ||
colorBackgroundDropdownItemHover: 'colorBackgroundDropdownItemHover', | ||
colorBackgroundInputDefault: 'colorBackgroundInputDefault', | ||
colorBackgroundInputDisabled: 'colorBackgroundInputDisabled', | ||
colorBackgroundItemSelected: 'colorBackgroundItemSelected', | ||
colorBackgroundLayoutMain: 'colorBackgroundLayoutMain', | ||
colorBackgroundNotificationBlue: 'colorBackgroundNotificationBlue', | ||
colorBackgroundNotificationGreen: 'colorBackgroundNotificationGreen', | ||
colorBackgroundNotificationRed: 'colorBackgroundNotificationRed', | ||
colorBorderButtonNormalDefault: 'colorBorderButtonNormalDefault', | ||
colorBorderContainerTop: 'colorBorderContainerTop', | ||
colorBorderDividerDefault: 'colorBorderDividerDefault', | ||
colorChartsYellow700: 'colorChartsYellow700', | ||
colorForegroundControlDefault: 'colorForegroundControlDefault', | ||
colorTextBodySecondar: 'colorTextBodySecondary', | ||
colorTextFormSecondary: 'colorTextFormSecondary', | ||
colorTextHeadingDefault: 'colorTextHeadingDefault', | ||
colorTextInputPlaceholder: 'colorTextInputPlaceholder', | ||
colorTextLabel: 'colorTextLabel', | ||
colorTextNotificationDefault: 'colorTextNotificationDefault', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import mockComponent from '../mockComponent'; | ||
|
||
const dreiRaw: any = jest.createMockFromModule('@react-three/drei'); | ||
|
||
const drei = Object.keys(dreiRaw).reduce((acc, comp) => { | ||
if (!comp.startsWith('_')) { | ||
acc[comp] = mockComponent(comp); | ||
} else { | ||
acc[comp] = dreiRaw[comp]; | ||
} | ||
return acc; | ||
}, {}); | ||
|
||
module.exports = { | ||
...drei, | ||
}; |
4 changes: 4 additions & 0 deletions
4
packages/scene-composer/__mocks__/@react-three/postprocessing.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
EffectComposer: 'EffectComposer', | ||
Outline: 'Outline', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const reactIntl = jest.requireActual('react-intl'); | ||
const intl = reactIntl.createIntl({ | ||
locale: 'en', | ||
}); | ||
|
||
module.exports = { | ||
...reactIntl, | ||
useIntl: jest.fn(() => intl), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
/** | ||
* Mock implementation of R3F (React Three Fiber) components with the string name for a clean snapshot test. | ||
*/ | ||
module.exports = { | ||
...jest.requireActual('three'), | ||
audioListener: 'audioListener', | ||
positionalAudio: 'positionalAudio', | ||
|
||
mesh: 'mesh', | ||
instancedMesh: 'instancedMesh', | ||
scene: 'scene', | ||
sprite: 'sprite', | ||
lOD: 'lOD', | ||
skinnedMesh: 'skinnedMesh', | ||
skeleton: 'skeleton', | ||
bone: 'bone', | ||
lineSegments: 'lineSegments', | ||
lineLoop: 'lineLoop', | ||
points: 'points', | ||
group: 'group', | ||
immediateRenderObject: 'immediateRenderObject', | ||
|
||
// cameras | ||
camera: 'camera', | ||
perspectiveCamera: 'perspectiveCamera', | ||
orthographicCamera: 'orthographicCamera', | ||
cubeCamera: 'cubeCamera', | ||
arrayCamera: 'arrayCamera', | ||
|
||
// geometry | ||
instancedBufferGeometry: 'instancedBufferGeometry', | ||
bufferGeometry: 'bufferGeometry', | ||
boxBufferGeometry: 'boxBufferGeometry', | ||
circleBufferGeometry: 'circleBufferGeometry', | ||
coneBufferGeometry: 'coneBufferGeometry', | ||
cylinderBufferGeometry: 'cylinderBufferGeometry', | ||
dodecahedronBufferGeometry: 'dodecahedronBufferGeometry', | ||
extrudeBufferGeometry: 'extrudeBufferGeometry', | ||
icosahedronBufferGeometry: 'icosahedronBufferGeometry', | ||
latheBufferGeometry: 'latheBufferGeometry', | ||
octahedronBufferGeometry: 'octahedronBufferGeometry', | ||
parametricBufferGeometry: 'parametricBufferGeometry', | ||
planeBufferGeometry: 'planeBufferGeometry', | ||
polyhedronBufferGeometry: 'polyhedronBufferGeometry', | ||
ringBufferGeometry: 'ringBufferGeometry', | ||
shapeBufferGeometry: 'shapeBufferGeometry', | ||
sphereBufferGeometry: 'sphereBufferGeometry', | ||
tetrahedronBufferGeometry: 'tetrahedronBufferGeometry', | ||
textBufferGeometry: 'textBufferGeometry', | ||
torusBufferGeometry: 'torusBufferGeometry', | ||
torusKnotBufferGeometry: 'torusKnotBufferGeometry', | ||
tubeBufferGeometry: 'tubeBufferGeometry', | ||
wireframeGeometry: 'wireframeGeometry', | ||
parametricGeometry: 'parametricGeometry', | ||
tetrahedronGeometry: 'tetrahedronGeometry', | ||
octahedronGeometry: 'octahedronGeometry', | ||
icosahedronGeometry: 'icosahedronGeometry', | ||
dodecahedronGeometry: 'dodecahedronGeometry', | ||
polyhedronGeometry: 'polyhedronGeometry', | ||
tubeGeometry: 'tubeGeometry', | ||
torusKnotGeometry: 'torusKnotGeometry', | ||
torusGeometry: 'torusGeometry', | ||
textGeometry: 'textGeometry', | ||
sphereGeometry: 'sphereGeometry', | ||
ringGeometry: 'ringGeometry', | ||
planeGeometry: 'planeGeometry', | ||
latheGeometry: 'latheGeometry', | ||
shapeGeometry: 'shapeGeometry', | ||
extrudeGeometry: 'extrudeGeometry', | ||
edgesGeometry: 'edgesGeometry', | ||
coneGeometry: 'coneGeometry', | ||
cylinderGeometry: 'cylinderGeometry', | ||
circleGeometry: 'circleGeometry', | ||
boxGeometry: 'boxGeometry', | ||
|
||
// materials | ||
material: 'material', | ||
shadowMaterial: 'shadowMaterial', | ||
spriteMaterial: 'spriteMaterial', | ||
rawShaderMaterial: 'rawShaderMaterial', | ||
shaderMaterial: 'shaderMaterial', | ||
pointsMaterial: 'pointsMaterial', | ||
meshPhysicalMaterial: 'meshPhysicalMaterial', | ||
meshStandardMaterial: 'meshStandardMaterial', | ||
meshPhongMaterial: 'meshPhongMaterial', | ||
meshToonMaterial: 'meshToonMaterial', | ||
meshNormalMaterial: 'meshNormalMaterial', | ||
meshLambertMaterial: 'meshLambertMaterial', | ||
meshDepthMaterial: 'meshDepthMaterial', | ||
meshDistanceMaterial: 'meshDistanceMaterial', | ||
meshBasicMaterial: 'meshBasicMaterial', | ||
meshMatcapMaterial: 'meshMatcapMaterial', | ||
lineDashedMaterial: 'lineDashedMaterial', | ||
lineBasicMaterial: 'lineBasicMaterial', | ||
|
||
// primitive | ||
primitive: 'primitive', | ||
|
||
// lights and other | ||
light: 'light', | ||
spotLightShadow: 'spotLightShadow', | ||
spotLight: 'spotLight', | ||
pointLight: 'pointLight', | ||
rectAreaLight: 'rectAreaLight', | ||
hemisphereLight: 'hemisphereLight', | ||
directionalLightShadow: 'directionalLightShadow', | ||
directionalLight: 'directionalLight', | ||
ambientLight: 'ambientLight', | ||
lightShadow: 'lightShadow', | ||
ambientLightProbe: 'ambientLightProbe', | ||
hemisphereLightProbe: 'hemisphereLightProbe', | ||
lightProbe: 'lightProbe', | ||
|
||
// helpers | ||
spotLightHelper: 'spotLightHelper', | ||
skeletonHelper: 'skeletonHelper', | ||
pointLightHelper: 'pointLightHelper', | ||
hemisphereLightHelper: 'hemisphereLightHelper', | ||
gridHelper: 'gridHelper', | ||
polarGridHelper: 'polarGridHelper', | ||
directionalLightHelper: 'directionalLightHelper', | ||
cameraHelper: 'cameraHelper', | ||
boxHelper: 'boxHelper', | ||
box3Helper: 'box3Helper', | ||
planeHelper: 'planeHelper', | ||
arrowHelper: 'arrowHelper', | ||
axesHelper: 'axesHelper', | ||
|
||
// textures | ||
texture: 'texture', | ||
videoTexture: 'videoTexture', | ||
dataTexture: 'dataTexture', | ||
dataTexture3D: 'dataTexture3D', | ||
compressedTexture: 'compressedTexture', | ||
cubeTexture: 'cubeTexture', | ||
canvasTexture: 'canvasTexture', | ||
depthTexture: 'depthTexture', | ||
|
||
// misc | ||
raycaster: 'raycaster', | ||
vector2: 'vector2', | ||
vector3: 'vector3', | ||
vector4: 'vector4', | ||
euler: 'euler', | ||
matrix3: 'matrix3', | ||
matrix4: 'matrix4', | ||
quaternion: 'quaternion', | ||
bufferAttribute: 'bufferAttribute', | ||
instancedBufferAttribute: 'instancedBufferAttribute', | ||
color: 'color', | ||
fog: 'fog', | ||
fogExp2: 'fogExp2', | ||
shape: 'shape', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
import * as React from 'react'; | ||
|
||
export const sceneComposerIdContext = React.createContext('default'); | ||
|
||
export const useSceneComposerId = () => { | ||
return React.useContext(sceneComposerIdContext); | ||
}; |
Oops, something went wrong.