diff options
author | Maurice Raybaud <mauriceraybaud@hotmail.fr> | 2021-05-27 19:41:55 +0300 |
---|---|---|
committer | Maurice Raybaud <mauriceraybaud@hotmail.fr> | 2021-05-27 19:41:55 +0300 |
commit | e25068ef471c6d6cd5ee64a2eef9b7d672c57029 (patch) | |
tree | 06761f2667d2f875d10ed0fff1af1bc7c20a2bda /render_povray/texturing_properties.py | |
parent | a885950276ea98dfa6a67c6d035198b59692a658 (diff) |
Revert "POV : fix registering"
This reverts commit a885950276ea98dfa6a67c6d035198b59692a658.
Diffstat (limited to 'render_povray/texturing_properties.py')
-rwxr-xr-x | render_povray/texturing_properties.py | 129 |
1 files changed, 125 insertions, 4 deletions
diff --git a/render_povray/texturing_properties.py b/render_povray/texturing_properties.py index 6551b8c3..bb89ee02 100755 --- a/render_povray/texturing_properties.py +++ b/render_povray/texturing_properties.py @@ -17,7 +17,6 @@ # ##### END GPL LICENSE BLOCK ##### # <pep8 compliant> - """Declare texturing properties controllable in UI.""" import bpy @@ -463,6 +462,128 @@ class MaterialTextureSlot(PropertyGroup): ############################################################################### +# Texture slots (World context) exported as POV texture properties. +############################################################################### +class WorldTextureSlot(PropertyGroup): + """Declare world texture slot level properties for UI and translated to POV.""" + + bl_idname = ("pov_texture_slots",) + bl_description = ("Texture_slots from Blender-2.79",) + + # Adding a "real" texture datablock as property is not possible + # (or at least not easy through a dynamically populated EnumProperty). + # That's why we'll use a prop_search() UILayout function in ui.py. + # So we'll assign the name of the needed texture datablock to the below StringProperty. + texture: StringProperty(update=active_texture_name_from_uilist) + # and use another temporary StringProperty to change the linked data + texture_search: StringProperty( + name="", update=active_texture_name_from_search, description="Browse Texture to be linked" + ) + + blend_factor: FloatProperty( + name="Blend", + description="Amount texture affects color progression of the " "background", + soft_min=0.0, + soft_max=1.0, + default=1.0, + ) + + horizon_factor: FloatProperty( + name="Horizon", + description="Amount texture affects color of the horizon", + soft_min=0.0, + soft_max=1.0, + default=1.0, + ) + + object: StringProperty( + name="Object", + description="Object to use for mapping with Object texture coordinates", + default="", + ) + + offset: FloatVectorProperty( + name="Offset", + description=("Fine tune of the texture mapping X, Y and Z locations "), + precision=4, + step=0.1, + soft_min=-100.0, + soft_max=100.0, + default=(0.0, 0.0, 0.0), + options={"ANIMATABLE"}, + subtype="TRANSLATION", + ) + + scale: FloatVectorProperty( + name="Size", + subtype="XYZ", + size=3, + description="Set scaling for the texture’s X, Y and Z sizes ", + precision=4, + step=0.1, + soft_min=-100.0, + soft_max=100.0, + default=(1.0, 1.0, 1.0), + options={"ANIMATABLE"}, + ) + + texture_coords: EnumProperty( + name="Coordinates", + description="Texture coordinates used to map the texture onto the background", + items=( + ("VIEW", "View", "Use view vector for the texture coordinates"), + ( + "GLOBAL", + "Global", + "Use global coordinates for the texture coordinates (interior mist)", + ), + ( + "ANGMAP", + "AngMap", + "Use 360 degree angular coordinates, e.g. for spherical light probes", + ), + ("SPHERE", "Sphere", "For 360 degree panorama sky, spherical mapped, only top half"), + ("EQUIRECT", "Equirectangular", "For 360 degree panorama sky, equirectangular mapping"), + ("TUBE", "Tube", "For 360 degree panorama sky, cylindrical mapped, only top half"), + ("OBJECT", "Object", "Use linked object’s coordinates for texture coordinates"), + ), + default="VIEW", + ) + + use_map_blend: BoolProperty( + name="Blend Map", description="Affect the color progression of the background", default=True + ) + + use_map_horizon: BoolProperty( + name="Horizon Map", description="Affect the color of the horizon", default=False + ) + + use_map_zenith_down: BoolProperty( + name="", description="Affect the color of the zenith below", default=False + ) + + use_map_zenith_up: BoolProperty( + name="Zenith Up Map", description="Affect the color of the zenith above", default=False + ) + + zenith_down_factor: FloatProperty( + name="Zenith Down", + description="Amount texture affects color of the zenith below", + soft_min=0.0, + soft_max=1.0, + default=1.0, + ) + + zenith_up_factor: FloatProperty( + name="Zenith Up", + description="Amount texture affects color of the zenith above", + soft_min=0.0, + soft_max=1.0, + default=1.0, + ) + + +############################################################################### # Space properties from removed former Blender Internal ############################################################################### @@ -995,9 +1116,7 @@ class RenderPovSettingsTexture(PropertyGroup): tex_scale_z: FloatProperty(name="Scale Z", description="", min=0.0, max=10000.0, default=1.0) -classes = ( - MaterialTextureSlot, - RenderPovSettingsTexture) +classes = (MaterialTextureSlot, WorldTextureSlot, RenderPovSettingsTexture) def register(): @@ -1005,11 +1124,13 @@ def register(): register_class(cls) bpy.types.Material.pov_texture_slots = CollectionProperty(type=MaterialTextureSlot) + bpy.types.World.pov_texture_slots = CollectionProperty(type=WorldTextureSlot) bpy.types.Texture.pov = PointerProperty(type=RenderPovSettingsTexture) def unregister(): del bpy.types.Texture.pov + del bpy.types.World.pov_texture_slots del bpy.types.Material.pov_texture_slots for cls in reversed(classes): |