NVil Forum

General Category => Feature Requests => Topic started by: Mason on February 04, 2017, 11:32:45 am

Title: FBX support
Post by: Mason on February 04, 2017, 11:32:45 am
FBX provides support for Crease Edges and Splines
Title: Re: FBX support
Post by: IStonia on March 21, 2017, 04:14:25 am
Can you create a fbx file from Maya? I need a sample file to understand how fbx stores edge crease info.

1. Create a 6 polygon box.
2. Make all edges hard edges.
3. Crease 4 of the edges.
4. Save the object to a FBX6.0 ascii format. If can't save to this specific format, just save it to any fbx format you can. Make sure when you load this file back into Maya, the edge crease info is maintained.
Title: Re: FBX support
Post by: Mason on March 23, 2017, 09:34:20 am
https://www.dropbox.com/s/mqujihpewfvrqgx/creasedCube.fbx?dl=0

Just saw your email!

For the creases to export,  the geometry needs to be in smooth preview before export.

It uses FBX 2016 format.   FBX is typically updated at least once a year by Autodesk because their other products are updated on a fixed schedule.
Title: Re: FBX support
Post by: IStonia on March 23, 2017, 09:48:17 am
Thanks! It's exactly what I wanted.
Title: Re: FBX support
Post by: Mason on March 23, 2017, 09:45:47 pm
that would be awesome (and roundtrip without losing the creases ;)
Title: Re: FBX support
Post by: IStonia on April 13, 2017, 11:54:13 am
Try this
http://www.digitalfossils.com/Download/NVil-Apr-14-17.rar

* Spline can not be exported/imported because the types are different.
* Edge crease support is limited in fbx format. It only has one value for edge creasing. But in Nvil, there four values to control creasing. So if you use radial creasing, the information will be lost on exporting.
Title: Re: FBX support
Post by: steve on April 13, 2017, 06:48:05 pm
Hi IStonia,

What is the reason for exporting FBX to file version 6.1? (which I think is Autodesk 2009 applications)

Title: Re: FBX support
Post by: IStonia on April 13, 2017, 09:38:06 pm
I tried to find from the net the difference between fbx and fbx 6.0 but no luck. So I just pick one from the fbx sdk which has 6 fbx versions.

Can you test the dxf file format as well?

Title: Re: FBX support
Post by: steve on April 13, 2017, 10:06:08 pm
My quick tests where just to see if I could import the FBX(from Nvil) into Blender (I wanted to see if Instancies/orientations where transfered), but there was an error from Blender:- "Version 6100 unsupported, must be 7100 or later"
Using Autodest "FBX Converter 2013.2"(latest version available), I can convert the file to "FBX 2013" which is file version 7.3 and will import to Blender.

It is not a major problem, just that I thought if you are creating a new plugin(FBX exporter), you would create a more up to date file version export.

What FBX versions does the SDK show you?
Title: Re: FBX support
Post by: IStonia on April 13, 2017, 10:40:21 pm
They are

FBX binary, FBX ascii, FBX encrypted.
and
FBX 6.0 binary, FBX 6.0 ascii, FBX6.0 encrypted.

They are available in fbx 2012 sdk which is the only one I can use because I use vs 1012. I use FBX 6.0 binary for exporting format.
Title: Re: FBX support
Post by: steve on April 13, 2017, 10:49:38 pm
Maybe you need to choose option "FBX Binary"?

Looking through (using converter) FBX versions.

FBX 2011 = 7.1
FBX 2012 = 7.2
FBX 2013 = 7.3
Title: Re: FBX support
Post by: IStonia on April 14, 2017, 12:08:44 am
I don't know. I am confused about these fbx versions. In the sdk I use, v2012, there is no 7.2.

I just keep it as is now until I know more information.
Title: Re: FBX support
Post by: steve on April 14, 2017, 03:38:08 pm
I don't know. I am confused about these fbx versions. In the sdk I use, v2012, there is no 7.2.
For FBX/SDK 2012, the default file output is 7.2 (as I put forward in my last post). That information in within the "Autodesk FBX 2012 SDK Documentation" -> Supported file formats:-
Quote
The FBX SDK can:

    Import FBX files compatible with FBX file format versions 7.2, 7.1, 7.0, 6.1, and 6.0
    Export FBX files compatible with FBX file format versions 7.2 (default), 7.1, 7.0, and 6.1.

Quote
I just keep it as is now until I know more information.
Check the SDK documentation.

I have already come across an issue with export time/file size when expoting instancies. For simple example:-
I created a sphere, made 999 instancies, exported (from Nvil) as FBX, Nvil gave the "Not responding" for quite a while, but eventually exported an FBX file of 447.37 MB. I converted that file to FBX 2012(file version 7.2), the file size was then 1.39 MB
Title: Re: FBX support
Post by: Mason on April 14, 2017, 08:59:34 pm
FBX versions update about once a year.  Version number is the year, so latest version is 2017, with 2018 probably being released within a few weeks.

Autodesk products: Maya, Max, Mudbox will always ship with a current version.


Creases was introduced in the later versions (not sure wich)

http://help.autodesk.com/view/MAYAUL/2016/ENU/?guid=GUID-AA3B8EA4-DDFB-4B0F-9654-2BF6B8781AE7
Title: Re: FBX support
Post by: steve on April 16, 2017, 12:32:02 am
A couple of other issues from quick test.

1: Objects are having thier pivot rotated 90deg around Y axis.

2: When creating instance array where 2/3 axis are used to generate array, the "Instance Source" moves location within the array. For example:- Create box at world 0,0,0. Create "Instance array with 5 along X and 5 along Z. Export as FBX, then import the FBX to new scene. Although the array is in correct position, the "Instance source" is no longer at 0,0,0
Title: Re: FBX support
Post by: IStonia on April 16, 2017, 09:32:08 am
Try this. Now it's version 7.5.
http://www.digitalfossils.com/Download/NVil-Apr-16-17.rar


A couple of other issues from quick test.

1: Objects are having thier pivot rotated 90deg around Y axis.

2: When creating instance array where 2/3 axis are used to generate array, the "Instance Source" moves location within the array. For example:- Create box at world 0,0,0. Create "Instance array with 5 along X and 5 along Z. Export as FBX, then import the FBX to new scene. Although the array is in correct position, the "Instance source" is no longer at 0,0,0

1. Is the mesh's orientation still correct?
2. Should be fixed.
Title: Re: FBX support
Post by: steve on April 16, 2017, 03:16:45 pm
Try this. Now it's version 7.5.
How did you manage to get file version 7.5? FBX SDK 2012 will only output up to 7.2
Have you changed SDK?

Quote
1. Is the mesh's orientation still correct?
On quick tests, yes. It is the object pivot rotating 90 clockwise around Y axis
Quote
2. Should be fixed.
Now (on quick test) looks correct.

A problem with file format:-
Blender will not import the file from Nvil (it looks like blender only supports files to 7.4), so loaded the FBX(from Nvil) into "FBX converter 2013.3", but that is informing me the file is corrupted, so will not convert.

I will see if I can find an application that supports file version 7.5 (currently, I cannot test file format, as although Nvil will export/import the FBX file, that does not mean the format is currently correct)
Title: Re: FBX support
Post by: Mason on April 16, 2017, 09:53:06 pm
On my end:

Maya --> Nvil  creases work great and orientation is correct.

Nvil --> Maya  object is smoothed and without creases,  orientation is correct.
Title: Re: FBX support
Post by: IStonia on April 16, 2017, 10:08:51 pm
On my end:

Maya --> Nvil  creases work great and orientation is correct.

Nvil --> Maya  object is smoothed and without creases,  orientation is correct.


Which update did you use for the testing?
Title: Re: FBX support
Post by: Mason on April 16, 2017, 10:53:14 pm
April 16-17  using FBX 2016
Title: Re: FBX support
Post by: IStonia on April 17, 2017, 02:25:53 am
Mason, load this into Maya and see if any crease
http://www.digitalfossils.com/Download/FBXCreaseTest.rar
Title: Re: FBX support
Post by: Mason on April 17, 2017, 09:47:07 am
Imports with crease data!!  Looks perfect.
Title: Re: FBX support
Post by: IStonia on April 18, 2017, 08:33:30 am
I am still trying to pin point the problem.
Please test these two and see if the crease still there.

http://www.digitalfossils.com/Download/FBXCreaseTest - 2.rar
http://www.digitalfossils.com/Download/FBXCreaseTest - 3.rar
Title: Re: FBX support
Post by: Mason on April 18, 2017, 11:39:33 am
I get a 404 error on the links
Title: Re: FBX support
Post by: IStonia on April 18, 2017, 11:48:54 am
Try this

http://www.digitalfossils.com/Download/FBXCreaseTest-2.rar
http://www.digitalfossils.com/Download/FBXCreaseTest-3.rar
Title: Re: FBX support
Post by: Mason on April 18, 2017, 12:22:19 pm
creasedCube7500_B - 2.fbx  imports into Maya correctly with crease data

B-3 does not
Title: Re: FBX support
Post by: IStonia on April 18, 2017, 12:53:08 pm
You can open the two files with Windows NotePad.

The only difference between these two files is

creasedCube7500_B - 2.fbx

         EdgeCrease: *12 {
            a: 0,0.7,0.7,0,0,0,0.7,0.7,0,0,0,0
         }


creasedCube7500_B - 3.fbx

         EdgeCrease: *12 {
            a:
0,0,0.699999988079071,0,0.699999988079071,0.699999988079071,0.699999988079071,0,0,0,0,0
         }


I have no idea why creasedCube7500_B - 3.fbx doesn't work. Maybe you have better thinking. You can edit creasedCube7500_B - 3.fbx to see in what situation it works.

Title: Re: FBX support
Post by: Mason on April 18, 2017, 02:32:17 pm
seems your formatting was wrong!

this works:

EdgeCrease: *12 {
            a:0,0,0.699999988079071,0,0.699999988079071,0.699999988079071,0.699999988079071,0,0,0,0,0         
         }
Title: Re: FBX support
Post by: Mason on April 18, 2017, 02:37:56 pm
v3 doesnt work in Nvil either, but when correcting the formatting it also works in Nvil.
Title: Re: FBX support
Post by: IStonia on April 18, 2017, 07:37:24 pm
Can you remove this portion and see if it still works?

      LayerElementSmoothing: 0 {
         Version: 102
         Name: ""
         MappingInformationType: "ByEdge"
         ReferenceInformationType: "Direct"
         Smoothing: *12 {
            a: 0,0,0,0,0,0,0,0,0,0,0,0
         }
      }
Title: Re: FBX support
Post by: Mason on April 19, 2017, 09:05:25 am
Removing it, and the file does not import.
Title: Re: FBX support
Post by: IStonia on April 19, 2017, 09:36:20 am
Try remove this also

         LayerElement:  {
            Type: "LayerElementSmoothing"
            TypedIndex: 0
         }
Title: Re: FBX support
Post by: Mason on April 19, 2017, 10:46:03 am
Works.  What is your train of thought? 
Title: Re: FBX support
Post by: IStonia on April 19, 2017, 10:53:59 am
What we have been dealing with is the file you exported from Maya without going through Nvil.

Now here is the file which I imported from your Maya file into Nvil then exported to fbx.
http://www.digitalfossils.com/Download/FBXCreaseTest_Nvil.rar
Title: Re: FBX support
Post by: Mason on April 19, 2017, 11:57:32 am
Geo imports correctly, but without crease data. 

 I had a look  at it in notepad and it is without formatting so hard to read.
Title: Re: FBX support
Post by: IStonia on April 19, 2017, 12:14:05 pm
Can you read any thing in it?
Title: Re: FBX support
Post by: Mason on April 19, 2017, 12:46:02 pm
Yeah, just doesnt have any word wrap, so is basically a single line of code.  Ahh....I can read in sublime text.
Title: Re: FBX support
Post by: IStonia on April 19, 2017, 12:48:35 pm
It opens in my NotePad fine.
Title: Re: FBX support
Post by: IStonia on April 19, 2017, 12:50:20 pm
No. It is not NotePad. Use WordPad.
Title: Re: FBX support
Post by: Mason on April 19, 2017, 12:58:03 pm
I found what is missing:

Seems you need this header:

; Object properties
;------------------------------------------------------------------

Objects:  {
   Geometry: 140747960, "Geometry::pCube1", "Mesh" {
      Smoothness: 3
      PreviewDivisionLevels: 2
      RenderDivisionLevels: 2
      DisplaySubdivisions: 0
      BoundaryRule: 1
      PreserveBorders: 0
      PreserveHardEdges: 0
      PropagateEdgeHardness: 0
      Vertices: *24 {
Title: Re: FBX support
Post by: Mason on April 19, 2017, 01:00:02 pm
These are the smooth preview settings that are needed for Creases.

Adding that to creasedCube7500_A.fbx, and it imports into Maya correctly.
Title: Re: FBX support
Post by: IStonia on April 19, 2017, 01:03:23 pm
I suspect these settings too. Why Maya needs them? Do I need to set all of them?
Title: Re: FBX support
Post by: Mason on April 19, 2017, 01:10:26 pm
They are the smooth preview settings.  To export creases,  this preview mode has to be active (subdvisions).  I will delete each setting to see when it breaks.

FYI,  all of those settings are features Nvil already uses.
Title: Re: FBX support
Post by: Mason on April 19, 2017, 01:15:27 pm
Yeah, they are needed in order to support default functionality in Maya.

Somebody would have to test with Modo/Blender to verify those apps.  They may not even support Creases in FBX regardless.

If it works correctly for Maya, it will work in Mudbox/3dsMax most likely.
Title: Re: FBX support
Post by: IStonia on April 19, 2017, 02:04:33 pm
Try this
http://www.digitalfossils.com/Download/NVil-Apr-19-17.rar
Title: Re: FBX support
Post by: Mason on April 19, 2017, 02:29:32 pm
Yes,  can now roundtrip, between Maya and Nvil with crease support!  This is really cool!
Title: Re: FBX support
Post by: Mason on April 19, 2017, 02:32:23 pm
The same FBX works in Mudbox and 3ds Max.
Title: Re: FBX support
Post by: steve on April 19, 2017, 03:41:54 pm
Hi IStonia,

Thank you for adding FBX export format options.

Is there a reason for removing the FBX import "coordinate system" options?
Title: Re: FBX support
Post by: IStonia on April 19, 2017, 09:45:35 pm
There is coordinate system setting in the fbx file.
Title: Re: FBX support
Post by: steve on April 20, 2017, 04:58:38 pm
There is coordinate system setting in the fbx file.
I presume you are refering to how the FBX importer will re-orient an object based on the applications AxisUp. It is that I want to stop/over-ride.

Title: Re: FBX support
Post by: IStonia on April 23, 2017, 08:57:47 am
There is coordinate system setting in the fbx file.
I presume you are refering to how the FBX importer will re-orient an object based on the applications AxisUp. It is that I want to stop/over-ride.

Try this
http://www.digitalfossils.com/Download/NVil-Apr-23-17.rar