Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'uv_magic_uv/ui/view3d_uv_manipulation.py')
-rw-r--r--uv_magic_uv/ui/view3d_uv_manipulation.py36
1 files changed, 17 insertions, 19 deletions
diff --git a/uv_magic_uv/ui/view3d_uv_manipulation.py b/uv_magic_uv/ui/view3d_uv_manipulation.py
index 4c09bdf2..e385da38 100644
--- a/uv_magic_uv/ui/view3d_uv_manipulation.py
+++ b/uv_magic_uv/ui/view3d_uv_manipulation.py
@@ -48,13 +48,11 @@ from ..op.mirror_uv import MUV_OT_MirrorUV
from ..op.move_uv import MUV_OT_MoveUV
from ..op.preserve_uv_aspect import MUV_OT_PreserveUVAspect
from ..utils.bl_class_registry import BlClassRegistry
-
-__all__ = [
- 'MUV_PT_View3D_UVManipulation',
-]
+from ..utils import compatibility as compat
@BlClassRegistry()
+@compat.ChangeRegionType(region_type='TOOLS')
class MUV_PT_View3D_UVManipulation(bpy.types.Panel):
"""
Panel class: UV Manipulation on Property Panel on View3D
@@ -69,7 +67,7 @@ class MUV_PT_View3D_UVManipulation(bpy.types.Panel):
def draw_header(self, _):
layout = self.layout
- layout.label(text="", icon='IMAGE')
+ layout.label(text="", icon=compat.icon('IMAGE'))
def draw(self, context):
sc = context.scene
@@ -108,11 +106,11 @@ class MUV_PT_View3D_UVManipulation(bpy.types.Panel):
box.prop(sc, "muv_world_scale_uv_mode", text="")
if sc.muv_world_scale_uv_mode == 'MANUAL':
- sp = box.split(factor=0.5)
+ sp = compat.layout_split(box, 0.5)
col = sp.column()
col.prop(sc, "muv_world_scale_uv_tgt_texture_size",
text="Texture Size")
- sp = sp.split(factor=1.0)
+ sp = compat.layout_split(sp, 1.0)
col = sp.column()
col.label(text="Density:")
col.prop(sc, "muv_world_scale_uv_tgt_density", text="")
@@ -125,19 +123,19 @@ class MUV_PT_View3D_UVManipulation(bpy.types.Panel):
ops.show_dialog = False
elif sc.muv_world_scale_uv_mode == 'SAME_DENSITY':
- sp = box.split(factor=0.4)
+ sp = compat.layout_split(box, 0.4)
col = sp.column(align=True)
col.label(text="Source:")
- sp = sp.split(factor=1.0)
+ sp = compat.layout_split(sp, 1.0)
col = sp.column(align=True)
col.operator(MUV_OT_WorldScaleUV_Measure.bl_idname,
text="Measure")
- sp = box.split(factor=0.7)
+ sp = compat.layout_split(box, 0.7)
col = sp.column(align=True)
col.prop(sc, "muv_world_scale_uv_src_density", text="Density")
col.enabled = False
- sp = sp.split(factor=1.0)
+ sp = compat.layout_split(sp, 1.0)
col = sp.column(align=True)
col.label(text="px2/cm2")
@@ -152,19 +150,19 @@ class MUV_PT_View3D_UVManipulation(bpy.types.Panel):
ops.show_dialog = False
elif sc.muv_world_scale_uv_mode == 'SCALING_DENSITY':
- sp = box.split(factor=0.4)
+ sp = compat.layout_split(box, 0.4)
col = sp.column(align=True)
col.label(text="Source:")
- sp = sp.split(factor=1.0)
+ sp = compat.layout_split(sp, 1.0)
col = sp.column(align=True)
col.operator(MUV_OT_WorldScaleUV_Measure.bl_idname,
text="Measure")
- sp = box.split(factor=0.7)
+ sp = compat.layout_split(box, 0.7)
col = sp.column(align=True)
col.prop(sc, "muv_world_scale_uv_src_density", text="Density")
col.enabled = False
- sp = sp.split(factor=1.0)
+ sp = compat.layout_split(sp, 1.0)
col = sp.column(align=True)
col.label(text="px2/cm2")
@@ -183,22 +181,22 @@ class MUV_PT_View3D_UVManipulation(bpy.types.Panel):
sc.muv_world_scale_uv_tgt_scaling_factor
elif sc.muv_world_scale_uv_mode == 'PROPORTIONAL_TO_MESH':
- sp = box.split(factor=0.4)
+ sp = compat.layout_split(box, 0.4)
col = sp.column(align=True)
col.label(text="Source:")
- sp = sp.split(factor=1.0)
+ sp = compat.layout_split(sp, 1.0)
col = sp.column(align=True)
col.operator(MUV_OT_WorldScaleUV_Measure.bl_idname,
text="Measure")
- sp = box.split(factor=0.7)
+ sp = compat.layout_split(box, 0.7)
col = sp.column(align=True)
col.prop(sc, "muv_world_scale_uv_src_mesh_area",
text="Mesh Area")
col.prop(sc, "muv_world_scale_uv_src_uv_area", text="UV Area")
col.prop(sc, "muv_world_scale_uv_src_density", text="Density")
col.enabled = False
- sp = sp.split(factor=1.0)
+ sp = compat.layout_split(sp, 1.0)
col = sp.column(align=True)
col.label(text="cm2")
col.label(text="px2")