message='finished in %.2f sec' % (time.time()-self.start)
self.set(message, 1.0)
+def progress_start(base):
+ global progressBar
+ progressBar=ProgressBar(base)
+
+def progress_finish():
+ global progressBar
+ progressBar.finish()
+
+def progress_print(message, progress=0.05):
+ global progressBar
+ progressBar.advance(message, progress)
+
+def progress_set(message, progress):
+ global progressBar
+ progressBar.set(message, progress)
+
###############################################################################
class Writer(object):
material.diffuse_color=[m.color.r, m.color.g, m.color.b]
material.alpha=m.color.a
material.diffuse_intensity=m.diffuse
- # temporary
- material.emit=1.0
return material
def createPmdMaterial(m):
material.specular_color=([m.specular.r, m.specular.g, m.specular.b])
material.mirror_color=([m.ambient.r, m.ambient.g, m.ambient.b])
material.subsurface_scattering.enabled=True if m.flag==1 else False
- # temporary
- material.emit=1.0
return material
def createTexture(path):
def objectMakeParent(parent, child):
child.parent=parent
+def objectAddMirrorModifier(mesh_object):
+ return mesh_object.modifiers.new("Modifier", "MIRROR")
-def meshAddMqoGeometry(mesh, o, materials, imageMap, scale):
+def meshAddMqoGeometry(mesh_object, o, materials, imageMap, scale):
+ mesh=mesh_object.data
# count triangle and quadrangle
faceCount=0
for f in o.faces:
o.selected=True
scene.objects.active=o
+def objectGetActive(scene):
+ return scene.objects.active
+
def meshAddVertexGroup(meshObject, name):
meshObject.add_vertex_group(name)
layer.append(False)
bone.layer=layer
+def objectLayerMask(object, layers):
+ layer=[]
+ for i in range(20):
+ try:
+ layer.append(True if layers[i]!=0 else False)
+ except IndexError:
+ layer.append(False)
+ object.layers=layer
+
def objectPinShape(o):
o.shape_key_lock=True
def VtoV(v):
return mathutils.Vector([v.x, v.y, v.z])
+def meshSetSmooth(mesh, smoothing):
+ mesh.autosmooth_angle=int(smoothing)
+ mesh.autosmooth=True
+ mesh.calc_normals()
+