#b.ik_dof_y=False
pass
- def setSphereMap(material, index, blend_type=None):
+ def setSphereMap(material, index, blend_type='MULTIPLY'):
slot=material.texture_slots[index]
- slot.texture_coordinates='REFLECTION'
+ slot.texture_coordinates='NORMAL'
slot.mapping='SPHERE'
- if blend_type:
- slot.blend_type=blend_type
+ slot.blend_type=blend_type
###############################################################################
return l.bones[0].getName()
+def get_group_name(g):
+ group_name=englishmap.getEnglishBoneGroupName(g.getName().strip())
+ if not group_name:
+ group_name=g.getName().strip()
+ return group_name
+
+
def __importToonTextures(io, tex_dir):
mesh, meshObject=bl.mesh.create('ToonTextures')
material=bl.material.create('ToonTextures')
else:
# create bone group
for i, g in enumerate(l.bone_group_list):
- name=englishmap.getEnglishBoneGroupName(g.getName().strip())
- if not name:
- name=g.getName()
+ name=get_group_name(g)
bl.object.createBoneGroup(armature_object, name, "THEME%02d" % (i+1))
# assign bone to group
bone_name=b.getName()
# group
g=l.bone_group_list[g_index-1]
- group_name=englishmap.getEnglishBoneGroupName(g.getName().strip())
- if not group_name:
- group_name=g.getName()
+ group_name=get_group_name(g)
# assign
pose.bones[bone_name].bone_group=pose.bone_groups[group_name]
material=createPmdMaterial(m, material_index)
toon_index=bl.material.addTexture(
material,
- bl.material.getTexture(toon_material, m.toon_index).texture,
+ bl.material.getTexture(
+ toon_material,
+ 0 if m.toon_index==0xFF else m.toon_index
+ ).texture,
False)
texture_name=m.getTexture()
texture, image=bl.texture.create(path)
textureMap[texture_name]=texture
imageMap[material_index]=image
- bl.material.addTexture(material, texture)
+ texture_index=bl.material.addTexture(material, texture)
if t.endswith('sph'):
# sphere map
- setSphereMap(material, i)
+ setSphereMap(material, texture_index)
elif t.endswith('spa'):
# sphere map
- setSphereMap(material, i, 'ADD')
+ setSphereMap(material, texture_index, 'ADD')
bl.mesh.addMaterial(mesh, material)
index+=1