SketchUp / api-issue-tracker

Public issue tracker for the SketchUp and LayOut's APIs
https://developer.sketchup.com/
38 stars 10 forks source link

Exported thumbnail doesn't display the same material as the model #922

Closed LItterBoy-GB closed 3 months ago

LItterBoy-GB commented 9 months ago
  1. SketchUp Version: 2023
  2. OS Platform: Windows 11

There is a difference between the thumbnail and the actual model.

1.skp

Sketchup.active_model.selection[0].definition.thumbnail_camera = Sketchup.active_model.active_view.camera
Sketchup.active_model.selection[0].definition.save_thumbnail File.join('E:', "1.jpg")

image image

thomthom commented 7 months ago

I think that has been by design in the thumbnail logic. It prunes out the background color.

thomthom commented 7 months ago

Or are you talking about something else? Can you add some specifics to what is expected behaviour?

LItterBoy-GB commented 7 months ago

Or are you talking about something else? Can you add some specifics to what is expected behaviour?

The export preview of the model in black has turned to white

thomthom commented 7 months ago

Oh, the material of the model. Hm.. didn't notice that. Interesting.

sketchup[bot] commented 7 months ago

Logged as: SKEXT-3887

ChrisFullmer commented 3 months ago

Looking at this issue, it appears that the component thumbnail was created before the dark material was applied. Now the thumbnail is cached in the model without the dark material. You can use definition.refresh_thumbnail to update the cached thumbnail. Then write out the thumbnail and it will show the dark material. https://ruby.sketchup.com/Sketchup/ComponentDefinition.html#refresh_thumbnail-instance_method