import mathutils
import os
+import sys
import time
import functools
+# \e$B%U%!%$%k%7%9%F%`$NJ8;z%3!<%I\e(B
+# \e$B2~B$HG$H$N6&MQ$N$?$a\e(B
+FS_ENCODING=sys.getfilesystemencoding()
+if os.path.exists(os.path.dirname(sys.argv[0])+"/utf8"):
+ INTERNAL_ENCODING='utf-8'
+else:
+ INTERNAL_ENCODING=FS_ENCODING
+
+
###############################################################################
# ProgressBar
###############################################################################
material.specular_hardness=int(m.shinness)
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
bpy.ops.object.location_apply()
return dumy.data, dumy
+def objectDelete(scene, obj):
+ scene.objects.unlink(obj)
+
def faceVertexCount(face):
return len(face.verts)
constraint.target=armature_object
constraint.subtarget=effector_name
constraint.use_tail=False
+ # not used. place folder when export.
+ constraint.weight=ik.weight
+ constraint.iterations=ik.iterations * 10
return constraint
def createArmatureBone(armature, name):
def shapeKeyAssign(shapeKey, index, pos):
shapeKey.data[index].co=pos
+def objectIsVisible(obj):
+ return obj.restrict_view
+
+def meshVertexGroupNames(meshObject):
+ for g in meshObject.vertex_groups:
+ yield g.name
+
+def faceNormal(face):
+ return face.normal
+
+def meshFaceUv(mesh, i, face):
+ return mesh.uv_textures[0].data[i].uv
+
+def armatureModifierGetObject(m):
+ return m.object
+
+def objectHasShapeKey(o):
+ return o.data.shape_keys
+
+def objectShapeKeys(o):
+ return o.data.shape_keys.keys
+
+def meshVertexGroup(meshObject, name):
+ for i, v in enumerate(meshObject.data.verts):
+ for g in v.groups:
+ if meshObject.vertex_groups[g.group].name==name:
+ yield(i)
+
+def materialGet(scene, material_name):
+ return bpy.data.materials[material_name]
+
+def modifierIsArmature(m):
+ return m.type=="ARMATURE"
+
+def boneHeadLocal(b):
+ return b.head_local[0:3]
+
+def boneTailLocal(b):
+ return b.tail_local[0:3]
+
+def boneIsConnected(b):
+ return b.connected
+
+def constraintIsIKSolver(c):
+ return c.type=='IK'
+
+def ikChainLen(c):
+ return c.chain_length
+
+def ikTarget(c):
+ return c.subtarget
+
+def ikItration(c):
+ return c.iterations
+
+def ikRotationWeight(c):
+ return c.weight
+
+def shapeKeyGet(b, index):
+ return b.data[index].co
+
+def shapeKeys(b):
+ for k in b.data:
+ yield k.co
+