download_sketchfab_model
Import Sketchfab 3D models into Blender with automatic scaling to specified dimensions for consistent scene integration.
Instructions
Download and import a Sketchfab model by its UID. The model will be scaled so its largest dimension equals target_size.
Parameters:
uid: The unique identifier of the Sketchfab model
target_size: REQUIRED. The target size in Blender units/meters for the largest dimension. You must specify the desired size for the model. Examples: - Chair: target_size=1.0 (1 meter tall) - Table: target_size=0.75 (75cm tall) - Car: target_size=4.5 (4.5 meters long) - Person: target_size=1.7 (1.7 meters tall) - Small object (cup, phone): target_size=0.1 to 0.3
Returns a message with import details including object names, dimensions, and bounding box. The model must be downloadable and you must have proper access rights.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | ||
| target_size | Yes |
Implementation Reference
- src/blender_mcp/server.py:724-772 (handler)The function `download_sketchfab_model` acts as the MCP tool handler for downloading and importing Sketchfab models into Blender. It communicates with a Blender connection to perform the actual download and processing.
def download_sketchfab_model( ctx: Context, uid: str, target_size: float ) -> str: """ Download and import a Sketchfab model by its UID. The model will be scaled so its largest dimension equals target_size. Parameters: - uid: The unique identifier of the Sketchfab model - target_size: REQUIRED. The target size in Blender units/meters for the largest dimension. You must specify the desired size for the model. Examples: - Chair: target_size=1.0 (1 meter tall) - Table: target_size=0.75 (75cm tall) - Car: target_size=4.5 (4.5 meters long) - Person: target_size=1.7 (1.7 meters tall) - Small object (cup, phone): target_size=0.1 to 0.3 Returns a message with import details including object names, dimensions, and bounding box. The model must be downloadable and you must have proper access rights. """ try: blender = get_blender_connection() logger.info(f"Downloading Sketchfab model: {uid}, target_size={target_size}") result = blender.send_command("download_sketchfab_model", { "uid": uid, "normalize_size": True, # Always normalize "target_size": target_size }) if result is None: logger.error("Received None result from Sketchfab download") return "Error: Received no response from Sketchfab download request" if "error" in result: logger.error(f"Error from Sketchfab download: {result['error']}") return f"Error: {result['error']}" if result.get("success"): imported_objects = result.get("imported_objects", []) object_names = ", ".join(imported_objects) if imported_objects else "none" output = f"Successfully imported model.\n" output += f"Created objects: {object_names}\n" # Add dimension info if available