parameters: (mesh, target)
docstring: Building of meshes is a bit specific.
  
      We override here the various datasets that can
      not be process as regular fields.
  
      For instance, the length of the normals array is
      mNumVertices (no mNumNormals is available)
docstring_summary: Building of meshes is a bit specific.
docstring_tokens: Building of meshes is a bit specific .
function: def _finalize_mesh(mesh, target):
      """ Building of meshes is a bit specific.
  
      We override here the various datasets that can
      not be process as regular fields.
  
      For instance, the length of the normals array is
      mNumVertices (no mNumNormals is available)
      """
      nb_vertices = getattr(mesh, "mNumVertices")
  
      def fill(name):
          mAttr = getattr(mesh, name)
          if numpy:
              if mAttr:
                  data = numpy.array([make_tuple(getattr(mesh, name)[i]) for i in range(nb_vertices)], dtype=numpy.float32)
                  setattr(target, name[1:].lower(), data)
              else:
                  setattr(target, name[1:].lower(), numpy.array([], dtype="float32"))
          else:
              if mAttr:
                  data = [make_tuple(getattr(mesh, name)[i]) for i in range(nb_vertices)]
                  setattr(target, name[1:].lower(), data)
              else:
                  setattr(target, name[1:].lower(), [])
  
      def fillarray(name):
          mAttr = getattr(mesh, name)
  
          data = []
          for index, mSubAttr in enumerate(mAttr):
              if mSubAttr:
                  data.append([make_tuple(getattr(mesh, name)[index][i]) for i in range(nb_vertices)])
  
          if numpy:
              setattr(target, name[1:].lower(), numpy.array(data, dtype=numpy.float32))
          else:
              setattr(target, name[1:].lower(), data)
  
      fill("mNormals")
      fill("mTangents")
      fill("mBitangents")
  
      fillarray("mColors")
      fillarray("mTextureCoords")
  
      # prepare faces
      if numpy:
          faces = numpy.array([f.indices for f in target.faces], dtype=numpy.int32)
      else:
          faces = [f.indices for f in target.faces]
      setattr(target, 'faces', faces)
function_tokens: def _finalize_mesh ( mesh , target ) : nb_vertices = getattr ( mesh , "mNumVertices" ) def fill ( name ) : mAttr = getattr ( mesh , name ) if numpy : if mAttr : data = numpy . array ( [ make_tuple ( getattr ( mesh , name ) [ i ] ) for i in range ( nb_vertices ) ] , dtype = numpy . float32 ) setattr ( target , name [ 1 : ] . lower ( ) , data ) else : setattr ( target , name [ 1 : ] . lower ( ) , numpy . array ( [ ] , dtype = "float32" ) ) else : if mAttr : data = [ make_tuple ( getattr ( mesh , name ) [ i ] ) for i in range ( nb_vertices ) ] setattr ( target , name [ 1 : ] . lower ( ) , data ) else : setattr ( target , name [ 1 : ] . lower ( ) , [ ] ) def fillarray ( name ) : mAttr = getattr ( mesh , name ) data = [ ] for index , mSubAttr in enumerate ( mAttr ) : if mSubAttr : data . append ( [ make_tuple ( getattr ( mesh , name ) [ index ] [ i ] ) for i in range ( nb_vertices ) ] ) if numpy : setattr ( target , name [ 1 : ] . lower ( ) , numpy . array ( data , dtype = numpy . float32 ) ) else : setattr ( target , name [ 1 : ] . lower ( ) , data ) fill ( "mNormals" ) fill ( "mTangents" ) fill ( "mBitangents" ) fillarray ( "mColors" ) fillarray ( "mTextureCoords" ) # prepare faces if numpy : faces = numpy . array ( [ f . indices for f in target . faces ] , dtype = numpy . int32 ) else : faces = [ f . indices for f in target . faces ] setattr ( target , 'faces' , faces )