|
@@ -4,6 +4,22 @@ import { Texture } from 'babylonjs/Materials/Textures/texture';
|
|
|
import { DataStorage } from './dataStorage';
|
|
|
|
|
|
export class SerializationTools {
|
|
|
+
|
|
|
+ public static UpdateLocations(material: NodeMaterial, globalState: GlobalState) {
|
|
|
+ material.editorData = [];
|
|
|
+
|
|
|
+ // Store node locations
|
|
|
+ for (var block of material.attachedBlocks) {
|
|
|
+ let node = globalState.onGetNodeFromBlock(block);
|
|
|
+
|
|
|
+ material.editorData.push({
|
|
|
+ blockId: block.uniqueId,
|
|
|
+ x: node ? node.x : 0,
|
|
|
+ y: node ? node.y : 0
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public static Serialize(material: NodeMaterial, globalState: GlobalState) {
|
|
|
let bufferSerializationState = Texture.SerializeBuffers;
|
|
|
Texture.SerializeBuffers = DataStorage.ReadBoolean("EmbedTextures", true);
|