webots
webots copied to clipboard
CadShape appearance interpretation
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
meshnodes and use thenameparameter 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 modelfeature. It converts the mesh to asolid, each submesh has its own IFS and appearance. It is quite easy to use and fast. However, whenCadShapeworks 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
CadShapenode. 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 theCadShapenode more complicated but seems maybe the better way to proceed. - Restore the
Import 3D modelfeature. Not very good as it is very similar to CadShape and can confuse user but seems like the least effort solution: ifCadShapeworks, 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.