62 mevis.MLAB.log(message)
67 mevis.MLAB.logError(message)
80 field = self.
__ctx.field(fieldName)
83 self.
_logError(
"Field (%s) not found in the used context!" % (fieldName))
86 fieldType = field.type
87 if (fieldType
in (
'Trigger'))
or fieldValue
is None:
89 self.
_logInfo(
"Touched field %s" % (fieldName))
100 self.
_logInfo(
"Set field %s to value %s" % (fieldName, fieldValue))
111 field = self.
__ctx.field(fieldName)
114 self.
_logError(
"Field (%s) not found in the used context!" % (fieldName))
133 field = self.
__ctx.field(fieldName)
146 if 'Vector6' in field.type:
147 return field.stringValue()
148 elif 'MLBase' in field.type:
149 return field.object()
154 if 'Vector6' in field.type:
155 if isinstance(fieldValue, (str, bytes)):
156 field.setStringValue(fieldValue)
158 field.setVectorValue(fieldValue)
159 elif 'MLBase' in field.type:
160 field.setObject(fieldValue)
162 field.value = fieldValue
Class to handle field changes and make them revertable.
setFieldValue(self, fieldName, fieldValue, verbose=False)
Set the value of a field.
__del__(self)
The default destructor.
addField(self, fieldName, verbose=False)
Add a field and its value without setting it.
enableAutoRevert(self, enable)
revert(self)
Revert all changes made.
__init__(self, context)
The default constructor.
autoRevert(self)
Revert all changes made if auto-revert is enabled.
setFieldValue(field, fieldValue)