本文整理汇总了Python中FxStudio.isNoSave方法的典型用法代码示例。如果您正苦于以下问题:Python FxStudio.isNoSave方法的具体用法?Python FxStudio.isNoSave怎么用?Python FxStudio.isNoSave使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FxStudio
的用法示例。
在下文中一共展示了FxStudio.isNoSave方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: load
# 需要导入模块: import FxStudio [as 别名]
# 或者: from FxStudio import isNoSave [as 别名]
def load():
""" Load the plugin.
"""
if not FxStudio.isCommandLineMode():
# Use this code to add one menu item.
PluginManagerUI.add_export_menu_item(collapsedxmlexporter.MENU_EXPORT_ID,
'Export Collapsed XML Actor...',
collapsedxmlexporter.on_menu_export)
if FxStudio.isNoSave():
PluginManagerUI.disable_export_menu_item(collapsedxmlexporter.MENU_EXPORT_ID)
示例2: on_menu_export
# 需要导入模块: import FxStudio [as 别名]
# 或者: from FxStudio import isNoSave [as 别名]
def on_menu_export(event_id):
""" Called when the user selects the menu option to export collapsed xml.
"""
if FxStudio.isNoSave():
FxStudio.error('This operation is disabled in no-save.')
else:
if FxStudio.containsUnsavedChanges():
FxStudio.error('Please save the actor before continuing.')
else:
actor_path = FxStudio.getActorPath()
if len(actor_path) > 0:
initial_xml_path = re.sub('\.facefx', '.xml', actor_path)
xml_file = FxStudio.displayFileSaveDialog(msg='Export FaceFX Actor to XML',\
default_path=os.path.dirname(initial_xml_path),\
default_filename=os.path.basename(initial_xml_path),\
wildcard='Actor XML Files (*.xml)|*.xml',\
confirm_overwrite=True)
if xml_file is not None:
_export_collapsed_xml(actor_path, xml_file)
else:
FxStudio.error('Please save the actor before continuing.')