I’m trying to write my own image (*.png) importer. My simple subclass of
Sketchup::Importer is below (It’s just a test to figure out if I know what I’m doing, it doesn’t do anything ).
When I use the UI to use my
JmcImporter subclass, I see that my
#do_options methods fire successfully (i.e. put statements logged to the console). However, my
#load_file method does not appear to fire when I select and load a *.png. Instead, SketchUp seems to default to it’s image importer.
If I alter my
#file_extension to import text files the
#load_file method fires ok. Anybody know why my
#load_file wouldn’t work for images?
class JmcImporter < Sketchup::Importer def description p "description called" return "Jeff's Image Importer (*.png)" end def file_extension return "png" end def id return "com.sketchup.importers.jmc_png" end def supports_options? return true end def do_options my_settings = UI.inputbox(['Resolution:'], ['1'], "Import Options") p "do_options called" end def load_file(file_path, status) p 'load file called' return 0 end end Sketchup.register_importer(JmcImporter.new)