When some of your scenes from a 2021 model are showing as empty whiteness in 2022

This is going to be a long read. You can scan quickly to know if you are the intended audience, and find your way to when I (eventually) talk about a work around.

There is a new issue in SketchUp 2022.0.1 that has come about because of fixes to other long standing problems. Actually, one of the problems is short standing, it was caused by a fix to the long standing one. Here’s a brief history:

  1. Problem that lots of people complained about.
  2. Fix to that problem.
  3. Some people were relying on the problem that most people were complaining about, and the #2 fix ruined things for them.
  4. New fix to make things nice for both the majority who complained about the problem, and the minority that relied on the problem.

Alas, there are some people who were doing things in a way that didn’t rely on the old problem, but that were influenced by it. The #4 fix ruined things for them.

A more exact history:

  1. Frequently there was bad clipping seen in SketchUp, mainly when you had used Perspective to move the camera into the geometry, then switched to Parallel Projection and looked around.
  2. 2022.0 had a new way of working, where the camera was backed outwards to avoid causing the clipping.
  3. One workflow that some people used was to Position Camera, and rely on the clipping problem to cut off all geometry behind the camera. Doing that saved using a section plane. The #2 fix meant that the camera was now showing geometry that previous was not visible.
  4. So, SketchUp was changed to allow people to position camera and keep the clipping, but it also backs out the camera position to solve the clipping when it wasn’t intended.

The ‘alas’ crowd are people who did use section planes, which meant not having to exploit the clipping issue by using the position camera feature, but, they also had used the position camera feature, which wasn’t needed, because they had a section plane. When such a 2021 or earlier model is opened in 2022.0.1, something about the position of the section plane and the position of the camera can leave some scenes looking empty.

We have a fix for that, but it still needs to be tested in the next update to SketchUp. I can’t tell you when that will be released. But, it’s enough into the future to make it worth telling you about a work around to the problem.

At least for the cases that we’ve heard about, people affected by the 2022.0.1 fix were apparently ok with the 2022.0 fix. That’s because they were using section planes, and so weren’t affected by having the camera backed outwards. Which means, if we can provoke a camera moving backwards for each scene that is affected, it would change the model to match what it would have looked like in 2022.0.

Getting to the workaround soon…

@sWilliams is a very smart fellow. He had been following the issue, and made a suggestion on how to fix existing models while waiting for the next official release. He made a Ruby script that goes through each of the scenes, finds the ones that may have the issue, and then adjusts the camera position to prevent seeing the emptiness.

Ruby scripts are often what is used to make extensions, but they can also be run live, in the window that is called Ruby Console. With 2022, it’s in the Extensions/Developer sub menu. Open that up, you will need it soon.

To run a script in that window, you need to carefully copy exactly what you want to say, paste it into the entry field at the bottom of the window, then press Enter/Return, to run that script. Below is the script needed to fix the emptiness problem.

The script does rely on one thing in the model, that you may need to change. Go into Window/Model Info, choose Animation, and make sure the Enable scene transitions checkbox isn’t checked. You can come back and turn it on again after running the script.

It would be a good idea to try this fix on a copy of the file. At this point we’ve fixed several files this way, but something may be different about your file. If this work around doesn’t help your case, please see if you can let me try a copy of your file.

Ok, here goes… You have the model with the problem scenes open, you have the Ruby Console showing, and you turned off scene transitions. Carefully copy this text, from the ‘d’ of 'def, to the ‘l’ of ‘nil’. You may need to do some scrolling to get to all of that text.

def self.repair_scene( index )
  model = Sketchup.active_model
  view = model.active_view
  camera = view.camera
  camera.perspective = true
  camera.perspective = false
  model.pages.selected_page.update( PAGE_USE_CAMERA )
  UI.start_timer(0) { find_next( index ) }
end

def self.find_next( index )
  index += 1
  model = Sketchup.active_model
  pages = model.pages
  while pages.size > 0 && index < pages.size
    page = pages[ index ]
    puts "Checking #{ page.name }"
    camera = page.camera
    if !camera.is_2d? && !camera.perspective?
      puts "Repairing #{ pages.selected_page.name }"
      pages.selected_page = page
      UI.start_timer( 0 ) { repair_scene( index ) }
      break
    end
    index += 1
  end
  puts "Repair Completed" if index == pages.size 
end

index = -1
find_next( index )
nil

Copy that text, then click in the entry field in the Ruby Console, and do a paste. Press Enter or Return, and you should see some messages telling you what is being done.

When you see Repair Complete, the script has finished. Try the scenes that were previously empty.

Please let me know if that works, or if you are still seeing the problem. Be ready to send me the file from before you tried the script.

Hi, I was really hoping this script was the saving grace…however, when I ran it…
this is what I got :frowning: any ideas ?
Thanks

That’s not the Ruby Console - which Colin explained how to open [menu item Extensions > Developer > Ruby Console], it’s an extension providing a different interface…
The Ruby code Colin gave works fine for me in the RC…

I tried the current version of Ruby Console +, and the script still worked ok.

My bad, thanks TIG, it worked in the real Ruby Console :slight_smile:

Colin, well, not for me, but the real Ruby Console worked fine, so thanks :slight_smile:
I just hope that the next bug fix release that cures this problem will not be at xmas time but early autumn :wink:

Having the same “whiteout” problem with two (2) parallel projected scenes in a 12 MB file, however,… not yet comfortable enough with Ruby script/coding to mess with this mod. Luckily, layout pages don’t seem to be affected by the offending sketchup scenes. Please let me know if/when fix becomes available. I’ve opted to receive further notifications from this thread. Thx

Thank you for this, it worked perfectly.