Hey, all. In the documentation for UI.savepanel, the following appears:
Bug Fixed in SketchUp 2014: Wildcards were not working properly from SU7 to SU2013. Semicolon-separated lists of wildcards did not populate the file type dropdown. The filter string would be shown in the file name field with ‘*’ characters converted to ‘_’ characters.
I’m noticing this exact issue happening when I call UI.savepanel in SketchUp 2015 on 64-bit Windows.
For clarity, here is the function call:
UI.savepanel("Set File Location", "C:\\", "*.flv;*.mp4;*.mpeg4")
As the fix report states, the wildcards are not appearing in the file type dropdown, but showing in the filename location with underscore characters replacing the asterisks.
I’m calling this function within a
Also, I’m not sure if this is the right place to report bugs - if not, feel free to point me in the right direction and I’d be happy to post this issue there.
Also, for some reason it seems like UI.savepanel does not fully escape the backslashes within the returned filepath.
I just learned that it’s actually valid in Ruby to perform the following:
variable = "C:\some\path\to\dir"
as opposed to
variable = "C:\\some\\path\\to\\dir"
I might be missing something here, but I’m thinking this is also a side effect from calling UI.savepanel.
Also, if the value returned from UI.savepanel is sent to an external C function and read using the Ruby Extension API, the memory read is invalid and a segmentation fault is thrown.
I decided to send a dummy string in order to compare the result, and there were no issues.