Is there any way to import solidworks files into unity as assets? - unity3d

I'm attempting to program a simple chess game using the unity game engine. However, I can't work out how to import the assets that I've created in Solidworks into Unity.
Is it possible to do?

SolidWorks files tend to describe parametric geometry, such as NURBs, but most game engines prefer to work with raw polygons.
Unity has direct support for the following model formats: FBX, OBJ, DAE, 3DS.
SolidWorks can export to STL format, which other programs should be able to convert to OBJ, DAE, and/or FBX. Recommending a specific tool is beyond the scope of Stack Overflow, but I know that such tools exist. I recommend searching terms such as "stl to obj conversion".
These sorts of headaches are fairly common with 3D assets, since so many programs use customized file formats.

Also with 3DS studio max, you can directly open Solidwork files and then export as them as .fbx (you need to have Solidworks installed in the same machine as 3DS Max).
about SolidWorks (SLDPRT, SLDASM) Files:
http://help.autodesk.com/cloudhelp/2015/ENU/3DSMax/files/GUID-861F1B25-0F1B-4E79-A660-821F4CD2175B.htm
Other free tool for converting 3D files: (can save as .obj, which unity reads)
MeshLab
http://meshlab.sourceforge.net/
*Update for 2018:
Unity has partnered with this CAD importer company, and its available to purchase from: https://unity3d.com/pixyz
They support pretty much all the available CAD formats, including SolidWorks
full importer list at https://www.pixyz-software.com/plugin/

Just for reference, since Solidworks 2019 it is not necessary to use any AddIn/3rd Party Plugin. It is supported out of the box: https://help.solidworks.com/2019/english/whatsnew/t_export_using_extended_reality.htm

the "XR exporter" in SOLIDWORKS will allow you to export the model with some additional content (animation, appearances, metadata) to the GLTF / GLB fileformat and using the GLTF importer for unity (should be free) you're done.

Related

How do I open a `.pb` file? Ideally, how to import it into Meta Quest 2?

I'm using Matterport's free scanning software for Android and it spits out 2 files called 2b7cb66c-4c9e-408d-88c5-90b8c0322c13_sweep_features.pb and 2b7cb66c-4c9e-408d-88c5-90b8c0322c13_sweep_cloud.pb (the important thing is that they're of the forms [nums]_sweep_features.pb and [nums]_sweep_cloud.pb).
:^)
How can I open .pb files?
.
=======================================================
=======================================================
My ultimate goal: the room in VR
I need to know how to open the file so I can walk around the rooms I scan in my Meta Quest 2 VR Headset. Ideally, I'd get it working in Unity, but UnrealEngine would be fine too. The most important thing is that I get the numerical and/or color information about the scanned room. Besides sweep_cloud.pb, there is also a file called sweep_features.pb.
Maybe .pb is a Tensorflow format? I say that because most of the .pb files I have found through Google for are Protocol Buffers, many of which store Neural Network (Tensorflow) files, and "feature" is jargon in Neural Networks and Machine Learning more generally!
Another guess would be something like a .obj file, a numpy (.npy) file or other point cloud format that probably has some color information in it!
Thanks!

Import .ai (illustrator file) in Unity and display them

I want to load an illustrator file in my game. Unity should recognize different layers, colors, and forms, and layers with text and display them in a 2d canvas.
The goal is that the players can click on different forms and that unity recognize them as individual forms. Do you know any unity asset or a way to make this possible?
For example when you import an image like this as an illustrator file -> https://www.mandala-bilder.de/mandala/erwachsenemandalas/mandala-ideen-erwachsene.pdf
I thought about an SVG file but then I canĀ“t use the different layers.
Illustrator has a proprietary file format, it has no publicly available documentation for newer versions. While you can dig out old specifications (this is why some programs only support AI files saved in ancient versions) http://www.idea2ic.com/File_Formats/Adobe%20Illustrator%20File%20Format.pdf I do not think you can just go in and start supporting a 2021 variant without requesting (and motivating) the spec from Adobe. They might also want to charge you for it.
SVG on the other hand is free and it's spec is public so there is much widely spread support. also SVG supports groups which can get your around the need for layers
Vector Express is a free conversion API you should be able to use. (requires a network connection, though)
https://github.com/smidyo/vectorexpress-api
You should be able to POST a request (https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest.Post.html) to this endpoint, with the raw AI file as the body:
POST https://vector.express/api/v2/public/convert/ai/gs/pdf/psd2svg/svg/
This will return a JSON object with a link to an SVG file that you can then download and display.

What file formats are supported by Unity and Hololens?

What file formats does Unity and Hololens support ? We assume only FBX and GLTF file formats only?
Are there open source tools to convert to these formats ?
The ARR service accept FBX and GLTF file formats only.
Unity supports FBX, GLTF, OBJ and Maya files.
Unfortunately, Microsoft doesn't provide any specific tooling to convert a CAD file to these formats. However, Microsoft has recommended using programs like PiXYZ ( https://www.pixyz-software.com/studio/ ) to convert from various CAD formats to a tessellated mesh , which Unity or ARR can read in (such as FBX). Note, the HoloLens itself doesn't care too much about the the format as long as it is a triangulated mesh of polygons. (HoloLens is just a UWP device that uses DirectX). But, Unity does the heavy lifting of sending the polygon data to DirectX. You will likely have to optimize/reduce their CAD data since the HoloLens is a mobile device it can't render much more than 100-200k polygons at 60 frames per second. So, if you need more "complex" representations of the CAD data that's where ARR can help.
Thank you Cameron for providing me/us the info! Microsoft Developers are the best.

Unity3D problems with FBX models

I am currently trying to make a game in Unity but have encountered a problem that I've tried to solve for a couple of hours without success.
I've downloaded a package from the Asset Store with a foundation to a game. In this downloaded project the models used for the game is stored in one .FBX file which contains all the individual models. The creator of this package has a method for "re-skinning" these models, where he says that one should open the .FBX in 3DS Max, attach your new model to the old, and then remove the old model.
I've done a character in MagicaVoxel which I then export as an .OBJ and import it to 3DS Max and follow his instructions. But when I export the new .FBX with my new model and test it with Unity the model is super tiny and the colors are wrong. This is especially weird because all the other models are perfectly fine.
Have tried numerous ways, but since I'm new at both Unity, MagicaVoxel and 3DS Max I haven't the skill to solve this problem myself.
Thanks in advance!
Rasmus

How to load a 3d model from URL in unity?

What is the best way to load a 3d model from a URL inside of unity at runtime. I have tried this obj importer
http://wiki.unity3d.com/index.php?title=ObjImporter
But the mesh in not imported properly. What other options exist? Assetbundle needs a pro version and even that won't solve as I need to load a 3d model from url. Any suggestions?
The way to go would be asset bundles. They are Unity's (proprietary) way to load prepackaged, compressed assets from a file or an URL. All asset bundles must be prepared and built in Unity Editor.
If you need a more general approach which loads a raw file format like fbx, obj, 3ds, collada, et cetera, you should use the Assimp library. Assimp library is written in C++ but there is a wrapper for C#.NET here.
There are also wrappers for Unity like this Unity Assimp being free but quite outdated. The Asset Store though is packed with format specific importers including this free OBJ importer.
2021 update
Unity now also has Addressables which are an evolution of the aforementioned Asset Bundles. In a sentence, Addressables are memory managed, asynchronously loadable resources that can be loaded from local or remote end points.
There are a couple of libraries available to load 3d model from a URL in Unity.
These are the best two libraries to load the model from remote location at runtime.
Asynchronous Importer and run-time Loader for Unity
Runtime OBJ Importer
Asynchronous Importer and run-time Loader for Unity is quite a useful tool to import obj files from a remote location with texture and materials. where the Runtime OBJ Importer might miss the texture/material of the model.
Demos:
https://github.com/codemaker2015/unity3d-runtime-model-importer
https://github.com/codemaker2015/Runtime-OBJ-Importer-Demo