Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons-contrib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-addons-contrib
Commits
32be0452
Commit
32be0452
authored
May 25, 2014
by
Eugenio Pignataro
Browse files
Options
Downloads
Patches
Plain Diff
BugFixes and Cleanup Overlap UVs
parent
67e1ac21
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
oscurart_tools/oscurart_meshes.py
+12
-27
12 additions, 27 deletions
oscurart_tools/oscurart_meshes.py
with
12 additions
and
27 deletions
oscurart_tools/oscurart_meshes.py
+
12
−
27
View file @
32be0452
...
...
@@ -277,6 +277,8 @@ class OscObjectToMesh(bpy.types.Operator):
def
DefOscOverlapUv
(
valprecision
):
inicio
=
time
.
time
()
mode
=
bpy
.
context
.
object
.
mode
bpy
.
ops
.
object
.
mode_set
(
mode
=
'
OBJECT
'
,
toggle
=
False
)
ob
=
bpy
.
context
.
object
...
...
@@ -287,7 +289,7 @@ def DefOscOverlapUv(valprecision):
polydict
=
{
redondeo
(
poly
.
center
[:])
:
poly
for
poly
in
ob
.
data
.
polygons
}
vertdict
=
{
redondeo
(
vert
.
co
[:])
:
vert
for
vert
in
ob
.
data
.
vertices
}
polyeq
=
{
indice
.
index
:
polydict
[
absol
(
center
)].
index
for
center
,
indice
in
polydict
.
items
()
if
center
[
0
]
<
=
0
polyeq
=
{
indice
.
index
:
polydict
[
absol
(
center
)].
index
for
center
,
indice
in
polydict
.
items
()
if
center
[
0
]
<
0
if
polydict
.
get
(
absol
(
center
))}
verteq
=
{
indice
.
index
:
vertdict
[
absol
(
co
)].
index
for
co
,
indice
in
vertdict
.
items
()
if
co
[
0
]
<=
0
if
vertdict
.
get
(
absol
(
co
))}
...
...
@@ -295,35 +297,17 @@ def DefOscOverlapUv(valprecision):
dict
=
{
poly
.
index
:
{
ob
.
data
.
loops
[
vertex
].
vertex_index
:
vertex
for
vertex
in
poly
.
loop_indices
}
for
poly
in
ob
.
data
.
polygons
}
for
poly
,
data
in
dict
.
items
():
if
ob
.
data
.
polygons
[
poly
].
center
.
x
<=
0
:
poly
,
data
polyeq
[
poly
],
dict
[
polyeq
[
poly
]]
for
ind
in
data
:
ind
,
verteq
[
ind
]
data
[
ind
],
dict
[
polyeq
[
poly
]][
verteq
[
ind
]]
uvm
.
data
[
data
[
ind
]].
uv
=
uvm
.
data
[
dict
[
polyeq
[
poly
]][
verteq
[
ind
]]].
uv
if
ob
.
data
.
polygons
[
poly
].
center
.
x
<
0
and
polyeq
.
get
(
poly
):
for
vertice
,
vertex
in
data
.
items
():
if
len
(
dict
[
poly
])
==
len
(
dict
[
polyeq
[
poly
]])
and
verteq
.
get
(
vertice
):
# DEBUG
source
,
target
=
dict
[
poly
][
vertice
]
,
dict
[
polyeq
[
poly
]][
verteq
[
vertice
]]
uvm
.
data
[
target
].
uv
=
uvm
.
data
[
source
].
uv
bpy
.
ops
.
object
.
mode_set
(
mode
=
mode
,
toggle
=
False
)
print
(
"
Time elapsed: %4s seconds
"
%
(
time
.
time
()
-
inicio
))
"""
rd = 4
ACTOBJ = bpy.context.object
inicio= time.time()
bpy.ops.mesh.faces_mirror_uv(direction=
'
POSITIVE
'
, precision=valprecision)
bpy.ops.object.mode_set(mode=
'
OBJECT
'
)
SELUVVERT = [ver for ver in ACTOBJ.data.uv_layers[ACTOBJ.data.uv_textures.active.name].data[:] if ver.select]
MAY = [ver for ver in SELUVVERT if ver.uv[0] > .5]
for vl in MAY:
vl.uv = (1-vl.uv[0],vl.uv[1])
bpy.ops.object.mode_set(mode=
'
EDIT
'
)
print
(
"
Time elapsed: %4s seconds
"
%
(
time
.
time
()
-
inicio
))
print(
"
Time elapsed: %4s seconds
"
% (time.time()-inicio))
"""
class
OscOverlapUv
(
bpy
.
types
.
Operator
):
bl_idname
=
"
mesh.overlap_uv_faces
"
...
...
@@ -421,3 +405,4 @@ class ModalIndexOperator(bpy.types.Operator):
self
.
report
({
"
WARNING
"
},
"
Is not a 3D Space
"
)
return
{
'
CANCELLED
'
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment