import AtomsHoudini
def export_static_mesh(file_path, transform, root_joint_list,
triangulate=True, include_textures=True):
AtomsHoudini.exportAtomsMesh(str(file_path), str(transform),
[str(x) for x in root_joint_list], False,
triangulate, include_textures, "", "")
def export_skinned_mesh(file_path, transform, skeleton_file,
root_joint_list, triangulate=True,
include_textures=True):
AtomsHoudini.exportAtomsMesh(str(file_path), (transform),
[str(x) for x in root_joint_list], True,
triangulate, include_textures,
str(skeleton_file),
str(root_joint_list[0]))
def export_skeleton_definition(root_joint, file_path, extra_joints):
rj = root_joint
if not rj.startswith('/obj/'):
rj = '/obj/' + root_joint
cmd = 'tcAtomsSkeletonDefinitionExporter -f %s -r %s' % (file_path, rj)
if extra_joints:
ejs = []
for e in extra_joints:
ejs.append(e if e.startswith('/obj/') else '/obj/' + e)
cmd += " -e %s" % ','.join(ejs or [])
res = hou.hscript(cmd)
def export_animation(file_path, ground_height, foot_threshold,
foot_down_from_scene, format):
cmd = ('tcAtomsSkeletonAnimationExporter -f %s -o %s -r %d -g %f -d %d'
%(file_path, foot_threshold, format, ground_height,
int(foot_down_from_scene)))
res = hou.hscript(cmd)
return res[1] if res[1] else None
def export_fbx(file_path, agent_group, ids, start, end):
cmd = ('tcAtomsExportFbx -f %s -g %s -i %s -s %d -e %d'
% (file_path, agent_group, ','.join([str(i) for i in ids]),
int(start), int(end)))
res = hou.hscript(cmd)