:py:mod:`synthpic2.recipe.prototypes` ===================================== .. py:module:: synthpic2.recipe.prototypes .. autoapi-nested-parse:: Prototype module. Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 feature/index.rst prototypes/index.rst Package Contents ---------------- Classes ~~~~~~~ .. autoapisummary:: synthpic2.recipe.prototypes.Feature synthpic2.recipe.prototypes.GeometryPrototype synthpic2.recipe.prototypes.MaterialPrototype synthpic2.recipe.prototypes.MeasurementTechniquePrototype .. py:class:: Feature This class allows to get and set feature values. These features can either be custom-defined, or link to a property of a Blender object. .. py:property:: value :type: Any .. py:attribute:: name :type: str .. py:attribute:: blender_link :type: Optional[str] .. py:attribute:: _target_ :type: Optional[str] :value: 'synthpic2.recipe.prototypes.Feature' .. py:attribute:: _value :type: Optional[Any] .. py:method:: __post_init__() -> None Gets called after the init routine. .. py:method:: _validate_blender_link() -> None Validate the `blender_link` property. Raises: ValueError: raised if the `blender_link` property is invalid .. py:method:: _sanitize_blender_link() -> None Sanitize the `blender_link` property. .. py:method:: _parse_blender_link() -> tuple[Any, InterfaceType, KeyType] Extract the attributes from blender_link and assign it to value. https://regex101.com/r/k5ClC9/1 .. py:method:: _get_node_value(node: Any, interface: InterfaceType, key: KeyType) -> Any :staticmethod: .. py:method:: _set_node_value(node: Any, interface: InterfaceType, key: KeyType, value: Any) -> None :staticmethod: .. py:method:: _parse_node_interface_and_key(regex_match: re.Match) -> tuple[InterfaceType, int | str] :staticmethod: .. py:method:: update_blender_link(renaming_maps: Dict[str, synthpic2.custom_types.RenamingMap]) -> None .. py:class:: GeometryPrototype Bases: :py:obj:`_AppendablePrototype` Prototype for particle geometry. .. py:property:: _registry :type: synthpic2.recipe.registries.Registry .. py:attribute:: _target_ :type: str :value: 'synthpic2.recipe.prototypes.GeometryPrototype' .. py:attribute:: name_in_blend_file :type: str :value: 'GeometryPrototype' .. py:method:: __attrs_post_init__() -> None Define attributes that are not accessible via Hydra. .. py:method:: append() -> None Append a GeometryPrototype, store it in the 'GeometryPrototypes' collection and hide said collection. .. py:class:: MaterialPrototype Bases: :py:obj:`_AppendablePrototype` Prototype definition for a material. .. py:property:: _registry :type: synthpic2.recipe.registries.Registry .. py:attribute:: _target_ :type: str :value: 'synthpic2.recipe.prototypes.MaterialPrototype' .. py:attribute:: name_in_blend_file :type: str :value: 'MaterialPrototype' .. py:method:: __attrs_post_init__() -> None Define attributes that are not accessible via Hydra. .. py:class:: MeasurementTechniquePrototype Bases: :py:obj:`_Prototype`, :py:obj:`synthpic2.recipe.render_preparation_mixin.RenderPreparationMixin` Prototype definition for a measurement technique. .. py:property:: _registry :type: synthpic2.recipe.registries.Registry .. py:attribute:: _target_ :type: str :value: 'synthpic2.recipe.prototypes.MeasurementTechniquePrototype' .. py:attribute:: measurement_volume_object_name :type: str :value: 'MeasurementVolume' .. py:attribute:: background_object_name :type: Optional[str] .. py:attribute:: hideable_object_names :type: Optional[List[str]] .. py:method:: __attrs_post_init__() -> None .. py:method:: _add_render_features() -> None .. py:method:: initialize() -> None Open the blend file that is associated with the prototype. .. py:method:: setup_after_invocation() -> None Setup steps to be executed after the `MeasurementTechniquePrototype` has been invoked as part of a `MeasurementTechniqueBlueprint`. .. py:method:: _fix_common_user_errors() -> None Fix common user errors, such as no active object or measurement technique being in edit mode. .. py:method:: _validate() -> None Validate that the specified blend file sticks to the conventions of synthPIC2. Raises: ConventionError: if there is no scene named 'Scene' in the measurement technique prototype ConventionError: if there is no collection named 'MeasurementTechnique' in the measurement technique prototype ConventionError: if there is no camera in the measurement technique prototype .. py:method:: _prepare_categorical_rendering_mode() -> None .. py:method:: _hide_hideable_objects() -> None .. py:method:: _prepare_real_rendering_mode() -> None .. py:method:: _prepare_stylized_rendering_mode() -> None .. py:method:: _prepare_stylized_xray_rendering_mode() -> None .. py:method:: _prepare_normal_map_rendering_mode() -> None .. py:method:: _prepare_depth_map_rendering_mode() -> None