本文整理汇总了Python中FxStudio.warn方法的典型用法代码示例。如果您正苦于以下问题:Python FxStudio.warn方法的具体用法?Python FxStudio.warn怎么用?Python FxStudio.warn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FxStudio
的用法示例。
在下文中一共展示了FxStudio.warn方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_drop
# 需要导入模块: import FxStudio [as 别名]
# 或者: from FxStudio import warn [as 别名]
def on_drop(files):
"""Handles files dropped on the viewport. """
try:
# If there is not an .fbx file present in the file list, ignore it.
if len([x for x in files if path_has_extension(x, '.fbx')]) == 0:
return
fbx_file = _get_fbx_file(files)
betf_file = _get_betf_file(files)
if not FxStudio.isActorLoaded():
FBXImporter.full_import_fbx(fbx_file, betf_file)
else:
if len(FxStudio.getFaceGraphNodeNames()) > 0:
msg = "Dragging an FBX file onto an empty actor will set up the "
msg += "character for you. Dragging an fbx file onto an actor "
msg += "with an existing face graph will update the render asset. "
msg += "No auto updating will occur. Do you want to continue?"
if FxStudio.displayYesNoBox(msg) == "yes":
FBXImporter.render_asset_only_import(fbx_file)
else:
FBXImporter.full_import_fbx(fbx_file, betf_file)
except FBXImportError as e:
FxStudio.warn(': '.join(['FBXImporter', str(e)]))
示例2: render_asset_only_import
# 需要导入模块: import FxStudio [as 别名]
# 或者: from FxStudio import warn [as 别名]
def render_asset_only_import(fbx_path):
"A simple import of the FBX as the render asset, without tracking files."
_fail_if_no_ogrefbx()
try:
with FxHelperLibrary.Progress("Importing FBX...") as progress:
progress.update(0.05)
# Convert the base FBX to a render asset. If this fails, the
# exception we will caught before any work is done from the calls
# below. The goal is to warn about the failure without changing
# anything.
import_render_asset(fbx_path, progress)
progress.update(0.7)
# Set the render asset in the actor.
update_render_asset(fbx_path)
progress.update(1.0)
# set the fbx_export_input_file console variable
FxStudio.setConsoleVariable('fbx_export_input_file', fbx_path)
# Make sure we aren't tracking files.
options = PluginOptions()
options.clear()
except (RuntimeError, FBXImportError) as e:
FxStudio.warn(': '.join(['FBXImporter', str(e)]))
示例3: oneTimeInit
# 需要导入模块: import FxStudio [as 别名]
# 或者: from FxStudio import warn [as 别名]
def oneTimeInit():
runOnceFile = FxStudio.getConsoleVariable("g_userdirectory") + "Settings\\runonce"
if os.path.exists(runOnceFile) == False:
# This is the first time Studio has been run.
if FxStudio.isCommandLineMode():
FxStudio.warn('This appears to be FaceFX Studio\'s first run.')
FxStudio.error('We still have a bit of set up left to do. Please run FaceFX Studio in normal (GUI) mode before running in command line mode.')
FxStudio.setConsoleVariable('err_cli_init', '1')
else:
runOnceFileHandle = open(runOnceFile, "w")
runOnceFileHandle.write("File to signal not to open intro content.")
runOnceFileHandle.close()
if FxStudio.displayYesNoBox("Would you be willing to help us make FaceFX Studio a better product? FaceFX Studio will prompt you to send a crash report in the event of a crash, but sometimes extra information goes a long way to helping our engineers track down an issue. In particularly rare or difficult to diagnose cases, it is helpful for our engineers to be able to contact you to discuss the issue. If you are willing to help, please answer yes to enter contact information to be sent along with crash reports.") == "yes":
contactInfoFile = FxStudio.getConsoleVariable("g_userdirectory") + "Settings\\contact-info.txt"
contactInfoPrompt = "Please enter your name and any contact information (email, phone, etc) on the single line below.\nThis information is stored in " + contactInfoFile + "\nand can be edited or removed at any time."
contactInfo = FxStudio.getTextFromUser(contactInfoPrompt, "Contact Information")
if len(contactInfo) > 0:
contactInfoFileHandle = open(contactInfoFile, "w")
contactInfoFileHandle.write(contactInfo)
contactInfoFileHandle.close()
示例4: on_idle
# 需要导入模块: import FxStudio [as 别名]
# 或者: from FxStudio import warn [as 别名]
def on_idle():
"""Called when Studio is idle. Check for updates to monitored files. """
if not FxStudio.isActorLoaded():
return
# If the notification dialog is currently visible return immediately.
if is_notification_dialog_visible():
return
try:
options = PluginOptions()
fbx_path = options.fbx_abs_path
if fbx_path:
if not os.path.exists(fbx_path):
if _update_from_relative_paths():
# update the FBX path from the new options.
fbx_path = options.fbx_abs_path
if not os.path.exists(fbx_path):
if not fbx_path in _missing_paths:
_missing_paths[fbx_path] = fbx_path
FxStudio.warn('Linked FBX file not found: {0}'.format(fbx_path))
return
fbx_anims = FBXAnims(fbx_path)
#print 'disk', fbx_anims.disk_animations
#print 'cached', fbx_anims.cached_animations
#print 'added', fbx_anims.added_animations
#print 'removed', fbx_anims.removed_animations
#print 'changed', fbx_anims.changed_animations
if _is_anything_modified(options, fbx_anims):
import_render_asset = False
update_render_asset = False
selection = wx.ID_YES
remembered_selection = get_remembered_selection()
if remembered_selection is not None:
selection = remembered_selection
else:
selection = show_notification_dialog()
if selection == wx.ID_NO:
# Update the timestamps on anything that changed to prevent
# this notification from popping up again... also run the
# render asset update but NOT the actor update.
# This has the side effect of updating the base fbx file
# timestamp.
_is_base_fbx_modified(options)
# This has the side effect of updating the batch export
# text file timestamp.
_is_betf_modified(options)
# Remove all animations from the render asset that have been
# removed from the local disk.
for path in fbx_anims.removed_animations:
FBXImporter.remove_animation(fbx_path, path)
update_render_asset = True
# If the pose animation was removed, import the render asset
# so that the system will know the poses should come from the
# base fbx file instead.
if fbx_anims.is_pose_anim_removed():
import_render_asset = True
update_render_asset = True
if import_render_asset:
with FxHelperLibrary.Progress("Synchronizing...") as progress:
progress.update(0.05)
# If a pose animation exists, the poses will come from the
# external animation. Otherwise, the poses will come from the
# base fbx.
poses_are_in_base_fbx = not fbx_anims.pose_anim_exists()
progress.update(0.1)
# Import the render asset. We ask the importer to only touch
# the internal animation if the poses will come from it.
FBXImporter.import_render_asset(fbx_path,
export_internal_animation=poses_are_in_base_fbx)
# We need to reimport all other animations without modifying
# their timestamps.
_reimport_animations(fbx_path, fbx_anims, progress)
progress.update(1.0)
# Poses may need to be updated as a result of this but
# the user specifically selected no when we asked for
# permission to do so.
if fbx_anims.is_pose_anim_modified():
# [Re]import the pose animation.
FBXImporter.import_animation(fbx_path,
fbx_anims.get_pose_anim_path())
update_render_asset = True
if fbx_anims.is_other_anim_modified():
# [Re]import all of the other animations.
for path in fbx_anims.get_updated_animations_ex_pose_anim():
FBXImporter.import_animation(fbx_path, path)
update_render_asset = True
#.........这里部分代码省略.........
示例5: full_import_fbx
# 需要导入模块: import FxStudio [as 别名]
# 或者: from FxStudio import warn [as 别名]
def full_import_fbx(fbx_path, batch_export_path=None):
"""Imports an FBX file from a path.
parameters:
fbx_path -- Fully-qualified path to an FBX file.
batch_export_path [optional] -- If parameter is not provided, a dialog will
be displayed asking the user to browse for the batch export text file.
If the path is known, the dialog can be bypassed by providing the path
as a parameter to this function. If you only wish to import a render
asset without importing bone poses, passing the empty string as the path
will do the trick.
side effects:
- If no actor is loaded in Studio, a new actor is created.
- The render asset is changed to the imported FBX assets.
- If a batch export text file is selected, the bone poses are loaded from
the FBX file.
"""
try:
# Prerequisites
_fail_if_no_ogrefbx()
_ensure_exists_actor()
_ensure_exists_importer_cache()
if batch_export_path is None:
batch_export_path = _get_betf_path_from_user()
# Cache the FBX and BETF path
options = PluginOptions()
options.betf_abs_path = batch_export_path
options.betf_rel_path = make_relative_to_clientspec_root(batch_export_path)
# Set the fbx_export_input_file console variable to the fbx file.
FxStudio.setConsoleVariable('fbx_export_input_file', fbx_path)
with FxHelperLibrary.Progress("Importing FBX...") as progress:
progress.update(0.05)
# Convert the base FBX to a render asset.
import_render_asset(fbx_path, progress)
# Update the options. This will enable automatic updating
options.fbx_abs_path = fbx_path
options.fbx_rel_path = make_relative_to_clientspec_root(fbx_path)
# Find any animations for the base FBX and add them to the render asset.
_find_and_create_animations_for(fbx_path)
progress.update(0.25)
# Set the render asset in the actor.
update_render_asset(fbx_path)
progress.update(0.3)
# Create FaceFX animations for the imported Ogre body animations.
create_ogre_anims()
if update_poses(progress):
rig_new_import()
progress.update(0.97)
with FxHelperLibrary.Unattended():
# Sync to the default template to get the color map and workspaces.
commands.sync_template(config.DEFAULT_TEMPLATE_PATH, flags='-workspaces -colormap')
commands.flush_undo_redo_buffers()
progress.update(1.0)
# Cache the correct timestamps
if os.path.exists(batch_export_path):
options.betf_modification_timestamp = os.path.getmtime(batch_export_path)
options.fbx_modification_timestamp = os.path.getmtime(fbx_path)
except (RuntimeError, FBXImportError) as e:
options.clear()
commands.flush_undo_redo_buffers()
FxStudio.warn(': '.join(['FBXImporter', str(e)]))