alters-mit / asset_bundle_creator

Asset Bundle Creator combines several open-source tools to make it easy to convert source files such as .fbx files into Unity prefabs and asset bundles.
Other
1 stars 0 forks source link
unity unity3d

Asset Bundle Creator

Asset Bundle Creator combines several open-source tools to make it easy to convert source files such as .fbx files into Unity prefabs and asset bundles.

All import processes can be interrupted. This can allow you to combine automatic and manual asset creation methods. You can, for example, automatically generate a prefab from a .fbx file, manually edit to the prefab, and then automatically generate asset bundles.

All 3D objects, articulated or otherwise, receive hull mesh colliders, a group of convex mesh colliders generated with VHACD. This means that mesh colliders will always be form-fitting.

You can import .urdf robot files with RobotCreator, which is very similar to Unity's own URDF importer; it's a little more limited in functionality but it also tends to work better.

You can also import PartNet Mobility .urdf files; to my knowledge, Asset Bundle Creator is the only such importer for Unity. It is also possible to convert models or .urdf files referenced by .sdf and .lisdf files into asset bundles.

There are two caveats:

  1. This software uses command-line calls and doesn't have a user interface. A user interface will (hopefully) be added soon.
  2. Please review the license.

Requirements

Usage

  1. Close Unity Editor
  2. Open a terminal shell
  3. Type in the command and press enter

This is an example command-line call:

&"C:/Program Files/Unity/Hub/Editor/2020.3.24f1/Editor/Unity.exe" -projectpath "C:/Users/USER/asset_bundle_creator" -quit -batchmode -executeMethod ModelCreator.SourceFileToPrefab -name="model" -source="D:/models/model.obj" -output_directory="D:/asset_bundles/model"

All command-line calls include these arguments:

Argument Example Description
The path to the Unity executable. &"C:/Program Files/Unity/Hub/Editor/2020.3.24f1/Editor/Unity.exe" This example is for Windows Powershell. For OS X or Linux, replace & with ./
-projectPath "C:/Users/USER/asset_bundle_creator" The path to the asset_bundle_creator Unity Project. Replace USER with your user name.
-quit This tells Unity Editor to quit after the call.
-batchmode This tells Unity Editor to run in the background.
-executeMethod ModelCreator.SourceFileToPrefab The name of the creator launcher and the method you want to invoke. Note that there are no double quotes around this value.

All other arguments in this call such as -name="model" are specific to the method (in this case, ModelCreator.SourceFileToPrefab).

This example calls Cleanup which will remove all intermediary source file and prefabs from the Unity Project:

&"C:/Program Files/Unity/Hub/Editor/2020.3.24f1/Editor/Unity.exe" -projectpath "C:/Users/USER/asset_bundle_creator" -quit -batchmode -executeMethod ModelCreator.Cleanup -cleanup

API Documentation

Type of creator Source file types Description
ModelCreator .fbx or .obj Generates non-articulated Unity GameObjects; these GameObjects will have exactly one Rigidbody (at the root object). There may be many visual meshes and mesh colliders.
RobotCreator .urdf Generates articulated Unity robots. Each joint has an ArticulationBody component (not a Rigidbody), visual meshes, and mesh colliders.
CompositeObjectCreator .urdf Generates articulated Unity GameObjects. Each joint has an Rigidbody component, a Joint component (e.g. a HingeJoint), visual meshes, and mesh colliders.
AnimationCreator .anim or .fbx Generates asset bundles of .anim files.
HumanoidCreator .fbx Generates asset bundles of .fbx files.
LisdfReader .sdf or .lisdf Generates multiple GameObject asset bundles using a combination of RobotCreator and CompositeObjectCreator.

Usage with ThreeDWorld (TDW)

This software was originally made for TDW and offers some TDW-specific functionality, notably record metadata. TDW includes helpful Python wrapper classes for every command-line call in Asset Bundle Creator:

Asset Bundle Creator Class TDW Python class
ModelCreator ModelCreator
RobotCreator RobotCreator
CompositeObjectCreator CompositeObjectCreator
HumanoidCreator HumanoidCreator
AnimationCreator HumanoidAnimationCreator
LisdfReader LisdfReader

Misc. Documentation

Roadmap