Export FBX file Units

Feel free to ask any question here
FOSTERRMS14
Posts: 8
Joined: Tue Jul 14, 2015 11:40 am

Export FBX file Units

Post by FOSTERRMS14 »

I have created a mesh from a PTX file using Poisson Surface Reconstruction Plugin and then have saved the mesh out as an FBX (Binary) format for use in AutoCAD & Navisworks.

In AutoCAD i can not get the file to open at all.
But in Navis works the file opens but apears to be 1/10th the size of the true model. IE it seems tthat cloud compare has scaled the model by a factor of 0.010.

I have also tried to oevrlay an stl file from Cloud compare with the FBX. The STL is in the correct space and scale.
Is there some sort of scale factor applied to FBX file exports?
daniel
Site Admin
Posts: 7332
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Export FBX file Units

Post by daniel »

FBX files generated by CC have been tested on FBX Review (the official Autodesk FBX Viewer - it's free).

Can you maybe check with your own data? And if it fails can you send the file to me? It's weird that Autocad fails to read an Autodesk format ;)

And up to my knowledge, there's no scaling set on the output FBX files. Same thing, I've just tested this (again with FBX Review) by comparing an OBJ file with the FBX version generated by CC. If the issue is on Naviswork's side, you could still scale the mesh in CC before exporting it to FBX?
Daniel, CloudCompare admin
FOSTERRMS14
Posts: 8
Joined: Tue Jul 14, 2015 11:40 am

Re: Export FBX file Units

Post by FOSTERRMS14 »

Thanks, I will have a look at the FBX viewer.

The point cloud i brought into CC is in meters units and i exported a STL, DXF & FBX.
I found in Navisworks the point cloud, STL & DXF all overlay but the FBX was actually 100 times smaller.

I scaled the file in CC by 100 then exported the FBX. This then ovelaid well with the point cloud & STL.

I will look at the fbx viewer and let you know my findings.
Charlesw
Posts: 45
Joined: Mon Apr 10, 2017 3:54 pm

Re: Export FBX file Units

Post by Charlesw »

Was anything ever found on this topic? I am finding that my FBX exports (when brought into Navis) are importing to Navis as "centimeters".

In CloudCompare, I have an FBX file generated from CAD. This file is in inches.

I created a mesh from a point cloud which is also in inches.

I exported (tried all variations of fbx standards) as inches.

Navis Manage imports the FBX from CAD with the correct units.

Navis Manage imports the created mesh from cloud as centimeters.

Any thoughts on what this could be from?
daniel
Site Admin
Posts: 7332
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Export FBX file Units

Post by daniel »

Indeed, CC never deals with units AT ALL. Therefore CC won't read the units out of FBX files, and it won't set them when saving the cloud (leaving them to their default value, which must be millimeter or something like this?).

We should add something specific to the FBX I/O filter to handle this.
Daniel, CloudCompare admin
daniel
Site Admin
Posts: 7332
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Export FBX file Units

Post by daniel »

Okay, I've fixed the code. You''ll need to wait for the new 2.10 alpha version (or compile it yourself ;).
Daniel, CloudCompare admin
Charlesw
Posts: 45
Joined: Mon Apr 10, 2017 3:54 pm

Re: Export FBX file Units

Post by Charlesw »

I have no problem compiling on my own. May I ask what was changed? maybe I can just add it in. I am still working in .9beta code...

the newest release (official .9) has quite a bit of code that has changed and will inevitably cause many of my current plugins (automations) to cease working as they are heavily dependent on the .9 beta code and my own additions combined. As soon as I can find the time, I will be recompiling and updating everything to the new release, but this may be a few weeks out.
Charlesw
Posts: 45
Joined: Mon Apr 10, 2017 3:54 pm

Re: Export FBX file Units

Post by Charlesw »

On the topic of exporting FBX files. There is a dialog when exporting to choose a type of format for the FBX file. Is there a way to silence this dialog or skip past it? Aside from commenting that block of code from the main source code? I did not see a way to do so but could have easily missed it. The plugin I am working on requires a mesh to be saved after running but needs to have no dialogs present. Is this something that can be specified in saveparameters?

I've tried to turn "alwaysshowdialog" off. This works fine for the main saving of the application, however it seems since the fbx file type is a 3rd party, it does not abide by the same saveparameters....
daniel
Site Admin
Posts: 7332
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Export FBX file Units

Post by daniel »

I don't think the signatures of the classes has changed that much in the release version, have they?

Anyway, the only modifications are in the FBXFilter.cpp file (see https://github.com/CloudCompare/CloudCo ... 2cba9f893b).

And to prevent the FBXFilter from opening a dialog to let the user chose the format, you just have to call 'FBXFilter::SetDefaultOutputFormat' (see the FBX_EXPORT_FMT option in the command line mode: http://www.cloudcompare.org/doc/wiki/in ... _line_mode).
Daniel, CloudCompare admin
Charlesw
Posts: 45
Joined: Mon Apr 10, 2017 3:54 pm

Re: Export FBX file Units

Post by Charlesw »

I believe part of my issue has come from not being able to reference your code. (I know there is something simple I am doing wrong here - but do not know what)

What I started doing was taking segments of code that I needed and re-purposing it inside my plugin.

I guess the question then really is, Why does VS2015 tell me the following when I try to use "FBXFilter::SetDefaultOutputFormat".

"Name followed by :: must be a class or namespace"

^^Amateur status ^^

I have included the FBXFilter header, along with the fbxsdk just in case - neither worked. the fbx sdk did allow me to use the sdk methods. But I was still unable to access the FBXFilter.

Regarding the classes changing: i think the biggest one I looked at thus far was revolving around normal calculations. Much of the plugin(s) I was making required modifications to what was already in place in CC so I copied it over and made the changes. I will be going through my code next week to see if anything else really changed much. This isnt really much of a worry as the new additions in the official release of 9 have caught my interest and should help smooth out some of the processes I was running before.
Post Reply