expose datasmith in SketchUp API?

Hi, Im testing a SketchUp-Datasmith-UnrealEngine workflow. I was using a custom ruby script for that until now (export selected + hide some stuff).
My question is:
is it possible to call the datasmith export methods in SketchUp using ruby? What I would like to do is:

  1. Start my custom ruby plugin
  2. Temporary hide some objects / faces with a specific material
  3. Call the datasmith method passing my selection OR temporary hide everything that doesn’t need to be exported if export selected isn’t available in the Datasmith api
  4. after the datasmith export, unhide what was temporary hidden

Cheers,
Max

Hello, the dev told me that you should be able to access to the datasmith functions:
e.g. EpicGames::Datasmith.export <filename>, <dir> - will export model into <dir>/<filename>.udatasmith

The sketchup datasmith plugin is a Ruby script itself. The files are installed into “C:\ProgramData\SketchUp\SketchUp XXXX\SketchUp\Plugins\UnrealDatasmithSketchUp”, main Ruby file for the plugin (where all the export functions are defined and called) are in plugin_main.rb

For hiding/unhiding question, in case you did not find them yet, link to official ruby documentation Class: Sketchup::Drawingelement — SketchUp Ruby API Documentation

2 Likes

Hi UE_FlavienP, thanks for the reply. That command works perfectly thanks!