There's a lot of 3D content out there, and we understand that a lot of it is not in the SketchUp file format. But, if you can read the content, you can use the Ruby Importer plugin API to import it into SketchUp.
It's easy to write and use your own Ruby importers in SketchUp. Just follow these steps:
1. Define a class with the plugin API methods.
2. Register an object of the class with SketchUp.
3. Recover from Mardi Gras festivities (may not be applicable).
1. Define a class with the plugin API methods.
2. Register an object of the class with SketchUp.
3. Recover from Mardi Gras festivities (may not be applicable).
An importer class must have the following methods:
def description
# Returns a brief description of your importer plugin.
enddef file_extension
# Returns the file extension of the file format your
# importer can read (e.g. fbx, dae, etc.)
enddef supports_options?
# Returns true if your plugin supports import options.
enddef do_options
# Presents the import options dialog panel to the user.
enddef id
# Returns the id string of your importer.
enddef load_file(file_name, show_summary)
# Reads the contents of location on disk specified
# by file_name.
# Shows the summary dialog panel if show_summary is true.
# Returns 0 on success, returns 1 on failure.
0
endOnce you have defined your importer class, register your importer with SketchUp:
Sketchup.register_importer MyImporter.new
Now your importer plugin will be available when you select the Import item under the File menu of SketchUp. The Ruby Importer capability is available in both SketchUp Free and Pro. Now go forth and import.
No comments:
Post a Comment
You are welcome to contribute comments, but they should be relevant to the conversation. We reserve the right to remove off-topic remarks in the interest of keeping the conversation focused and engaging.