1
0
forked from cgvr/DeltaVR

Compare commits

..

No commits in common. "1b0d9fd0b03d953cfc4e083daff39a45a75fe432" and "e25f1c75b5277532e1e071293954816be291514d" have entirely different histories.

3 changed files with 8 additions and 37 deletions

View File

@ -104,8 +104,7 @@ def main():
print(f"Generated image file: {image_path}") print(f"Generated image file: {image_path}")
model_path = pipeline_folder / "models" / timestamp model_path = pipeline_folder / "models" / timestamp
image_to_3d(image_path, model_path) image_to_3d(image_path, model_path)
model_file_path = model_path / "0" / "mesh.glb" print(f"Generated 3D model file: {model_path}")
print(f"Generated 3D model file: {model_file_path}")
if __name__ == "__main__": if __name__ == "__main__":

Binary file not shown.

View File

@ -45,17 +45,15 @@ public class ModelGenerationPipelineStarter : MonoBehaviour
private async void StartModeGenerationPipeline() private async void StartModeGenerationPipeline()
{ {
string modelPath = null;
await Task.Run(() => await Task.Run(() =>
{ {
string inputPrompt = "Uhm I want I think an epic broadsword with a fancy golden pommel"; string inputPrompt = "Uhm I want I think an epic broadsword with a fancy golden pommel";
// Path to your virtual environment's python.exe // Path to your virtual environment's python.exe
string pythonExe = @"D:\henrisel\DeltaVR3DModelGeneration\3d-generation-pipeline\.venv\Scripts\python.exe"; string pythonExe = @"D:\users\henrisel\DeltaVR3DModelGeneration\3d-generation-pipeline\.venv\Scripts\python.exe";
// Path to your Python script // Path to your Python script
string scriptPath = @"D:\henrisel\DeltaVR3DModelGeneration\3d-generation-pipeline\start_pipeline.py"; string scriptPath = @"D:\users\henrisel\DeltaVR3DModelGeneration\3d-generation-pipeline\start_pipeline.py";
// Arguments to pass to the script // Arguments to pass to the script
string arguments = $"{scriptPath} --prompt \"{inputPrompt}\""; string arguments = $"{scriptPath} --prompt \"{inputPrompt}\"";
@ -77,38 +75,12 @@ public class ModelGenerationPipelineStarter : MonoBehaviour
process.ErrorDataReceived += (sender, e) => UnityEngine.Debug.LogError(e.Data); process.ErrorDataReceived += (sender, e) => UnityEngine.Debug.LogError(e.Data);
process.Start(); process.Start();
process.BeginOutputReadLine();
string output = process.StandardOutput.ReadToEnd(); process.BeginErrorReadLine();
string error = process.StandardError.ReadToEnd();
process.WaitForExit(); process.WaitForExit();
// Extract model path from output
foreach (string line in output.Split('\n'))
{
if (line.StartsWith("Generated 3D model file: "))
{
modelPath = line.Replace("Generated 3D model file: ", "").Trim();
break;
}
}
}
if (!string.IsNullOrEmpty(modelPath))
{
//LoadModel(modelPath);
UnityEngine.Debug.Log("Got generated model path: " + modelPath);
}
else
{
UnityEngine.Debug.LogError("Model path not found in Python output.");
} }
}); });
UnityEngine.Debug.Log("Python script finished!");
} }
} }