Unity Editor script to generate models in locally running Hunyuan3D A developer released a Unity Editor script that generates 3D models from text prompts using a locally running instance of Tencent's Hunyuan3D model. The tool, distributed as a C# EditorWindow, connects to a local Hunyuan3D server on port 8080 and exposes parameters including inference steps, octree resolution, chunk count, and guidance scale, with options for texture generation and background removal. Generated assets are saved directly into the Unity project's Assets folder. | | // first run the launcher and texturing mode enabled. | | | // https://github.com/YanWenKun/Hunyuan3D-2-WinPortable | | | using System; | | | using System.Collections.Generic; | | | using System.Globalization; | | | using System.IO; | | | using System.Text; | | | using System.Text.RegularExpressions; | | | using System.Threading.Tasks; | | | using UnityEditor; | | | using UnityEngine; | | | using UnityEngine.Networking; | | | namespace UnityLibrary.AI | | | { | | | public class Hunyuan3DEditor : EditorWindow | | | { | | | SerializeField private string serverUrl = "http://127.0.0.1:8080"; | | | SerializeField private string outputFolder = "Assets/Generated/Hunyuan3D"; | | | TextArea 3, 8 | | | SerializeField private string prompt = "A wooden treasure chest, game asset, white background"; | | | SerializeField private bool generateTexture = true; | | | SerializeField private bool removeBackground = true; | | | SerializeField private bool randomizeSeed = true; | | | SerializeField private int seed = 1234; | | | SerializeField private int inferenceSteps = 5; | | | SerializeField private int octreeResolution = 256; | | | SerializeField private int numChunks = 8000; | | | SerializeField private float guidanceScale = 5f; | | | private bool isGenerating; | | | private string status = "Ready"; | | | MenuItem "Tools/Hunyuan3D/Text to 3D" | | | public static void ShowWindow | | | { | | | Hunyuan3DEditor window = GetWindow