Set roughness of material on loaded GLB

Hi! Anyone know how to set roughness on a loaded GLB. Im reading a bunch of posts about it, but it seems like the examples are always creating a new material, whereas im just looking to set the existing roughness as i can in the inspector. Like here:
Screenshot 2023-03-08 at 9.28.18 PM

Any tips? Also, i remember we used to be able to record changes in the inspector and export the code that did the same thing. Can’t find that option anymore. Is it gone?

PG here (don’t want those trees to be shiny!)

When you load GLB, default materials which bbl generated are PBRMaterial. (Note some mesh.material are undefined)
You can change them as PBRMaterial directly.


There’s the Replay section in the Tools pane which can record diffs in .json files:

but I’m not sure we had a tool that generated source code for the diffs(?)

1 Like

Sure did. It recorded only the changes (not the diffs) and gave the code for it. And it was very slick and perfect for capturing just this code without having to dig into the API or the doc. Only thing is it was not sustainable. RIP :headstone: I shall remember you my dear old friend :rose: :smiling_face_with_tear:

yea - that tool was amazing.
(and thanks @Moriy - thought i’d tried that and got an error - but must have been some other configuration. thx much!)

1 Like

btw, i bet it would be relatively easy to use GPT to generate the code given the diffs… if the diffs could be isolated more easily. when i look at the diff file, it’s so massive - i can’t identify the single change i’ve made. like above, when i change roughness to .5 from .25, i get a massive diffs file…

Here, i tried a simple simple example so got a relatively small diffs file - and ran it through GPT. Seems reasonable (except that i would expect the diffs data to show me the before and after value - versus just the after value)

It would be a great enhancement to the tool if you could record only changes made via the inspector vs. whatever is happening on screen.

Here’s a better prompt and output:

Not too bad but it should be Id and not ID and normally you would only want it on transform node so getTransformNodeById :slight_smile: or a position property might not exist.

That’s what we had before. Sadly, I’m afraid this will likely not happen. Not as if I didn’t try my luck when this tool was burried :smiling_face_with_tear: I guess we will just have to do with this new version. It does have advantages but I agree that this is a downside to it. Time to better learn the API I suppose :grin: It’s not a bad thing in itself :student: