Syler
(Syler)
February 28, 2019, 10:26pm
1
when i run this code:
ob = bpy.context.active_object
point = ob.location
print (point)
offset = 5
ob.location[1] = ob.location[1] + offset
print (point)
i get Vector (0.0000, 0.0000, 0.0000)
the first time i run the print command and
Vector (0.0000, 5.0000, 0.0000)
the second time.
i want a copy of the location Not a reference.
HENDRIX1
(-HENDRIX-)
February 28, 2019, 10:35pm
2
1 Like
Syler
(Syler)
February 28, 2019, 10:39pm
3
thanks should have tried that but i didn’t because when i wrote C.active_object.location in the console i only got xyzw and all the other possible combinations of xyzw
kkar
(kkar)
February 28, 2019, 10:41pm
4
you can use import copy
copy.copy(loc)
I also figured that if you wrap it in a Vector class you get a copy of it as well.
2 Likes
TitusLVR
(TitusLVR)
March 2, 2019, 12:58pm
5
Or sometimes:
Import copy
Copy.deepcopy(yourdata)