![]() |
0.1.39
|
Classes | |
| class | PlantArchitecture |
| High-level interface for plant architecture modeling and procedural plant generation. More... | |
| class | PlantArchitectureError |
| Raised when PlantArchitecture operations fail. More... | |
Functions | |
| validate_vec3 (value, name, func) | |
| validate_vec2 (value, name, func) | |
| validate_int2 (value, name, func) | |
| None | _validate_build_parameters (Optional[dict] build_parameters, Optional[str] plant_model, Optional[List[str]] accepted=None) |
| Check build parameter types, and names against those the plant model accepts. | |
| str | _resolve_user_path (Union[str, Path] filepath) |
| Convert relative paths to absolute paths before changing working directory. | |
| _plantarchitecture_working_directory () | |
| Context manager that temporarily changes working directory to where PlantArchitecture assets are located. | |
| is_plantarchitecture_available () | |
| Check if PlantArchitecture plugin is available for use. | |
| _surfaces_phytomer_callback_errors (method) | |
| Re-raise an exception from a Python phytomer creation or callback function out of the call that ran it. | |
| PlantArchitecture | create_plant_architecture (Context context) |
| Create PlantArchitecture instance with context. | |
Variables | |
| logger = logging.getLogger(__name__) | |
| _pending_callback_error = None | |
|
protected |
Context manager that temporarily changes working directory to where PlantArchitecture assets are located.
PlantArchitecture C++ code uses hardcoded relative paths like "plugins/plantarchitecture/assets/textures/" expecting assets relative to working directory. This manager temporarily changes to the build directory where assets are actually located.
| RuntimeError | If build directory or PlantArchitecture assets are not found, indicating a build system error. |
Definition at line 148 of file PlantArchitecture.py.
|
protected |
Convert relative paths to absolute paths before changing working directory.
This preserves the user's intended file location when the working directory is temporarily changed for C++ asset access. Absolute paths are returned unchanged.
| filepath | File path to resolve (string or Path object) |
Definition at line 128 of file PlantArchitecture.py.
|
protected |
Re-raise an exception from a Python phytomer creation or callback function out of the call that ran it.
ctypes cannot propagate an exception out of a callback, so the trampolines built by :meth:PlantArchitecture.setPhytomerCreationFunction and :meth:PlantArchitecture.setPhytomerCallbackFunction store it and make the native call fail; this decorator then raises the stored exception in place of the resulting native error.
Definition at line 241 of file PlantArchitecture.py.
|
protected |
Check build parameter types, and names against those the plant model accepts.
The native library also rejects a name the model does not accept, but raising here gives callers a ValueError like every other argument check, before anything is built.
| build_parameters | Mapping supplied by the caller, or None. |
| plant_model | Label of the currently loaded model, used in the error message. |
| accepted | Names the model accepts, from getPlantModelBuildParameterNames(), or None to check types only (the native library still checks the names). |
| ValueError | If build_parameters is not a dict of str -> number, or contains a key the model does not accept. |
Definition at line 82 of file PlantArchitecture.py.
| PlantArchitecture pyhelios.PlantArchitecture.create_plant_architecture | ( | Context | context | ) |
Create PlantArchitecture instance with context.
| context | Helios Context |
Definition at line 6564 of file PlantArchitecture.py.
| pyhelios.PlantArchitecture.is_plantarchitecture_available | ( | ) |
Check if PlantArchitecture plugin is available for use.
Definition at line 216 of file PlantArchitecture.py.
| pyhelios.PlantArchitecture.validate_int2 | ( | value, | |
| name, | |||
| func ) |
Definition at line 42 of file PlantArchitecture.py.
| pyhelios.PlantArchitecture.validate_vec2 | ( | value, | |
| name, | |||
| func ) |
Definition at line 34 of file PlantArchitecture.py.
| pyhelios.PlantArchitecture.validate_vec3 | ( | value, | |
| name, | |||
| func ) |
Definition at line 26 of file PlantArchitecture.py.
|
protected |
Definition at line 244 of file PlantArchitecture.py.
| pyhelios.PlantArchitecture.logger = logging.getLogger(__name__) |
Definition at line 62 of file PlantArchitecture.py.