public void dialogCancel() { PersistenceManager ETerrainMaterialPersistMan = "ETerrainMaterialPersistMan"; SimGroup TerrainMaterialDlgNewGroup = "TerrainMaterialDlgNewGroup"; SimGroup TerrainMaterialDlgDeleteGroup = "TerrainMaterialDlgDeleteGroup"; // Restore material properties we have changed. this.restoreMaterials(); // Clear the persistence manager state. ETerrainMaterialPersistMan.clearAll(); // Delete all new object we have created. TerrainMaterialDlgNewGroup.clear(); // Restore materials we have marked for deletion. int deletedCount = TerrainMaterialDlgDeleteGroup.getCount(); for (uint i = 0; i < deletedCount; i++) { SimObject mat = TerrainMaterialDlgDeleteGroup.getObject(i); mat.parentGroup = "RootGroup"; ((SimSet)"TerrainMaterialSet").add(mat); } ((GuiCanvas)"Canvas").popDialog(this); }
public void snapshotMaterials() { if (!"TerrainMaterialDlgSnapshot".isObject()) { new ObjectCreator("SimGroup", "TerrainMaterialDlgSnapshot").Create(); } SimGroup group = "TerrainMaterialDlgSnapshot"; SimSet TerrainMaterialSet = "TerrainMaterialSet"; group.clear(); int matCount = TerrainMaterialSet.getCount(); for (uint i = 0; i < matCount; i++) { TerrainMaterial mat = TerrainMaterialSet.getObject(i); if (!mat.isMemberOfClass("TerrainMaterial")) { continue; } ObjectCreator oc = new ObjectCreator("ScriptObject"); oc["parentGroup"] = group.ID; oc["material"] = mat; oc["internalName"] = mat["internalName"]; oc["diffuseMap"] = mat["diffuseMap"]; oc["normalMap"] = mat["normalMap"]; oc["detailMap"] = mat["detailMap"]; oc["macroMap"] = mat["macroMap"]; oc["detailSize"] = mat["detailSize"]; oc["diffuseSize"] = mat["diffuseSize"]; oc["detailStrength"] = mat["detailStrength"]; oc["detailDistance"] = mat["detailDistance"]; oc["macroSize"] = mat["macroSize"]; oc["macroStrength"] = mat["macroStrength"]; oc["macroDistance"] = mat["macroDistance"]; oc["useSideProjection"] = mat["useSideProjection"]; oc["parallaxScale"] = mat["parallaxScale"]; oc.Create(); } }