Define typescript interface for options of method to make screenshots

Third argument of this method doesnt have interface but can

As I can see in doc the interface may be like this

  engine: Engine,
  camera: Camera,
  size: {
    height?: number;
    precision?: number;
    width?: number;
  } | number,

And in the CreateScreenshotAsync and CreateScreenshot uses same options for size, so it should be define outside as independent interface like:

interface IScreenshotSize {
  height?: number;
  precision?: number;
  width?: number;


CreateScreenshot(engine: Engine, camera: Camera, size: IScreenshotSize | number...
CreateScreenshotAsync(engine: Engine, camera: Camera, size: IScreenshotSize | number...
CreateScreenshotUsingRenderTarget(engine: Engine, camera: Camera, size: IScreenshotSize | number...
CreateScreenshotUsingRenderTargetAsync(engine: Engine, camera: Camera, size: IScreenshotSize | number...

agree! Do you want to do the PR?

No thank. I still not read section “for contributors”, maybe in far furute =)

Sad…this could be a good way to help others

You know how to convince, i’ll try

1 Like

@Deltakosh see, I made it changes, and created PR, check it please

1 Like

Thanks man! truly appreciated

1 Like

@Deltakosh @sebavan and why when precision setup the width and height from options will be ignored?

That could be a good improvements :slight_smile: using width and height if defined

1 Like

I made pull from upstream and cant build app by exec cd Tools/Gulp/ && npm install && npm run build

Maybe you can prompt me what I need to do with it? (1.5 KB)

Did you also installed gulp locally and globally?

I did it before (at friday) npm install -g gulp@4.0.0 – globally
And locally from package.json at root of babylon.js folder

Pinging @sebavan as I have no idea what this error could be

Can you try gulp --max-old-space-size=8192 in the tools/gulp folder and provide me the log ?

Your current log does not highlight the issue unfortunately :frowning:

Ok, I wil try, but currently common error is

[at-loader] ..\..\loaders\src\glTF\2.0\Extensions\ExtrasAsMetadata.ts:5:27 
    TS2307: Cannot find module 'babylonjs-gltf2interface'.

No, error not changed and still looks like this: (2.6 KB)

w00000t this is really strange that it does not happen on the build server or for us locally :frowning: I can not understand where this would come.

Can you try (just for testing purpose) to clone in another directory navigate to tools/gulp then npm install then gulp --max-old-space-size=8192 ???

I’ll try but now I see what my IDE show error in the gltf-loader

This should definitely not happen as if you look in the tsconfig.json it references the file from the dist folder. Can you check you have the file dist/preview release/glTF2Interface/babylon.glTF2Interface.d.ts ???