Mercurial > hg > Game > Cerium
changeset 1237:3c7e09953326 draft
delete codes for debuged
author | kazz <kazz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 20 Oct 2011 23:54:30 +0900 |
parents | bf913abaed15 |
children | 8c2711796060 |
files | SceneGraph/BlenderScript/export_xml3.py |
diffstat | 1 files changed, 1 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/SceneGraph/BlenderScript/export_xml3.py Thu Oct 20 23:35:23 2011 +0900 +++ b/SceneGraph/BlenderScript/export_xml3.py Thu Oct 20 23:54:30 2011 +0900 @@ -26,18 +26,10 @@ ###################################################### import math -#import subprocess import os -#import Blender import struct import base64 import bpy -#from Blender import NMesh, Scene, Object, Material, Texture, Window -#from Blender import sys as bsys, Mathutils, Draw, BGL -#from Blender.sys import * - -import sys -import codecs global anim anim = 0 @@ -87,7 +79,6 @@ #exporting an anime ###change -#def export_anime(object_name): def export_anime(object_name,file): startF = Blender.Get('staframe') endF = Blender.Get('endframe') @@ -131,7 +122,6 @@ # exporting a mesh ##change -#def exportMesh(mesh, obj): def exportMesh(mesh, obj, file): vdata = [] # list of [ii0, ii1, ii2, ...] lists indexed by Blender-Vertex-index @@ -255,11 +245,8 @@ normal = face.normal uvs = [] if mesh.uv_texture_stencil and mesh.uv_texture_stencil.data.values() != []: - print(mesh.uv_texture_stencil.data) uv_tex = mesh.uv_texture_stencil.data[face.index] uvs = [uv_tex.uv1, uv_tex.uv2, uv_tex.uv3, uv_tex.uv4] - print(len(uvs)) - print(len(face.vertices)) if len(uvs) == len(face.vertices): uv = uvs[vi] else: @@ -342,32 +329,25 @@ if derived == None: continue for ob_derived, mat in derived: -# for ob_derived, mat in getDerivedObjects(ob, False): - if ob.type not in ('MESH', 'CURVE', 'SURFACE', 'TEXT', 'META'): continue -# data = ob_derived.to_mesh(sce, True, 'PREVIEW') data = bpy.data.meshes[ob_derived.name] -# data.uv_texture_stencil = bpy.data.meshes[ob_derived.name].uv_texture_stencil -# data = getMeshFromObject(ob_derived, None, True, False, sce) + if data: data.transform(mat) -# data.transform(mat, recalc_normals=False) mesh_objects.append((ob_derived, data)) mat_ls = data.materials mat_ls_len = len(mat_ls) # get material/image tuples. if len(data.uv_textures): -# if data.faceUV: if not mat_ls: mat = mat_name = None for f, uf in zip(data.faces, data.uv_texture_stencil.data): if mat_ls: mat_index = f.material_index -# mat_index = f.mat if mat_index >= mat_ls_len: mat_index = f.mat = 0 mat = mat_ls[mat_index] @@ -376,7 +356,6 @@ # else there alredy set to none img = uf.image -# img = f.image if img: img_name = img.name else: img_name = None @@ -391,7 +370,6 @@ # Why 0 Why! for f in data.faces: if f.material_index >= mat_ls_len: -# if f.mat >= mat_ls_len: f.material_index = 0 # f.mat = 0