# Auto-generated by `python -m gen` — do not edit manually.

from typing import TYPE_CHECKING, Literal

import bpy

from mathutils import Vector

from ...builder import BaseNode, SocketAccessor

from ...types import (
    InputFloat,
    InputVector,
)

from ...builder.socket import (
    ColorSocket,
    FloatSocket,
    VectorSocket,
)


class EnvironmentTexture(BaseNode):
    """
    Sample an image file as an environment texture. Typically used to light the scene with the background node

    Parameters
    ----------
    vector : InputVector
        Vector

    Inputs
    ------
    i.vector : VectorSocket
        Vector

    Outputs
    -------
    o.color : ColorSocket
        Color
    """

    _bl_idname = "ShaderNodeTexEnvironment"
    node: bpy.types.ShaderNodeTexEnvironment

    class _Inputs(SocketAccessor):
        vector: VectorSocket
        """Vector"""

    class _Outputs(SocketAccessor):
        color: ColorSocket
        """Color"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(
        self,
        vector: InputVector = None,
        *,
        projection: Literal["EQUIRECTANGULAR", "MIRROR_BALL"] = "EQUIRECTANGULAR",
        interpolation: Literal["Linear", "Closest", "Cubic", "Smart"] = "Linear",
    ):
        super().__init__()
        key_args = {"Vector": vector}
        self.projection = projection
        self.interpolation = interpolation
        self._establish_links(**key_args)

    @property
    def projection(self) -> Literal["EQUIRECTANGULAR", "MIRROR_BALL"]:
        return self.node.projection

    @projection.setter
    def projection(self, value: Literal["EQUIRECTANGULAR", "MIRROR_BALL"]):
        self.node.projection = value

    @property
    def interpolation(self) -> Literal["Linear", "Closest", "Cubic", "Smart"]:
        return self.node.interpolation

    @interpolation.setter
    def interpolation(self, value: Literal["Linear", "Closest", "Cubic", "Smart"]):
        self.node.interpolation = value


class IesTexture(BaseNode):
    """
    Match real world lights with IES files, which store the directional intensity distribution of light sources

    Parameters
    ----------
    vector : InputVector
        Vector
    strength : InputFloat
        Strength

    Inputs
    ------
    i.vector : VectorSocket
        Vector
    i.strength : FloatSocket
        Strength

    Outputs
    -------
    o.fac : FloatSocket
        Factor
    """

    _bl_idname = "ShaderNodeTexIES"
    node: bpy.types.ShaderNodeTexIES

    class _Inputs(SocketAccessor):
        vector: VectorSocket
        """Vector"""
        strength: FloatSocket
        """Strength"""

    class _Outputs(SocketAccessor):
        fac: FloatSocket
        """Factor"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(
        self,
        vector: InputVector = None,
        strength: InputFloat = 1.0,
        *,
        filepath: str = "",
        mode: Literal["INTERNAL", "EXTERNAL"] = "INTERNAL",
    ):
        super().__init__()
        key_args = {"Vector": vector, "Strength": strength}
        self.filepath = filepath
        self.mode = mode
        self._establish_links(**key_args)

    @classmethod
    def internal(
        cls, vector: InputVector = None, strength: InputFloat = 1.0
    ) -> "IesTexture":
        """Create IES Texture with operation 'Internal'. Use internal text data-block"""
        return cls(mode="INTERNAL", vector=vector, strength=strength)

    @classmethod
    def external(
        cls, vector: InputVector = None, strength: InputFloat = 1.0
    ) -> "IesTexture":
        """Create IES Texture with operation 'External'. Use external .ies file"""
        return cls(mode="EXTERNAL", vector=vector, strength=strength)

    @property
    def filepath(self) -> str:
        return self.node.filepath

    @filepath.setter
    def filepath(self, value: str):
        self.node.filepath = value

    @property
    def mode(self) -> Literal["INTERNAL", "EXTERNAL"]:
        return self.node.mode

    @mode.setter
    def mode(self, value: Literal["INTERNAL", "EXTERNAL"]):
        self.node.mode = value


class ImageTexture(BaseNode):
    """
    Sample an image file as a texture

    Parameters
    ----------
    vector : InputVector
        Vector

    Inputs
    ------
    i.vector : VectorSocket
        Vector

    Outputs
    -------
    o.color : ColorSocket
        Color
    o.alpha : FloatSocket
        Alpha
    """

    _bl_idname = "ShaderNodeTexImage"
    node: bpy.types.ShaderNodeTexImage

    class _Inputs(SocketAccessor):
        vector: VectorSocket
        """Vector"""

    class _Outputs(SocketAccessor):
        color: ColorSocket
        """Color"""
        alpha: FloatSocket
        """Alpha"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(
        self,
        vector: InputVector = None,
        *,
        projection: Literal["FLAT", "BOX", "SPHERE", "TUBE"] = "FLAT",
        interpolation: Literal["Linear", "Closest", "Cubic", "Smart"] = "Linear",
        projection_blend: float = 0.0,
        extension: Literal["REPEAT", "EXTEND", "CLIP", "MIRROR"] = "REPEAT",
    ):
        super().__init__()
        key_args = {"Vector": vector}
        self.projection = projection
        self.interpolation = interpolation
        self.projection_blend = projection_blend
        self.extension = extension
        self._establish_links(**key_args)

    @property
    def projection(self) -> Literal["FLAT", "BOX", "SPHERE", "TUBE"]:
        return self.node.projection

    @projection.setter
    def projection(self, value: Literal["FLAT", "BOX", "SPHERE", "TUBE"]):
        self.node.projection = value

    @property
    def interpolation(self) -> Literal["Linear", "Closest", "Cubic", "Smart"]:
        return self.node.interpolation

    @interpolation.setter
    def interpolation(self, value: Literal["Linear", "Closest", "Cubic", "Smart"]):
        self.node.interpolation = value

    @property
    def projection_blend(self) -> float:
        return self.node.projection_blend

    @projection_blend.setter
    def projection_blend(self, value: float):
        self.node.projection_blend = value

    @property
    def extension(self) -> Literal["REPEAT", "EXTEND", "CLIP", "MIRROR"]:
        return self.node.extension

    @extension.setter
    def extension(self, value: Literal["REPEAT", "EXTEND", "CLIP", "MIRROR"]):
        self.node.extension = value


class SkyTexture(BaseNode):
    """
    Generate a procedural sky texture

    Parameters
    ----------
    vector : InputVector
        Vector

    Inputs
    ------
    i.vector : VectorSocket
        Vector

    Outputs
    -------
    o.color : ColorSocket
        Color
    """

    _bl_idname = "ShaderNodeTexSky"
    node: bpy.types.ShaderNodeTexSky

    class _Inputs(SocketAccessor):
        vector: VectorSocket
        """Vector"""

    class _Outputs(SocketAccessor):
        color: ColorSocket
        """Color"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(
        self,
        vector: InputVector = None,
        *,
        sky_type: Literal[
            "SINGLE_SCATTERING", "MULTIPLE_SCATTERING", "PREETHAM", "HOSEK_WILKIE"
        ] = "MULTIPLE_SCATTERING",
        sun_disc: bool = True,
        sun_size: float = 0.01,
        sun_intensity: float = 1.0,
        sun_elevation: float = 0.262,
        sun_rotation: float = 0.0,
        altitude: float = 100.0,
        air_density: float = 1.0,
        aerosol_density: float = 1.0,
        ozone_density: float = 1.0,
        sun_direction: tuple[float, float, float] = (0.0, 0.0, 1.0),
        turbidity: float = 0.0,
        ground_albedo: float = 0.0,
    ):
        super().__init__()
        key_args = {"Vector": vector}
        self.sky_type = sky_type
        self.sun_disc = sun_disc
        self.sun_size = sun_size
        self.sun_intensity = sun_intensity
        self.sun_elevation = sun_elevation
        self.sun_rotation = sun_rotation
        self.altitude = altitude
        self.air_density = air_density
        self.aerosol_density = aerosol_density
        self.ozone_density = ozone_density
        self.sun_direction = sun_direction
        self.turbidity = turbidity
        self.ground_albedo = ground_albedo
        self._establish_links(**key_args)

    @classmethod
    def single_scattering(cls) -> "SkyTexture":
        """Create Sky Texture with operation 'Single Scattering'. Single scattering sky model"""
        return cls(sky_type="SINGLE_SCATTERING")

    @classmethod
    def multiple_scattering(cls) -> "SkyTexture":
        """Create Sky Texture with operation 'Multiple Scattering'. Multiple scattering sky model (more accurate)"""
        return cls(sky_type="MULTIPLE_SCATTERING")

    @classmethod
    def preetham(cls, vector: InputVector = None) -> "SkyTexture":
        """Create Sky Texture with operation 'Preetham'. Preetham 1999 (Legacy)"""
        return cls(sky_type="PREETHAM", vector=vector)

    @classmethod
    def hosek_wilkie(cls, vector: InputVector = None) -> "SkyTexture":
        """Create Sky Texture with operation 'Hosek / Wilkie'. Hosek / Wilkie 2012 (Legacy)"""
        return cls(sky_type="HOSEK_WILKIE", vector=vector)

    @property
    def sky_type(
        self,
    ) -> Literal[
        "SINGLE_SCATTERING", "MULTIPLE_SCATTERING", "PREETHAM", "HOSEK_WILKIE"
    ]:
        return self.node.sky_type

    @sky_type.setter
    def sky_type(
        self,
        value: Literal[
            "SINGLE_SCATTERING", "MULTIPLE_SCATTERING", "PREETHAM", "HOSEK_WILKIE"
        ],
    ):
        self.node.sky_type = value

    @property
    def sun_disc(self) -> bool:
        return self.node.sun_disc

    @sun_disc.setter
    def sun_disc(self, value: bool):
        self.node.sun_disc = value

    @property
    def sun_size(self) -> float:
        return self.node.sun_size

    @sun_size.setter
    def sun_size(self, value: float):
        self.node.sun_size = value

    @property
    def sun_intensity(self) -> float:
        return self.node.sun_intensity

    @sun_intensity.setter
    def sun_intensity(self, value: float):
        self.node.sun_intensity = value

    @property
    def sun_elevation(self) -> float:
        return self.node.sun_elevation

    @sun_elevation.setter
    def sun_elevation(self, value: float):
        self.node.sun_elevation = value

    @property
    def sun_rotation(self) -> float:
        return self.node.sun_rotation

    @sun_rotation.setter
    def sun_rotation(self, value: float):
        self.node.sun_rotation = value

    @property
    def altitude(self) -> float:
        return self.node.altitude

    @altitude.setter
    def altitude(self, value: float):
        self.node.altitude = value

    @property
    def air_density(self) -> float:
        return self.node.air_density

    @air_density.setter
    def air_density(self, value: float):
        self.node.air_density = value

    @property
    def aerosol_density(self) -> float:
        return self.node.aerosol_density

    @aerosol_density.setter
    def aerosol_density(self, value: float):
        self.node.aerosol_density = value

    @property
    def ozone_density(self) -> float:
        return self.node.ozone_density

    @ozone_density.setter
    def ozone_density(self, value: float):
        self.node.ozone_density = value

    @property
    def sun_direction(self) -> Vector:
        return self.node.sun_direction

    @sun_direction.setter
    def sun_direction(self, value: Vector | tuple[float, float, float]):
        self.node.sun_direction = value

    @property
    def turbidity(self) -> float:
        return self.node.turbidity

    @turbidity.setter
    def turbidity(self, value: float):
        self.node.turbidity = value

    @property
    def ground_albedo(self) -> float:
        return self.node.ground_albedo

    @ground_albedo.setter
    def ground_albedo(self, value: float):
        self.node.ground_albedo = value
