Index: avango-utils/python/SConscript
===================================================================
--- avango-utils/python/SConscript	(revision 357)
+++ avango-utils/python/SConscript	(revision 358)
@@ -23,4 +23,5 @@
 
 import avango.build
+import glob
 
 env = avango.build.PythonEnvironment()
@@ -32,5 +33,12 @@
 avango_utils_python_files = Split("""
     __init__.py
+    _bool_script_merge.py
+    _bool_scripts.py
+    _converter.py
+    _loadfile_scaler.py
     _MFMerger.py
+    _property_modifier.py
+    _task_scheduler.py
+    _triggers.py
     """)
 
Index: avango-utils/python/__init__.py
===================================================================
--- avango-utils/python/__init__.py	(revision 357)
+++ avango-utils/python/__init__.py	(revision 358)
@@ -24,4 +24,10 @@
 from _utils import *
 from _MFMerger import *
+from _bool_script_merge import *
+from _bool_scripts import *
+from _converter import *
+from _property_modifier import *
+from _task_scheduler import *
+from _triggers import *
 
 import avango.nodefactory
Index: avango-utils/python/_bool_script_merge.py
===================================================================
--- avango-utils/python/_bool_script_merge.py	(revision 358)
+++ avango-utils/python/_bool_script_merge.py	(revision 358)
@@ -0,0 +1,40 @@
+import avango
+import avango.script
+
+import _bool_scripts
+
+def merge_and_connect_bool_scripts(script1, script2):
+    '''
+    Merges the SFBool nodes a two avango.FieldContainers with an OR relation
+    '''
+    merged_script = avango.script.Script()
+    
+    for i in xrange(script1._get_num_fields()):
+        #get field of script1
+        script1_field = script1._get_field(i)
+        field1_name = script1_field._get_name()
+        field1_type = script1_field._get_type()
+        
+        #get corresponding field of script2
+        script2_field = script2._get_field(field1_name)
+        field2_type = script1_field._get_type()
+        
+        #check if script2 also has a filed with this name and of the same type
+        if script2_field == None and field1_type == field2_type:
+            continue
+        
+        #check if the type of the field is not SFBool and 
+        #the merged script already does not already contain a field with the given name
+        if type != "SFBool" and merged_script._get_field(field1_name):
+            continue 
+        
+        new_field = avango._avango._make_field_by_name(script1_field._get_type())
+        merged_script.add_field(new_field, field1_name)
+
+        # connect new field from node's field   
+        new_field = merged_script._get_field(field1_name)    
+#        new_field.connect_from(script1_field)
+#        new_field.connect_from(script2_field)
+        new_field.connect_from(_bool_scripts.make_bool2_or(script1_field,script2_field))
+        
+    return merged_script
Index: avango-utils/python/_bool_scripts.py
===================================================================
--- avango-utils/python/_bool_scripts.py	(revision 358)
+++ avango-utils/python/_bool_scripts.py	(revision 358)
@@ -0,0 +1,82 @@
+import avango
+import avango.script
+
+class Bool2And(avango.script.Script):
+    
+    Input1 = avango.SFBool()
+    Input2 = avango.SFBool()
+    
+    Output = avango.SFBool()
+    
+    def evaluate(self):
+        if self.Input1.value and self.Input2.value:
+            self.Output.value = True
+        else: 
+            self.Output.value = False
+            
+class Bool2Or(avango.script.Script):
+    
+    Input1 = avango.SFBool()
+    Input2 = avango.SFBool()
+    
+    Output = avango.SFBool()
+    
+    def evaluate(self):
+        if self.Input1.value or self.Input2.value:
+            self.Output.value = True
+        else: 
+            self.Output.value = False
+
+class Bool3And(avango.script.Script):
+    
+    Input1 = avango.SFBool()
+    Input2 = avango.SFBool()
+    Input3 = avango.SFBool()
+    
+    Output = avango.SFBool()
+    
+    def evaluate(self):
+        if self.Input1.value and self.Input2.value and self.Input3.value:
+            self.Output.value = True
+        else: 
+            self.Output.value = False
+            
+class Bool3Or(avango.script.Script):
+    
+    Input1 = avango.SFBool()
+    Input2 = avango.SFBool()
+    Input3 = avango.SFBool()
+    
+    Output = avango.SFBool()
+    
+    def evaluate(self):
+        if self.Input1.value or self.Input2.value or self.Input3.value:
+            self.Output.value = True
+        else: 
+            self.Output.value = False
+            
+def make_bool2_or(input1,input2):
+    bool2_or = Bool2Or()
+    bool2_or.Input1.connect_from(input1)
+    bool2_or.Input2.connect_from(input2)
+    return bool2_or.Output
+            
+def make_bool2_and(input1,input2):
+    bool2_and = Bool2And()
+    bool2_and.Input1.connect_from(input1)
+    bool2_and.Input2.connect_from(input2)
+    return bool2_and.Output
+
+def make_bool3_and(input1,input2,input3):
+    bool3_and = Bool3And()
+    bool3_and.Input1.connect_from(input1)
+    bool3_and.Input2.connect_from(input2)
+    bool3_and.Input3.connect_from(input3)
+    return bool3_and.Output
+
+def make_bool3_or(input1,input2,input3):
+    bool3_and = Bool3Or()
+    bool3_and.Input1.connect_from(input1)
+    bool3_and.Input2.connect_from(input2)
+    bool3_and.Input3.connect_from(input3)
+    return bool3_and.Output
Index: avango-utils/python/_converter.py
===================================================================
--- avango-utils/python/_converter.py	(revision 358)
+++ avango-utils/python/_converter.py	(revision 358)
@@ -0,0 +1,28 @@
+import avango
+import avango.script
+import avango.osg
+
+class Float2Add(avango.script.Script):
+    "Adds two float values"
+    
+    Value0 = avango.SFFloat()
+    Value1 = avango.SFFloat()
+    
+    Output = avango.SFFloat()
+    
+    def evaluate(self):
+        self.Output.value = self.Value0.value + self.Value1.value
+
+class Float4AddVec2Converter(avango.script.Script):
+    "Converts four Floats into a Vec2, where vec.x = Value00 + Value01 and vec.y = Value10 + Value11"
+
+    Value00 = avango.SFFloat()
+    Value01 = avango.SFFloat()
+    
+    Value10 = avango.SFFloat()
+    Value11 = avango.SFFloat()
+    
+    Output = avango.osg.SFVec2()
+
+    def evaluate(self):
+        self.Output.value = avango.osg.Vec2(self.Value00.value+self.Value01.value, self.Value10.value+self.Value11.value)
Index: avango-utils/python/_loadfile_scaler.py
===================================================================
--- avango-utils/python/_loadfile_scaler.py	(revision 358)
+++ avango-utils/python/_loadfile_scaler.py	(revision 358)
@@ -0,0 +1,34 @@
+import avango
+import avango.script
+import avango.osg
+from avango.script import field_has_changed
+
+class LoadFileScaler(avango.script.Script):
+    LoadFile = avango.osg.SFLoadFile()
+    LoadFileFinished = avango.SFString()
+    Radius = avango.SFFloat()
+    MatrixOut = avango.osg.SFMatrix()
+    
+    def __init__(self):
+        self.super(LoadFileScaler).__init__()
+        
+        self.Radius.value = 1.0
+        self.__file_loaded = False
+        
+    @field_has_changed(LoadFileFinished)
+    def loading_finished(self):
+        
+        if self.LoadFile.value.Filename.value == self.LoadFileFinished.value:
+            self.__file_loaded = True
+        
+    def evaluate(self):
+        if self.__file_loaded:
+            self.MatrixOut.value = self.calc_scale_matrix()
+            self.__file_loaded = False
+
+    def calc_scale_matrix(self):
+        b = avango.osg.calc_bounding_box(self.LoadFile.value)
+        width = b.x_max() - b.x_min()
+        scaleFactor = 1.0 /  (width);
+        scaleFactor *= self.Radius.value;
+        return avango.osg.make_scale_mat(scaleFactor,scaleFactor,scaleFactor)
Index: avango-utils/python/_property_modifier.py
===================================================================
--- avango-utils/python/_property_modifier.py	(revision 358)
+++ avango-utils/python/_property_modifier.py	(revision 358)
@@ -0,0 +1,57 @@
+import avango
+import avango.script
+
+
+class PropertyModifierInt(avango.script.Script):
+    
+    Enable = avango.SFBool()
+    
+    Property = avango.SFInt()
+    PropertyMin = avango.SFInt()
+    PropertyMax = avango.SFInt()
+    
+    TimeIn = avango.SFDouble()
+    
+    PropertyStepSize = avango.SFInt()
+    PropertyInc = avango.SFBool()
+    PropertyDec = avango.SFBool()
+    TriggerTimeDelta = avango.SFFloat()
+    
+    Triggered = avango.SFBool()
+    
+    def __init__(self):
+        self.always_evaluate(True)
+        self.last_trigger_time = TimeIn.value
+        
+        self.PropertyInc.value = False
+        self.PropertyDec.value = False
+        
+        self.Enable.value = False
+        
+        self.PropertyStepSize.value = 1
+        self.PropertyMin.value = 0
+        self.PropertyMax.value = 100000
+        self.TriggerTimeDelta.value = 0.05
+        
+    def evaluate(self):
+        
+        if (not self.PropertyInc.value and not self.PropertyDec.value) or not self.Enable.value:
+            return
+        
+        time = TimeIn.value
+        time_delta = time - self.last_trigger_time
+        if time_delta > self.TriggerTimeDelta.value:
+                        
+            if self.PropertyInc.value:
+                new_val = self.Property.value+self.PropertyStepSize.value
+                if new_val <= self.PropertyMax.value:
+                    self.Property.value = new_val
+                    self.Triggered.value = True
+                self.last_trigger_time = time
+                    
+            elif self.PropertyDec.value:
+                new_val = self.Property.value-self.PropertyStepSize.value
+                if new_val >= self.PropertyMin.value:
+                    self.Property.value = new_val
+                    self.Triggered.value = True
+                self.last_trigger_time = time
Index: avango-utils/python/_task_scheduler.py
===================================================================
--- avango-utils/python/_task_scheduler.py	(revision 358)
+++ avango-utils/python/_task_scheduler.py	(revision 358)
@@ -0,0 +1,30 @@
+import avango
+import avango.script
+
+class TaskScheduler(avango.script.Script):
+    Time = avango.SFDouble()
+
+    def __init__(self):
+        self.tasks = []
+        self.Time.value = 0
+
+    def cleanup(self):
+        self.disconnect_and_clear_all_fields()
+        self.tasks = []
+
+    def evaluate(self):
+        time = self.Time.value
+        tasks = self.tasks
+        self.tasks = []
+        for task in tasks:
+            if time > task[0]:
+                task[1]()
+            else:
+                self.tasks.append(task)
+        if len(self.tasks) == 0:
+            self.Time.disconnect()
+
+    def delay_call(self, time, callback):
+        if len(self.tasks) == 0:
+            self.Time.connect_from(time_sensor.Time)
+        self.tasks.append((self.Time.value + time, callback))
Index: avango-utils/python/_triggers.py
===================================================================
--- avango-utils/python/_triggers.py	(revision 358)
+++ avango-utils/python/_triggers.py	(revision 358)
@@ -0,0 +1,55 @@
+import avango
+import avango.script
+from avango.script import field_has_changed
+
+class ImmediateTriggerCallback(avango.script.Script):
+    Trigger = avango.SFBool()
+    EnableCallback = avango.script.SFObject()
+    DisableCallback = avango.script.SFObject()
+
+    def __init__(self):
+        self._last_trigger = False
+
+    def cleanup(self):
+        self.disconnect_and_clear_all_fields()
+        self._last_trigger = False
+
+    @field_has_changed(Trigger)
+    def trigger_changed(self):
+        callback = None
+        if self.Trigger.value:
+            if not self._last_trigger:
+                self._last_trigger = True
+                callback = self.EnableCallback.value
+        else:
+            if self._last_trigger:
+                self._last_trigger = False
+                callback = self.DisableCallback.value
+        if callback is not None:
+            callback()
+
+
+class TriggerCallback(avango.script.Script):
+    Trigger = avango.SFBool()
+    EnableCallback = avango.script.SFObject()
+    DisableCallback = avango.script.SFObject()
+
+    def __init__(self):
+        self._last_trigger = False
+
+    def cleanup(self):
+        self.disconnect_and_clear_all_fields()
+        self._last_trigger = False
+
+    def evaluate(self):
+        callback = None
+        if self.Trigger.value:
+            if not self._last_trigger:
+                self._last_trigger = True
+                callback = self.EnableCallback.value
+        else:
+            if self._last_trigger:
+                self._last_trigger = False
+                callback = self.DisableCallback.value
+        if callback is not None:
+            callback()
Index: avango-utils/tests/SConscript
===================================================================
--- avango-utils/tests/SConscript	(revision 357)
+++ avango-utils/tests/SConscript	(revision 358)
@@ -28,4 +28,5 @@
 avango_utils_test_files = Split("""
     TestProximitySensor.py
+    TestBoolScripts.py
     TestMFMerger.py
     runtests.py
Index: avango-utils/tests/TestBoolScripts.py
===================================================================
--- avango-utils/tests/TestBoolScripts.py	(revision 358)
+++ avango-utils/tests/TestBoolScripts.py	(revision 358)
@@ -0,0 +1,41 @@
+# -*- Mode:Python -*-
+
+##########################################################################
+#                                                                        #
+# This file is part of AVANGO.                                           #
+#                                                                        #
+# Copyright 1997 - 2010 Fraunhofer-Gesellschaft zur Foerderung der       #
+# angewandten Forschung (FhG), Munich, Germany.                          #
+#                                                                        #
+# AVANGO is free software: you can redistribute it and/or modify         #
+# it under the terms of the GNU Lesser General Public License as         #
+# published by the Free Software Foundation, version 3.                  #
+#                                                                        #
+# AVANGO is distributed in the hope that it will be useful,              #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of         #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the           #
+# GNU General Public License for more details.                           #
+#                                                                        #
+# You should have received a copy of the GNU Lesser General Public       #
+# License along with AVANGO. If not, see <http://www.gnu.org/licenses/>. #
+#                                                                        #
+##########################################################################
+
+import avango
+import avango.osg
+import avango.utils
+import unittest
+
+class BoolScriptsTestCase(unittest.TestCase):
+    def testMakeInstance(self):
+        self.assert_(avango.utils.nodes.Bool2And())
+        self.assert_(avango.utils.nodes.Bool2Or())
+        self.assert_(avango.utils.nodes.Bool3And())
+        self.assert_(avango.utils.nodes.Bool3Or())
+        
+        combined_script = avango.utils.merge_and_connect_bool_scripts(avango.utils.nodes.Bool2And(),avango.utils.nodes.Bool2And())
+        self.assert_(combined_script)
+
+def Suite():
+   suite = unittest.TestLoader().loadTestsFromTestCase(BoolScriptsTestCase)
+   return suite
Index: avango-utils/tests/runtests.py
===================================================================
--- avango-utils/tests/runtests.py	(revision 357)
+++ avango-utils/tests/runtests.py	(revision 358)
@@ -26,4 +26,5 @@
 from avango.utils.tests import TestProximitySensor
 from avango.utils.tests import TestMFMerger
+from avango.utils.tests import TestBoolScripts
 
 if __name__ == '__main__':
@@ -31,4 +32,5 @@
         TestProximitySensor.Suite(),
         TestMFMerger.Suite(),
+        TestBoolScripts.Suite(),
     ]
     alltests = unittest.TestSuite(suites)
