Improve the linewidthmesh attribute of GUI functions

On the GUI editor, there are no attributes such as linkoffsety and linkoffsetx. There are no attributes after linkwithmesh

cc @carolhmj

I think we’ll probably need some design work for this one, @PatrickRyan what do you think? The link offsets require a mesh to be linked, so how would we display that on the editor, since we don’t show the meshes there?

@carolhmj I assume that if we set a value on the parameters for constrol.linkOffsetX and control.linkOffsetY and save them into the GUI json no problems would be created. The user would still have to call control.linkWithMesh(mesh) to see those parameters in action, so setting them to a default value (likely 0) in the GUI Editor should not cause any unexpected behavior.

The main question then becomes how useful is it to be able to set values on those parameters in isolation of the scene with the meshes you want to attach controls to? I can see an argument for having the parameters in the GUI Editor especially when we start talking about control templates. But these parameters should also appear in the inspector for that control and the user can also set them in code. So while the user will not see the attached mesh in the GUI Editor, it’s likely that once we are able to create and share control templates, the GUI Editor should be able to save this information as well.

And it should (I believe this already happens) be able to reflect any changes the user makes to a control’s parameter value in the inspector or in code. The challenge here is that the user needs to remember to save the json from the GUI Editor if any changes are made to parameter values in the inspector. I have some ideas around this for the future.

3 Likes

@PatrickRyan thanks for the response! It makes sense to add the link parameters already then, right?

Absolutely. Else, it wouldn’t make sense and would only create confusion

Agreed. I believe best would be to wait until then… (my opinion only)

@carolhmj, you are right, adding the link parameters now is fine. We will have to be explicit in the documentation about what these are and how they work since they need to be attached to a scene that has control.linkWithMesh(mesh) enabled for the user to see any impact on the control.

The challenge I spoke about with data being saved when changed outside the GUI editor (like in the inspector) is a problem we have with many of our tools like NME because when we need to update changes in the code, we need to rerun the scene which makes us lose context with any open tools or parameters changed in the inspector. This is a longer term solve that needs a bit more infrastructure to get right, so we should not wait for that work.

1 Like

Added in: Add Link offset properties to Gui Editor by carolhmj · Pull Request #12933 · BabylonJS/Babylon.js (github.com), will be in next version.

3 Likes

very good