本文整理汇总了Python中FxStudio.setCurrentTime方法的典型用法代码示例。如果您正苦于以下问题:Python FxStudio.setCurrentTime方法的具体用法?Python FxStudio.setCurrentTime怎么用?Python FxStudio.setCurrentTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FxStudio
的用法示例。
在下文中一共展示了FxStudio.setCurrentTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_poses
# 需要导入模块: import FxStudio [as 别名]
# 或者: from FxStudio import setCurrentTime [as 别名]
def update_poses(progress=None):
"""Creates or updates the poses in an actor's face graph. """
options = PluginOptions()
pose_names = _get_pose_names(options.betf_abs_path, options.keyframes)
frame_rate = options.framerate
with PreviewAnimation(config.POSE_ANIM_NAME):
# Set the rest pose in FaceFX Studio.
if progress:
progress.update(0.44)
FxStudio.setCurrentTime(0.0)
commands.set_rest_pose()
# Create the bone poses in FaceFX Studio.
if len(pose_names) > 0:
if progress:
progress.update(0.48)
_create_poses(pose_names, frame_rate)
commands.flush_undo_redo_buffers()
return pose_names is not None
示例2: _create_poses
# 需要导入模块: import FxStudio [as 别名]
# 或者: from FxStudio import setCurrentTime [as 别名]
def _create_poses(pose_names, frame_rate):
""" Creates poses for every frame from either the batch export text file,
or if that was not provided, for every keyed frame in the FBX. """
with WarningForwarder():
# Set the bone weights to zero so the skeleton will move as we tick through
# the frames in the batch export file.
with CommandBatcher('-addednodes -changedbones'):
commands.set_all_boneweights_to(0.0)
inv_frame_rate = 1.0 / frame_rate
for pose_name, frame_number in pose_names:
# Seek to the current time.
FxStudio.setCurrentTime(frame_number * inv_frame_rate)
# Place the state of the character into a pose.
commands.export_frame(pose_name)
# Set the bone weights back to the default of 1.
commands.set_all_boneweights_to(1.0)
# After the batch of commands succeeds, prune bones that did not move from
# the rest pose.
commands.prune_rest_pose()