How do I identify which piece of code governs the respective setting in the inspector?

Materials, in Babylon, can be inspected with the inspector. In this inspector, different settings can be changed. How do identify which piece of code is equivalent to the respective setting in the inspector? I tried searching through the docs but I was unable to guess which keywords would find the correct document.

(I was hoping to learn how to grab properties from the inspector in the thread “how to grab properties from inspector” but the content of that thread had nothing to do with the title.)

You can use this:

If you open the .json produced, you will see the name of the properties that have been changed during the recording.

that is actually pretty handy :wink: of course , in this light additionally, lets not forget to move forward with the times and make use of chatGPT , eg : I just asked :

Q: “using babylonjs framework , please list all properties of the PBR material that deal with clearcoat”

A:

Sure, here are the properties of the PBR material in BabylonJS framework that deal with clearcoat:

  1. clearCoat: This property sets the intensity of the clearcoat layer on the surface of the material. It is a value between 0 (no clearcoat) and 1 (full clearcoat).

  2. clearCoatIntensity: This property sets the intensity of the clearcoat reflections on the surface of the material. It is a value between 0 (no reflections) and 1 (full reflections).

  3. clearCoatRoughness: This property sets the roughness of the clearcoat layer on the surface of the material. It is a value between 0 (smooth) and 1 (rough).

  4. clearCoatNormal: This property sets the normal map for the clearcoat layer on the surface of the material. It is a texture that contains the normal information for the clearcoat layer.

  5. useClearCoat: This property enables or disables the clearcoat layer on the surface of the material. It is a boolean value where true enables the clearcoat layer and false disables it.

  6. clearCoatColor: This property sets the color of the clearcoat layer on the surface of the material. It is a BABYLON.Color3 object that represents the color of the clearcoat layer.

you could ask for code examples as well :wink:

Looks like it can read the API. Else, one could just go to the API, I guess :grin:

yes, it is just the api being repeated BUT this manner of searching is consolidated and faster. Plus dont miss out as I wrote at the end , you could follow this up or even upfront ask for code examples of each and it will do a snippet of code for each… the API docs cant do that. Again, you could go search for it somewhere on the internet but this takes like ~2 seconds to get all that focused and consolidated info at your fingertips.

1 Like

Yup but it has errors :slight_smile:

clearCoat is actually the main property where all the other ones will be :slight_smile:

On It you will find:

  • isEnabled
  • intensity
  • roughness
  • bumpTexture
  • All the tint props
  • and many more

I am not entirely sure where chatGPT sourced those props but none of them exist :slight_smile:

It is weird cause it is a lot of time really accurate in the answer

oh hold on , i do recall hearing the training data only went up to 2021 , could it be older api code then?

dammit , they need to update the training data!

@sebavan , interesting , if you try the bing version , which uses search results I think above training data , it is still incorrect , eg :

  • clearCoat: This property sets the intensity of the clear coat layer. The default value is 0.

its lists these as its source :

1. doc.babylonjs.com
2. forum.babylonjs.com
3. doc.babylonjs.com

Which of course has the props as you mentioned … so it to must actually be using older cached search results, not doing an actual live search.

Thats a little dissapointing, ok so my previous advice on using chatGPT needs to be taken with caution

This is perfect! Thanks for pointing this out. I never knew of the “Delta Changes” thing. This feels very much like script listening for Adobe plugins :+1: