Problem with UVHelper
-
When I try to experiment with UVHelper using this code"
` require 'sketchup.rb'def uvhelp
face=Sketchup.active_model.selection[0] tw = Sketchup::TextureWriter.new uvHelp = face.get_UVHelper true, true, tw pts = [] i = 0 face.outer_loop.vertices.each do |vert| pts[i] = vert.position pts[i+1] = uvHelp.get_front_UVQ(vert.position) i = i+2 end prompt = ["P1","UV1", "P2","UV2", "P3","UV3", "P4","UV4"] defaults = [pts[0], pts[1], pts[2], pts[3], pts[4], pts[5], pts[6], pts[7]] results = inputbox prompt, defaults, nameend
if( not file_loaded?("UVHelper.rb") )
UI.menu("Plugins").add_item($exStrings.GetString("UVHelper")) { uvhelp }
end
file_loaded("UVHelper.rb")`I get this error message:
Error: #<TypeError: wrong argument type (expected Sketchup::TextureWriter)>
C:/Program Files/Google/Google SketchUp 6/Plugins/UVHelper.rb:8:inget_UVHelper' C:/Program Files/Google/Google SketchUp 6/Plugins/UVHelper.rb:8:inuvhelp'
C:/Program Files/Google/Google SketchUp 6/Plugins/UVHelper.rb:26
C:/Program Files/Google/Google SketchUp 6/Plugins/UVHelper.rb:26:in `call'It doesn't even like the call to face.get_UVHelper, which is straight from the examples.
-
That's odd. Typeing into the Ruby console I get the same error.
But I have used the same code in one of my own plugin and that works. I can't see what the difference might be. -
Ah! I see it now.
Use
tw = Sketchup.create_texture_writerinstead oftw = Sketchup::TextureWriter.new.I'll add it to the list of errors in the manual: http://www.sketchucation.com/forums/scf/viewtopic.php?f=180&t=17047
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement