Skip to content

Commit

Permalink
4.2 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelBilek committed Jul 13, 2024
0 parents commit 4ab19fe
Show file tree
Hide file tree
Showing 13 changed files with 2,237 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Byte-compiled / optimized / DLL files
__pycache__/
674 changes: 674 additions & 0 deletions license.txt

Large diffs are not rendered by default.

Binary file added media/islands_and_texture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/modifiers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/normals.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/stretching.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# VisualUV

This Blender add-on offers several customizable 3D Viewport and UV Editor overlays for visualizing common issues in UV Maps, like UV Streching, Flipping, and Overlapping. The addon is accessible from a panel in the tools section of the 3D Viewport and the UV Editor.
>You need Blender of version at least 3.5.

# Main features

This is the list of the main features offered by this add-on.

## Quick texture preview

Overlay for previewing image textures with just one click. The default Grid texture can be switched to any other image loaded in your workspace. You can change the scale and alpha of the texture. This overlay can be combined with all other VisualUV's overlays

## UV Stretching

This overlay works similarly to Blender's default UV Stretching Visualization but is also displayed on the original model in the 3D Viewport. You can choose between visualizing stretching of faces by angles, areas and edge length.

## UV Normals

This overlay colors the UV Faces depending on the direction of their normals.

## UV Overlapping

This overlay uses Blender's feature for selecting overlapping UVs, but additionally colors them both in the UV Editor and the 3D Viewport.
> This feature is only available in the Edit-Mode and with Synchronized UV Selection turned-off.
> This feature needs to be manualy refreshed to visualize correct information.
## Colored UV Islands

Overlay for coloring each UV Island with a distinct color.

![image info](media/islands_and_texture.png)
![image info](media/normals.png)
![image info](media/stretching.png)

# Customization

After turning on any VisualUV overlay, you will be get access to several customization options.

## Refresh and Auto-Update

VisualUV by default refreshes after every **button release** and **mouse click**. Working with models of thousands of polygons can become unpleasant, with constant stuttering as VisualUV recalculates visual information about the geometry. The **Auto-Update** feature can be turned off, and all overlays can be refreshed manualy be a designated button. The **Refresh** button also serves as a quick **restart**, as some operations in Blender may internaly crash the overlays.

## Wireframe

A wireframe shader is turned on by default and is visible in Edit-Mode.
>Turning off this option boost performance.
## Position and Color Change

Turning on these options let's you modify the position and colors of the overlay.

## Explosion View

This feature will let you divide the overlay into individual UV Islands and allowing you to offset them away from the center.

![image info](media/modifiers.png)
83 changes: 83 additions & 0 deletions visual_uv/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# VisualUV
# Copyright (C) 2023 Samuel Bílek

# This program is free software: you can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.

# You should have received a copy of the GNU General Public License along with this program. If not, see
# <https://www.gnu.org/licenses/>.

import bpy
from bpy.props import (
BoolProperty,
FloatVectorProperty,
FloatProperty,
EnumProperty,
PointerProperty,
IntProperty,
)

from .visualuv_ui import VISUALUV_PT_3d_view, VISUALUV_PT_2d_view
from .visualuv_ops import (
VISUALUV_OT_update,
VISUALUV_OT_toggle_texture,
VISUALUV_OT_toggle_stretching,
VISUALUV_OT_toggle_islands,
VISUALUV_OT_toggle_normals,
VISUALUV_OT_toggle_overlap,
VISUALUV_OT_overlay,
)
from .visualuv_props import VISUALUV_ObjectProperties, VISUALUV_WindowManagerProperties


bl_info = {
"name": "VisualUV",
"author": "Samuel Bílek",
"description": "Adds UV Mapping visualization overlays for objects. \
Useful for quick texture preview and visualising UV Stretching, Flipped UVs, Overlapped UVs and for coloring individual UV Islands.",
"blender": (3, 5, 0),
"version": (1, 0, 0),
"location": "3D Viewport / UV Editor > Tools > VisualUV",
"warning": "",
"category": "Object",
}

classes = (
VISUALUV_PT_3d_view,
VISUALUV_PT_2d_view,
VISUALUV_OT_update,
VISUALUV_OT_toggle_texture,
VISUALUV_OT_toggle_stretching,
VISUALUV_OT_toggle_islands,
VISUALUV_OT_toggle_normals,
VISUALUV_OT_toggle_overlap,
VISUALUV_OT_overlay,
VISUALUV_ObjectProperties,
VISUALUV_WindowManagerProperties,
)


def register():
for c in classes:
bpy.utils.register_class(c)
bpy.types.Object.visualuv = PointerProperty(type=VISUALUV_ObjectProperties)
bpy.types.WindowManager.visualuv = PointerProperty(
type=VISUALUV_WindowManagerProperties
)


def unregister():
del bpy.types.WindowManager.visualuv
del bpy.types.Object.visualuv

for c in classes:
bpy.utils.unregister_class(c)


if __name__ == "__main__":
register()
Binary file added visual_uv/__visualuv_checkers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4ab19fe

Please sign in to comment.