generate_hyper3d_model_via_images
Convert images into 3D models using Hyper3D, import them into Blender with built-in materials, and adjust size with optional bbox conditions for precise scaling.
Instructions
Generate 3D asset using Hyper3D by giving images of the wanted asset, and import the generated asset into Blender. The 3D asset has built-in materials. The generated model has a normalized size, so re-scaling after generation can be useful.
Parameters:
input_image_paths: The absolute paths of input images. Even if only one image is provided, wrap it into a list. Required if Hyper3D Rodin in MAIN_SITE mode.
input_image_urls: The URLs of input images. Even if only one image is provided, wrap it into a list. Required if Hyper3D Rodin in FAL_AI mode.
bbox_condition: Optional. If given, it has to be a list of ints of length 3. Controls the ratio between [Length, Width, Height] of the model.
Only one of {input_image_paths, input_image_urls} should be given at a time, depending on the Hyper3D Rodin's current mode. Returns a message indicating success or failure.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bbox_condition | No | ||
| input_image_paths | No | ||
| input_image_urls | No |
Implementation Reference
- src/blender_mcp/server.py:742-796 (handler)Main tool handler: validates inputs, encodes local images to base64, processes bbox, submits 'create_rodin_job' to Blender addon via socket, returns task UUID and subscription_key or error.@mcp.tool() def generate_hyper3d_model_via_images( ctx: Context, input_image_paths: list[str]=None, input_image_urls: list[str]=None, bbox_condition: list[float]=None ) -> str: """ Generate 3D asset using Hyper3D by giving images of the wanted asset, and import the generated asset into Blender. The 3D asset has built-in materials. The generated model has a normalized size, so re-scaling after generation can be useful. Parameters: - input_image_paths: The **absolute** paths of input images. Even if only one image is provided, wrap it into a list. Required if Hyper3D Rodin in MAIN_SITE mode. - input_image_urls: The URLs of input images. Even if only one image is provided, wrap it into a list. Required if Hyper3D Rodin in FAL_AI mode. - bbox_condition: Optional. If given, it has to be a list of ints of length 3. Controls the ratio between [Length, Width, Height] of the model. Only one of {input_image_paths, input_image_urls} should be given at a time, depending on the Hyper3D Rodin's current mode. Returns a message indicating success or failure. """ if input_image_paths is not None and input_image_urls is not None: return f"Error: Conflict parameters given!" if input_image_paths is None and input_image_urls is None: return f"Error: No image given!" if input_image_paths is not None: if not all(os.path.exists(i) for i in input_image_paths): return "Error: not all image paths are valid!" images = [] for path in input_image_paths: with open(path, "rb") as f: images.append( (Path(path).suffix, base64.b64encode(f.read()).decode("ascii")) ) elif input_image_urls is not None: if not all(urlparse(i) for i in input_image_paths): return "Error: not all image URLs are valid!" images = input_image_urls.copy() try: blender = get_blender_connection() result = blender.send_command("create_rodin_job", { "text_prompt": None, "images": images, "bbox_condition": _process_bbox(bbox_condition), }) succeed = result.get("submit_time", False) if succeed: return json.dumps({ "task_uuid": result["uuid"], "subscription_key": result["jobs"]["subscription_key"], }) else: return json.dumps(result) except Exception as e: logger.error(f"Error generating Hyper3D task: {str(e)}") return f"Error generating Hyper3D task: {str(e)}"
- src/blender_mcp/server.py:697-704 (helper)Supporting function to normalize bbox_condition to a list of integers scaled to 0-100 range based on max value.def _process_bbox(original_bbox: list[float] | list[int] | None) -> list[int] | None: if original_bbox is None: return None if all(isinstance(i, int) for i in original_bbox): return original_bbox if any(i<=0 for i in original_bbox): raise ValueError("Incorrect number range: bbox must be bigger than zero!") return [int(float(i) / max(original_bbox) * 100) for i in original_bbox] if original_bbox else None
- src/blender_mcp/server.py:539-557 (helper)Utility tool to check Hyper3D (Rodin) integration status in Blender addon.@mcp.tool() def get_hyper3d_status(ctx: Context) -> str: """ Check if Hyper3D Rodin integration is enabled in Blender. Returns a message indicating whether Hyper3D Rodin features are available. Don't emphasize the key type in the returned message, but sliently remember it. """ try: blender = get_blender_connection() result = blender.send_command("get_hyper3d_status") enabled = result.get("enabled", False) message = result.get("message", "") if enabled: message += "" return message except Exception as e: logger.error(f"Error checking Hyper3D status: {str(e)}") return f"Error checking Hyper3D status: {str(e)}"
- src/blender_mcp/server.py:798-839 (helper)Polling tool to check status of the Hyper3D generation job.@mcp.tool() def poll_rodin_job_status( ctx: Context, subscription_key: str=None, request_id: str=None, ): """ Check if the Hyper3D Rodin generation task is completed. For Hyper3D Rodin mode MAIN_SITE: Parameters: - subscription_key: The subscription_key given in the generate model step. Returns a list of status. The task is done if all status are "Done". If "Failed" showed up, the generating process failed. This is a polling API, so only proceed if the status are finally determined ("Done" or "Canceled"). For Hyper3D Rodin mode FAL_AI: Parameters: - request_id: The request_id given in the generate model step. Returns the generation task status. The task is done if status is "COMPLETED". The task is in progress if status is "IN_PROGRESS". If status other than "COMPLETED", "IN_PROGRESS", "IN_QUEUE" showed up, the generating process might be failed. This is a polling API, so only proceed if the status are finally determined ("COMPLETED" or some failed state). """ try: blender = get_blender_connection() kwargs = {} if subscription_key: kwargs = { "subscription_key": subscription_key, } elif request_id: kwargs = { "request_id": request_id, } result = blender.send_command("poll_rodin_job_status", kwargs) return result except Exception as e: logger.error(f"Error generating Hyper3D task: {str(e)}") return f"Error generating Hyper3D task: {str(e)}"
- src/blender_mcp/server.py:842-872 (helper)Tool to import the completed Hyper3D generated asset into Blender scene.def import_generated_asset( ctx: Context, name: str, task_uuid: str=None, request_id: str=None, ): """ Import the asset generated by Hyper3D Rodin after the generation task is completed. Parameters: - name: The name of the object in scene - task_uuid: For Hyper3D Rodin mode MAIN_SITE: The task_uuid given in the generate model step. - request_id: For Hyper3D Rodin mode FAL_AI: The request_id given in the generate model step. Only give one of {task_uuid, request_id} based on the Hyper3D Rodin Mode! Return if the asset has been imported successfully. """ try: blender = get_blender_connection() kwargs = { "name": name } if task_uuid: kwargs["task_uuid"] = task_uuid elif request_id: kwargs["request_id"] = request_id result = blender.send_command("import_generated_asset", kwargs) return result except Exception as e: logger.error(f"Error generating Hyper3D task: {str(e)}") return f"Error generating Hyper3D task: {str(e)}"