Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 354cc6e952 | |||
| 628ccb5ce0 | |||
| 280a9f5c94 | |||
| 1abff7587e |
@@ -1,3 +1,28 @@
|
||||
# Symmetrize Texture
|
||||
|
||||
Symmetrize Texture is an add-on that lets you symmetrize your texture image along a specified axis.
|
||||

|
||||
|
||||
Symmetrize Texture is a Blender add-on that lets you symmetrize your texture image along a specified axis.
|
||||
|
||||
If you want to symmetrize your texture image by using the add-on, make sure the base UV map is already symmetrical. The [Symmetrize UV Util](https://superhivemarket.com/products/symmetrize-uv-util) add-on could help you create a symmetrical UV map.
|
||||
3D Brush
|
||||
|
||||
You can use a special brush in the 3D view. When you trace some parts with the brush, the only traced parts are symmetrized. The size of brush can be changed by pressing the "F" key.
|
||||
|
||||
This feature runs in the 3D view in Object Mode. (It does not work in Texture Paint mode)
|
||||
|
||||

|
||||
|
||||
## 2D Brush
|
||||
|
||||
This is a 2D version of the mirror brush as described above.
|
||||
|
||||
This feature runs in the UV/Image Editor.
|
||||
|
||||

|
||||
|
||||
## Mirrored Copy
|
||||
|
||||
It makes mirror-image copy of one side, leaving the original in place. This is useful for drawing model that is symmetrical about x or y axis. Draw one side of the model, then use the feature for the other side.
|
||||
|
||||
This feature runs in the UV/Image Editor.
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
'''
|
||||
Copyright (C) 2021 - 2024 Akaneyu
|
||||
Copyright (C) 2021 - 2025 Akaneyu
|
||||
|
||||
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
|
||||
@@ -18,8 +18,8 @@
|
||||
bl_info = {
|
||||
"name": "Symmetrize Texture",
|
||||
"author": "akaneyu",
|
||||
"version": (1, 2, 0),
|
||||
"blender": (3, 3, 0),
|
||||
"version": (1, 4, 0),
|
||||
"blender": (4, 2, 0),
|
||||
"location": "View3D",
|
||||
"warning": "",
|
||||
"description": "",
|
||||
|
||||
+7
-6
@@ -1,5 +1,5 @@
|
||||
'''
|
||||
Copyright (C) 2021 - 2023 Akaneyu
|
||||
Copyright (C) 2021 - 2025 Akaneyu
|
||||
|
||||
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
|
||||
@@ -29,7 +29,9 @@ class SYMMETRIZE_TEXTURE_OT_use_3d_brush(bpy.types.Operator):
|
||||
bl_label = "Use 3D Brush"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
self.native_lib = None
|
||||
self.lmb = False
|
||||
self.image = None
|
||||
@@ -290,9 +292,6 @@ class SYMMETRIZE_TEXTURE_OT_mirrored_copy(bpy.types.Operator):
|
||||
bl_label = "Mirrored Copy"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.area.spaces.active.mode != 'UV' \
|
||||
@@ -390,7 +389,9 @@ class SYMMETRIZE_TEXTURE_OT_use_2d_brush(bpy.types.Operator):
|
||||
bl_label = "Use 2D Brush"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
self.native_lib = None
|
||||
self.lmb = False
|
||||
self.image = None
|
||||
|
||||
+27
-30
@@ -1,5 +1,5 @@
|
||||
'''
|
||||
Copyright (C) 2020 - 2024 Akaneyu
|
||||
Copyright (C) 2020 - 2025 Akaneyu
|
||||
|
||||
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
|
||||
@@ -16,15 +16,12 @@
|
||||
'''
|
||||
|
||||
import gpu
|
||||
from gpu.shader import create_from_info
|
||||
from gpu_extras.batch import batch_for_shader
|
||||
from mathutils import Matrix
|
||||
import numpy as np
|
||||
|
||||
default_vertex_shader = '''
|
||||
uniform mat4 ModelViewProjectionMatrix;
|
||||
|
||||
in vec2 pos;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = ModelViewProjectionMatrix * vec4(pos, 0, 1.0);
|
||||
@@ -32,10 +29,6 @@ void main()
|
||||
'''
|
||||
|
||||
default_fragment_shader = '''
|
||||
uniform vec4 color;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
fragColor = color;
|
||||
@@ -43,13 +36,6 @@ void main()
|
||||
'''
|
||||
|
||||
dotted_line_vertex_shader = '''
|
||||
uniform mat4 ModelViewProjectionMatrix;
|
||||
|
||||
in vec2 pos;
|
||||
in float arcLength;
|
||||
|
||||
out float arcLengthInter;
|
||||
|
||||
void main()
|
||||
{
|
||||
arcLengthInter = arcLength;
|
||||
@@ -59,15 +45,6 @@ void main()
|
||||
'''
|
||||
|
||||
dotted_line_fragment_shader = '''
|
||||
uniform float scale;
|
||||
uniform float offset;
|
||||
uniform vec4 color1;
|
||||
uniform vec4 color2;
|
||||
|
||||
in float arcLengthInter;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
if (step(sin((arcLengthInter + offset) * scale), 0.5) == 1) {
|
||||
@@ -80,12 +57,32 @@ void main()
|
||||
|
||||
class UIRenderer:
|
||||
def __init__(self):
|
||||
self.default_shader = gpu.types.GPUShader(default_vertex_shader,
|
||||
default_fragment_shader)
|
||||
self.default_shader_u_color = self.default_shader.uniform_from_name("color")
|
||||
default_shader_info = gpu.types.GPUShaderCreateInfo()
|
||||
default_shader_info.push_constant('MAT4', 'ModelViewProjectionMatrix')
|
||||
default_shader_info.push_constant('VEC4', 'color')
|
||||
default_shader_info.vertex_in(0, 'VEC2', 'pos')
|
||||
default_shader_info.fragment_out(0, 'VEC4', 'fragColor')
|
||||
default_shader_info.vertex_source(default_vertex_shader)
|
||||
default_shader_info.fragment_source(default_fragment_shader)
|
||||
self.default_shader = create_from_info(default_shader_info)
|
||||
self.default_shader_u_color = self.default_shader.uniform_from_name('color')
|
||||
|
||||
self.dotted_line_shader = gpu.types.GPUShader(dotted_line_vertex_shader,
|
||||
dotted_line_fragment_shader)
|
||||
dotted_line_shader_inter = gpu.types.GPUStageInterfaceInfo("dotted_line")
|
||||
dotted_line_shader_inter.smooth('FLOAT', "arcLengthInter")
|
||||
|
||||
dotted_line_shader_info = gpu.types.GPUShaderCreateInfo()
|
||||
dotted_line_shader_info.push_constant('MAT4', 'ModelViewProjectionMatrix')
|
||||
dotted_line_shader_info.push_constant('FLOAT', 'scale')
|
||||
dotted_line_shader_info.push_constant('FLOAT', 'offset')
|
||||
dotted_line_shader_info.push_constant('VEC4', 'color1')
|
||||
dotted_line_shader_info.push_constant('VEC4', 'color2')
|
||||
dotted_line_shader_info.vertex_in(0, 'VEC2', 'pos')
|
||||
dotted_line_shader_info.vertex_in(1, 'FLOAT', 'arcLength')
|
||||
dotted_line_shader_info.vertex_out(dotted_line_shader_inter)
|
||||
dotted_line_shader_info.fragment_out(0, 'VEC4', 'fragColor')
|
||||
dotted_line_shader_info.vertex_source(dotted_line_vertex_shader)
|
||||
dotted_line_shader_info.fragment_source(dotted_line_fragment_shader)
|
||||
self.dotted_line_shader = create_from_info(dotted_line_shader_info)
|
||||
self.dotted_line_shader_u_color1 = self.dotted_line_shader.uniform_from_name("color1")
|
||||
self.dotted_line_shader_u_color2 = self.dotted_line_shader.uniform_from_name("color2")
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 207 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.2 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.7 MiB |
Reference in New Issue
Block a user