Assuming that a composite object only has articulated joints (in other words, it doesn't have lights or other non-joints), the object can be expressed in a .urdf file.
It is possible to create composite objects from a .urdf file, but usually not advisable. This is a backend document for such special cases.
Given that a .urdf file can describe a composite object, it follows that technically any robot can be a TDW composite object. However, in TDW, robots and composites are not the same. Robots use ArticulationBody components for joints. Composite objects use Joint components.
There are advantages and disadvantages to each of these but generally if you're creating a robot asset bundle, you should always use RobotCreator and if you're creating an articulated object from a .urdf file, you can use the CompositeObjectCreator.
- The
tdw
module - The Asset Bundle Creator Unity project. Read this for a list of requirements.
CompositeObjectCreator
can be used to create asset bundles from a .urdf file. If you want to create an asset bundle from a .fbx file or a prefab, do not use CompositeObjectCreator
; use ModelCreator
instead, as described here.
The syntax for CompositeObjectCreator
is very similar to that of ModelCreator
, except that the source file is a .urdf file instead of a .fbx or .obj file:
from pathlib import Path
from tdw.asset_bundle_creator.composite_object_creator import CompositeObjectCreator
from tdw.backend.paths import EXAMPLE_CONTROLLER_OUTPUT_PATH
source_file = Path.home().joinpath("partnet_mobility/Basin/102379/mobility.urdf")
output_directory = EXAMPLE_CONTROLLER_OUTPUT_PATH.joinpath("custom_composite_object")
c = CompositeObjectCreator()
c.source_file_to_asset_bundles(name="basin_102379",
source_file=source_file,
output_directory=output_directory)
There are other API calls as well, some of which are shared with ModelCreator
. Read the API documentation here.
This is the last document in the "Composite (articulated) objects" tutorial.
Python API: