Moving objects by plc

by Petra Berlina   Last Updated October 09, 2019 18:15 PM - source

I have to move an object (cube, camera, ...) according to a value from a industrial plc. In principle that works fine - but after a short while Blender (2.80) stops working. I saw, that the Windows Taskmanager shows a continiously increasing number of handles, the nuber of Threads is nearly constant. Do i have to dispose or kill anything? I can't find any hint :-(
Any comments welcome and many thanks in advance!

    import bpy, time, threading
    def moveObj(val): # reduced to make it easier to understand
        val = val + 0.05
        if val > 20:
            val=0

       bpy.data.objects['MyObject'].location=(val, -val, val*0.5)
       threading.Timer(0.05, moveObj, [val]).start()

    moveObj(2) #call the method with start-value

taskmanager

Tags : python


Related Questions


Ipodtouch Jail-Break aid?

Updated March 26, 2015 07:30 AM


Python: Methods to multiply/divide vectors

Updated March 27, 2015 14:20 PM

Adding sliders from UI to pie menu

Updated April 19, 2015 22:09 PM