I have a python script. It works well when I run the code in python console but if I open the script file in text editor and click "Run Script", blender crashed.
Does anyone know what might causes the difference?
Here is the script:
import bpy
from bpy import data as D
from bpy import context as C
from mathutils import *
from math import *
import blensor
bpy.context.scene.objects.active=bpy.data.objects['Camera']
blensor.tof.scan_advanced( max_distance = 20.0)