TexTools is a UV and Texture toolset created several years ago for Blender and Max by @renderhjs. In this open repository, originally created by @SavMartin, we develop the current version of this popular Blender add-on.
if len(obj.data.vertex_colors) > 0 :
vclsNames = [vcl.name for vcl in obj.data.vertex_colors]
if 'TexTools_colorID' in vclsNames:
obj.data.vertex_colors['TexTools_colorID'].active = True
else:
obj.data.vertex_colors.new(name='TexTools_colorID')
obj.data.vertex_colors['TexTools_colorID'].active = True
else:
obj.data.vertex_colors.new(name='TexTools_colorID')
It can be simplified to:
if 'TexTools_colorID' not in obj.data.vertex_colors :
obj.data.vertex_colors.new(name='TexTools_colorID')
obj.data.vertex_colors['TexTools_colorID'].active = True
I see one or two other similar circumlocutions in that file, too.
I just noticed this in
op_color_assign.py
:It can be simplified to:
I see one or two other similar circumlocutions in that file, too.