예제 #1
0
MAX_RADIUS = 200
MAX_OPACITY = 255
MAX_ANGLE = 360

source_layer_id = layer.get_registry(REGISTRY_NAME + "-source-layer-id")
if source_layer_id is not None:
    layer.select_id(source_layer_id)
else:
    source_layer_id = layer.get_id()
source_layer_name = layer.get_name()

chosen_radius = layer.get_registry(REGISTRY_NAME + "-radius")
if chosen_radius == None:
    chosen_radius = layer.get_registry(OPPOSITE_REGISTRY_NAME + "-radius")
if chosen_radius == None:
    chosen_radius = image.get_registry(REGISTRY_NAME + "-radius")
if chosen_radius == None:
    chosen_radius = image.get_registry(OPPOSITE_REGISTRY_NAME + "-radius")
if chosen_radius == None:
    chosen_radius = 20

chosen_angle = layer.get_registry(REGISTRY_NAME + "-angle")
if chosen_angle == None:
    chosen_angle = layer.get_registry(OPPOSITE_REGISTRY_NAME + "-angle")
    if chosen_angle is not None:
        chosen_angle = (chosen_angle + 180) % 360
if chosen_angle == None:
    chosen_angle = image.get_registry(REGISTRY_NAME + "-angle")
if chosen_angle == None:
    chosen_angle = image.get_registry(OPPOSITE_REGISTRY_NAME + "-angle")
    if chosen_angle is not None:
FRIENDLY_NAME = dialog.get_script_name()
MAX_RADIUS = 100
MAX_OFFSET = 100
MAX_OPACITY = 255

source_layer_id = layer.get_registry("shadow-source-layer-id")
if source_layer_id is not None:
    layer.select_id(source_layer_id)
else:
    source_layer_id = layer.get_id()
source_layer_name = layer.get_name()

chosen_radius = layer.get_registry("shadow-radius")
if chosen_radius == None:
    chosen_radius = image.get_registry("shadow-radius")
if chosen_radius == None:
    chosen_radius = 10

chosen_offset = layer.get_registry("shadow-offset")
if chosen_offset == None or len(chosen_offset) != 2:
    chosen_offset = image.get_registry("shadow-offset")
if chosen_offset == None or len(chosen_offset) != 2:
    chosen_offset = (10, 10)

shadow_layer_id = layer.get_registry("shadow-layer-id")
if image.get_layer_index(shadow_layer_id) == None:
    shadow_layer_id = None

if shadow_layer_id is not None:
    layer.select_id(shadow_layer_id)
예제 #3
0
if layer.is_empty():
    dialog.show_message("Layer is empty")
    exit()

############ image processing

MAX_RADIUS = 100
MAX_OPACITY = 255

source_layer_id = layer.get_id()
source_layer_name = layer.get_name()

chosen_radius = layer.get_registry("stroke-radius")
if chosen_radius == None: 
    chosen_radius = image.get_registry("stroke-radius")
if chosen_radius == None:
    chosen_radius = 10

stroke_layer_id = layer.get_registry("stroke-layer-id")
if image.get_layer_index(stroke_layer_id) == None:
    stroke_layer_id = None

if stroke_layer_id is not None:
    layer.select_id(stroke_layer_id)
    chosen_opacity = layer.get_opacity()
    overlay_color = colors.str_to_RGBA(layer.get_registry("overlay-color"))
    layer.select_id(source_layer_id)
else:
    chosen_opacity = layer.get_opacity() 
    overlay_color = None