don’t know if this possible because I need it for orientation an object
one more example:
camera_orientation = self.send_camori #send_camori is an shorted string from an long line. shorted with [1:-1] (example)
#yes of course it is converted with .to_euler()
print(camera_orientation)# this prints [0.0, 0.0, 0.0]
xyz = numpy.array(camera_orientation)
#and want to use xyz like this
avatar_cam_obj.worldOrientation = xyz
don’t know if I have to convert it before to an vector or else,
and when how?
You don’t need to use numpy here. Your code extract looks like a copy of different examples of programs, (what is self here?).
You shouldn’t need to convert a string to anything, unless you’re trying to configure vectors from the GUI (which makes little sense).
from mathutils import Euler
from math import radians
x = radians(45)
y = radians(90)
z = radians(120)
some_orientation = Euler((x, y, z))
some_obj.worldOrientation = some_orientation
Yes. If you want to put something in a string, send it and recover it later you have to format it clearly. I usually use a symbol to keep entries in a string separate.
Something like;
my_ori = “$”.join(str(number) for number in list(camera.worldOrientation))
Then
orientation = mathutils.Vector ([float(number) for number in my_ori.split("$")])