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:
authorCampbell Barton <ideasman42@gmail.com>2012-03-16 00:04:44 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-03-16 00:04:44 +0400
commitbbd6c6136af3f8dd6e4b9be36277c74eefdbbdf9 (patch)
tree541f8e0cbc235d7a38a3c021fd1dfadd0fe91a41 /io_scene_x3d/import_x3d.py
parent3e41f9e194e5a39ed8b072b3584b791af19e3721 (diff)
x3d now works with BMesh updates
Diffstat (limited to 'io_scene_x3d/import_x3d.py')
-rw-r--r--io_scene_x3d/import_x3d.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/io_scene_x3d/import_x3d.py b/io_scene_x3d/import_x3d.py
index 9c6986de..38cd5a05 100644
--- a/io_scene_x3d/import_x3d.py
+++ b/io_scene_x3d/import_x3d.py
@@ -1675,7 +1675,7 @@ def importMesh_IndexedFaceSet(geom, bpyima, ancestry):
# bpymesh.faces.extend(faces, smooth=True)
bpymesh.validate()
- bpymesh.update()
+ # bpymesh.update() # cant call now, because it would convert tessface
if len(bpymesh.faces) != len(faces):
print('\tWarning: adding faces did not work! file is invalid, not adding UVs or vcolors')
@@ -1687,7 +1687,7 @@ def importMesh_IndexedFaceSet(geom, bpyima, ancestry):
if coords_tex:
#print(ifs_texpoints)
# print(geom)
- uvlay = bpymesh.uv_textures.new()
+ uvlay = bpymesh.tessface_uv_textures.new()
for i, f in enumerate(uvlay.data):
f.image = bpyima
@@ -1762,7 +1762,7 @@ def importMesh_IndexedFaceSet(geom, bpyima, ancestry):
# This should be safe because when 2 axies have the same length, the lower index will be used.
axis_v += 1
- uvlay = bpymesh.uv_textures.new()
+ uvlay = bpymesh.tessface_uv_textures.new()
# HACK !!! - seems to be compatible with Cosmo though.
depth_v = depth_u = max(depth_v, depth_u)
@@ -1782,7 +1782,7 @@ def importMesh_IndexedFaceSet(geom, bpyima, ancestry):
# Add vcote
if vcolor:
# print(ifs_vcol)
- collay = bpymesh.vertex_colors.new()
+ collay = bpymesh.tessface_vertex_colors.new()
for f_idx, f in enumerate(collay.data):
fv = bpymesh.faces[f_idx].vertices[:]
@@ -1829,6 +1829,8 @@ def importMesh_IndexedFaceSet(geom, bpyima, ancestry):
# XXX25
# bpymesh.vertices.delete([0, ]) # EEKADOODLE
+ bpymesh.update()
+
return bpymesh, ccw
@@ -2169,17 +2171,17 @@ def importShape(node, ancestry, global_matrix):
if bpymat:
bpydata.materials.append(bpymat)
- if bpydata.uv_textures:
+ if bpydata.tessface_uv_textures:
if depth == 32: # set the faces alpha flag?
transp = Mesh.FaceTranspModes.ALPHA
- for f in bpydata.uv_textures.active.data:
+ for f in bpydata.tessface_uv_textures.active.data:
f.blend_type = 'ALPHA'
if texmtx:
# Apply texture transform?
uv_copy = Vector()
- for f in bpydata.uv_textures.active.data:
+ for f in bpydata.tessface_uv_textures.active.data:
fuv = f.uv
for i, uv in enumerate(fuv):
uv_copy.x = uv[0]