Python Reference Guide
 
Loading...
Searching...
No Matches
BasicOperations\FBConfigFile.py
1# Copyright 2009 Autodesk, Inc. All rights reserved.
2# Use of this software is subject to the terms of the Autodesk license agreement
3# provided at the time of installation or download, or which otherwise accompanies
4# this software in either electronic or hard copy form.
5#
6# Script description:
7# Opens Motionbuilder preference file and edit it.
8#
9# Topic: FBConfigFile
10#
11
12from pyfbsdk import FBApplication, FBSystem, FBConfigFile
13
14lApplication = FBApplication()
15lSystem = FBSystem()
16lconfig = FBConfigFile("@Application.txt")
17
18# Updating the Undo value to 50,
19lconfig.Set("Undo", "UndoLevel", "50", "Default is 10")
20
21# Getting the Keyboard mapping choice
22lvalue = lconfig.Get("Keyboard", "Default")
23print(lvalue)
24if not (lvalue == "MotionBuilder"):
25 print("Value is being updated")
26 lconfig.Set("Keyboard", "Default", "MotionBuilder")
27
28# This is how you clear the file, not recommended unless you have a back up of the original
29#lconfig.ClearFile()
30
31del (FBApplication, FBSystem, FBConfigFile, lApplication, lSystem, lconfig, lvalue)
FBApplication is used mainly to manage files.
Definition: pyfbsdk_generated.h:801
Interface to the application config files.
Definition: pyfbsdk_generated.h:4732
Provides access to the underlying system, and the MotionBuilder scene.
Definition: pyfbsdk_generated.h:18771