paint: uvmap edit fixes
This commit is contained in:
+49
-48
@@ -502,54 +502,55 @@ void util_render_make_decal_preview();
|
||||
void util_render_make_text_preview();
|
||||
void util_render_make_font_preview();
|
||||
void util_render_make_brush_preview();
|
||||
void util_render_make_node_preview(ui_node_canvas_t *canvas, ui_node_t *node, gpu_texture_t *image, ui_node_canvas_t *group, ui_node_t_array_t *parents);
|
||||
void util_render_pick_pos_nor_tex();
|
||||
mat4_t util_render_get_decal_mat();
|
||||
void util_brush_update();
|
||||
vec4_t raycast_aabb_mouse(object_t *object);
|
||||
bool point_in_aabb(object_t *object, vec4_t point);
|
||||
void util_resize_borders();
|
||||
void util_select_update();
|
||||
void util_shortcut_brush();
|
||||
void util_shortcut_global();
|
||||
void util_shortcut_undo_redo();
|
||||
void util_shortcut_viewport();
|
||||
void util_stencil_transform();
|
||||
void util_touch_update();
|
||||
void tab_materials_draw(ui_handle_t *htab);
|
||||
void tab_materials_accept_swatch_drop(swatch_color_t *swatch);
|
||||
void tab_materials_accept_material_drop(slot_material_t *material);
|
||||
void tab_brushes_accept_brush_drop(slot_brush_t *brush);
|
||||
void tab_fonts_accept_font_drop(slot_font_t *font);
|
||||
void tab_textures_accept_asset_drop(asset_t *asset);
|
||||
void tab_browser_show_directory(char *directory);
|
||||
void tab_browser_draw(ui_handle_t *htab);
|
||||
void util_mesh_merge(mesh_object_t_array_t *paint_objects);
|
||||
void util_mesh_merge_geometry();
|
||||
void util_mesh_swap_axis(i32 a, i32 b);
|
||||
void util_mesh_flip_normals();
|
||||
void util_mesh_calc_normals(bool smooth);
|
||||
void util_mesh_to_origin();
|
||||
void util_mesh_apply_displacement(gpu_texture_t *texpaint_pack, f32 strength, f32 uv_scale);
|
||||
void util_mesh_equirect_unwrap(raw_mesh_t *mesh);
|
||||
void util_mesh_decimate(f32 strength);
|
||||
void util_mesh_smooth();
|
||||
void util_mesh_bevel(f32 amount);
|
||||
void util_mesh_subdivide();
|
||||
void util_mesh_pack_uvs(i16_array_t *texa);
|
||||
void ui_header_init();
|
||||
void ui_header_render_ui();
|
||||
void ui_header_draw_tool_properties();
|
||||
void player_update();
|
||||
plugin_t *plugin_create();
|
||||
void plugin_start(char *plugin);
|
||||
void plugin_stop(char *plugin);
|
||||
void plugin_notify_on_ui(plugin_t *plugin, void *f);
|
||||
void plugin_notify_on_update(plugin_t *plugin, void *f);
|
||||
void plugin_notify_on_delete(plugin_t *plugin, void *f);
|
||||
void import_plugin_run(char *path);
|
||||
void parser_logic_parse(ui_node_canvas_t *canvas);
|
||||
void resource_load(string_array_t *names);
|
||||
void util_render_make_node_preview(ui_node_canvas_t *canvas, ui_node_t *node, gpu_texture_t *image, ui_node_canvas_t *group, ui_node_t_array_t *parents);
|
||||
void util_render_pick_pos_nor_tex();
|
||||
mat4_t util_render_get_decal_mat();
|
||||
void util_brush_update();
|
||||
vec4_t raycast_aabb_mouse(object_t *object);
|
||||
bool point_in_aabb(object_t *object, vec4_t point);
|
||||
void util_resize_borders();
|
||||
void util_select_update();
|
||||
void util_shortcut_brush();
|
||||
void util_shortcut_global();
|
||||
void util_shortcut_undo_redo();
|
||||
void util_shortcut_viewport();
|
||||
void util_stencil_transform();
|
||||
void util_touch_update();
|
||||
void tab_materials_draw(ui_handle_t *htab);
|
||||
void tab_materials_accept_swatch_drop(swatch_color_t *swatch);
|
||||
void tab_materials_accept_material_drop(slot_material_t *material);
|
||||
void tab_brushes_accept_brush_drop(slot_brush_t *brush);
|
||||
void tab_fonts_accept_font_drop(slot_font_t *font);
|
||||
void tab_textures_accept_asset_drop(asset_t *asset);
|
||||
void tab_browser_show_directory(char *directory);
|
||||
void tab_browser_draw(ui_handle_t *htab);
|
||||
mesh_object_t_array_t *util_mesh_get_visible();
|
||||
void util_mesh_merge(mesh_object_t_array_t *paint_objects);
|
||||
void util_mesh_merge_geometry();
|
||||
void util_mesh_swap_axis(i32 a, i32 b);
|
||||
void util_mesh_flip_normals();
|
||||
void util_mesh_calc_normals(bool smooth);
|
||||
void util_mesh_to_origin();
|
||||
void util_mesh_apply_displacement(gpu_texture_t *texpaint_pack, f32 strength, f32 uv_scale);
|
||||
void util_mesh_equirect_unwrap(raw_mesh_t *mesh);
|
||||
void util_mesh_decimate(f32 strength);
|
||||
void util_mesh_smooth();
|
||||
void util_mesh_bevel(f32 amount);
|
||||
void util_mesh_subdivide();
|
||||
void util_mesh_pack_uvs(i16_array_t *texa);
|
||||
void ui_header_init();
|
||||
void ui_header_render_ui();
|
||||
void ui_header_draw_tool_properties();
|
||||
void player_update();
|
||||
plugin_t *plugin_create();
|
||||
void plugin_start(char *plugin);
|
||||
void plugin_stop(char *plugin);
|
||||
void plugin_notify_on_ui(plugin_t *plugin, void *f);
|
||||
void plugin_notify_on_update(plugin_t *plugin, void *f);
|
||||
void plugin_notify_on_delete(plugin_t *plugin, void *f);
|
||||
void import_plugin_run(char *path);
|
||||
void parser_logic_parse(ui_node_canvas_t *canvas);
|
||||
void resource_load(string_array_t *names);
|
||||
gpu_texture_t *resource_get(char *name);
|
||||
rect_t *resource_tile50(gpu_texture_t *img, i32 i);
|
||||
rect_t *resource_tile18(gpu_texture_t *img, i32 i);
|
||||
|
||||
@@ -737,15 +737,11 @@ void tab_meshes_apply_visible(mesh_object_t *o) {
|
||||
}
|
||||
}
|
||||
|
||||
mesh_object_t_array_t *visibles = any_array_create_from_raw((void *[]){}, 0);
|
||||
for (i32 k = 0; k < g_project->_->paint_objects->length; ++k) {
|
||||
mesh_object_t *p = g_project->_->paint_objects->buffer[k];
|
||||
if (p->base->visible) {
|
||||
any_array_push(visibles, p);
|
||||
}
|
||||
}
|
||||
util_mesh_merge(visibles);
|
||||
g_context->ddirty = 2;
|
||||
util_mesh_merge(util_mesh_get_visible());
|
||||
util_uv_uvmap_cached = false;
|
||||
util_uv_trianglemap_cached = false;
|
||||
util_uv_dilatemap_cached = false;
|
||||
g_context->ddirty = 2;
|
||||
}
|
||||
|
||||
void tab_meshes_draw_mesh_slot(mesh_object_t *o, i32 i) {
|
||||
|
||||
@@ -1244,15 +1244,11 @@ void tab_timeline_draw(ui_handle_t *htab) {
|
||||
if (eye_hover && g_ui->input_released) {
|
||||
mesh->base->visible = !mesh->base->visible;
|
||||
|
||||
mesh_object_t_array_t *visibles = any_array_create_from_raw((void *[]){}, 0);
|
||||
for (i32 k = 0; k < g_project->_->paint_objects->length; k++) {
|
||||
mesh_object_t *p = g_project->_->paint_objects->buffer[k];
|
||||
if (p->base->visible) {
|
||||
any_array_push(visibles, p);
|
||||
}
|
||||
}
|
||||
util_mesh_merge(visibles);
|
||||
g_context->ddirty = 2;
|
||||
util_mesh_merge(util_mesh_get_visible());
|
||||
util_uv_uvmap_cached = false;
|
||||
util_uv_trianglemap_cached = false;
|
||||
util_uv_dilatemap_cached = false;
|
||||
g_context->ddirty = 2;
|
||||
}
|
||||
|
||||
rect_t *rect = resource_tile50(icons, ICON_CUBE);
|
||||
|
||||
@@ -104,7 +104,6 @@ void edit_uvmap_update() {
|
||||
texa->buffer[vi * 2] = (i16)math_min(math_max(new_x, -32767), 32767);
|
||||
texa->buffer[vi * 2 + 1] = (i16)math_min(math_max(new_y, -32767), 32767);
|
||||
}
|
||||
util_uv_uvmap_cached = false;
|
||||
ui_view2d_hwnd->redraws = 2;
|
||||
}
|
||||
|
||||
@@ -119,8 +118,14 @@ void edit_uvmap_update() {
|
||||
_is_dragging = false;
|
||||
mesh_object_t *o = g_context->paint_object;
|
||||
mesh_data_build_vertices(o->data->_->vertex_buffer, o->data->vertex_arrays);
|
||||
|
||||
if (g_context->merged_object != NULL) {
|
||||
util_mesh_merge(util_mesh_get_visible());
|
||||
}
|
||||
util_uv_uvmap_cached = false;
|
||||
util_uv_trianglemap_cached = false;
|
||||
util_uv_dilatemap_cached = false;
|
||||
ui_view2d_hwnd->redraws = 2;
|
||||
}
|
||||
if (_is_box_sel) {
|
||||
_is_box_sel = false;
|
||||
|
||||
@@ -557,14 +557,7 @@ void tab_layers_apply_filter(i32 filter) {
|
||||
util_mesh_merge(NULL);
|
||||
}
|
||||
else if (filter > g_project->_->paint_objects->length) {
|
||||
mesh_object_t_array_t *visibles = any_array_create_from_raw((void *[]){}, 0);
|
||||
for (i32 i = 0; i < g_project->_->paint_objects->length; ++i) {
|
||||
mesh_object_t *p = g_project->_->paint_objects->buffer[i];
|
||||
if (p->base->visible) {
|
||||
any_array_push(visibles, p);
|
||||
}
|
||||
}
|
||||
util_mesh_merge(visibles);
|
||||
util_mesh_merge(util_mesh_get_visible());
|
||||
}
|
||||
layers_set_object_mask();
|
||||
util_uv_uvmap_cached = false;
|
||||
|
||||
@@ -34,6 +34,17 @@ mesh_object_t_array_t *util_mesh_get_unique() {
|
||||
return ar;
|
||||
}
|
||||
|
||||
mesh_object_t_array_t *util_mesh_get_visible() {
|
||||
mesh_object_t_array_t *ar = any_array_create_from_raw((void *[]){}, 0);
|
||||
for (i32 i = 0; i < g_project->_->paint_objects->length; ++i) {
|
||||
mesh_object_t *p = g_project->_->paint_objects->buffer[i];
|
||||
if (p->base->visible) {
|
||||
any_array_push(ar, p);
|
||||
}
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
static mesh_data_t *util_mesh_build_merged_data(mesh_object_t_array_t *paint_objects, char *name) {
|
||||
i32 vlen = 0;
|
||||
i32 ilen = 0;
|
||||
|
||||
Reference in New Issue
Block a user