MCPcopy Create free account
hub / github.com/VAST-AI-Research/tripo-python-sdk / convert_model

Method convert_model

tripo3d/client.py:921–986  ·  view source on GitHub ↗

Convert a 3D model to different format. Args: original_model_task_id: The task ID of the original model. format: Output format. One of: "GLTF", "USDZ", "FBX", "OBJ", "STL", "3MF" quad: Whether to generate quad mesh. Default: False for

(
        self,
        original_model_task_id: str,
        format: Literal["GLTF", "USDZ", "FBX", "OBJ", "STL", "3MF"],
        quad: Optional[bool] = False,
        force_symmetry: Optional[bool] = False,
        face_limit: Optional[int] = None,
        flatten_bottom: Optional[bool] = False,
        flatten_bottom_threshold: Optional[float] = 0.01,
        texture_size: Optional[int] = 4096,
        texture_format: Optional[Literal["BMP", "DPX", "HDR", "JPEG", "OPEN_EXR", "PNG", "TARGA", "TIFF", "WEBP"]] = "JPEG",
        scale_factor: Optional[float] = 1.0,
        pivot_to_center_bottom: Optional[bool] = False,
        with_animation: Optional[bool] = True,
        pack_uv: Optional[bool] = False,
        bake: Optional[bool] = True,
        part_names: Optional[List[str]] = None,
        export_vertex_colors: Optional[bool] = False,
        fbx_preset: Optional[Literal["blender", "mixamo", "3dsmax"]] = "blender",
        export_orientation: Optional[Literal["+x", "+y", "-x", "-y"]] = "+x",
        animate_in_place: Optional[bool] = False,
    )

Source from the content-addressed store, hash-verified

919 return await self.create_task(task_data)
920
921 async def convert_model(
922 self,
923 original_model_task_id: str,
924 format: Literal["GLTF", "USDZ", "FBX", "OBJ", "STL", "3MF"],
925 quad: Optional[bool] = False,
926 force_symmetry: Optional[bool] = False,
927 face_limit: Optional[int] = None,
928 flatten_bottom: Optional[bool] = False,
929 flatten_bottom_threshold: Optional[float] = 0.01,
930 texture_size: Optional[int] = 4096,
931 texture_format: Optional[Literal["BMP", "DPX", "HDR", "JPEG", "OPEN_EXR", "PNG", "TARGA", "TIFF", "WEBP"]] = "JPEG",
932 scale_factor: Optional[float] = 1.0,
933 pivot_to_center_bottom: Optional[bool] = False,
934 with_animation: Optional[bool] = True,
935 pack_uv: Optional[bool] = False,
936 bake: Optional[bool] = True,
937 part_names: Optional[List[str]] = None,
938 export_vertex_colors: Optional[bool] = False,
939 fbx_preset: Optional[Literal["blender", "mixamo", "3dsmax"]] = "blender",
940 export_orientation: Optional[Literal["+x", "+y", "-x", "-y"]] = "+x",
941 animate_in_place: Optional[bool] = False,
942 ) -> str:
943 """
944 Convert a 3D model to different format.
945
946 Args:
947 original_model_task_id: The task ID of the original model.
948 format: Output format. One of: "GLTF", "USDZ", "FBX", "OBJ", "STL", "3MF"
949 quad: Whether to generate quad mesh. Default: False
950 force_symmetry: Whether to force model symmetry. Default: False
951 face_limit: Maximum number of faces.
952 flatten_bottom: Whether to flatten the bottom of the model. Default: False
953 flatten_bottom_threshold: Threshold for bottom flattening. Default: 0.01
954 texture_size: Size of the texture. Default: 4096
955 texture_format: Format of the texture. One of: "BMP", "DPX", "HDR", "JPEG", "OPEN_EXR",
956 "PNG", "TARGA", "TIFF", "WEBP". Default: "JPEG"
957 scale_factor: Scale factor for the model. Default: 1.0
958 pivot_to_center_bottom: Whether to move pivot point to center bottom. Default: False
959 with_animation: Whether to export animation. Default: False
960 pack_uv: Whether to pack UV. Default: False
961 bake: Whether to bake the model. Default: True
962 part_names: List of part names to export.
963 export_vertex_colors: Whether to export vertex colors.
964 fbx_preset: Preset for FBX export. One of: "blender", "mixamo", "3dsmax".
965 export_orientation: Orientation for export. One of: "+x", "+y", "-x", "-y".
966 animate_in_place: Whether to animate in place.
967 Returns:
968 The task ID.
969
970 Raises:
971 TripoRequestError: If the request fails.
972 TripoAPIError: If the API returns an error.
973 """
974 task_data = {
975 "type": "convert_model",
976 "original_model_task_id": original_model_task_id,
977 "format": format,
978 }

Callers

nothing calls this directly

Calls 3

_add_optional_paramsMethod · 0.95
_get_passed_argsMethod · 0.95
create_taskMethod · 0.95

Tested by

no test coverage detected