[Tutor] writing the correct map names

2007-09-14 Thread Paul Coones

# Test for maps
#if faceUV = 0:

texture_map = "NULL.TIF"

if me.hasVertexUV():
print "must be a 
texture map!"
texture_map = 
current_obj.name
texture_map = texture_map 
+ ".TIF"



smf_file.write(str(texture_map 
+ '\n'))

#if not map:
bump_map = '"null.bump.tif"'
if me.hasVertexUV():
print"must be a bump 
map!"
bump_map = 
current_obj.name
bump_map = bump_map + 
"_bump.TIF"


smf_file.write(str(bump_map + 
'\n'))

1.00,0.500,0.500,0,1,NULL.TIF
"null.bump.tif"
-7.028856,3.349522,4.785803,0.23,0.46, 
-0.46,0.00,0.00


When I do have a mapped object, the script is not putting in the map  
name nor the bump map name.
What am I missing? The python script is for the 3D graphics program  
Blender, which is free.___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] How do I add uvs to each vert line if a texture/bump map is used?

2007-09-14 Thread Paul Coones
C3DModel
4
2
0,50
Cube
1
1
8,1,12,0
v1
1.00,0.500,0.500,0,1,NULL.TIF
"null.bump.tif"
-7.028856,3.349522,4.785803,0.23,0.46, 
-0.46,0.00,0.00
-7.028856,1.349522,4.785803,0.816492,-0.408246, 
-0.408246,0.00,0.00
-9.028855,1.349522,4.785803,-0.577349,-0.577349, 
-0.577349,0.00,0.00
-9.028855,3.349522,4.785803,-0.577349,0.577349, 
-0.577349,0.00,0.00
-7.028855,3.349521,6.785803,0.46,0.23,0.46,0.00,0.00
-7.028856,1.349521,6.785803,0.408246, 
-0.816492,0.408246,0.00,0.00
-9.028855,1.349522,6.785803,-0.408246, 
-0.408246,0.816492,0.00,0.00
-9.028855,3.349522,6.785803, 
-0.46,0.46,0.23,0.00,0.00
  4, 0, 7
  0, 3, 7
  2, 6, 7
  2, 7, 3
  1, 5, 2
  5, 6, 2
  0, 4, 1
  4, 5, 1
  4, 7, 6
  4, 6, 5
  0, 1, 2
  0, 2, 3
Plane
1
1
4,1,2,0
v1
1.00,0.500,0.500,0,1,NULL.TIF
"null.bump.tif"
0.991230,-2.242427,0.00,0.00,0.00,1.00,0.00,0.00
0.991230,-4.242427,0.00,0.00,0.00,1.00,0.00,0.00
-1.008770, 
-4.242427,0.00,0.00,0.00,1.00,0.00,0.00
-1.008770, 
-2.242426,0.00,0.00,0.00,1.00,0.00,0.00
  0, 3, 2
  0, 2, 1

NOTE: each vert line contains x,y,z,nx,ny,nz,u,v
Location of smf_export.py file on savefile:
http://www.savefile.com/files/1054095

Thanks, Paul ( upretirementman )

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor