scene.debugLayer : Copy last command to Clipboard

Pleasure ! :slight_smile:

@Deltakosh : by sharing a link to my build, here we are with @Joe_Kerr being able to test it, in ā€œreal conditionā€ totaly out of any dev infrastructure or context. Do you run such tests at BJS ?

That’s a good way to be able to avoid the ā€œIt worked on my machineā€ issue at release push. Maybe it could be an idea, to setup some kind of ā€œtestā€ CDN where final builds are sent online, for real, in order to be able to trigger an actual ā€œonline testā€. It could even be added to the automatic CI/CD. For example a VM or even an actual machine, free of any dev infra, connecting to the test CDN, and running a test, etc…

What do you think ? :slight_smile:


(By the way, I have a lot of other ideas, but if I put them down, I’ll SPAM the Feature Request Category :joy: )

1 Like

@Deltakosh :arrow_right: Adding new debug tools to the scene Inspector : copyCommandToClipboard & window.debugNode by Tricotou Ā· Pull Request #15050 Ā· BabylonJS/Babylon.js Ā· GitHub

Here is my very first PR :champagne: :slight_smile:

++
Tricotou

3 Likes

You rocked it! Love that feature!

And an amazing one !!!

Hello all !

@Deltakosh , @sebavan , Thank you for your kind comments about this PR and its new features :slight_smile:


Is there a way I can run a test ā€œat homeā€, under the same ā€œconstraintsā€ than the CI/CD run on Azure DevOps from the official repo ?

I’m asking because, on my machine I had no error on runing the build :

npm run build:dev
npm run build:umd

While the CI/CD gave error such as format, linting, etc… (For example I missed some let instead of const on variables which was not modified…) How can I test myself, instead of pushing a new commit, and waiting for the CI/CD to give me a go ?


Also, there is one last error (from the Linting error on Azure DevOps) I don’t know how to solve, if you can help :
error import/no-internal-modules: Reaching to "core/index" is not allowed.

The problem is about this file : packages/dev/sharedUiComponents/src/copyCommandToClipboard.ts where I do a :

import * as BABYLON from "core/index";

I was trying to reach the main BABYLON namespace in order to find the Class Name of the considered target, among BABYLON Classes, but maybe it’s not the way to go. It’s in relation with the first point I was mentioning in the PR’s first comment. Any idea about the right way to go ?


++
Tricotou

For lining you can run npm run format:test

For your error you have to import from the class itself like import ā€œwhateverā€ from ā€œcore/cameras/cameraā€

To get all the classes it is a bi trickier as we are using modules import in the inspector so there is no Babylon namespace perse (to help with treeshaking)

Maybe try to look around this guy?

Perfect ! :+1:

Ouuhhhw, sweet ! That’s exactly what I was thinking about : Registering all class names in a dict :smiley:
The existing function is for going from Name to Class only, but I just added a new one, for going the opposite way, from Class to Name :

/**
 * @internal
 */
export function GetClassName(obj: any): string {
    for (const key in _RegisteredTypes) {
        if (obj instanceof (_RegisteredTypes[key] as any)) {
            return key;
        }
    }
    return "Unknown";
}

Built, and tested, it works :+1:


Example by clicking on mesh scale :
BABYLON.AbstractMesh.scaling = new BABYLON.Vector3(1, 1, -1);


That said, it appears some classes are not registered, such as AbstractScene :
Unknown.clearColor = new BABYLON.Color3(0, 0, 0);//(HEX : #000000)
Or as well the ImageProcessingConfiguration :
Unknown.contrast = 1;


I’ll have a look at where the classes are registered, in order to try to add them :slight_smile:
If I can manage so, I’ll be so happy that a neater solution had been found :grin:

++
Tricotou

We should not use AbstractXXX classes

That’s what I thought, I was exactly having a look at this right now :slight_smile:
It comes from the fact that

scene instanceof BABYLON.AbstractScene;//true
scene instanceof BABYLON.Scene;//true

Both are true. I need to put a bit more logic in the loop, in order to avoid returning the AbstractXXX parent Class :stuck_out_tongue:

1 Like

Okay, so, I think we are reaching some milestone here :

  • import * as BABYLON from "core/index"; is not allowed : :white_check_mark: Solved using new function GetClassName along with registered classes from the core/Misc/typeStore implementation
  • AbstractXXX : :white_check_mark: Solved
  • Missing some Classes : :white_check_mark: Solved by registering names for Sound, MaterialPluginBase, BaseParticleSyste, ArcRotateCamera, FlyCamera, FollowCamera, ArcFollowCamera, FreeCamer, HemisphericLight, DirectionalLight, PointLight, SpotLight
  • Issue with copy buttons on particles (component floatLine which is used by component sliderLine was inducing a double copy button) : :white_check_mark: Solved by tweeking the inspector/components/actionTabs/actionTabs.scss, with a display:none inside the class floatLine when child of sliderLine

Demo Video (last version)

@Deltakosh , @sebavan on the PR there are still some errors but labelled as non Required (Visualization Tests - WebGPU), I hope it will be OK :crossed_fingers:

++
Tricotou

1 Like

webGPU is ok to ignore for now :slight_smile:
we should be good to go!

2 Likes

My finger is hover the merge button :slight_smile: waiting for the requeued task to finish

1 Like

It has been merged, CONGRATS !!!

1 Like

NICE ! :smiley: I’m so excited ! :grin:
:champagne: :champagne: :champagne:
How much time before it takes effect on the official CDN ?

3 Likes

Congratulations! Should be live this thursday!

Ok bad news we had to revert it as it is breaking all other tools

Please make sure to test all tools depending on the shared controls (nme, nge, sandbox, gui editor)

1 Like

:scream: Wow. Sorry for that…
Glad you could easily revert, then :see_no_evil:
Working on it ASAP :slight_smile:

++
Tricotou

no worries! We should have reviewed better

Ok I found the issue, it’s better than I thought.
it’s just a matter of some .scss files

Indeed I had edited only the one for the Inspector

I’m on it.

  • Fixed for Node Material Editor :white_check_mark:
  • Fixed for Node Geometry Editor :white_check_mark:
  • Fixed for GUI Editor :white_check_mark: