paint: brush nodes cleanup

This commit is contained in:
luboslenco
2026-07-16 11:40:26 +02:00
parent 40473635c9
commit 1ca2026e6e
19 changed files with 618 additions and 570 deletions
@@ -28,3 +28,80 @@ void *tex_image_node_create(ui_node_t *raw, f32_array_t *args) {
n->raw = raw;
return n;
}
void tex_image_node_init() {
ui_node_t *tex_image_node_def =
GC_ALLOC_INIT(ui_node_t, {.id = 0,
.name = _tr("Image Texture"),
// type: "tex_image_node",
.type = "TEX_IMAGE",
.x = 0,
.y = 0,
.color = 0xff4982a0,
.inputs = any_array_create_from_raw(
(void *[]){
GC_ALLOC_INIT(ui_node_socket_t, {.id = 0,
.node_id = 0,
.name = _tr("Vector"),
.type = "VECTOR",
.color = 0xff6363c7,
.default_value = f32_array_create_xyz(0.0, 0.0, 0.0),
.min = 0.0,
.max = 1.0,
.precision = 100,
.display = 0}),
},
1),
.outputs = any_array_create_from_raw(
(void *[]){
GC_ALLOC_INIT(ui_node_socket_t, {.id = 0,
.node_id = 0,
.name = _tr("Color"),
.type = "VALUE", // Match brush output socket type
.color = 0xffc7c729,
.default_value = f32_array_create_xyzw(0.0, 0.0, 0.0, 1.0),
.min = 0.0,
.max = 1.0,
.precision = 100,
.display = 0}),
GC_ALLOC_INIT(ui_node_socket_t, {.id = 0,
.node_id = 0,
.name = _tr("Alpha"),
.type = "VALUE",
.color = 0xffa1a1a1,
.default_value = f32_array_create_x(1.0),
.min = 0.0,
.max = 1.0,
.precision = 100,
.display = 0}),
},
2),
.buttons = any_array_create_from_raw(
(void *[]){
GC_ALLOC_INIT(ui_node_button_t, {.name = _tr("file"),
.type = "ENUM",
.output = -1,
.default_value = f32_array_create_x(0),
.data = u8_array_create_from_string(""),
.min = 0.0,
.max = 1.0,
.precision = 100,
.height = 0}),
GC_ALLOC_INIT(ui_node_button_t, {.name = _tr("color_space"),
.type = "ENUM",
.output = -1,
.default_value = f32_array_create_x(0),
.data = u8_array_create_from_string("linear\nsrgb"),
.min = 0.0,
.max = 1.0,
.precision = 100,
.height = 0}),
},
2),
.width = 0,
.flags = 0});
any_array_push(nodes_brush_category0, tex_image_node_def);
// any_map_set(nodes_brush_creates, "tex_image_node", tex_image_node_create);
any_map_set(nodes_brush_creates, "TEX_IMAGE", tex_image_node_create);
}