Cloning a SubGeometry gives an error:

TypeError: Error #1009: Cannot access a property or method of a null object 
reference.

at line 261:

public function clone() : SubGeometry
{
var clone : SubGeometry = new SubGeometry();
clone.updateVertexData(_vertices.concat());
clone.updateUVData(_uvs.concat());
clone.updateSecondaryUVData(_secondaryUvs.concat());// This line
clone.updateIndexData(_indices.concat());
if (!_autoDeriveVertexNormals) 
clone.updateVertexNormalData(_vertexNormals.concat());
if (!_autoDeriveVertexTangents) 
clone.updateVertexTangentData(_vertexTangents.concat());
return clone;
}

And if i trace the _secondaryUvs, it returns null.
Source:

var primCube:Cube = new Cube(new ColorMaterial(0x888888), CUBESIZE, 
CUBESIZE, CUBESIZE);
_view.scene.addChild(primCube)

var cubeSubGeom:SubGeometry = primCube.geometry.subGeometries[0];
var newSubGeom:SubGeometry = cubeSubGeom.clone();

Reply via email to