TexTools is a UV and Texture tool set for 3dsMax created several years ago. This open repository will port in time several of the UV tools to Blender in python. http://renderhjs.net/textools/blender
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.1 KiB

import bpy
import bmesh
import operator
from mathutils import Vector
from collections import defaultdict
from math import pi
from . import utilities_color
class op(bpy.types.Operator):
bl_idname = "uv.textools_color_io_export"
bl_label = "Export"
bl_description = "Export current color palette to clipboard"
def poll(cls, context):
# Only in UV editor mode
if bpy.context.area.type != 'IMAGE_EDITOR':
return False
return True
def execute(self, context):
export_colors(self, context)
return {'FINISHED'}
def export_colors(self, context):
hex_colors = []
for i in range(bpy.context.scene.texToolsSettings.color_ID_count):
color = getattr(bpy.context.scene.texToolsSettings,
bpy.context.window_manager.clipboard = ", ".join(hex_colors)
'INVOKE_DEFAULT', message="{}x colors copied to clipboard".format(len(hex_colors)))