当前位置: 首页>>代码示例>>Python>>正文


Python FxStudio.setConsoleVariable方法代码示例

本文整理汇总了Python中FxStudio.setConsoleVariable方法的典型用法代码示例。如果您正苦于以下问题:Python FxStudio.setConsoleVariable方法的具体用法?Python FxStudio.setConsoleVariable怎么用?Python FxStudio.setConsoleVariable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FxStudio的用法示例。


在下文中一共展示了FxStudio.setConsoleVariable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: render_asset_only_import

# 需要导入模块: import FxStudio [as 别名]
# 或者: from FxStudio import setConsoleVariable [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)]))
开发者ID:e-johnson,项目名称:AndroidProject,代码行数:29,代码来源:FBXImporter.py

示例2: oneTimeInit

# 需要导入模块: import FxStudio [as 别名]
# 或者: from FxStudio import setConsoleVariable [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()
开发者ID:e-johnson,项目名称:AndroidProject,代码行数:23,代码来源:facefxinit.py

示例3: __exit__

# 需要导入模块: import FxStudio [as 别名]
# 或者: from FxStudio import setConsoleVariable [as 别名]
 def __exit__(self, type, value, traceback):
     FxStudio.setConsoleVariable('g_unattended', self.old_setting)
开发者ID:e-johnson,项目名称:AndroidProject,代码行数:4,代码来源:FxHelperLibrary.py

示例4: __enter__

# 需要导入模块: import FxStudio [as 别名]
# 或者: from FxStudio import setConsoleVariable [as 别名]
 def __enter__(self):
     FxStudio.setConsoleVariable('g_unattended', 1)
     return self
开发者ID:e-johnson,项目名称:AndroidProject,代码行数:5,代码来源:FxHelperLibrary.py

示例5: full_import_fbx

# 需要导入模块: import FxStudio [as 别名]
# 或者: from FxStudio import setConsoleVariable [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)]))
开发者ID:e-johnson,项目名称:AndroidProject,代码行数:83,代码来源:FBXImporter.py


注:本文中的FxStudio.setConsoleVariable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。