webots icon indicating copy to clipboard operation
webots copied to clipboard

CadShape appearance interpretation

Open BenjaminDeleze opened this issue 3 years ago • 0 comments
trafficstars

Cadshape works well in most of the cases, however, when something goes wrong (aa appearance looks bad for example) their is no "good" option to fix it.

Current options:

  • Directly modify the mesh file (not user friendly)
  • Import the mesh in different mesh nodes and use the name parameter to include only one submesh at a time so that we can define each appearance manually. Heavy to do and imply a lot of redundancy.

Previous solution:

  • Use the Import 3D model feature. It converts the mesh to a solid, each submesh has its own IFS and appearance. It is quite easy to use and fast. However, when CadShape works it is useless and is duplicative.

Future solutions:

  • Modify how Webots interprets the appearance parameters of the mesh files: maybe possible to have some improvements, but it will not solve all problems as we need to keep backward coherency, but also because we need to convert the parameters to the PBR of Webots and depending on the software used to export the mesh, parameters could mean everything and their opposite (see (https://github.com/cyberbotics/webots/pull/4285#issuecomment-1090423903). So, at some point we have to make choices to get the appearances right in most cases but not in all cases.
  • Make a script to convert a mesh directly to a proto such that it would be easier to modify. I think it is not user friendly and also we do not always want a proto.
  • Expose the list of appearances in the CadShape node. It would work the same as the appearanceOverride parameter that we have in some Protos. We could get the name of the appearance from the mesh file in order to recognize which appearance correspond to what. It will make the CadShape node more complicated but seems maybe the better way to proceed.
  • Restore the Import 3D model feature. Not very good as it is very similar to CadShape and can confuse user but seems like the least effort solution: if CadShape works, use it, if not, use the old way. (Bonus: it generates IFS which can be useful we creating new PROTO with 3D model).

This is the possible solutions that we discussed so far, but there is maybe others.

BenjaminDeleze avatar May 17 '22 10:05 BenjaminDeleze