From c2e5651015bd3a548ac3db0be3a37f28f88542f9 Mon Sep 17 00:00:00 2001 From: Brian Zinn Date: Wed, 11 Nov 2020 23:01:10 -0800 Subject: [PATCH] fix textures (broke when adding ThinTexture - new in 4.2). --- package.json | 10 +++--- src/generatedCode.ts | 82 +++++++++++++++++++++--------------------- tools/generate-code.ts | 16 ++++----- 3 files changed, 54 insertions(+), 54 deletions(-) diff --git a/package.json b/package.json index 3c11283a..d1884315 100644 --- a/package.json +++ b/package.json @@ -47,11 +47,11 @@ "devDependencies": { "@babel/core": "^7.11.6", "@babel/plugin-proposal-class-properties": "^7.10.4", - "@babylonjs/core": "^4.2.0-rc.6", - "@babylonjs/gui": "^4.2.0-rc.6", - "@babylonjs/inspector": "4.2.0-rc.6", - "@babylonjs/loaders": "4.2.0-rc.6", - "@babylonjs/procedural-textures": "4.2.0-rc.6", + "@babylonjs/core": "^4.2.0-rc.8", + "@babylonjs/gui": "4.2.0-rc.8", + "@babylonjs/inspector": "4.2.0-rc.8", + "@babylonjs/loaders": "4.2.0-rc.8", + "@babylonjs/procedural-textures": "4.2.0-rc.8", "@inlet/react-pixi": "^1.2.8", "@rollup/plugin-json": "^4.0.2", "@rollup/plugin-typescript": "^4.0.0", diff --git a/src/generatedCode.ts b/src/generatedCode.ts index 0dc112c2..e7e3c8bb 100644 --- a/src/generatedCode.ts +++ b/src/generatedCode.ts @@ -6079,14 +6079,14 @@ export class FiberStandardMaterialPropsHandler implements PropsHandler { checkPrimitiveDiff(oldProps.DoubleClickDelay, newProps.DoubleClickDelay, 'DoubleClickDelay', changedProps) checkPrimitiveDiff(oldProps.DragMovementThreshold, newProps.DragMovementThreshold, 'DragMovementThreshold', changedProps) checkPrimitiveDiff(oldProps.dumpNextRenderTargets, newProps.dumpNextRenderTargets, 'dumpNextRenderTargets', changedProps) - // type: 'BabylonjsCoreBaseTexture' property (not coded) BabylonjsCoreScene.environmentBRDFTexture. + checkTextureDiff(oldProps.environmentBRDFTexture, newProps.environmentBRDFTexture, 'environmentBRDFTexture', changedProps) checkPrimitiveDiff(oldProps.environmentIntensity, newProps.environmentIntensity, 'environmentIntensity', changedProps) - // type: 'BabylonjsCoreBaseTexture' property (not coded) BabylonjsCoreScene.environmentTexture. + checkTextureDiff(oldProps.environmentTexture, newProps.environmentTexture, 'environmentTexture', changedProps) checkPrimitiveDiff(oldProps.ExclusiveDoubleClickMode, newProps.ExclusiveDoubleClickMode, 'ExclusiveDoubleClickMode', changedProps) checkColor3Diff(oldProps.fogColor, newProps.fogColor, 'fogColor', changedProps) checkPrimitiveDiff(oldProps.fogDensity, newProps.fogDensity, 'fogDensity', changedProps) diff --git a/tools/generate-code.ts b/tools/generate-code.ts index 28fda5be..a27e681b 100644 --- a/tools/generate-code.ts +++ b/tools/generate-code.ts @@ -124,7 +124,7 @@ const enumMap: Map = new Map(); let ENUMS_LIST: string[] = []; const PROPS_EXPORTS: string[] = []; // used to put all props in single import. -// These are the base/factory classes we used to generate everything. Comment them out to skip generation (you must keep "Node", though) +// These are the base/factory classes we used to generate everything. let classesOfInterest: Map = new Map(); // always needed: @@ -134,10 +134,10 @@ classesOfInterest.set("Mesh", undefined); classesOfInterest.set("AbstractScene", undefined); classesOfInterest.set("Scene", undefined); -// decides what is generated +// decides what is generated (useful to remove some to speed up debugging) classesOfInterest.set("Camera", undefined); -classesOfInterest.set("Material", undefined); classesOfInterest.set("MeshBuilder", undefined) +classesOfInterest.set("Material", undefined); classesOfInterest.set("Light", undefined); classesOfInterest.set("Control", undefined); classesOfInterest.set("Control3D", undefined); @@ -151,7 +151,7 @@ classesOfInterest.set("PhysicsImpostor", undefined); classesOfInterest.set("VRExperienceHelper", undefined); classesOfInterest.set("DynamicTerrain", undefined); classesOfInterest.set("EffectLayer", undefined); -classesOfInterest.set("Behavior", undefined); +classesOfInterest.set("Behavior", undefined); // TODO: remove this. classesOfInterest.set("PointsCloudSystem", undefined); /** @@ -931,7 +931,7 @@ const addPropsAndHandlerClasses = (generatedCodeSourceFile: SourceFile, generate let addedProperties = new Set(); // These properties break out to specific method handlers - type PropertyKind = 'BabylonjsCoreThinTexture' | 'BabylonjsCoreColor3' | 'BabylonjsCoreColor4' | 'BabylonjsCoreVector3' | 'BabylonjsCoreFresnelParameters' | 'BabylonjsCoreQuaternion' | + type PropertyKind = 'BabylonjsCoreBaseTexture' | 'BabylonjsCoreColor3' | 'BabylonjsCoreColor4' | 'BabylonjsCoreVector3' | 'BabylonjsCoreFresnelParameters' | 'BabylonjsCoreQuaternion' | 'BabylonjsGuiControl' | 'number[]' | 'lambda' | 'observable' | 'method' | 'primitive' | 'object'; type NameAndType = { name: string @@ -955,7 +955,7 @@ const addPropsAndHandlerClasses = (generatedCodeSourceFile: SourceFile, generate if (type === null) { return; // skip } - const methodName = method.getName() + // const methodName = method.getName() setMethods.push(method); }) }) @@ -1000,7 +1000,7 @@ const addPropsAndHandlerClasses = (generatedCodeSourceFile: SourceFile, generate }) } else { switch (type) { - case 'BabylonjsCoreThinTexture': + case 'BabylonjsCoreBaseTexture': case 'BabylonjsCoreColor3': case 'BabylonjsCoreColor4': // Color4.equals() not added until PR #5517 case 'BabylonjsCoreVector3': @@ -1114,7 +1114,7 @@ const addPropsAndHandlerClasses = (generatedCodeSourceFile: SourceFile, generate case 'BabylonjsCoreFresnelParameters': writer.writeLine(`checkFresnelParametersDiff(oldProps.${propToCheck.name}, newProps.${propToCheck.name}, '${propToCheck.name}', changedProps)`); break; - case 'BabylonjsCoreThinTexture': + case 'BabylonjsCoreBaseTexture': writer.writeLine(`checkTextureDiff(oldProps.${propToCheck.name}, newProps.${propToCheck.name}, '${propToCheck.name}', changedProps)`) break; case 'observable':