提交 10bef8e6 编写于 作者: M Mr.doob

convert_obj_three: split d and Tr. Removed TRANSPARENCY. See #7520

上级 fea7d9b8
......@@ -138,7 +138,6 @@ import glob
ALIGN = "none" # center centerxz bottom top none
SHADING = "smooth" # smooth flat
TYPE = "ascii" # ascii binary
TRANSPARENCY = "normal" # normal invert
TRUNCATE = False
SCALE = 1.0
......@@ -428,14 +427,19 @@ def parse_mtl(fname):
if chunks[0] == "Ns" and len(chunks) == 2:
materials[identifier]["specularCoef"] = float(chunks[1])
# Dissolves
# d 0.9
if chunks[0] == "d" and len(chunks) == 2:
materials[identifier]["opacity"] = float(chunks[1])
if materials[identifier]["opacity"] < 1.0:
materials[identifier]["transparent"] = True
# Transparency
# Tr 0.9 or d 0.9
if (chunks[0] == "Tr" or chunks[0] == "d") and len(chunks) == 2:
materials[identifier]["transparent"] = True
if TRANSPARENCY == "invert":
materials[identifier]["opacity"] = float(chunks[1])
else:
materials[identifier]["opacity"] = 1.0 - float(chunks[1])
# Tr 0.1
if chunks[0] == "Tr" and len(chunks) == 2:
materials[identifier]["opacity"] = 1.0 - float(chunks[1])
if materials[identifier]["opacity"] < 1.0:
materials[identifier]["transparent"] = True
# Optical density
# Ni 1.0
......@@ -1574,10 +1578,6 @@ if __name__ == "__main__":
if a in ("binary", "ascii"):
TYPE = a
elif o in ("-d", "--dissolve"):
if a in ("normal", "invert"):
TRANSPARENCY = a
elif o in ("-b", "--bakecolors"):
BAKE_COLORS = True
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册