Difference between revisions of "Tutorial: Creating Unity Assets with SOLIDWORKS"

From CEED Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 +
There are two main ways to export Unity Assets with Solidworks. Both methods have their pros and cons, but at the end of the day, the main consideration is if you want to have textures exported from Solidworks, or if you want more control over the computational weight of your asset (which will ultimately dictate the framerate at which your application will run).
 +
 +
==Exporting without Textures==
 +
The first method, without textures, gives you more control over how heavy the asset is.   
 +
 +
=== Exporting to STL ===
 +
 +
* With SOLIDWORKS, open an assembly file. Under ''File'', select ''Save As'' and under ''Save as type'', select .STL   
  
==Exporting SOLIDWORKS Assemblies==
 
With SOLIDWORKS, open an assembly file. Under ''File'', select ''Save As'' and under ''Save as type'', select .STL.   
 
 
[[File:Screenshot (7).png|center|thumb|364x364px|The ''File'' dropdown menu of SOLIDWORKS.]]
 
[[File:Screenshot (7).png|center|thumb|364x364px|The ''File'' dropdown menu of SOLIDWORKS.]]
Afterwards, press the ''Options'' button, and make sure that the option ''Save all components of an assembly in a single file'' is unchecked. You should now have a .STL file for each assembly part. Place all the .STL files into a single folder.
 
<br />[[File:Screenshot (8).png|thumb|The SOLIDWORKS ''options'' menu to convert all of an assembly's components to .STL files.  |alt=|center]] 
 
  
==Importing .STL files into Blender==
+
* Press the ''Options'' button, and make sure that the option ''Save all components of an assembly in a single file'' is unchecked. You may also change the quality of the STL you export in this option dialogue. You should now have a .STL file for each assembly part. Place all the .STL files into a single folder.<br />
 +
 
 +
[[File:Screenshot (8).png|thumb|The SOLIDWORKS ''options'' menu to convert all of an assembly's components to .STL files.  |alt=|center]]<br />
 +
===Importing .STL files into Blender===
 
Open Blender, and delete the ''Camera, Cube,'' and ''Light'' on the right-hand side of the page by right-clicking on them, and pressing ''Delete''.     
 
Open Blender, and delete the ''Camera, Cube,'' and ''Light'' on the right-hand side of the page by right-clicking on them, and pressing ''Delete''.     
 
[[File:Screenshot (9).png|center|thumb|Deleting the default ''Light'' item in Blender. ]]   
 
[[File:Screenshot (9).png|center|thumb|Deleting the default ''Light'' item in Blender. ]]   
Line 13: Line 20:
 
[[File:Screenshot (10).png|center|thumb|Example of a drill press SOLIDWORKS assembly converted to a .blend file. The drill press' appearance was modified using Blender. ]]       
 
[[File:Screenshot (10).png|center|thumb|Example of a drill press SOLIDWORKS assembly converted to a .blend file. The drill press' appearance was modified using Blender. ]]       
 
    
 
    
==Exporting to Unity==
+
===Exporting to Unity===
 
In Blender, from the top left corner, press ''File,'' and then ''Save''. Simply drag and drop the .blend file into Unity, where the assembly can now be used as an asset. If you wish to modify the asset, such as change its size or its appearance, simply open the .blend file and modify it using Blender.
 
In Blender, from the top left corner, press ''File,'' and then ''Save''. Simply drag and drop the .blend file into Unity, where the assembly can now be used as an asset. If you wish to modify the asset, such as change its size or its appearance, simply open the .blend file and modify it using Blender.
 +
 +
== Exporting with Textures ==
 +
The process of exporting with textures requires the use of Solidworks Visualize and a bit of setup, but allows for exporting with less steps. The quality (weight) of the exported asset is not directly obvious, however, as SW Visualize does not give an option for the quality of the export. According to the documentation, the quality of the polygonal file created by visualize on import is dictated by the properties used in Solidworks for the quality of any open document (go to ''Options (Gear)>Document Properties (Tab)>Image Quality'' to change this setting). This was however never properly verified.
 +
 +
=== Setting Up Visualize ===
 +
Visualize will by default scale any parts that are imported if they are larger than a specified value. To change this, open Visualize and go Tools>Options>Import, and change the auto-scale options to
 +
<br />
 +
 +
=== Importing to Visualize ===
 +
Once you are in Solidworks Visualize, you may simply navigate to ''File>Import''... and browse to your Solidworks part or assembly.
 +
<br />

Revision as of 21:31, 11 June 2021

There are two main ways to export Unity Assets with Solidworks. Both methods have their pros and cons, but at the end of the day, the main consideration is if you want to have textures exported from Solidworks, or if you want more control over the computational weight of your asset (which will ultimately dictate the framerate at which your application will run).

Exporting without Textures

The first method, without textures, gives you more control over how heavy the asset is.

Exporting to STL

  • With SOLIDWORKS, open an assembly file. Under File, select Save As and under Save as type, select .STL
The File dropdown menu of SOLIDWORKS.
  • Press the Options button, and make sure that the option Save all components of an assembly in a single file is unchecked. You may also change the quality of the STL you export in this option dialogue. You should now have a .STL file for each assembly part. Place all the .STL files into a single folder.
The SOLIDWORKS options menu to convert all of an assembly's components to .STL files.


Importing .STL files into Blender

Open Blender, and delete the Camera, Cube, and Light on the right-hand side of the page by right-clicking on them, and pressing Delete.

Deleting the default Light item in Blender.

Now, from the top left corner, press File, Import and Stl. Navigate towards the folder that contains your .STL files. Once in the folder, CTRL + left-click all the .STL files, and finally click on Import STL. Once imported, the assembly will no longer have the textures or material appearances that were assigned to it in SOLIDWORKS. However, it is possible to assign new colors and/or textures to all the imported components using Blender.

Example of a drill press SOLIDWORKS assembly converted to a .blend file. The drill press' appearance was modified using Blender.

Exporting to Unity

In Blender, from the top left corner, press File, and then Save. Simply drag and drop the .blend file into Unity, where the assembly can now be used as an asset. If you wish to modify the asset, such as change its size or its appearance, simply open the .blend file and modify it using Blender.

Exporting with Textures

The process of exporting with textures requires the use of Solidworks Visualize and a bit of setup, but allows for exporting with less steps. The quality (weight) of the exported asset is not directly obvious, however, as SW Visualize does not give an option for the quality of the export. According to the documentation, the quality of the polygonal file created by visualize on import is dictated by the properties used in Solidworks for the quality of any open document (go to Options (Gear)>Document Properties (Tab)>Image Quality to change this setting). This was however never properly verified.

Setting Up Visualize

Visualize will by default scale any parts that are imported if they are larger than a specified value. To change this, open Visualize and go Tools>Options>Import, and change the auto-scale options to

Importing to Visualize

Once you are in Solidworks Visualize, you may simply navigate to File>Import... and browse to your Solidworks part or assembly.