|
@@ -155,12 +155,20 @@ def wrap(texture):
|
|
|
|
|
|
"""
|
|
|
logger.debug("texture.wrap(%s)", texture)
|
|
|
- wrapping = {
|
|
|
- True: constants.WRAPPING.MIRROR,
|
|
|
- False: constants.WRAPPING.REPEAT
|
|
|
- }
|
|
|
- return (wrapping[texture.use_mirror_x],
|
|
|
- wrapping[texture.use_mirror_y])
|
|
|
+
|
|
|
+ if(texture.extension == "REPEAT"):
|
|
|
+ wrapping = {
|
|
|
+ True: constants.WRAPPING.MIRROR,
|
|
|
+ False: constants.WRAPPING.REPEAT
|
|
|
+ }
|
|
|
+ return (wrapping[texture.use_mirror_x],
|
|
|
+ wrapping[texture.use_mirror_y])
|
|
|
+
|
|
|
+ # provide closest available three.js behavior.
|
|
|
+ # other possible values: "CLIP", "EXTEND", "CLIP_CUBE", "CHECKER",
|
|
|
+ # best match CLAMP behavior
|
|
|
+ else:
|
|
|
+ return (constants.WRAPPING.CLAMP, constants.WRAPPING.CLAMP);
|
|
|
|
|
|
|
|
|
def textures():
|