FBX multiple objects export to separate files.

Next
 From:  Stardust
8226.1 
Hi Moi'ers

After using several file formats in export I have settle with FBX as the best option for me (detail conservative) and I usually export each named/colored object part in separate file for better control in the render engine.

I wonder if you 'Gurus' can write a script that solves "multiple object export to separate FBX files"?

Would be awesome to reduce the export time

Thanks

Stardust


- Michael for Nobel Prize -
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
8226.2 In reply to 8226.1 
Hi Stardust, a few additional details would probably help, like how would the file name for each separate file be determined, do you want a file save dialog to pop up for each separate file or do you want to see the dialog to choose one base name and then have the other files be numbered versions like name01.fbx name02.fbx .

How do you want to control the meshing parameters for the multi file export, should the meshing dialog show up for each separate file?


> I usually export each named/colored object part in separate file for better control in the render engine.

I guess you'd need to pick one method for the script to do, should it make a separate file for each named object or should it be a separate file for each style?

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Stardust
8226.3 In reply to 8226.2 
Hi Michael

Thanks for the quick respond.

My first thought was to arrange this sequence (I might have missed some..)

- Activate the objects and styles you wish to export
- A dialog shows up with all objects marked, listed and named as the origin object
- Settings for export are made
- Name of the separate files will inherent the named objects when fix file is created.


This might be hard to make.. but it will be just great if :)


/Stardust
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
8226.4 In reply to 8226.3 
Hi Stardust, the more UI and dialogs that are shown tend to take a lot more time to develop. For example there isn't currently any already built in way to "activate the styles you want to export", if you needed to be able to pick styles that would involve some custom developed UI to do it.

I'd be more likely to be able to cook up something for you if it had less steps and less or no custom UI needed in it.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Stardust
8226.5 In reply to 8226.4 
Great Michael

For me it sure could be very straight forward with "only" a new button - Multiple export
(It might even be dedicated to only fbx format if it will ease up the code)


Function as;

- Activate objects (no styles) to be exported
- Using same dialog as origin Settings
- Easiest way to name separate files, like 001..002..003 (If the files can inherit the object names it would be great)


The goal is only to export separate objects in "one click" operation


Thanks

BR
Stardust

- Michael for Nobel Prize -
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
8226.6 In reply to 8226.5 
Hi Stardust, someone else had a very similar request today and I just posted a script over in this other thread: http://moi3d.com/forum/index.php?webtag=MOI&msg=8230.1

Currently that script exports to .obj format, you can change it to export to .fbx format by editing the line number 42 that currently has this:

code:
var filename = g_dirname + name + '.obj';


to instead have this:

code:
var filename = g_dirname + name + '.fbx';


You also need to edit the directory name at the top of the script, that's the directory where the files will be written to, it will write a separate file for each group of named objects that are in the current model, and the exported file's name will be the object name. Right now it doesn't pay attention to selection, to make it only export selected objects, change line number 18 of the script that currently has this:

code:
var all_objs = moi.geometryDatabase.getObjects();  


to this instead:

code:
var all_objs = moi.geometryDatabase.getSelectedObjects(); 



You wrote:
> - Using same dialog as origin Settings

I'm sorry I'm not understanding this part, what is the origin dialog?

Hopefully that is close to what you were looking for though.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Stardust
8226.7 In reply to 8226.6 
Wohaa.. Michael, you're a genius


Thanks a lot, I will test it right away.

Sorry for not being clear of the part > - Using same dialog as origin Settings
I mean the mesh setting dialog

Thanks

Merry Christmas

/Stardust



- Michael for Nobel Prize -
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
8226.8 In reply to 8226.7 
Hi Stardust, you're welcome!

I've attached here a modified version for you, which has the modifications I mentioned above to use selected objects only, and to write to .fbx files instead of .obj and additionally it will show the meshing options dialog during the first export so you can adjust the settings using the dialog, which will then be used by the rest of the exports as well.

- Michael

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Stardust
8226.9 In reply to 8226.8 
Oboy Michael, what can I say..you are incredible!!

Thanks a million

I wish you the best of holiday

/Stardust

- Michael for Nobel Prize -
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Stardust
8226.10 In reply to 8226.9 
Hi Michael

I just want to double check that my changed file path is written correct when use in mac

line 12 ... var g_dirname = '/Users/user name/desktop/fbxexp/';

I am having problem to extract files to this desktop folder called 'fbxexp'


Thanks

/Stardust
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
8226.11 In reply to 8226.10 
Hi Stardust, sorry yeah for the Mac you'll need to set the path using a Windows path with a pretend z: drive, like this:

var g_dirname = 'z:\\Users\\user name\\Desktop\\fbxexp\\';

V4 will handle native paths better for the Mac version.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Stardust
8226.12 In reply to 8226.11 
Amazing..Thanks Michael

This is an incredible forum master folks!
I cant think of another where you get this rapid respond, just wow

Thanks

/Stardust

- Michael for Nobel Prize -
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All