Returning to the previous way of uv-mapping reading (the new one apparently caused troubles).

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7702 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Kae..pl 14 years ago
parent 82a718e413
commit bb474ecbd2
  1. 14
      engine/src/blender/com/jme3/scene/plugins/blender/helpers/v249/MeshHelper.java

@ -156,9 +156,9 @@ public class MeshHelper extends AbstractBlenderHelper {
materialWithoutTextures = pImage.isNull(); materialWithoutTextures = pImage.isNull();
// uvs always must be added wheater we have texture or not // uvs always must be added wheater we have texture or not
uvs = (DynamicArray<Number>) mtFace.getFieldValue("uv"); uvs = (DynamicArray<Number>) mtFace.getFieldValue("uv");
uvCoordinates.add(new Vector2f(uvs.get(0, 0).floatValue(), 1.0f - uvs.get(0, 1).floatValue())); uvCoordinates.add(new Vector2f(uvs.get(0, 0).floatValue(), uvs.get(0, 1).floatValue()));
uvCoordinates.add(new Vector2f(uvs.get(1, 0).floatValue(), 1.0f - uvs.get(1, 1).floatValue())); uvCoordinates.add(new Vector2f(uvs.get(1, 0).floatValue(), uvs.get(1, 1).floatValue()));
uvCoordinates.add(new Vector2f(uvs.get(2, 0).floatValue(), 1.0f - uvs.get(2, 1).floatValue())); uvCoordinates.add(new Vector2f(uvs.get(2, 0).floatValue(), uvs.get(2, 1).floatValue()));
} }
int matNr = ((Number) mFace.getFieldValue("mat_nr")).intValue(); int matNr = ((Number) mFace.getFieldValue("mat_nr")).intValue();
Integer materialNumber = Integer.valueOf(materialWithoutTextures ? -1 * matNr - 1 : matNr); Integer materialNumber = Integer.valueOf(materialWithoutTextures ? -1 * matNr - 1 : matNr);
@ -202,9 +202,9 @@ public class MeshHelper extends AbstractBlenderHelper {
if (v4 > 0) { if (v4 > 0) {
if (uvs != null) { if (uvs != null) {
uvCoordinates.add(new Vector2f(uvs.get(0, 0).floatValue(), 1.0f - uvs.get(0, 1).floatValue())); uvCoordinates.add(new Vector2f(uvs.get(0, 0).floatValue(), uvs.get(0, 1).floatValue()));
uvCoordinates.add(new Vector2f(uvs.get(2, 0).floatValue(), 1.0f - uvs.get(2, 1).floatValue())); uvCoordinates.add(new Vector2f(uvs.get(2, 0).floatValue(), uvs.get(2, 1).floatValue()));
uvCoordinates.add(new Vector2f(uvs.get(3, 0).floatValue(), 1.0f - uvs.get(3, 1).floatValue())); uvCoordinates.add(new Vector2f(uvs.get(3, 0).floatValue(), uvs.get(3, 1).floatValue()));
} }
this.appendVertexReference(v1, vertexList.size(), vertexReferenceMap); this.appendVertexReference(v1, vertexList.size(), vertexReferenceMap);
indexList.add(vertexList.size()); indexList.add(vertexList.size());
@ -511,7 +511,7 @@ public class MeshHelper extends AbstractBlenderHelper {
// (max. 4 in JME) // (max. 4 in JME)
Pointer pDW = (Pointer) dvert.getFieldValue("dw"); Pointer pDW = (Pointer) dvert.getFieldValue("dw");
List<Integer> vertexIndices = vertexReferenceMap.get(Integer.valueOf(vertexIndex));// we fetch the referenced vertices here List<Integer> vertexIndices = vertexReferenceMap.get(Integer.valueOf(vertexIndex));// we fetch the referenced vertices here
if (totweight > 0 && pDW.isNotNull()) {// pDW should never be null here, but I check it just in case :) if (totweight > 0 && pDW.isNotNull() && groupToBoneIndexMap!=null) {// pDW should never be null here, but I check it just in case :)
int weightIndex = 0; int weightIndex = 0;
List<Structure> dw = pDW.fetchData(dataRepository.getInputStream()); List<Structure> dw = pDW.fetchData(dataRepository.getInputStream());
for (Structure deformWeight : dw) { for (Structure deformWeight : dw) {

Loading…
Cancel
Save