showtransition not working

I have another configuration in this same file that invokes:


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

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

I posted this a few weeks ago, and it worked fine in v18 for everyone who tried it…

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

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

	# create a command object.
	cmd ='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
	}'View').add_item cmd

end #module


Thank you. My version and yours seem to work when called from the menu item. Using a shortcut key sometimes works and sometimes doesn’t, and even console invocation of Ruby sometimes fails. Maybe it is confused with active_model. I’ll monitor and see if I can spot a pattern.

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

yours appears when you run Sketchup.get_shortcuts in ruby ​​console?

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


You were using a Mac, right? Are you sure a model window has focus when you activate the hotkey?

I still see this error in SU2019 on Mac!

Sketchup.active_model.options["PageOptions"].each_pair{ |key,value| puts "#{key}:#{value}"}

The options are completely unlinked from the behavior of the UI/scenes. In Windows everything is fine.

It’s very important to me to temporarily disable page transitions, but on Mac it’s no longer possible.
Just modify the Animation settings on a model and you’ll see that the values ​​read by the above code don’t change.

It all goes along with the long-standing problem that Mac loses “active_model” sometimes, even when only one model is open.

Is this a regression in SU2019? (If so, do you know which of the releases?)

I’m not aware of that. Do you have an example? (Or logged it in our issue tracker?)

I tested the code in SU2019.1 and it works fine! So it must be something recent…

I would have to write one. It happens in our Batch Render on Mac. At some point, active_model is no longer accessible and instead of rendering the next scene, the last one is rendered. It’s not easy to replicate, because it requires certain user behavior, which I haven’t identified yet.
Maybe we’ll try something in Leeds?

Was this related to linking to the standalone C API instead of the live API?

Yes. The UI decoupling was related to a bad API binding.

I discussed the issue with Hilliard on DevCamp. Realized that it can happen on Mac under other circumstances. He is on his way to fix the problem.

@tt_su I’m not sure what this “fix” refers to, and I don’t see anything in the API release notes referring to this from v19 to the latest version.

Could these “other circumstances” be a central issue(s)?
(It’s impossible to search the release notes for the app.)

Source link

James D. Brown
James D. Brown
Articles: 8279