[code] Fbx export - option hash?
-
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'
-
@kaas said:
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?)
-
@dan rathbun said:
...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. -
If it's just for you, maybe you can use mouse/keyboard macros? Some softwares could automate what you need
-
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-skylines-sketchup-tools/blob/master/src/tt_citites_skylines/exporters/fbx.rb -
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 amodel.export filename , false
wherefilename
would be the name of the group/component I wanted to export with.fbx
as suffix. -
@thomthom said:
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 said:
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.
-
Nice - in V18 the option hashes are added for several file formats.
http://ruby.sketchup.com/file.exporter_options.html
Advertisement