mirror of
https://github.com/Doodle3D/Doodle3D-Core.git
synced 2024-12-22 19:13:49 +01:00
wait for assets to be loaded in create scene data
This commit is contained in:
parent
24abade4b9
commit
0a3686d8df
@ -51,7 +51,7 @@ class DoodlePreview extends React.Component {
|
|||||||
|
|
||||||
const { canvas } = this.refs;
|
const { canvas } = this.refs;
|
||||||
|
|
||||||
const sceneData = createSceneData(sketchData);
|
const sceneData = await createSceneData(sketchData);
|
||||||
|
|
||||||
const scene = createScene(sceneData, canvas);
|
const scene = createScene(sceneData, canvas);
|
||||||
this.setState(scene);
|
this.setState(scene);
|
||||||
|
5
src/d3/createSceneData.js
vendored
5
src/d3/createSceneData.js
vendored
@ -1,7 +1,10 @@
|
|||||||
import shortid from 'shortid';
|
import shortid from 'shortid';
|
||||||
import { SHAPE_TYPE_PROPERTIES } from '../constants/shapeTypeProperties.js';
|
import { SHAPE_TYPE_PROPERTIES } from '../constants/shapeTypeProperties.js';
|
||||||
|
import { load } from '../utils/loaded.js';
|
||||||
|
|
||||||
|
export default async function createSceneData(docData) {
|
||||||
|
await load;
|
||||||
|
|
||||||
export default function docToShapeData(docData) {
|
|
||||||
const sketchData = {
|
const sketchData = {
|
||||||
spaces: {},
|
spaces: {},
|
||||||
objectsById: {}
|
objectsById: {}
|
||||||
|
Loading…
Reference in New Issue
Block a user