Looks good Dave.
I went back to IE and cleared my cache, added a &t=1 parameter (to force a reload), and still no luck.
Can someone else try it.
Looks good Dave.
I went back to IE and cleared my cache, added a &t=1 parameter (to force a reload), and still no luck.
Can someone else try it.
Whan I view this collection in Internet Explorer, I only see 16 items:
https://3dwarehouse.sketchup.com/collection.html?id=9f5aa31dc3ee00ef6c134b68c36309b4
Am I dreaming?
Or should I just abandon the 3D warehouse?
Coincidentally I posted a clay image on my blog today:
(Rendered with IRender nXt using the Clay Rendering option)
The sketchy edges do not reflect in the mirror properly. We have another option to render edges which would handle reflections properly, but it only works with non-sketchy edges. If you want Sketchy edges - it is best not to include this obvious of a reflection.
@tt_su said:
Yea, it's an annoying deviance that Sketchup::load acts like Sketchup::require.
For my personal projects I got reload code for when testing RBS files where I remove the file from the $LOADED_FEATURES list.
$LOADED_FEATURES - Aha! I didn't know about that. I guess you learn something ever day.
@dan rathbun said:
I totally disagree and always will.
If it is wrong, fix it make it correct, at the first best opportunity.
With this release using Ruby 2.0, was the perfect time to fix it so that developers could check their code, and update it at the same time they fixed other things that needed fixing for Ruby 2.x.
You are right Dan. This release would have been a great time to fix this, and we could all have looked through our code for calls to Sketchup.load() to anticipate problems.
Also, if Sketchup.load() always loaded things, rather than just the first time, if would almost never create a real problem. So they should just fix it now.
(It would "create a problem", if some one was changing .rb files on the fly, and then loading them with Sketchup.load and expecting that the would only load if they had not already been loaded. I suspect that no one is actually doing this. We do have code which creates ruby files on the fly, and then loads them - but we expect them to actually get loaded. [We wrote these as part of an early CAD System to SketchUp importer which created a ruby file of the geometry of the CAD System, and then loaded to ruby file to import the geometry.])
@jim said:
You could test using the unscrambled file, then load would work as expected.
I don't think Sketchup.load ever works as expected.
I expected it to load the .rb or .rbs, even if I had already loaded it before.
What it does is quietly "not load" it if it has been loaded already.
I couldn't find anything else about this in the Forum, so I thought I would pass it along.
In previous versions of SketchUp, we used Win32API to start processes.
We changed all these to use the Ruby system() command for SU 2014.
Sometime we want to start a process where ruby does not wait for it to complete.
You can do this with the DOS start command:
system('start ' + scommand_line)
The the program in the command line will execute and ruby will continue without waiting for it. (Note the command line contains the name of the .exe and also some command arguments)
However, due to quirk with "start", this fails if the command line starts with double quotes. I found this comment on the web:
"START has a peculiarity involving double quotes around the first parameter. If the first parameter has double quotes it uses that as the optional TITLE for the new window. "
So, just adding a blank set of double quotes fixed our problem. This works whether the command line actually starts with a double quote or not
system('start "" ' + scommand_line)
Either way it is a confusion.
We use "require" when we only want to load something once - and are prepared to exit and restart SketchUp if we want to change something an load it again.
But, especially when debugging our code, we want to use 'load' to reload a ruby which we are debugging without having to exit and restart SketchUp. (Perhaps we should reload it, but it is awfully convenient to be able to reload a ruby and test it on the fly)
Because we incorrectly assumed that Sketchup.load() and load() were identical, except for the processing of .rbs files, SketchUp.load() occasionally slipped into something which would have worked with load.
Ah, but C'est la Vie - it is too late now for SketchUp to make load and require operated differently, and more in keeping with Ruby load and require. So we'll just have to be more careful to use just load().
I see this note on the Google SketchUp forum:
*[pre:jdmy8csy]"Sketchup.load behaves just like Sketchup.require.
I just wanted to make note in case anyone was expecting Sketchup.load
to behave the same as its Ruby equivalent."[/pre:jdmy8csy]*
Could that be true?
If we are not using .rbs, is there any reason to use Sketchup.load rather than just load?
I am feeling pretty dumb this afternoon.
I have a ruby which looks like this:
printf("test.rb")
When I start SketchUp 2014 and load it, I get this:
(it is stored in c:\aa)
Sketchup.load('c:/aa/test.rb') test.rb true
If I try it again, I get this:
Sketchup.load('c:/aa/test.rb') false
Is there some new, (or perhaps even old), logic that only loads a ruby once?
If I use just load, it loads fine:
` load('c:/aa/test.rb')
test.rb
true
load('c:/aa/test.rb')
test.rb
true`
@brighter3d said:
Brighter3D PRO 1.14.2, 1280x720 (720p)
Thanks,
I put the first one on SketchUpRendering.com
@brighter3d said:
Brighter3D 1.14.2 PRO
Thanks - I liked the solid one better, and put a copy on SketchUpRendering.com
@dan rathbun said:
This IS expected... a user can copy a shared plugin to THEIR OWN plugin folder, and tweak it for their own use. THEIR edition then loads for THEM only, without affecting the edition that is shared by other users.
That was pretty clever! - Letting the User have his own version and it works well for APPDATA and ProgramData.
But if the same rubies happen to be in a SketchUp 2014 Plugins folder in Program Files, then find_support_file() finds them instead. (I understand that no one is supposed to place anything in the SketchUp Plugins folder in Program Files - but you can imagine why users using SketchUp 2014 for the first time might copy their old Plugins folder into SketchUp 2014 in Program files)
I placed identical ruby files - one in Plugins and one in a sub-folder of Plugins - in APPDATA and in ProgramData - and the AppData ones got run properly. (Using find_support_file() to get the full path of the second file worked properly)
However, when I placed the same files in Program Files as well (the same rubies in all 3 locations), and used get_support_file() to try to find the second ruby file, then it messed up and found the one in Program Files. When SketchUp started up, it ran the first ruby file from APPDATA, but find_support_file found the one in Program Files instead of the one in APPDATA.
I created two ruby files, rps_level1.rb uses find_support_file() to locate rps_level2.rb and then runs it.
rps_level1.rb - placed in Plugins:
` SKETCHUP_CONSOLE.show
printf("\n-----------------------\n")
printf("IN: %s\n", FILE)
printf("\nIN: 'RPS/rps_level2.rb'\n")
$sfull_path = Sketchup.find_support_file('Plugins/RPS/rps_level2.rb').to_s
printf("\nLOADING FULL PATH: %s\n", $sfull_path)
load ($sfull_path)`
rps_level2.rb placed in the Plugins/RPS sub folder:
printf("IN rps_level2.rb: %s\n", __FILE__)
When duplicate files were placed in APPDATA and ProgramData only the ones in APPDATA were executed:
` -----------------------
IN: C:/Users/Al/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/rps_level1.rb
LOADING FULL PATH: C:/Users/Al/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/RPS/rps_level2.rb
IN rps_level2.rb: C:/Users/Al/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/RPS/rps_level2.rb`
But when I placed a third copy in Program Files Plugins, find_support_file found the one in Program Files and ran it instead.
(Sketchup.find_support_file() called from APPDATA returned the path in Program Files.)
` -----------------------
IN: C:/Users/Al/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/rps_level1.rb
LOADING FULL PATH: C:/Program Files (x86)/SketchUp/SketchUp 2014/Plugins/RPS/rps_level2.rb
IN rps_level2.rb: C:/Program Files (x86)/SketchUp/SketchUp 2014/Plugins/RPS/rps_level2.rb`
@tt_su said:
Can you give some more background for this error? Are you creating a string from ENV or FILE for the filename you want to load?
To duplicate a problem we are having with a client, I created a user on my machine with an extended ASCII character in the name (using a word from a path in the users AppData location).
The user name is: aplikacíX (but there is a hex 0xa1 in front of the X. (Here is a hex dump)
C:\AA>echo aplikacíX| od -hc
0000000 7061 696c 616b a163 0d58 000a
a p l i k a c 241 X \r \n
I then used find_support_file() to get the complete path of a file name in Plugins:
sdll = Sketchup.find_support_file('Plugins/RPS_win32_IRender_nXt.so')
sdll was set to: C:/Users/aplikacíX/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/RPS_win32_IRender_nXt.so
I then passed the name on to require
require sdll
and I get this error:
Error: #<Encoding::CompatibilityError: incompatible character encodings: Windows-1252 and UTF-8>
C:/Program Files (x86)/SketchUp/SketchUp 2014/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:109:in end_with?' C:/Program Files (x86)/SketchUp/SketchUp 2014/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:109:in
rescue in require'
C:/Program Files (x86)/SketchUp/SketchUp 2014/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:35:in `require'
It is possible that the error is with a call in the .so file. I'll try to find a way to check that out.
Thanks Dan - that works!
Is there anything similar for Ruby 1.8, or do I need to continue to use Win32API.so to read the registry?
Thanks Dan, this looks great.
Let me try it out
Thanks for the responses.
We are looking for a work-around for users with Unicode Characters in their user names - which causes \Users\XXX\AppData to fail with: "Error: #<Encoding::CompatibilityError: incompatible character encodings: Windows-1252 and UTF-8>"
And one of our users has a Unicode Character in what I presume is the local translation for AppData - "Data aplikací"
I looked in my old thrads and haven't found a Windows-1252/UTF-8 solution yet. We didn;t try the GetShortPathName() idea, because we were worried that it might solve some early problems, but leave other problems which would show up after we shipped the App to other countries.
So we are now thinking about installing our App in Program Files instead of the SketchUp Plugins folder, and only using a couple of .rb files in the plugins folder to find the rest of the app.
There are a lot of threads about this, but I am getting confused.
I took a look at Win32Api.rb in SketchUp 2014, and it says:
"Win32API is deprecated after Ruby 1.9.1; use dl directly instead"
Do I took a look at DL, and it says:
"DL is deprecated, please use Fiddle"
So I took a look at Fiddle, which does have some Win32 stuff, but I couldn't find an example on how to get a string from the registry using Fiddle.
Can someone post, or point me to a Ruby 2.0 example which will run in SketchUp and read a Windows Registry String?
The more we try to learn about the SketchUp 2014 Plugins folder location(s), the more confused we get.
Finding support files in Plugins
We put a file 'al1.rb', in Users\XXX*AppData*\Roaming\SketchUp\SketchUp 2014\SketchUp\Plugins.
We put a second file, al2.rb, in C:*Program Files* (x86)\SketchUp\SketchUp 2014\Plugins
We put a third file, al3.rb in C:*ProgramData*\SketchUp\SketchUp 2014\SketchUp\Plugins
Then we went to the ruby console and typed in:
Sketchup.find_support_file('Plugins/al1.rb'), and the same for
Sketchup.find_support_file('Plugins/al2.rb'), and
Sketchup.find_support_file('Plugins/al3.rb'),
and GUESS WHAT, it found all 3!
Which one comes first:
So, what if we put the same file in all three locations, which one would find_support_file() find?
Strangely enough, it found the one in Program Files
So we deleted that one and tried again (it now only exists in AppData and ProgramData)
Now it Finds the one in AppData.
So, the search order must be: Program Files, AppData, ProgramData
What about automatic execution when SketchUp StartUp.
We put the same file in all three folders and started SketchUp to see which one(s) it ran.
It only ran one, (probably because it uses require(), so only loads one version of a file with given name.
With all three there, it ran the one in AppData.
When we deleted the one in AppData, leaving the other two in ProgramData and Program Files, it ran the one in ProgramData.
It never automatically runs any from Program Files.
So the search order for running .rb files in Plugins must be: AppData, ProgramData (and Program Files is never run)
Why all the fuss?
Some of our Extension users wind up copying our apps to other folders, or copying apps from old versions of SketchUp into some of these folders (hoping they will no need to install a new version), so we have to be careful how we try to find the proper location for the new versions of the App.
What are your thoughts and/or what have you learned already?