Can anyone tell me how to test if something is a Blender Vector (from Mathutils?)
I’m writing a custom sequence type which accepts Blender Vectors as slice indices.
Unfortunately, I can’t get type testing to recognize Blender.Mathutils.Vector as a class:
import Blender import bpy from Blender.Mathutils import * x = Vector(0, 0, 1) if isinstance(x, type(Vector)): print 'true'
The above raises an error:
Traceback (most recent call last): File "Text", line 6, in <module> NameError: name 'vector' is not defined Traceback (most recent call last): File "Text", line 6, in <module> TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and typ es
This is the second time in two days I’ve become completely lost as to what I’m doing wrong. I’m starting to lose it.