Newer
Older
# SPDX-License-Identifier: GPL-2.0-or-later
"""Declare texturing properties controllable in UI."""
import bpy
from bpy.utils import register_class, unregister_class
from bpy.types import PropertyGroup
from bpy.props import (
FloatVectorProperty,
StringProperty,
BoolProperty,
IntProperty,
FloatProperty,
EnumProperty,
PointerProperty,
CollectionProperty,
)
from .shading_properties import active_texture_name_from_uilist, active_texture_name_from_search
# ---------------------------------------------------------------- #
# Texture slots (Material context) exported as POV texture properties.
# ---------------------------------------------------------------- #
class MaterialTextureSlot(PropertyGroup):
"""Declare material texture slot level properties for UI and translated to POV."""
bl_idname = ("pov_texture_slots",)
bl_description = ("Nodeless texture slots",)
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# 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 texturing_gui.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"
)
alpha_factor: FloatProperty(
name="Alpha", description="Amount texture affects alpha", default=1.0
)
ambient_factor: FloatProperty(
name="", description="Amount texture affects ambient", default=1.0
)
bump_method: EnumProperty(
name="",
description="Method to use for bump mapping",
items=(
("BUMP_ORIGINAL", "Bump Original", ""),
("BUMP_COMPATIBLE", "Bump Compatible", ""),
("BUMP_DEFAULT", "Bump Default", ""),
("BUMP_BEST_QUALITY", "Bump Best Quality", ""),
),
default="BUMP_ORIGINAL",
)
bump_objectspace: EnumProperty(
name="",
description="Space to apply bump mapping in",
items=(
("BUMP_VIEWSPACE", "Bump Viewspace", ""),
("BUMP_OBJECTSPACE", "Bump Objectspace", ""),
("BUMP_TEXTURESPACE", "Bump Texturespace", ""),
),
default="BUMP_VIEWSPACE",
)
density_factor: FloatProperty(
name="", description="Amount texture affects density", default=1.0
)
diffuse_color_factor: FloatProperty(
name="", description="Amount texture affects diffuse color", default=1.0
)
diffuse_factor: FloatProperty(
name="", description="Amount texture affects diffuse reflectivity", default=1.0
)
displacement_factor: FloatProperty(
name="", description="Amount texture displaces the surface", default=0.2
)
emission_color_factor: FloatProperty(
name="", description="Amount texture affects emission color", default=1.0
)
emission_factor: FloatProperty(
name="", description="Amount texture affects emission", default=1.0
)
emit_factor: FloatProperty(name="", description="Amount texture affects emission", default=1.0)
hardness_factor: FloatProperty(
name="", description="Amount texture affects hardness", default=1.0
)
mapping: EnumProperty(
name="",
description="",
items=(
("FLAT", "Flat", ""),
("CUBE", "Cube", ""),
("TUBE", "Tube", ""),
("SPHERE", "Sphere", ""),
),
default="FLAT",
)
mapping_x: EnumProperty(
name="",
description="",
items=(("NONE", "", ""), ("X", "", ""), ("Y", "", ""), ("Z", "", "")),
default="NONE",
)
mapping_y: EnumProperty(
name="",
description="",
items=(("NONE", "", ""), ("X", "", ""), ("Y", "", ""), ("Z", "", "")),
default="NONE",
)
mapping_z: EnumProperty(
name="",
description="",
items=(("NONE", "", ""), ("X", "", ""), ("Y", "", ""), ("Z", "", "")),
default="NONE",
)
mirror_factor: FloatProperty(
name="", description="Amount texture affects mirror color", default=1.0
)
normal_factor: FloatProperty(
name="", description="Amount texture affects normal values", default=1.0
)
normal_map_space: EnumProperty(
name="",
description="Sets space of normal map image",
items=(
("CAMERA", "Camera", ""),
("WORLD", "World", ""),
("OBJECT", "Object", ""),
("TANGENT", "Tangent", ""),
),
default="CAMERA",
)
object: StringProperty(
name="Object",
description="Object to use for mapping with Object texture coordinates",
default="",
)
raymir_factor: FloatProperty(
name="", description="Amount texture affects ray mirror", default=1.0
)
reflection_color_factor: FloatProperty(
name="", description="Amount texture affects color of out-scattered light", default=1.0
)
reflection_factor: FloatProperty(
name="", description="Amount texture affects brightness of out-scattered light", default=1.0
)
scattering_factor: FloatProperty(
name="", description="Amount texture affects scattering", default=1.0
)
specular_color_factor: FloatProperty(
name="", description="Amount texture affects specular color", default=1.0
)
specular_factor: FloatProperty(
name="", description="Amount texture affects specular reflectivity", default=1.0
)
offset: FloatVectorProperty(
name="Offset",
Maurice Raybaud
committed
description="Fine tune of the texture mapping X, Y and Z locations ",
Loading
Loading full blame...