[code] Fbx export - option hash?  Topic is solved

[code] Fbx export - option hash?

Postby kaas » Tue May 12, 2015 4:55 pm

I'm trying to write a custom fbx exporter that iterates through a selection of groups / components and creates individual fbx files named like the individual group / component names.

Looking at the API docs http://www.sketchup.com/intl/en/developer/docs/ourdoc/model#export, I can only find an option hash for Collada. I'm looking though for the equivalent for fbx.

Anyone a suggestion where to find the option hash for fbx? I only need some of the normal export options checked (see pic).

Edit: seems like Sketchup re-uses the last used manual settings. So for now the problem is 'solved'
0

kaas 
 

Re: [code] Fbx export - option hash?

Postby Dan Rathbun » Wed May 13, 2015 3:25 pm

kaas wrote:Anyone a suggestion where to find the option hash for fbx?

Yes, you have found that only the DAE export options are exposed in the Ruby API.

Why none of the others are, I don't know. (But also wonder why?)
0
    I'm not here much anymore. But a PM will fire email notifications.
    User avatar
    Dan Rathbun 
    PluginStore Author
    PluginStore Author
     

    Re: [code] Fbx export - option hash?

    Postby kaas » Thu May 14, 2015 4:46 pm

    Dan Rathbun wrote:...But also wonder why?
    Thanks for the reply Dan. In case the 'why' was referring to me: I'm going back and forth between Sketchup & Unreal a zillion times a day. Going file -> export -> 3d model for every single object I need to export was getting on my nerves. With a ruby it's more streamlined now.
    I wrongly expected I had to do the export settings (the option hash) in the ruby script but turned out Sketchup is just re-using the last used settings.
    0

    kaas 
     

    Re: [code] Fbx export - option hash?  Topic is solved

    Postby jiminy-billy-bob » Thu May 14, 2015 5:52 pm

    If it's just for you, maybe you can use mouse/keyboard macros? Some softwares could automate what you need
    0
    User avatar
    jiminy-billy-bob 
    PluginStore Author
    PluginStore Author
     

    Re: [code] Fbx export - option hash?

    Postby thomthom » Thu May 14, 2015 8:31 pm

    The other exporters where added before the COLLADA exporter - and never retrofitted with options. We have issue filed for this however.

    On this topic, I needed to control the export settings for FBX myself - which I did by modifying the settings stored by each OS. Not a pretty hack, but it works:
    https://github.com/thomthom/cities-skyl ... ers/fbx.rb
    0
    Thomas Thomassen — SketchUp Monkey & Coding addict
    List of my plugins and link to the CookieWare fund
    User avatar
    thomthom 
    PluginStore Author
    PluginStore Author
     

    Re: [code] Fbx export - option hash?

    Postby kaas » Thu May 14, 2015 8:42 pm

    Thanks for the replies but I had it already solved. Maybe the last edited line in the first post should have been more clear about that.
    Because Sketchup apparently remembers the last used fbx export settings, also from previous sessions, it turned out to be quite simple code. Just iterate through the selection and do a model.export filename , false where filename would be the name of the group/component I wanted to export with .fbx as suffix.
    0

    kaas 
     

    Re: [code] Fbx export - option hash?

    Postby Dan Rathbun » Fri May 15, 2015 12:06 am

    thomthom wrote:The other exporters where added before the COLLADA exporter - and never retrofitted with options. We have issue filed for this however.

    Yes that IS the WHY I was referring to...

    thomthom wrote:On this topic, I needed to control the export settings for FBX myself - which I did by modifying the settings stored by each OS. Not a pretty hack, but it works:

    I was thinking of doing the same thing.
    0
      I'm not here much anymore. But a PM will fire email notifications.
      User avatar
      Dan Rathbun 
      PluginStore Author
      PluginStore Author
       

      Re: [code] Fbx export - option hash?

      Postby kaas » Thu Nov 16, 2017 7:56 am

      Nice - in V18 the option hashes are added for several file formats.
      http://ruby.sketchup.com/file.exporter_options.html
      1

      kaas 
       

      SketchUcation One-Liner Adverts

      by Ad Machine » 5 minutes ago



      Ad Machine 
      Robot
       



       

      Return to Developers' Forum

      Who is online

      Users browsing this forum: szabadigeri and 6 guests

      Visit our sponsors: