[r139 BUG?] `raycaster.intersectObject` fails because groupMaterial index is -1 in imported FBX model

The reality is a major program (Cinema4d) exports FBX files with a large number of problems, not just this one. While working on the FBXLoader I did try to take a pragmatic approach and it already does handle many cases like this even though they are technically incorrect. However, towards the end nearly all the remaining problems were coming from models exported by the buggy Cinema4d exporter and I was finding that fixing one model often resulted in breaking other (correct) models and I was having to tediously check each fix against 50 or so models. I also don’t use Cinema4d so there wasn’t much motivation for me to work on bug fixes for it.

The fix for this particular bug doesn’t seem like it would break other models, and if you find that setting the negative indices to zero (or perhaps they wrap around to the end of the array?) then by all means please do make a PR with a fix.

I also might phrase this as expensive well-known product has had a buggy FBX exporter for years and doesn’t seem to have made any steps to fix it - even though they are presumably using the FBX SDK and should have a much easier time than we do since we have to reverse engineer the proprietary spec. Why should the onus be on us open source devs working for free to support something when the company selling a product for $4000 won’t fix things on their end?

2 Likes