@ -285,21 +285,31 @@ class MeshConverter:
geoVertex . normal = hsVector3 ( * tessface . normal )
geoVertex . normal = hsVector3 ( * tessface . normal )
geoVertex . color = hsColor32 ( * vertex_color )
geoVertex . color = hsColor32 ( * vertex_color )
geoVertex . uvs = [ hsVector3 ( uv [ 0 ] , 1.0 - uv [ 1 ] , 0.0 ) for uv in uvws ]
uvs = [ hsVector3 ( uv [ 0 ] , 1.0 - uv [ 1 ] , 0.0 ) for uv in uvws ]
if bumpmap is not None :
data . blender2gs [ vertex ] [ coluv ] = len ( data . vertices )
uvs . append ( dPosDu )
uvs . append ( dPosDv )
geoVertex . uvs = uvs
idx = len ( data . vertices )
data . blender2gs [ vertex ] [ coluv ] = idx
data . vertices . append ( geoVertex )
data . vertices . append ( geoVertex )
face_verts . append ( idx )
face_verts . append ( data . blender2gs [ vertex ] [ coluv ] )
else :
# If we have a bump mapping layer, then we need to add the bump gradients for
if bumpmap is not None :
# this face to the vertex's magic channels
idx = len ( uvws )
if bumpmap is not None :
geoVert = data . vertices [ data . blender2gs [ vertex ] [ coluv ] ]
num_user_uvs = len ( uvws )
# We can't edit in place :\
geoVertex = data . vertices [ data . blender2gs [ vertex ] [ coluv ] ]
uvMaps = geoVert . uvs
uvMaps [ idx ] + = dPosDu
# Unfortunately, PyHSPlasma returns a copy of everything. Previously, editing
uvMaps [ idx + 1 ] + = dPosDv
# in place would result in silent failures; however, as of python_refactor,
geoVert . uvs = uvMaps
# PyHSPlasma now returns tuples to indicate this.
geoUVs = list ( geoVertex . uvs )
geoUVs [ num_user_uvs ] + = dPosDu
geoUVs [ num_user_uvs + 1 ] + = dPosDv
geoVertex . uvs = geoUVs
face_verts . append ( data . blender2gs [ vertex ] [ coluv ] )
# Convert to triangles, if need be...
# Convert to triangles, if need be...
if len ( face_verts ) == 3 :
if len ( face_verts ) == 3 :