Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion sass/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
@import 'editor/editor-message-box';
@import 'editor/editor-confirmation-dialog';
@import 'editor/editor-settings-launch-page';
@import 'editor/editor-engine-picker';
@import 'editor/editor-auditor-picker';
@import 'editor/editor-clipboard';
@import 'editor/editor-howdoi';
Expand Down
76 changes: 0 additions & 76 deletions sass/editor/_editor-engine-picker.scss

This file was deleted.

5 changes: 0 additions & 5 deletions src/common/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ class Editor<T extends EditorMethods> extends Caller<T> {
*/
isCodeEditor: boolean = false;

/**
* Whether the Editor project is using engine v2.
*/
projectEngineV2: boolean = ('settings' in config.project) ? (config.project.settings as Record<string, any>)?.engineV2 ?? false : false;

/**
* Editor API history global
*/
Expand Down
3 changes: 1 addition & 2 deletions src/editor-api/external-types/config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ type Plan = {
};

type ProjectSettings = {
engineV2: boolean,
antiAlias: boolean,
fillMode: string,
resolutionMode: string,
Expand Down Expand Up @@ -112,7 +111,7 @@ type Url = {

type EngineVersions = {
current: { version: string, description: string },
force: { version: string, description: string },
force?: { version: string, description: string },
previous?: { version: string, description: string },
releaseCandidate?: { version: string, description: string },
};
Expand Down
4 changes: 2 additions & 2 deletions src/editor/assets/assets-migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ editor.once('load', () => {
asset.set('data.useSkybox', true);
}

// NOTE: useGammaTonemap is used by engine v1 so bind useTonemap to useGammaTonemap
// NOTE: keep legacy tonemap data in sync
asset.on('data.useTonemap:set', (value: boolean) => {
asset.set('data.useGammaTonemap', value);
});
Expand Down Expand Up @@ -281,7 +281,7 @@ editor.once('load', () => {
asset.set('data.clearCoatNormalMapOffset', [0, 0]);
}

// NOTE: set shader to blinn if it is not already for engine v1
// NOTE: keep legacy shader data normalized
if (asset.get('data.shader') !== 'blinn') {
const shader = asset.get('data.shader');
asset.set('data.shader', 'blinn');
Expand Down
10 changes: 0 additions & 10 deletions src/editor/assets/assets-srgb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,16 +313,6 @@ const startChecker = () => {
const isMaterial = usage.type === 'asset' && observer.get('type') === 'material';
const isUIElement = usage.path.includes('components.element');
const isSprite = usage.path.includes('components.sprite');
const isSpecularSheen = usage.path === 'data.specularMap' || usage.path === 'data.sheenMap';

// if project is using engine v1 and the usage is a specular or sheen map
// suppress the issue and log info message
if (!editor.projectEngineV2 && isSpecularSheen) {
editor.call('console:log', uiMsg, verboseMsg, usage.jump);
suppressed++;
continue;
}

// if all issues are usages then fixable so log a warning
if (issues.length === usages.length) {
editor.call('console:warn', uiMsg, verboseMsg, usage.jump);
Expand Down
2 changes: 1 addition & 1 deletion src/editor/attributes/reference/assets/cubemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ export const fields: AttributeReference[] = [{
}, {
name: 'asset:cubemap:generateLegacyCubemap',
title: 'Generate Legacy Cubemap',
description: 'Generate the prefiltered lighting data in cubemap format instead of atlas format. This option will result in larger prefiltered data that is slower to download at runtime, but is kept to be backwards compatible. This option should be used when running on PlayCanvas Engine v1.63 and earlier.'
description: 'Generate the prefiltered lighting data in cubemap format instead of atlas format. This option will result in larger prefiltered data that is slower to download at runtime, but is kept for backwards compatibility.'
}];
2 changes: 1 addition & 1 deletion src/editor/attributes/reference/components/audiosource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const fields: AttributeReference[] = [{
name: 'audiosource:component',
title: 'pc.AudioSourceComponent',
subTitle: '{pc.Component}',
description: `The AudioSource Component controls playback of an audio sample. ${editor.projectEngineV2 ? 'This class has been removed' : 'This class will be deprecated'} in favor of {@link pc.SoundComponent}.`,
description: 'The AudioSource Component controls playback of an audio sample. This class has been removed in favor of {@link pc.SoundComponent}.',
url: 'https://api.playcanvas.com/engine/classes/AudioSourceComponent.html'
}, {
name: 'audiosource:3d',
Expand Down
4 changes: 2 additions & 2 deletions src/editor/attributes/reference/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ editor.once('load', () => {
description: 'The order in which attempts are made to create the graphics devices.'
}, {
name: 'settings:project:enableWebGpu',
title: `Enable WebGPU${editor.projectEngineV2 ? '' : ' (beta)'}`,
description: `When enabled, the application will try to use WebGPU${editor.projectEngineV2 ? '' : ' (beta)'} if available.`
title: 'Enable WebGPU',
description: 'When enabled, the application will try to use WebGPU if available.'
}, {
name: 'settings:project:enableWebGl2',
title: 'Enable WebGL 2.0',
Expand Down
1 change: 0 additions & 1 deletion src/editor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ import './alerts/alert-maintenance';
// pickers
import './pickers/picker';
import './pickers/picker-confirm';
import './pickers/picker-engine';
import './pickers/picker-color';
import './pickers/picker-asset';
import './pickers/picker-curve';
Expand Down
27 changes: 0 additions & 27 deletions src/editor/inspector/assets/texture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1150,33 +1150,6 @@ class TextureAssetInspector extends Container {
this._webgl1NonPotWithoutAddressClampWarning.hidden = true;
this._webgl1NonPotWithMipmapsWarning.hidden = true;

// Don't show WebGL1 warnings when running in Engine v2 mode
if (editor.projectEngineV2) {
return;
}

const assets = this._assets;
// Show the warnings if any of the assets have an issue

for (let i = 0; i < assets.length; i++) {
const asset = assets[i];
if (!TextureCompressor.isPOT(asset.get('meta.width'), asset.get('meta.height'))) {
if (asset.get('data.mipmaps')) {
this._webgl1NonPotWithMipmapsWarning.hidden = false;
break;
}
}
}

for (let i = 0; i < assets.length; i++) {
const asset = assets[i];
if (!TextureCompressor.isPOT(asset.get('meta.width'), asset.get('meta.height'))) {
if (asset.get('data.addressu') !== 'clamp' || asset.get('data.addressv') !== 'clamp') {
this._webgl1NonPotWithoutAddressClampWarning.hidden = false;
break;
}
}
}
}

link(assets: Observer[]) {
Expand Down
6 changes: 2 additions & 4 deletions src/editor/inspector/components/audiosource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class AudiosourceComponentInspector extends ComponentInspector {

super(args);

this.headerText += editor.projectEngineV2 ? ' (REMOVED)' : ' (LEGACY)';
this.headerText += ' (REMOVED)';

this._attributesInspector = new AttributesInspector({
assets: args.assets,
Expand All @@ -102,9 +102,7 @@ class AudiosourceComponentInspector extends ComponentInspector {

this._field('3d').on('change', this._toggleFields.bind(this));

if (editor.projectEngineV2) {
this._attributesInspector.enabled = false;
}
this._attributesInspector.enabled = false;
}

_toggleFields() {
Expand Down
3 changes: 0 additions & 3 deletions src/editor/inspector/components/camera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,6 @@ class CameraComponentInspector extends ComponentInspector {
this._field(field).on('change', this._toggleFields.bind(this));
});

this._attributesInspector.getField('divider:0').hidden = !editor.projectEngineV2;
this._field('toneMapping').parent.hidden = !editor.projectEngineV2;
this._field('gammaCorrection').parent.hidden = !editor.projectEngineV2;
}

_toggleFields() {
Expand Down
52 changes: 0 additions & 52 deletions src/editor/inspector/settings-panels/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ const ATTRIBUTES: Attribute[] = [
};
})
}
}, {
label: '',
type: 'button',
alias: 'switchEngine',
args: {
text: `SWITCH TO ENGINE V${config.project.settings.engineV2 ? '1' : '2'}`,
icon: 'E304'
}
}
];

Expand Down Expand Up @@ -63,50 +55,6 @@ class EngineSettingsPanel extends BaseSettingsPanel {
}
}

const switchEngine = this._attributesInspector.getField('switchEngine');

let manualSet = false;
switchEngine.on('click', () => {
const engineV2 = this._projectSettings.get('engineV2');
editor.call('picker:engine', false, !engineV2, () => {
manualSet = true;
this._projectSettings.set('engineV2', !engineV2);
manualSet = false;
window.location.reload();
});
});

this._projectSettings.on('engineV2:set', (value, oldValue) => {
// check if user has write permissions
if (!editor.call('permissions:write')) {
return;
}

// check if value is changing
if (value === oldValue) {
return;
}

// disable switch button if hidden
if (switchEngine.hidden) {
return;
}

// ignore set if we initiated it
if (manualSet) {
return;
}

// skip initial set
if (oldValue === null) {
return;
}

editor.call('picker:engine', true, value);

// reload after a second
setTimeout(() => window.location.reload(), 1000);
});
}
}

Expand Down
Loading