def create_texture(self, fullpath):
try:
teximage = bpy.data.images.load(fullpath, True)
if teximage.users > 0:
for tex in bpy.data.textures:
if tex.type == 'IMAGE' and tex.image == teximage:
return tex
name,ext = os.path.splitext(os.path.basename(fullpath))
texobj = bpy.data.textures.new(name, type='IMAGE')
texobj.image = teximage
return texobj
except Exception as e:
for tex in bpy.data.textures:
if tex.type == 'IMAGE' and tex.name == fullpath:
return tex
return bpy.data.textures.new(fullpath, type='IMAGE')
import-ninja.py 文件源码
python
阅读 17
收藏 0
点赞 0
评论 0
评论列表
文章目录