Scene_Foundry_Demo / core /layout_generator.py
Chunteng's picture
Initial commit (Fresh Start)
a03fc9e
"""
Layout generator abstract interface
Define standard process for layout generation
"""
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Optional
class LayoutGenerator(ABC):
"""Layout generator base class"""
@abstractmethod
def generate(
self,
config_path: Path,
output_dir: Path,
seed: int = 0
) -> Path:
"""
Generate layout
Args:
config_path: Configuration file path
output_dir: Output directory
seed: Random seed
Returns:
Generated .blend file path
"""
pass
@abstractmethod
def validate_config(self, config_path: Path) -> bool:
"""Validate if configuration file is valid"""
pass
class GenerationError(Exception):
"""Layout generation error"""
pass