mirror of
https://github.com/AvaLovelace1/LegoGPT.git
synced 2026-05-24 09:38:23 -05:00
output folder fixes
This commit is contained in:
@@ -21,10 +21,13 @@ def main():
|
||||
|
||||
# Take user input
|
||||
filename = input('Enter a filename to save the output image (default=output.png): ')
|
||||
base = os.path.splitext(filename)[0] if filename else 'output'
|
||||
txt_filename = base + '.txt'
|
||||
ldr_filename = base + '.ldr'
|
||||
img_filename = base + '.png'
|
||||
output_dir = os.path.dirname(filename)
|
||||
if output_dir:
|
||||
os.makedirs(output_dir, exist_ok=True)
|
||||
base_name = os.path.splitext(filename)[0] if filename else 'output'
|
||||
txt_filename = os.path.abspath(base_name + '.txt')
|
||||
ldr_filename = os.path.abspath(base_name + '.ldr')
|
||||
img_filename = os.path.abspath(base_name + '.png')
|
||||
|
||||
seed = input('Enter a generation seed (default=42): ')
|
||||
seed = int(seed) if seed else 42
|
||||
|
||||
@@ -20,6 +20,9 @@ def render_lego(
|
||||
fov: float = 45,
|
||||
img_resolution: int = 512,
|
||||
) -> None:
|
||||
in_file = os.path.abspath(in_file)
|
||||
out_file = os.path.abspath(out_file)
|
||||
|
||||
plugin_path = Path(ImportLDraw.__file__).parent
|
||||
ldraw_lib_path = Path.home() / 'ldraw'
|
||||
|
||||
@@ -121,10 +124,8 @@ def main():
|
||||
args = parser.parse_args()
|
||||
|
||||
# Get the absolute path of the input file
|
||||
in_file = os.path.abspath(args.in_file)
|
||||
out_file = os.path.abspath(args.out_file)
|
||||
render_lego(in_file, out_file, square_image=True, instructions_look=False)
|
||||
print(f'Rendered image to {out_file}')
|
||||
render_lego(args.in_file, args.out_file, square_image=True, instructions_look=False)
|
||||
print(f'Rendered image to {args.out_file}')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user