Carrara to Sketchfab (FBX and OBJ issues)

keithgkeithg Posts: 62
edited August 2016 in Carrara Discussion

I've just started uploading some models to Sketchfab to share with others and have run into a few issues. I'll try my best to explain the issues and what I've already tried. Any advice would be very gratefully received.

Firstly I am using importing STEP models into Carrara which come in and render beautifully. They consist of a group of objects in my CAD software which come in as a group of surface nurbs in Carrara. I then use Carrara shaders on each of the individual surface nurbs. So far so good. I then export as .fbx or .obj.

Sketchfab accepts both .fbx and .obj but each has an issue.

FBX

These import into Sketchfab with each object having its own material group which I can colour in Sketchfab. Great. The mesh looks great however all the separate objects have the same center in Sketchfab even though they are correctly positioned in Carrara. As they come into Sketchfab as a single model you cannot move the individual objects.

OBJ

These import into Sketchfab with a great mesh and with all the individual parts positioned correctly however they all have the same material domain in Sketchfab meaning I can't colour specfic parts of the model.

Things I've tried.

  • Converting the STEP surface nurbs into vertex models in Carrara. This both solves the positioning issue of the .fbx export and also allows me to set different material shading domains which solves the material issues for .obj files. Unfortunately this process corrupts the mesh and no amount of fiddling fixes it.
  • Ungrouping then re-grouping the surface nurbs in carrara. No effect. Model still apperas in Sketchfab with all the individual parts centered.
  • I've tried every conceivable .obj export option but cararra shaders are not copied to .mtl files so Sketchfab always says there are no material references in the .obj file. The resultant .mtl file from Carrara is also empty.
  • I exported the STEP model from Carrara as both fbx and obj models then imported to DAZ thinking I could set the surfaces in there. Again, the mesh comes in corrupted.

So, in a nutshell. Only fbx or obj export of STEP groups gives me a good mesh in Sketchfab but one has positioning issues and the other has material issues.

Has anyone any ideas I may not have tried yet.

Post edited by keithg on
«1

Comments

  • cdordonicdordoni Posts: 583
    edited August 2016

    Just out of curiosity, have you imported the OBJ or FBX that you exported from Carrara, back into Carrara?

    Post edited by cdordoni on
  • keithgkeithg Posts: 62

    Interesting.

    I just tried that with unusual results.

    When I import the fbx to Sketchfab the mesh is great but all the component parts are on top of each other in the centre

    When I import the fbx to DAZ, everything is in the right place but the mesh is corrupted

    When import the fbx back into Carrara, the mesh is corrupted and the component parts are in the wrong position but not all central.

    Bt corrupted I mean that the mesh has large triangular polygons that reflect light poorly. A good mesh is totally smooth.

    Hmmmm

  • keithgkeithg Posts: 62
    edited August 2016

    Update.

    The FBX positioning issues seem to be a result of Carrara's co-ordinate system. Through trial and error I can get the parts to approximately look right in Sketchfab by putting all the component parts into the center in Carrara then exporting. It's not precise though. Think I'll give up on this.

    With obj's, the only way I can get different material domains into sketchfab is by converting all the step objects to vertex objects in Carrara and assigning materials in the model room. This isn't ideal as the vertex conversion causes problems with the mesh. 

    Question. is there any way to assign material domains to imported objects in Carrara without converting them to vertex objects? This would fix the issue completely.

    Post edited by keithg on
  • cdordonicdordoni Posts: 583

    I believe you need a vertex object to assign shading domains. The corruption issue you describe sound like the normals are messed up.

    I'm not sure why the position of objects in a group is getting messed up, but if you can import the objects individually from your cad program instead of all at once, perhaps that might be a work around?

  • DartanbeckDartanbeck Posts: 21,326

    It might be a selection in the export or import dialog?

  • keithgkeithg Posts: 62

    Thanks for the input. Yes, I can only seem to apply shading domains to vertex models not to my imported STEP models. It's a real shame because the normals on the imported model are perfect and converting them messes them up.

    With regards to the FBX co-ordinates I think it's because I need to group them together before I can export. You can't export selected objects as a single export, you have to group them. What is happening is then when sketchfab imports them it takes the group co-ordinates for all of the objects in the group. effectively they all come in at 0,0,0. I can offset them within the group before exporting but it's almost impossible as every time you change the local co-ordinates of a grouped object, the world co-ordinates of the group changes.

    I have tried importing all the objects separately but as soon as I group them for export I have the same issue.

    Dartanbeck, with reference to the export dialog, FBX export does not give you the option to ignore local co-ordinates like OBJ export does. I've tried everthing.

    One option I've considered is getting a shader baker plugin for Carrara but I'm not sure if this will successfully convert the shaders to textures on non-vertex objects. This would allow me to export as obj. Any ideas?

  • keithgkeithg Posts: 62

    Incidentally, I meant say, why is Carrara so overlooked? Sketchfab has plugins for many different 3D packages but not Carrara. I have used lots of different 3D software over the years (Sketchup, DAZ, SolidWorks etc.) and I think as an overall package Carrara is fantastic - especially it's format support. There aren't many non CAD packages that support STEP. I don't use its modeller much as my background is CAD so I prefer parametric modelling but as an animation and rendering studio I can hardly fault Carrara.

    Just a shame it's not getting the love and care from the developers it needs to push it more mainstream. I'd so love it to get iray built in. We can but hope.

  • 3DAGE3DAGE Posts: 3,311
    edited August 2016

    Whenever you Group a bunch of objects,. then the "Group" becomes the object container

    so the centre of the colection of objects, is the groups centre.

    You would only be able to have individual object centres if you exported each object individually, and were able to upload all these separate items, to sketchfab as some sort of scene of items,.

    perhaps as Sketchfab develops ,. and IF a need for that ability emerges, .....

     

    As for normals,. if you use "Reverse normals diection" ,. in Carrara's Vertex modeller,. that should correct the normals
     

    OctaneRenderer and Lux Render,. both have plugins available for Carrara.

    Iray isn't generally supplied as a "Free" it's around 200 dollars per seat,. and that would add a serious price hike. to a product which is frequently discounted in sales here

    as you say,. it's a shame.

    However,. there's a lot of love and appreciation of Carrara here in this forum, and at Carrara Cafe

    Post edited by 3DAGE on
  • DartanbeckDartanbeck Posts: 21,326
    3DAGE said:

    Whenever you Group a bunch of objects,. then the "Group" becomes the object container

    so the centre of the colection of objects, is the groups centre.

    You would only be able to have individual object centres if you exported each object individually, and were able to upload all these separate items, to sketchfab as some sort of scene of items,.

    That's exactly what I was thinking - but I don't do a lot of cross-system exporting. 

  • cdordonicdordoni Posts: 583
    keithg said:

    It's a real shame because the normals on the imported model are perfect and converting them messes them up.

    Another thought is the curvature of the nurbs surfaces and how they get meshed in Carrara.

    I have found Carrara's meshing to be fairly good; however, I have occasionally found areas where the nurbs curvature is very slight and gets flattened when meshed. Adjusting the import parameters in this case may not yield a good balance between an unnecessary amount of triangles and too few.

    I have found that breaking the surfaces into smaller ones in the CAD program where there are issues with the meshing will correct some artifacts.

  • DartanbeckDartanbeck Posts: 21,326

    cdordoni, you are always making my jaw drop to the floor... I love that! LOL

     

    cdordoni said:
    keithg said:

    It's a real shame because the normals on the imported model are perfect and converting them messes them up.

    Another thought is the curvature of the nurbs surfaces and how they get meshed in Carrara.

    I have found Carrara's meshing to be fairly good; however, I have occasionally found areas where the nurbs curvature is very slight and gets flattened when meshed. Adjusting the import parameters in this case may not yield a good balance between an unnecessary amount of triangles and too few.

    I have found that breaking the surfaces into smaller ones in the CAD program where there are issues with the meshing will correct some artifacts.

    Well, you too, 3DAGE!!! ;)

  • keithgkeithg Posts: 62

    First of all, thanks for the input - really appreciated.

    cdordoni - You are absolutely right, carrara is flattening some of the more shallow curves in my model. One solution is for me to create a high res mesh in my CAD program then bring into Cararra as an IGES mesh - this seems to fix the flattening. This will allow me to upload static objects as .obj's with different material domains.

    3DAGE - With regards to the fbx grouping I have e-mailed Sketchfab to see if there may be a solution. Because of it, I can't upload any animations done in Carrara as my animation will always be a group. I wonder how other programs get round this because there are many fbx animations uploaded to sketchfab which work fine. I believe DAZ fbx animations work ok - I'll need to look into it a bit more.

    Fair point on iray - I assume DAZ don't make enough out of it to sub the cost to nvidia. Octane is very expensive so I'll have a look at the Luxus plugin.

  • cdordonicdordoni Posts: 583

    Have you tried Autodesk's FBX converter? ... it is a free tool available from Autodesk's site http://usa.autodesk.com/adsk/servlet/pc/item?siteID=123112&id=22694909

    Though it is from 2013, it appears to be the latest version.

  • keithgkeithg Posts: 62
    edited August 2016

    SOLVED.

    Hopefully this may help someone else with similar problem.

    The issue is because I am exporting a bunch of components in a CAD program then importing them as a group into Carrara. They all effectively have their own world co-ordinates but programs such as Sketchfab resets all of these to the co-ordinates of the group (0,0,0) so everything comes into the center of the world.

    Converting each component into a vertex model in Carrara solves this by making each component part a simple mesh so the individual co-ordinates within Carrara get exported correctly.

    The downside is that converting to vertex sometimes creates ugly angles in the mesh where ther are very soft curves.

    The solution. I exported each of the parts from FreeCAD as an obj. I then brought these into Carrera. Here's the important bit - you have to create the Carrera objects as Facet meshes on import (not the default vertex). Now I converted each to a vertex model in Carrara and the meshes stayed smooth.

    I also unticked autoposition and ticked disable auto-scaling during import so they all came in in the right place at the right size. Then it was simple a case of grouping the component parts, creating my animations then exporting as fbx. Came into Sketchfab perfectly.

     

    Qicke Test Animation: https://skfb.ly/S6TA

     

    Post edited by keithg on
  • cdordonicdordoni Posts: 583
    keithg said:

    SOLVED.

    Hopefully this may help someone else with similar problem.

    The issue is because I am exporting a bunch of components in a CAD program then importing them as a group into Carrara. They all effectively have their own world co-ordinates but programs such as Sketchfab resets all of these to the co-ordinates of the group (0,0,0) so everything comes into the center of the world.

    Converting each component into a vertex model in Carrara solves this by making each component part a simple mesh so the individual co-ordinates within Carrara get exported correctly.

    The downside is that converting to vertex sometimes creates ugly angles in the mesh where ther are very soft curves.

    The solution. I exported each of the parts from FreeCAD as an obj. I then brought these into Carrera. Here's the important bit - you have to create the Carrera objects as Facet meshes on import (not the default vertex). Now I converted each to a vertex model in Carrara and the meshes stayed smooth.

    I also unticked autoposition and ticked disable auto-scaling during import so they all came in in the right place at the right size. Then it was simple a case of grouping the component parts, creating my animations then exporting as fbx. Came into Sketchfab perfectly.

     

    Qicke Test Animation: https://skfb.ly/S6TA

     

    Thanks for updating us!

  • DartanbeckDartanbeck Posts: 21,326
    keithg said:

    The solution. I exported each of the parts from FreeCAD as an obj. I then brought these into Carrera. Here's the important bit - you have to create the Carrera objects as Facet meshes on import (not the default vertex). Now I converted each to a vertex model in Carrara and the meshes stayed smooth.

    Aha! Good call!

     

    keithg said:

    I also unticked autoposition and ticked disable auto-scaling during import so they all came in in the right place at the right size. Then it was simple a case of grouping the component parts, creating my animations then exporting as fbx. Came into Sketchfab perfectly.

    I figured that sort of thing had to be part of it. I knew you'd been trying that stuff 'till you're blue in the face, so I kept my mouth shut. I'm not that into exporting stuff regularly anyways.

     

    keithg said:

    SOLVED.

    Qicke Test Animation: https://skfb.ly/S6TA

    Awesome! That is SO cool!

  • dot_batdot_bat Posts: 373

    read with great interest good thing you didnt give up cdordoni. one question what is the difference between a vertex mesh and a facet mesh? i generally xport as a vertex mesh, when would i want a facet mesh. thanx

     

  • keithgkeithg Posts: 62

    I'm a bit confused about this as well. I though facets were vertexes!

    All I know is that when you import an .obj Cararra defaults to import as a vertex primitive. To assign a shader domain or alter the mesh you still have to convert it in Carrara to a vertex primitive- strange when you brought it in as a vertex primitive. When Carrara converts the imported object to its own vertex model it sometimes flattens very smooth curves.

    If you change the default import to "import as a facet mesh" then when you convert to a vertex primitive, Carrara makes a much better job of it. No idea why :)

  • keithgkeithg Posts: 62
    keithg said:
    Test Animation: https://skfb.ly/S6TA

    Awesome! That is SO cool!

    Dartanbeck. I think the guy at Sketchfab was genuinely impressed that a physics animation could be done so quickly. You and I know it takes about 2 seconds in Carrara but I don't think many people reallise what a gem Carrara is.

  • keithgkeithg Posts: 62

    Just to close this topic I thought you might like to see how well this process works on even the most complicated models.

    Imported .obj parts as facet meshes into Carrara
    Converted all individual objects to vertex primitives in Carrara
    Grouped and exported whole think as single .fbx - could have animated but didn't for test
    Imported to Sketchfab and allocated shaders

    Final result: https://skfb.ly/SpTQ

    That's on a model with 1.6 million faces

  • DartanbeckDartanbeck Posts: 21,326

    That is Very cool! I like this Sketchfab thing. Don't have enought ime to try messing with it... but I really like it! I may eventually try and run some of my animations as VR sims though... we'll see.

    I think that "Facets" is just another word for a polygon, where vertex are the points, facets are the faces. So if a facet has bending applied to it somehow, that likely gets stored/exported as that shape, whereas the vertices would just be a plotting of where those points lie, rather than any extra bending which might be applied (vie SubD smoothing or non-coplanar faces, for example) to the polygons themselves. Pretty sure.

  • keithgkeithg Posts: 62

    Dartanbeck. I definitely think you should play with Sketchfab. It's incredibly simple and takes no time at all. I can see a lot of DAZ and Carrara users using it to show their models and animations. Sketchfab know DAZ Studio and I have suggested they develop a plugin to allow people to export straight from DAZ. They've already done these for programs like SolidWorks and Rhino.

    The account is free with unlimited uploads and a 50mb limit on models. It supports textures and bump mapping - see my example https://skfb.ly/SpXQ. Im agine how cool the DAZ shop would be if you could play with a model in 3D before buying. I haven't got VR head gear but Sketchfab fully supports it.

    I agree with your summary on faces v vertices but Carrara seems to contradict itself. When you convert a model in the model room it says "Vertex Modeler - Convert to facets"

  • DartanbeckDartanbeck Posts: 21,326
    keithg said:

    I agree with your summary on faces v vertices but Carrara seems to contradict itself. When you convert a model in the model room it says "Vertex Modeler - Convert to facets"

    Right... in that respect. But I was referring to the import/export options for bringing the details in/exporting the details out. I have a feeling that, by using verts instead of facets, some smoothing info is getting lost in the transition somehow, hence the Facet function working better for the initial import. 

     

    keithg said:

    Dartanbeck. I definitely think you should play with Sketchfab. It's incredibly simple and takes no time at all. I can see a lot of DAZ and Carrara users using it to show their models and animations. Sketchfab know DAZ Studio and I have suggested they develop a plugin to allow people to export straight from DAZ. They've already done these for programs like SolidWorks and Rhino.

    The account is free with unlimited uploads and a 50mb limit on models. It supports textures and bump mapping - see my example https://skfb.ly/SpXQ. Im agine how cool the DAZ shop would be if you could play with a model in 3D before buying. I haven't got VR head gear but Sketchfab fully supports it.

    ...and other (many other) benefits! Yeah... I'll be looking into this when I can. Too nutzoid busy right now - still trying to get my production off the ground - to start learning new technologies for my own workflow... but it sure is fun to check out! 

    Very cool! So, for example, you could upload that static tyre as a rotating tyre if you wanted, right? Then it would spin as we buzz around the thing? Like your model that falls apart... I had a lot of fun scrolling around that thing as it repeated itself falling apart and to the floor! I like your stuff. Looks wonderful! 

    So I wonder: If I had my main characters running along a path, we could then scroll around them as they do so, eh? Would be a lot higher than 50mb, but still. Just the possibility of being able to do that stuff is cool!

    I attended the Live Stream of Star Wars Celebration again this year (had so much fun last year... had to do it again!!!) and am incredibly intrigued by this whole 360 degree technology - especially after catching this panel on ILM's xLAB - pushing that technology (as they've done with so many other techs) through and beyond so many boundaries... it's unfathomable to try and imagine where this will all lead. 

    I may get myself some VR headset. That would be the first step. Whether that propels me into joining that flow, and making experiences for it... I hope so! :)

  • keithg said:

     I can see a lot of DAZ and Carrara users using it to show their models and animations.

    Just a bit of warning, just like on YouTube, sometimes content which does not belong to a account owner (=not their original work) ends up being uploaded (with "download" option), stuff over there is tirelessly fighting this B.S. so be careful what you download ...

    I doubt DAZ itself is gonna allow their models to be hosted there, if there is even theoretical chance to rip the models from SketchFab viewer.

    Otherwise, awesome place to be, I been a member for a while, it would be nice if someone would "crack" how to embed their viewer in these forums smiley

  • TGS808TGS808 Posts: 168
    edited August 2016

    ...

    Post edited by TGS808 on
  • keithgkeithg Posts: 62

    When you upload a model or animation, by default it cannot be downloaded by anyone else. I agree DAZ may have an issue if people allowed downloads. That said, they wouldn't download as fully poseable figures, just meshes I reckon. You can't upload rigged models as far as I can see.

    Dartanbeck. Get 5 people to accept an invite from you and you get a PRO account for free - 200mb file limit.

  • keithgkeithg Posts: 62
    keithg said:
    Otherwise, awesome place to be, I been a member for a while, it would be nice if someone would "crack" how to embed their viewer in these forums smiley

    It wouldn't take much for DAZ to do this. Sketchfab models and animations can be embedded in bulletin boards with bbcode. The editor they use for this forum is CKeditor, something I've been using for some time. There is a great plugin for bbcode available for CKeditor but it would take DAZ to implement it.

  • keithgkeithg Posts: 62
    keithg said:
    Very cool! So, for example, you could upload that static tyre as a rotating tyre if you wanted, right? Then it would spin as we buzz around the thing? Like your model that falls apart... I had a lot of fun scrolling around that thing as it repeated itself falling apart and to the floor! I like your stuff. Looks wonderful! 
    keithg said:
    So I wonder: If I had my main characters running along a path, we could then scroll around them as they do so, eh? Would be a lot higher than 50mb, but still. Just the possibility of being able to do that stuff is cool!

     

    Spinning tyre would be easy. Only issue with your running figure idea is that, in Sketchfab, the user is in control of the camera. Carrara camera animations are deleted on upload to Sketchfab so you couldn't set it up so the figure was always in frame.

  • DartanbeckDartanbeck Posts: 21,326
    keithg said:
    keithg said:
    Very cool! So, for example, you could upload that static tyre as a rotating tyre if you wanted, right? Then it would spin as we buzz around the thing? Like your model that falls apart... I had a lot of fun scrolling around that thing as it repeated itself falling apart and to the floor! I like your stuff. Looks wonderful! 
    keithg said:
    So I wonder: If I had my main characters running along a path, we could then scroll around them as they do so, eh? Would be a lot higher than 50mb, but still. Just the possibility of being able to do that stuff is cool!

     

    Spinning tyre would be easy. Only issue with your running figure idea is that, in Sketchfab, the user is in control of the camera. Carrara camera animations are deleted on upload to Sketchfab so you couldn't set it up so the figure was always in frame.

    Right, but I'd set it up so that the pivot point was just right, so that it would look cool rotating around it. If the camera can be taken off track of the original pivot... well that's a user-created issue! ;) Can it be set up so that people cannot download the model?

  • FifthElementFifthElement Posts: 569
    edited September 2016

    Yes, it can be set up without download smiley

    Post edited by FifthElement on
Sign In or Register to comment.