pyslapi icon indicating copy to clipboard operation
pyslapi copied to clipboard

Fixed invalid texture names

Open MrGaribaldi opened this issue 4 years ago • 1 comments

The sketchup api doesn't ensure there is a valid filename in texture.name, sometimes it only contains the filename extension.

Blender handles this fine, except when such materials are exported to other formats like fbx, then the missing filenames creates trouble.

I've solved this issue by checking if the texture.name starts with a '.' and the length is less than 5 characters. In this case we know that there will only be an image extension in the filename, and should combine it with the material name.

This simple fix ensures you can export the imported model.

MrGaribaldi avatar Apr 05 '21 19:04 MrGaribaldi

@MrGaribaldi Thank you for your contribution, Erik. I am sorry for my much-delayed response, I was on a long hiatus.

I also couldn't merge your PR at the time because I have moved on with a few more changes and commits on my end already. It's always nice to create the PR for the most active branch, here develop.

Now since I have pulled all my changes to the main branch, would you like to resolve the current conflicts here and make a fresh PR?

  • I think you would just need to move your code-block from line#340 to line#428

I have one more question related to the logic you have used. But first, let us resolve the current conflict and from there we can move ahead. Also, please provide me with a sample file to reproduce the bug you have faced (if possible), that would be super nice.

arindam-m avatar Jul 30 '21 17:07 arindam-m