Unity newbie here… In my professional life, I’m a software developer in the CAD/CAM arena, but I’ve always enjoyed tinkering with game programming on the side.
With that in mind, I’m trying to find a path to go from the CAD modeling tools I’m familiar with (various 3D parametric solid modelers like SolidWorks and Alibre Design) into Unity.
The typical formats that are available in these tools are things like IGES (igs), STEP (stp), STL, ACIS (sat), etc.
I understand Unity’s approach of importing 3D data is to target “standards”, not proprietary formats. That said, many of the above are standard formats in the area of mechanical 3D models. I wonder if any of the above formats are in the sites of the Unity developers?
Unfortunately, there doesn’t seem to be much in the way of (freely) available conversion tools to go between game-centric modeling formats and their CAD/mechanical-centric counterparts.
I’ve found a few such packages, but so far, haven’t been able to get from “here to there”.
Any tips on getting these formats into Unity (directly or via conversion) would be appreciate. In addition, I’d also appreciate any consideration from the Unity dev team for a direct import of one or more pf the mechanical modeling format standards.
As makers of Autocad 3D Studio Max and Maya, your best bet in my mind would be to go that route - try the 3DS exporter for Solidworks and .3DS file should import fine into Unity.
Another option if you have 3D Studio Max is to simply import your Autocad file (DWG) directly into 3DS and save it as a .3DS file. Again should be fine.
if you import it into 3DS Max though, exporting as FBX would be the even better idea.
A general information: Unity does not import anything but FBX, Collada, 3DS and OBJ
These are the 4 defacto standards for inter application 3D data exchange, any half way professional 3D application should either support the old primary format (OBJ) or the new one (Collada)
All other formats mentioned on the page work through silent reexporting to FBX and require the corresponding application to be installed on the machine
Thanks for the input, but I guess I wasn’t overly clear in my original description. My issue is that I don’t have access to the typical “digital content creation (DCC)” 3D applications, but I do have access to a number of “engineering” 3D applications.
So, for me, passing anything through Studio Max (or similar) is out of the question. I just wonder why it’s so difficult to translate models between the engineering world and the DCC world?
I know this is not a Unity-specific problem, as there’s always been a barrier between these two disciplines, even though they’re quite similar.
Dreamora - you mention “4 defacto standards” for 3D model exchange. Unfortunately, while those may be the standards for the DCC world, they’re almost meaningless in the 3D engineering world. Boeing and Lockheed don’t store real-world airplane model data in a 3DS file (for example).
In the engineering world, the defacto standard for 3D data exchange is (arguably) a STEP file (STP extension). If there were a way to convert a STP file into one of the DCC 3D standards (or, better yet, import it directly), that’d open up a whole new world of 3D tool possibilities to end Users.
Anyway, I don’t want to debate the pros and cons of 3D file formats - I just want to get my (engineering) models into Unity.
So, to be more specific than my previous post:
Does anyone know of a way to convert a STEP (stp) file to something that Unity can import?
Is the STEP format even on the radar of the Unity dev team for possible native import?
the main reason why cad formats are of no interest is sometimes caused that CAD apps create plans not needfully geometry with UV etc which is the one and only thing of interest when it comes to rendering directly.
Applications that work on both ends often support some cad formats or optionally have addons to do so, but the broad majority of the 3d realtime / rendering content creation application especially the less expensive ones don’t care about “exotic formats” which CADs are out of their own very specialized field.
Actually I’ve never even heard of a format called STEP
DXF / VRML and alike at least are somewhere known and are supported by different applications like Ultimate Unwrap3d and alike.
But highly specific apps have little to no chance to convert their own internal formats over, given they even generate data that can be used.
I have done what you want to do a whole lot of times in the past years: Converting CAD data to realtime-ready formats. And it’s a pain in the back.
Every CAD tool I know (Catia, PowerEngeneer, etc.) works with NURBS data because it’s perfectly accurate and easy to “understand” by machines and robots. But unfortunately, NURBS are of no use when it comes to realtime apps like Unity, because there’s no built-in NURBS approximation to generate Polygons out of it in runtime.
So what I do now is:
1.) Export the CAD data out of the authoring tool to a format like VRML2
2.) Convert the VRML2 data to Maya binaries in an external converter - Deep Exploration, for example. This will leave you with a hell of a lot of single poly objects. Tens of thousands, probably, depending on how your complex your object is. This is because every single NURBS surface is converted to a single polygon surface in the process, and every surface you generate in your CAD tool consists of a number of separate NURBS surfaces, depending on the curvature and how sophisticated the surface is.
3.) Open Maya with the converted file.
4.) Combine all these thousands and thousands of small polygonal surfaces depending on their original materials, while always keeping the 65k-barrier in mind.
5.) Save the file and import it to Unity.
6.) Assign shaders and make everything nice and neat.
This workflow works pretty nice for me, but since you told us that you neither have Maya nor Deep Exploration at your hands, it’s pretty much worthless to you.
So my answer to your initial question if there’s any way to get a CAD object without any 3rd party app into Unity is: No. There’s no way that I know of.
The only thing would be if you have Deep Exploration anywhere around your desk. Deep Exploration understands all major CAD formats including STEP, VRML, VRML2, DXF, DWG, etc., but also knows FBX. You could use Deep Exploration to convert directly to FBX and that format is used by Unity. So that might work. But keep in mind that you will end up with a hell of a lot of single objects in Unity what will in fact kill any good performance and manageability you might otherwise have. But it might be worth a try - IF you have Deep Exploration around somewhere. Not so far fetched since it is pretty well known in the CAD business.
Ultimate unwrap (not free, but pretty cheap) can import stl files (with a freely downloadable plugin), which I think, solidworks and so on should be able to create.
It can also create and edit UV maps. But, it does not do polygon reduction. A standalone polygon reduction tool that comes to mind is balancer, or polygon cruncher.
A bit late but maybe useful to somebody. Try the opencascade based FreeCAD project, it imports step/iges files and exports obj files which unity can apparently accept. I’ve not tried it myself mind you but I can confirm opencascade is very good at step imports and vrml exports. The obj export option seems to be unique to FreeCAD though. Link is here:
Failing that try the conversion program Polytrans, which is relatively cheap.
I work in the AEC industry, and I know where you’re coming from… It is sometimes a pain to translate files from engineering formats, but Rhino is your best friend here. It opens most surface and solid model formats and exports to dwg, dxf, and obj. Plus, if you’re a developer, chances are you know your way around the back end of these software, and usually you can use their API to grab the render meshes which you can output to a mesh format. For instance, for my iPHone application goBIM, I export models out of Autodesk Revit using the API to write out the render mesh to a text file similar to an OBJ.
To me, the best way to move data from Microstation to Realtime engines has been Micro–>3Dmax–>Engine.
THe worst of this workflow is that if you’re working not with solids doing 3d machinery but doing Site design in UTM coordinates (big numbers) you’ll find that when porting your data to 3dmax it looks quite weird. Even if you try to cheat the 3dmax by referencing the initial file to 0,0,0 coords, no error is shown but the ressult is the same, so the only way is to copy your CAD file and move it to the 0,0,0 wich is **it
I forgot to mention that Politrans is an especialiced data converter that claims to convert CAD-Solids formats to “artistic” 3d formats. You could give it a try to the demo. It will remove a face for each 5 in demo mode but it will give you an idea if works or not .
I just wanted to chime in here and didnt think this needed a new thread…
I am in a corporate environment where we use very large and elaborate CAD files to plan and build assets. These CAD files costs tens of millions of dollars to create and my industry is currently looking for ways to use them after the planning phases. The idea is to continue to update the CAD files and use them in operations.
Meaning these CAD files might get updated weekly. So we are looking for a way to simply have these assets stored on a server with a virtual world where the changes can be seen in real time.
So is it completely possible (with the right people) to build a framework in unity to support CAD formats the same way it supports 3DS and Maya?
It may be possible to create an import script or plugin to bring in a CAD model, but the problem you are going to run into is that CAD models make very poor realtime 3D models.
I’ll give you a real world example: I received a 1 MB STEP model from a client and converted it into a format that Unity can import. The resulting file was over 100 MB and over a million polygons. Many times bigger than Unity (or any other realtime game engine) can handle. We ended up spending a week creating a new model that looked identical to the CAD model, working from scratch and using the CAD model mostly for dimensions and detailed information. The end product was roughly 8,000 polygons and ran like greased lightning in Unity.
There are applications that will automatically reduce the number of polygons in a model, and some work better than others. But none do nearly as good a job as an artist and to be honest, although I’ve wanted to go this route I’ve never gotten good enough results to allow me to.
So my next question would be is this a engine restriction or a hardware restriction. Let’s say hypothetically I have hundreds of thousands of dollars to spend on hardware to run a persistent virtual world for 3d visualization. Could I not just beef up the system and optimize the engine to hypothetically handle a few million poly pipeline? Maximum 100-200 users. (We are currently looking for a good engine to use as a bases for our project and future projects which is why I am asking these questions.)
Or is there some kind of hard limit within the engine that causes this restriction? I actually have a digital art degree (currently project manager) and 100% agree that no amount of software or scripts used to “optimize” CAD files (or any 3D model) for polygon rendering can replace a 3D artist.
EDIT: and as a side question, has anyone tried to do application sharing or document editing in Unity? Screen Scraping, VPN, Open Office integration?
As I understand it (and if someone else remembers the specifics please feel free to chime in) it’s actually both. Unity has a limit of (and my memory is a bit sketchy here) 32,000 polys per object, and if I recall correctly, that is imposed by OpenGL and DirectX. You can get around that limit by making sure none of your objects are larger than 32,000 polys (ie. break big objects into smaller objects) and that could probably be done in a script.
I wonder, though, if you might be better served by a different “tool” for what you want, such as SolidWorks “eDrawings” or something similar?
Don’t get me wrong, Unity is a great engine, but I’ve found driving nails with a screwdriver usually ends in disappointing results.
in 3dmax, wich has a very poor realtime viewer from my point ov view I move up to 2 million (2.000.000) poligons with a nice framerrate in shaded mode.
I dont agree that there are not nice polygon reducers out there. I’ve used polygon cuncher plugin for 3dmax and in recudes meshes from 500.000 to 50-80k without your eye notices any change.
But as you can link a dwg directly into 3dmax and export it to fbx without breakng the link there is no so huge need for a cad format.
But yes I would suggest to support some elements of the cad format such as lines, because they’re lost during translation, and these lines can be very handy in unity for using them for placing elements along a line, make an objet follow that line etc…