Open DanRathbun opened 4 years ago
Also dezmo points out that the doc is incorrect in the option key listing ...
Newly listed for SU2020 are:
ROPDrawHiddenGeometry
ROPDrawHiddenObjects
But those are the constant names. The key names are ...
DrawHiddenGeometry
DrawHiddenObjects
These are the two that supersede the use of "DrawHidden"
.
~
SketchUp Ruby API Documentation Issue
The
Sketchup::RenderingOptions
class documentation mentions the addition of the integer constants ...... but not what the scenario is with the old constant ...
Also the docs fail to explicitly mention the v2020 addition of the options keys "DrawHiddenGeometry" and "DrawHiddenObjects" and again what is the situation concerning the old options key "DrawHidden" and it's integer constant for use with the
Sketchup::RenderingOptionsObserver
callback.Is the old "DrawHidden" key deprecated for versions 2020+ ?
Rhetorical: Why was a new integer assigned for "hidden geometry" ?
... and, which integer would API coders expect to be passed to the RO observer callback going forward,
28
or29
?TESTED:
Okay, we have a strange scenario. The observer callback gets the integer for the exact key used to make a change from Ruby code. (ie,
28
or29
) But ... the user's manually checking / unchecking the View menu item only sends the integer29
(Sketchup::RenderingOptions::ROPDrawHiddenGeometry
) in SketchUp 2020.So, my conclusion would have to be that the "DrawHidden" (and it's
ROPDrawHidden
constant) options key should be deprecated from use in new extensions targeting v20 and higher. But extensions supporting older versions as well need to check for both integers or duck type for the new constant as a conditional within the RO observer callback.Answer: The new constant was defined so the new behavior could be duck typed (as shown above.) Although the existence of the new
ROPDrawHiddenObjects
constant could have done this job alone.I was able to get the 2 keys ("DrawHiddenGeometry" and "DrawHidden") out of sync with each other, but only for a moment ...
... but when I manually opened the View menu, it seemed to sync them back together.
Thereafter, attempts (in this same session with the same model,) to purposely get them out of sync again via the same sort if console assignments failed.
Attempts to reload the same model (in the same session) and repeat still failed to reproduce the out of sync boolean returns values. So I don't know why it happened the first time, and then won't do it again.