Peer-to-Peer Forum

 

Login Register    
Batch way to convert a flt file into MANY external references
Posted: 13 July 2010 06:08 AM  
Member
RankRankRank
Total Posts:  53
Joined  2009-01-13

I have an FLT file which consist of a city.  Each building is its own object node (or group or LOD ... but it shouldn’t matter).  I want to convert each building into it own externally referenced file.  Any way to do this with creator or scripting?

 
Posted: 13 July 2010 08:40 AM   [ # 1 ]  
Moderator
RankRankRankRank
Total Posts:  590
Joined  2008-07-02

In Creator, you could:
1) Select each node you want to make into an x-ref
2) Use File>Write Select to write each node (separately) into their own OpenFlight file
3) Delete the selected nodes
4) Use File>External Reference to reference the newly created files as x-refs in the original (now) master file

I believe you could do this with OpenFlight Script as well. 
The brute force way would be:
1) Loop through each node you want to make into an x-ref
2) For each node:
  a) Create a new file mgNewDb
  b) Use mgDuplicateToDb to copy the node to the new db
  c) Attach the copy to the new db
  d) Copy the palette elements from the original file to the new db
  e) Close the new db
  f) Delete the node, replace it by an x-ref node that references new db created

The tedious bit is copying the palettes.

A more tricky way to do this in OpenFlight Script might be:
1) Loop through each node you want to make into an x-ref
2) For each node
  a) Detach all the root nodes in the db except this node
  b) Use mgSaveAsDb to write file to a new file name (note that detached nodes won’t be written)
  c) Delete the node, replace it by an x-ref node that references new db created

This way you don’t have to bother “copying” the palette elements. 

Good luck.

 
Posted: 13 July 2010 08:53 AM   [ # 2 ]  
Newbie
Rank
Total Posts:  6
Joined  2008-02-28

Use the “Make Externals” plugin which can be found here: Unsupported Tools - Creator

Selected nodes will be converted to Xrefs with very helpful output options (db origin, file name prefix, textures ...).

 
Posted: 13 July 2010 09:49 AM   [ # 3 ]  
Member
RankRankRank
Total Posts:  76
Joined  2008-12-23

Hello,
How do you download the “Unsupported Tools” in the new portal?  I can get to the site to see the descriptions of the tools, but they cannot be clicked on to download.  Is there separate site and how do you get to it?
Robert

 
Posted: 13 July 2010 10:09 AM   [ # 4 ]  
Newbie
Rank
Total Posts:  6
Joined  2008-02-28

You have to download theam all. 
The link is at the end of the page.

 
Posted: 13 July 2010 10:26 AM   [ # 5 ]  
Member
RankRankRank
Total Posts:  76
Joined  2008-12-23

efge,
Is there a free way of getting the unsupported tools?  Are there any uncompress programs that will open this file.
Thanks for the reply.
Robert

 
Posted: 13 July 2010 12:44 PM   [ # 6 ]  
Administrator
RankRankRankRank
Total Posts:  169
Joined  2009-02-25

The Unsupported Tools for Creator can be downloaded from the KB section.  I use Winrar (http://www.rarlab.com/) to uncompress the files.  Winzip should work as well.  RAR is bit more efficient and ZIP

KB Ref. ID: 6610
Make Externals   1.5   08/04   The Make Externals plug-in tool allows you remove selected nodes from a database and move them to external files.

Let us know if you can think of any improvements or updates to the tool.

 
Posted: 13 July 2010 03:53 PM   [ # 7 ]  
Member
RankRankRank
Total Posts:  76
Joined  2008-12-23

Lars,
The unzip software on XP worked with “.zip” files.  The IT person here had a version that extracted with no problems.  I wish I had “make external” earlier for other projects.
Thank you.
Robert

 
Posted: 14 July 2010 02:32 PM   [ # 8 ]  
Sr. Member
RankRankRankRank
Total Posts:  547
Joined  2009-03-17

I use MakeExternals all the time for exactly the same thing.  I do have one very important suggestion, besides a previous request to just make it part of Creator (not an unsupported plug-in).

RETAIN THE OBJECT NAMES IN THE HIERARCHY!!!!!!!

I like to name my buildings IAW our naming conventions, and have the top level group node at the to be the same as the base filename.  That way, if you need to tweak a building against the master reference, you can convert it, fix it, and do a Write Select or Make External, which would require the selected group to be named the same as you want the filename to be ....

Please!?!?!?!?!?