ShowTransition not working

bug

#1

I have another config in this same file that invokes:

Sketchup.active_model.options["PageOptions"]["ShowTransition"]=!showTransition

This used to work in prior versions of Sketchup, but no longer does (SU2018 MacOS 10.14), and seems to be de-coupled from the Model Info->Animation->Enable scene transitions checkbox. Steps to reproduce:

  1. Check the box Enable scene transition.
  2. Enter Sketchup.active_model.options["PageOptions"]["ShowTransition"]=false in the Ruby console window.
  3. Click another scene.

#2

I posted this a few weeks ago, and it ran fine on v18 for all who tried it…

module JcB
  module_function
  
	def show_trans_true
		Sketchup.active_model.options['PageOptions']['ShowTransition'] = true
	end

	def show_trans_false
		Sketchup.active_model.options['PageOptions']['ShowTransition'] = false
	end



	# create a command object.
	cmd = UI::Command.new('Toggle Scene Transition') {
		Sketchup.active_model.options['PageOptions']['ShowTransition'] ? show_trans_false : show_trans_true
	}
	cmd.menu_text = 'Toggle Scene Transition'
	
	cmd.set_validation_proc {
		if Sketchup.active_model.pages.count == 0
			MF_GRAYED
		else
			MF_ENABLED
		end
	}
	UI.menu('View').add_item cmd

end #module

john


#3

Thanks. My version and yours do seem to work when called from the menu item. Using a shortcut key sometimes works, and sometimes doesn’t, and even invoking from the Ruby console sometimes fails. Maybe it gets confused about active_model. I’ll monitor and see if I can spot a pattern.


#4

are you setting shortcut keys purely from code [ it’s considered to be bad practice ]…

do yours show up when you run Sketchup.get_shortcuts in Ruby Console?

they should be set from the GUI and work best from a menu command…

john


#5

You were using a mac, right? Are you sure a model window have focus when you trigger the shortcut key?