Module nif_common :: Class NifConfig
[hide private]
[frames] | no frames]

Class NifConfig

source code

Class which handles configuration of nif import and export in Blender.

Important: keep every instance of this class in a global variable (otherwise gui elements might go out of skope which will crash Blender).

Instance Methods [hide private]
 
__init__(self)
Initialize and load configuration.
source code
 
run(self, target, filename, callback)
Run the config gui.
source code
 
save(self)
Save and validate configuration to Blender registry.
source code
 
load(self)
Load the configuration stored in the Blender registry and checks configuration for incompatible values.
source code
 
eventId(self, event_name)
Return event id from event name, and register event if it is new.
source code
 
drawYSep(self)
Vertical skip.
source code
 
drawNextColumn(self)
Start a new column.
source code
 
drawSlider(self, text, event_name, min_val, max_val, callback, val=None, num_items=1, item=0)
Draw a slider.
source code
 
drawLabel(self, text, event_name, num_items=1, item=0)
Draw a line of text.
source code
 
drawList(self, text, event_name_prefix, val)
Create elements to select a list of things.
source code
 
drawToggle(self, text, event_name, val=None, num_items=1, item=0)
Draw a toggle button.
source code
 
drawPushButton(self, text, event_name, num_items=1, item=0)
Draw a push button.
source code
 
drawNumber(self, text, event_name, min_val, max_val, callback, val=None, num_items=1, item=0)
Draw an input widget for numbers.
source code
 
drawFileBrowse(self, text, event_name_prefix, val=None)
Create elements to select a file.
source code
 
drawString(self, text, event_name, max_length, callback, val=None, num_items=1, item=0)
Create elements to input a string.
source code
 
guiDraw(self)
Draw config GUI.
source code
 
guiButtonEvent(self, evt)
Event handler for buttons.
source code
 
guiEvent(self, evt, val)
Event handler for GUI elements.
source code
 
guiExit(self)
Close config GUI and call callback function.
source code
 
addTexturePath(self, texture_path) source code
 
updateTexpathCurrent(self)
Update self.texpathCurrent string.
source code
 
selectKeyframeFile(self, keyframefile) source code
 
selectEgmFile(self, egmfile) source code
 
updateLogLevel(self, evt, val) source code
 
updateScale(self, evt, val) source code
 
updateBonesPerPartition(self, evt, val) source code
 
updateObBSXFlags(self, evt, val) source code
 
updateObMaterial(self, evt, val) source code
 
updateObLayer(self, evt, val) source code
 
updateObMass(self, evt, val) source code
 
updateObMotionSystem(self, evt, val) source code
 
updateObQualityType(self, evt, val) source code
 
updateObUnknownByte1(self, evt, val) source code
 
updateObUnknownByte2(self, evt, val) source code
 
updateObWind(self, evt, val) source code
 
updateAnimSequenceName(self, evt, val) source code
 
updateEgmAnimScale(self, evt, val) source code
Class Variables [hide private]
  WELCOME_MESSAGE = 'Blender NIF Scripts 2.5.0 (running on Blend...
  CONFIG_NAME = 'nifscripts'
  TARGET_IMPORT = 0
  TARGET_EXPORT = 1
  XORIGIN = 50
  XCOLUMNSKIP = 390
  XCOLUMNSEP = 10
  YORIGIN = -40
  YLINESKIP = 20
  YLINESEP = 10
  DEFAULTS = {'EPSILON': 0.005, 'EXPORT_ANIMATION': 0, 'EXPORT_A...
Method Details [hide private]

drawList(self, text, event_name_prefix, val)

source code 

Create elements to select a list of things.

Registers events PREFIX_ITEM, PREFIX_PREV, PREFIX_NEXT, PREFIX_REMOVE and PREFIX_ADD.

drawFileBrowse(self, text, event_name_prefix, val=None)

source code 

Create elements to select a file.

Registers events PREFIX_ITEM, PREFIX_REMOVE, PREFIX_ADD.


Class Variable Details [hide private]

WELCOME_MESSAGE

Value:
'Blender NIF Scripts 2.5.0 (running on Blender 249, PyFFI 2.0.6)'

DEFAULTS

Value:
{'EPSILON': 0.005,
 'EXPORT_ANIMATION': 0,
 'EXPORT_ANIMSEQUENCENAME': '',
 'EXPORT_BHKLISTSHAPE': False,
 'EXPORT_BONESPERPARTITION': 18,
 'EXPORT_BONESPERVERTEX': 4,
 'EXPORT_EXTRA_SHADER_TEXTURES': True,
 'EXPORT_FILE': '/usr/bin/export.nif',
...