FBX multiple objects export to separate files.
 1-11  12-27

Previous
Next
 From:  Moier (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

Previous
Next
 From:  Anton.Berezin (ANTONBEREZIN)
8226.13 

Hi.
Could it work for .ai format?

Thanks.

  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.14 In reply to 8226.13 
Hi Anton,

re:
> Could it work for .ai format?

It would work for .ai format too if you just change the file extension to be .ai instead of .fbx .

But one additional thing is that there is a dialog box that pops up when you export to .ai format for setting different options. It is possible to not show the dialog box for a script driven save by passing in an additional parameter to geometryDatabase.saveAs() or geometryDatabase.fileExport() . That would be a string parameter with NoUI=true in it, like this:

moi.geometryDatabase.saveAs( filename, 'NoUI=true' );

You can also set other options through script by having multiple settings in the string separated by semi-colons. The full list of parameters that can be set in this way is:

// PDF/AI export function parameter options:
//
// NoUI=true
// ProjectionView=top | 3d | front | right
// ScaleType=fit | preserveunits
// MoiScale=1.0
// PageScale=1.0
// PageUnits=mm | cm | in | pt
// CenterOnPage=true
//
// PageSize=letter | legal | tabloid | a3 | a4 | a5 | custom
// Landscape=false
// PageSizeCustomWidth=8.5
// PageSizeCustomHeight=11.0
// PageSizeCustomUnits=mm | cm | in | pt
//
// GenerateOutlines=true
// GenerateSilhouettes=true
// GenerateHiddenLines=false
// ShadedBackground=true
// IgnoreTangentEdges=false
// Resolution=25.0
//
// Line style properties for visible lines:
// VisWidth=0.1
// VisColorMode=fromstyle | custom
// VisColor=0,0,0 (r,g,b color value for lines when color mode = custom)
// VisLayerMode=fromstyle | custom
// VisLayerName=Visible lines (layer name to use when layer mode = custom)
// VisLayerPrefixSuffix=prefix | suffix (which of prefix or suffix are shown in the UI when layer mode = fromstyle)
// VisLayerPrefix= (prefix to prepend to the layer name when layer mode = fromstyle)
// VisLayerSuffix= (suffix to append to layer name when layer mode = fromstyle)
//
// Line style properties for outlines:
// OutWidth=3.0
// OutColorMode=fromstyle | custom
// OutColor=0,0,0 (r,g,b color value for lines when color mode = custom)
// OutLayerMode=fromstyle | custom
// OutLayerName=Outlines (layer name to use when layer mode = custom)
// OutLayerPrefixSuffix=prefix | suffix (which of prefix or suffix are shown in the UI when layer mode = fromstyle)
// OutLayerPrefix= (prefix to prepend to the layer name when layer mode = fromstyle)
// OutLayerSuffix= (suffix to append to layer name when layer mode = fromstyle)
//
// Line style properties for silhouettes:
// SilWidth=0.4
// SilColorMode=fromstyle | custom
// SilColor=0,0,0 (r,g,b color value for lines when color mode = custom)
// SilLayerMode=fromstyle | custom
// SilLayerName=Silhouettes (layer name to use when layer mode = custom)
// SilLayerPrefixSuffix=prefix | suffix (which of prefix or suffix are shown in the UI when layer mode = fromstyle)
// SilLayerPrefix= (prefix to prepend to the layer name when layer mode = fromstyle)
// SilLayerSuffix= (suffix to append to layer name when layer mode = fromstyle)
//
// Line style properties for hidden lines:
// HidWidth=0.1
// HidColorMode=fromstyle | custom
// HidColor=0,0,0 (r,g,b color value for lines when color mode = custom)
// HidLayerMode=fromstyle | custom
// HidLayerName=Hidden lines (layer name to use when layer mode = custom)
// HidLayerPrefixSuffix=prefix | suffix (which of prefix or suffix are shown in the UI when layer mode = fromstyle)
// HidLayerPrefix= (prefix to prepend to the layer name when layer mode = fromstyle)
// HidLayerSuffix= (suffix to append to layer name when layer mode = fromstyle)
//
// Line style properties for annotations:
// AnnWidth=0.1
// AnnColorMode=fromstyle | custom
// AnnColor=0,0,0 (r,g,b color value for lines when color mode = custom)
// AnnLayerMode=fromstyle | custom
// AnnLayerName=Annotations (layer name to use when layer mode = custom)
// AnnLayerPrefixSuffix=prefix | suffix (which of prefix or suffix are shown in the UI when layer mode = fromstyle)
// AnnLayerPrefix= (prefix to prepend to the layer name when layer mode = fromstyle)
// AnnLayerSuffix= (suffix to append to layer name when layer mode = fromstyle)
//
// HiddenLinesOpacity=0.75 (opacity only applies to PDF export, not AI export)
// HiddenLinesDashed=true
// HiddenLinesDashSize=0.75
// HiddenLinesGapSize=1.0
//
// UseAICB=true (for AI copy to clipboard on OSX, for going into Adobe Illustrator CS3 or older).
  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:  Anton.Berezin (ANTONBEREZIN)
8226.15 In reply to 8226.14 

Hi.
I used this script which exporting all objects to AI* files, but all objects (fit to page). I used 3d viewport.
I think it will be good idea if it exporting each object + one test object( named "scale") maybe just line or rectangle.

This will allow the save scale of the objects relative to the test object and to each other

Could you help me to add this function to script?

Thanks

  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.16 In reply to 8226.15 
Hi Anton, are you exporting a 3D perspective view? Because if so the length of a line with perspective applied will not be able to give a scale factor like that.

- 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:  Anton.Berezin (ANTONBEREZIN)
8226.17 In reply to 8226.16 

Please check my images maybe it will be more clear.
Thanks.

Image Attachments:
Size: 1.3 MB, Downloaded: 31 times, Dimensions: 4000x2250px
Size: 199.4 KB, Downloaded: 21 times, Dimensions: 4000x2251px
  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.18 In reply to 8226.17 
Hi Anton, so if I understand right you want the line to establish a common page width?

Is the script you are using the "ExportNamedObjectsToIndividualFiles.js" from above in this thread (http://moi3d.com/forum/index.php?webtag=MOI&msg=8226.8) ?

Do you want something like the line has a certain name and the script will export that additionally to each file?

So in the script ExportNamedObjectsToIndividualFiles.js, on line 36 it has this currently:

code:
for ( var name in named_objs )
{
	// Clear the selection and then set all objects of this name to be selected.
	moi.geometryDatabase.deselectAll();
	named_objs[name].setProperty( 'selected', true );


So if you want the line to export with each file, it could go like this:

code:
for ( var name in named_objs )
{
	// Clear the selection and then set all objects of this name to be selected.
	moi.geometryDatabase.deselectAll();
	named_objs[name].setProperty( 'selected', true );

// new code here:

	var line_name = 'reg_line';
	if ( name == line_name )
		continue; //  Don't export the line all by itself.

	// select the line so it will export.
	if ( named_objs[line_name] )
		named_objs[line_name].setProperty( 'selected', true );


I haven't tested that, let me know if it doesn't work.

- 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:  Anton.Berezin (ANTONBEREZIN)
8226.19 In reply to 8226.18 

Sorry but it is not working.
Probably just I am not good java developer.


I am getting all 3 objects (1,2, line) as separate files

Thanks for your help again

  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.20 In reply to 8226.19 
Hi Anton, can you please post the current script you have and an example .3dm file ?

- 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:  Anton.Berezin (ANTONBEREZIN)
8226.21 In reply to 8226.20 

Yes sure.
And sorry for my incompetence


  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.22 In reply to 8226.21 
Hi Anton, try this attached one, and also the script is expecting the line's object name to be "reg_line" but in your .3dm file it is named "Testline".

I still didn't test this so please let me know if it still doesn't work and I will take a closer look.

- 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:  Anton.Berezin (ANTONBEREZIN)
8226.23 In reply to 8226.22 

Oh thanks man. It is realy working.
How could I thank you?
I am illustrator and if you need something to draw let me know.
(yaberezinanton@yandex.ru)

  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.24 In reply to 8226.23 
Hi Anton, that's great!

> How could I thank you?

It would be fun to see some of the output that you're using it for! :)

- 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:  Anton.Berezin (ANTONBEREZIN)
8226.25 In reply to 8226.24 

I’m trying to create method to export a complex illustration\model as different parts\files for further processing and assembly in Adobe illustrator.

I will show you the result

Thanks again

  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:  Mindset (IGNITER)
8226.26 In reply to 8226.22 
Hey Michael,

How can I make ExportNamedObjectsToIndividualFiles work for STEP [(*.stp, *.step, *.stpz) (AP 203, AP 214, AP 242)] ,or SAT [(*.sat) (Up to 2020)] Files?
Also, my target app, Alibre Atom3D, accepts only one Solid per file.
This script will write out every object having an identical name to the same file.
Might it append a numeric incremental for each such duplicately named solid and thereby save it into its own separately named file?
Another problem is that it will write out a group, rather than just its individual constituent solids.
Also, might the user pick the output directory at runtime ?


Thanks,
MindSet
  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:  Michael Gibson
8226.27 In reply to 8226.26 
Hi MindSet,

Are you using the ExportNamedObjectsToIndividualFiles.js that was in this previous post? :
http://moi3d.com/forum/index.php?webtag=MOI&msg=8226.8

re:
> How can I make ExportNamedObjectsToIndividualFiles work for STEP [(*.stp, *.step, *.stpz)
> (AP 203, AP 214, AP 242)] ,or SAT [(*.sat) (Up to 2020)] Files?

MoI will figure out what file type to write based on the file extension on the filename.

So to make it export STEP instead of FBX, go to line number 43 in the script which has this currently:
code:
    var filename = g_dirname + name + '.fbx';

And change the .fbx to .stp like this:
code:
    var filename = g_dirname + name + '.stp';

re:
> Might it append a numeric incremental for each such duplicately named solid and thereby save it
> into its own separately named file?

I've attached a version that should do that.


> Another problem is that it will write out a group, rather than just its individual constituent solids.

This should be fixed in the attached version also.


> Also, might the user pick the output directory at runtime ?

Sorry no that's not easy to do currently because there is not a directory picking UI set up for a script to use. I'll see what's involved in setting one up.

- 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
 

Reply to All Reply to All

 

 
 
Show messages:  1-11  12-27