wolfhece.pyvertexvectors.polygon_pbr_material ============================================= .. py:module:: wolfhece.pyvertexvectors.polygon_pbr_material Module Contents --------------- .. py:function:: _float_pair(values, default: tuple[float, float]) -> tuple[float, float] .. py:function:: _float_vec3(values, default: tuple[float, float, float]) -> tuple[float, float, float] .. py:function:: _float_vec4(values, default: tuple[float, float, float, float]) -> tuple[float, float, float, float] .. py:class:: PolygonPBRMaterial Optional PBR-like material for filled polygon rendering. The material blends texture details (albedo, normal, ORM, emissive) with global control factors (metallic_factor, roughness_factor, etc.) to achieve intuitive per-pixel variation and global override capability. Key shading formula: - metallic: blends ORM texture metallic channel with metallic_factor - factor=0 → fully controlled by texture - factor=1 → forces fully metallic everywhere - 00 to add metallic character to any surface. .. py:attribute:: roughness_factor :type: float :value: 1.0 Surface roughness multiplier [0.04..1.0]. Scales the ORM texture roughness channel. Values <1 = smoother, >1 = rougher. Interacts with ORM texture; pure texture control requires factor=1. .. py:attribute:: normal_scale :type: float :value: 1.0 Normal map intensity [0..∞]. Controls detail relief from normal texture. 0 = flat, 1 = full strength. .. py:attribute:: occlusion_strength :type: float :value: 1.0 Ambient occlusion intensity [0..1]. Scales ORM texture AO channel into shadow; 0 = no shadows, 1 = full. .. py:attribute:: emissive_factor :type: tuple[float, float, float] :value: (0.0, 0.0, 0.0) Emissive RGB [0..∞]. Additive glow color. Blends with emissive texture if present. .. py:attribute:: uv_scale :type: tuple[float, float] :value: (100.0, 100.0) Texture tiling scale. Larger = more repetitions. .. py:attribute:: uv_offset :type: tuple[float, float] :value: (0.0, 0.0) Texture coordinate translation for animation or alignment. .. py:attribute:: preset_name :type: str :value: '' .. py:attribute:: cushion_strength :type: float :value: 0.0 Cushion/pillow effect strength [0..2]. Tilts surface normals near polygon edges to simulate a raised border. 0 = flat, 1 = moderate pillow, 2 = strong 3D-like bevel. .. py:attribute:: _version :type: int :value: 2 .. py:property:: has_any_texture :type: bool .. py:method:: to_dict() -> dict .. py:method:: from_dict(data: dict | None) -> PolygonPBRMaterial :classmethod: .. py:method:: to_json() -> str .. py:method:: from_json(raw: str | None) -> PolygonPBRMaterial :classmethod: .. py:function:: get_pbr_presets_root(base_dir: pathlib.Path | None = None) -> pathlib.Path Return the expected root directory for built-in polygon PBR presets. .. py:function:: get_official_polygon_pbr_preset_names() -> list[str] Return the two official presets highlighted in the UI. .. py:function:: _make_material(*, root: pathlib.Path, preset_name: str, folder: str, metallic: float, roughness: float, normal_scale: float, occlusion_strength: float, emissive_factor: tuple[float, float, float], uv_scale: tuple[float, float], base_color_factor: tuple[float, float, float, float], with_emissive: bool = False) -> PolygonPBRMaterial .. py:function:: get_builtin_polygon_pbr_presets(base_dir: pathlib.Path | None = None) -> dict[str, PolygonPBRMaterial] Return the built-in polygon PBR preset catalogue.