[Plugin] Material_Maintenance v2.2 - 2013-01-13
-
The text file when opened in 'Notepad++.exe' as 'UTF-8 without BOM' shows this: BUT when the same text is pasted into here it displays differently...
!!!=> fromUIHandler: parameter string = 73-0__vzrefreshMaterialstruefalsefalse Error: #<NoMethodError: private method
puts' called for "73-0":String>`
Presumably the 'RS' record-separator character [ASCII-030] is non-printing...
Not sure how 'puts' seems broken
Are you parsing the string using split and the 'RS' as at splitter ?
You should then be able to 'puts' the array elements ?? -
@tig said:
The text file when opened in 'Notepad++.exe' as 'UTF-8 without BOM' shows this: [attachment=0:2y0lvhlv]<!-- ia0 -->Capture.PNG<!-- ia0 -->[/attachment:2y0lvhlv] BUT when the same text is pasted into here it displays differently...
!!!=> fromUIHandler: parameter string = 73-0__vzrefreshMaterialstruefalsefalse Error: #<NoMethodError: private method
puts' called for "73-0":String>`
Presumably the 'RS' record-separator character [ASCII-030] is non-printing...
Not sure how 'puts' seems broken
Are you parsing the string using split and the 'RS' as at splitter ?
You should then be able to 'puts' the array elements ??Yes I am splitting the string with the 'RS' char. Very strange error message indeed. The code snippet where it fails is:
` puts "!!!=> fromUIHandler: parameter string = #{parameterString}";
params = unmarshalParams(parameterString); params.each { |p| p.puts "p1 = >>#{p}<<"; // This is line 109 }`
Again this works fine on Windows, and appears to now also work for driven on his MAC so at a bit of a loss here.
One other strange thing with this is that the output should look like this:
!!!=> fromUIHandler; parameter string = 75-0__materialsRefreshedrefreshMaterialstruefalsefalse p1 = >>75-0<< p1 = >>__materialsRefreshed<< p1 = >>refreshMaterials<< p1 = >>true<< p1 = >>false<< p1 = >>false<< calling function >>refreshMaterials<<
i.e. the second parameter should be "__materialsRefreshed" not "__vz" which it appears to be for both the MAC implementations. Strictly speaking this should not work even for driven.
CMD, are you sure you have done a clean uninstall and install?
-
But
params.each{|p|puts "p1 = >>#{p}<<"}
should be the way ?
NOTp.puts
-
@tig said:
But
params.each{|p|puts "p1 = >>#{p}<<"}
should be the way ?
NOTp.puts
thanks TIG!
Still strange it worked on windows and driven's MAC and that the second parameter comes looks wrong but as long as it works.
I am making a new build without the trace code which I will upload soon.
-
Bug fix version V2.1.1 released.
Can be found here:
http://www.keepingmyhandin.com/Downhome/Sketchup/material_maintenance_2
CMD this should fix your problem also as the trace code that had the bug in is also now removed.
-
It may be me, but I've put the .rbz in the plugins folder, restarted SU but I cannot find the command or interface. Any thoughts?
Thanks!
-
You do not use an RBZ file like that. Please, read this tutorial on installing plugins:
http://sketchucation.com/resources/tutorials/37-beginner/108-installing-sketchup-plugins -
DOH!
I didn't install the extension- once I PROPERLY followed the instructions it looks great I can't wait to try it out on an inherited complex model with many similar materials. -
@myhand said:
Bug fix version V2.1.1 released.
... CMD this should fix your problem also as the trace code that had the bug in is also now removed.
Myhand,
Good stuff! no more errors!
.... but I am not getting material thumbnails nor am I getting component images to display.
Is this due to the change for mac?
-
@cmd
If you write this in the Ruby ConsoleENV['TMPDIR']
+ <enter> it gives the path to your 'temp' folder.
In that folder ought to be a subfolder named 'material_maintenance' and in that the xxx.png material thumbnails and xxx.comp.png component thumbnails ? They might have weird looking 'id' type names...
The subfolder is emptied when the tool runs, or it's made if it is missing.
It could be that the files are getting made but some enduring issue in the html/js on MAC is preventing them displaying ??
Can you confirm if the subfolder/files exist... -
@cmd said:
Myhand,
Good stuff! no more errors!
.... but I am not getting material thumbnails nor am I getting component images to display.
Is this due to the change for mac?
I suspect it can be to do with the temp folder location on your MAC. I save the thumbs in a folder I create within the system temp folder. I use a technique (from ThomThom's very good article on materials http://www.thomthom.net/thoughts/2012/03/the-secrets-of-sketchups-materials/)
to "guess" the temp folder.temp_path = File.expand_path( ENV['TMPDIR'] || ENV['TMP'] || ENV['TEMP'] )
It might be that this does not work on your system and we might have to add some options to the list.
driven, did you see the thumbs on your system?
-
The
ENV['TMPDIR']
should work on MAC, with the other two for PCs.
CMD needs to go look see if the subfolder/thumbnails are getting made...
If they aren't there's an issue with this bit; if they are the issue is with the html/js end ? -
I have experienced some OSX user that didn't have the environment set up correctly - there was no environment temp variable defined at all. That was a once-time thing though.
-
OK ... then
ENV.sort.each{|e|p e};p
will list everything available...
-
I have the same problem like cmd, the material thumbnails don't appear, I work on Mac OSX.
Other question, is it possible translate the plugin to another language?
Thanks Myhand !! -
@oxer said:
I have the same problem like cmd, the material thumbnails don't appear, I work on Mac OSX.
Can you please follow TIG's instructions below and let us know the results?
@tig said:
@cmd
If you write this in the Ruby ConsoleENV['TMPDIR']
+ <enter> it gives the path to your 'temp' folder.
In that folder ought to be a subfolder named 'material_maintenance' and in that the xxx.png material thumbnails and xxx.comp.png component thumbnails ? They might have weird looking 'id' type names...
The subfolder is emptied when the tool runs, or it's made if it is missing.
It could be that the files are getting made but some enduring issue in the html/js on MAC is preventing them displaying ??
Can you confirm if the subfolder/files exist...Can you also please run
ENV.sort.each{|e|p e};p
and attach the console output.
-
-
-
So the folder/subfolder is OK and the images exist.
The image naming seems unduly convoluted, as it's adding some special characters etc...
Why not use eachmaterial.display_name
[with some replacement of characters like \ / : * ? " < > | etc] linked to a hash of the display-name containing its 'id' ?
The thumbnail-images names match the 'display-names' ? -
@tig said:
So the folder/subfolder is OK and the images exist.
The image naming seems unduly convoluted, as it's adding some special characters etc...
Why not use eachmaterial.display_name
[with some replacement of characters like \ / : * ? " < > | etc] linked to a hash of the display-name containing its 'id' ?
The thumbnail-images names match the 'display-names' ?This is sort of what I have done. i.e.
display_name + "_" + object_id + ".png"
with invalid windows file name characters replaced with the ΒΆ character. I know this character caused us problems in the marshaling on OSX, but forgot to remove it here. I will do so in the next patch.
I do not think this is the problem though as some of the .png files do not have this character in the name...
I will add some trace code (and remove the ΒΆ character) if you do not mind testing again CMD.
Advertisement