This commit is contained in:
Aria Minaei 2021-09-05 17:45:51 +02:00
parent f24e2b96d5
commit 400b55bf09
4 changed files with 3 additions and 32 deletions

View file

@ -55,31 +55,7 @@ function App() {
return ( return (
<div onClick={() => setBgIndex((bgIndex) => (bgIndex + 1) % bgs.length)}> <div onClick={() => setBgIndex((bgIndex) => (bgIndex + 1) % bgs.length)}>
<Canvas dpr={[1.5, 2]} linear shadows frameloop="demand"> <Canvas dpr={[1.5, 2]} linear shadows frameloop="demand">
<Wrapper <Wrapper getSheet={() => getProject('Space').sheet('Scene')}>
getSheet={() =>
getProject('Space', {
state: {
sheetsById: {
'R3F-Canvas': {
staticOverrides: {
byObject: {
'Light 1': {
position: {
x: -60,
y: -63,
z: -79,
},
},
},
},
},
},
definitionVersion: '0.3.0-dev',
revisionHistory: ['1__HCrX_ol8j4wK3-Pi'],
},
}).sheet('Scene')
}
>
<fog attach="fog" args={[bg, 16, 30]} /> <fog attach="fog" args={[bg, 16, 30]} />
<color attach="background" args={[bg]} /> <color attach="background" args={[bg]} />
<ambientLight intensity={0.75} /> <ambientLight intensity={0.75} />

View file

@ -4,7 +4,7 @@ import type {MutableRefObject} from 'react'
import {useLayoutEffect, useRef} from 'react' import {useLayoutEffect, useRef} from 'react'
import React from 'react' import React from 'react'
import useRefAndState from './useRefAndState' import useRefAndState from './useRefAndState'
import {studio} from '@theatre/studio' import studio from '@theatre/studio'
import type {PerspectiveCamera as PerspectiveCameraImpl} from 'three' import type {PerspectiveCamera as PerspectiveCameraImpl} from 'three'
import type {ISheet} from '@theatre/core' import type {ISheet} from '@theatre/core'
import {types} from '@theatre/core' import {types} from '@theatre/core'

View file

@ -1,7 +1,6 @@
import SnapshotEditor from './components/SnapshotEditor' import SnapshotEditor from './components/SnapshotEditor'
import studio from '@theatre/studio' import studio from '@theatre/studio'
import Toolbar from './components/Toolbar/Toolbar' import Toolbar from './components/Toolbar/Toolbar'
import {types} from '@theatre/core'
export default function setupPlugin() { export default function setupPlugin() {
studio.extend({ studio.extend({
@ -12,9 +11,6 @@ export default function setupPlugin() {
panes: [ panes: [
{ {
class: 'snapshotEditor', class: 'snapshotEditor',
dataType: types.compound({
grosse: types.number(20),
}),
component: SnapshotEditor, component: SnapshotEditor,
}, },
], ],

View file

@ -30,7 +30,6 @@ export interface PaneClassDefinition<
DataType extends PropTypeConfig_Compound<{}>, DataType extends PropTypeConfig_Compound<{}>,
> { > {
class: string class: string
dataType: DataType
component: React.ComponentType<{ component: React.ComponentType<{
paneId: string paneId: string
}> }>
@ -237,7 +236,7 @@ export default class TheatreStudio implements IStudio {
return this._getSelectionDerivation().tapImmediate(studioTicker, fn) return this._getSelectionDerivation().tapImmediate(studioTicker, fn)
} }
get selection(): (ISheetObject | ISheet)[] { get selection(): Array<ISheetObject | ISheet> {
return this._getSelection() return this._getSelection()
} }