forked from cgvr/DeltaVR
Compare commits
2 Commits
e25f1c75b5
...
1b0d9fd0b0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b0d9fd0b0 | ||
|
|
f8ca8570af |
@ -104,7 +104,8 @@ 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)
|
||||||
print(f"Generated 3D model file: {model_path}")
|
model_file_path = model_path / "0" / "mesh.glb"
|
||||||
|
print(f"Generated 3D model file: {model_file_path}")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
BIN
Assets/_PROJECT/Scenes/DeltaBuilding_base.unity
(Stored with Git LFS)
BIN
Assets/_PROJECT/Scenes/DeltaBuilding_base.unity
(Stored with Git LFS)
Binary file not shown.
@ -45,15 +45,17 @@ 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:\users\henrisel\DeltaVR3DModelGeneration\3d-generation-pipeline\.venv\Scripts\python.exe";
|
string pythonExe = @"D:\henrisel\DeltaVR3DModelGeneration\3d-generation-pipeline\.venv\Scripts\python.exe";
|
||||||
|
|
||||||
// Path to your Python script
|
// Path to your Python script
|
||||||
string scriptPath = @"D:\users\henrisel\DeltaVR3DModelGeneration\3d-generation-pipeline\start_pipeline.py";
|
string scriptPath = @"D:\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}\"";
|
||||||
@ -75,12 +77,38 @@ 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();
|
|
||||||
process.BeginErrorReadLine();
|
string output = process.StandardOutput.ReadToEnd();
|
||||||
|
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!");
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user