Skip to content

Commit

Permalink
Merge pull request #8067 from mhirsch/blender_export_texture_mode
Browse files Browse the repository at this point in the history
export textures from blender with correct clip/repeat mode
  • Loading branch information
mrdoob committed Feb 7, 2016
2 parents c1cd181 + 736729f commit ffc405b
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions utils/exporters/blender/addons/io_three/exporter/api/texture.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit ffc405b

Please sign in to comment.