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

Method texture_model

tripo3d/client.py:1023–1100  ·  view source on GitHub ↗

Generate new texture for an existing 3D model. Args: original_model_task_id: The task ID of the original model. texture: Whether to generate texture. Default: True pbr: Whether to generate PBR materials. Default: True model_seed: Seed

(
        self,
        original_model_task_id: str,
        texture: Optional[bool] = True,
        pbr: Optional[bool] = True,
        model_seed: Optional[int] = None,
        texture_seed: Optional[int] = None,
        texture_quality: Optional[Literal["standard", "detailed"]] = "standard",
        texture_alignment: Optional[Literal["original_image", "geometry"]] = "original_image",
        part_names: Optional[List[str]] = None,
        compress: Optional[bool] = False,
        bake: Optional[bool] = True,
        text_prompt: Optional[str] = None,
        image_prompt: Optional[str] = None,
        style_image: Optional[str] = None,
        model_version: Optional[Literal["v2.5-20250123", "v3.0-20250812"]] = "v2.5-20250123",
    )

Source from the content-addressed store, hash-verified

1021 return await self.create_task(task_data)
1022
1023 async def texture_model(
1024 self,
1025 original_model_task_id: str,
1026 texture: Optional[bool] = True,
1027 pbr: Optional[bool] = True,
1028 model_seed: Optional[int] = None,
1029 texture_seed: Optional[int] = None,
1030 texture_quality: Optional[Literal["standard", "detailed"]] = "standard",
1031 texture_alignment: Optional[Literal["original_image", "geometry"]] = "original_image",
1032 part_names: Optional[List[str]] = None,
1033 compress: Optional[bool] = False,
1034 bake: Optional[bool] = True,
1035 text_prompt: Optional[str] = None,
1036 image_prompt: Optional[str] = None,
1037 style_image: Optional[str] = None,
1038 model_version: Optional[Literal["v2.5-20250123", "v3.0-20250812"]] = "v2.5-20250123",
1039 ) -> str:
1040 """
1041 Generate new texture for an existing 3D model.
1042
1043 Args:
1044 original_model_task_id: The task ID of the original model.
1045 texture: Whether to generate texture. Default: True
1046 pbr: Whether to generate PBR materials. Default: True
1047 model_seed: Seed for model generation randomization.
1048 texture_seed: Seed for texture generation randomization.
1049 texture_quality: Quality of the texture. One of:
1050 - "standard"
1051 - "detailed"
1052 texture_alignment: How to align the texture. One of:
1053 - "original_image"
1054 - "geometry"
1055 Default: "original_image"
1056 part_names: List of part names to texture.
1057 compress: Whether to compress the model.
1058 bake: Whether to bake the model.
1059 text_prompt: Text prompt for texture generation.
1060 image_prompt: Image prompt for texture generation. It Can be:
1061 - A path to a local image file
1062 - A URL to an image
1063 - An image token from previous upload
1064 style_image: Style image for texture generation. The same format as image_prompt.
1065 model_version: The model version to use.
1066 Returns:
1067 The task ID.
1068
1069 Raises:
1070 TripoRequestError: If the request fails.
1071 TripoAPIError: If the API returns an error.
1072 """
1073 task_data = {
1074 "type": "texture_model",
1075 "original_model_task_id": original_model_task_id,
1076 }
1077
1078 passed_args = self._get_passed_args()
1079
1080 # Handle texture_prompt special case first

Calls 4

_get_passed_argsMethod · 0.95
_add_optional_paramsMethod · 0.95
create_taskMethod · 0.95

Tested by 3

test_texture_modelMethod · 0.64