So I have experience in other programming languages, but this seemingly simple task is getting the better of me. All I want to do is swap one object with another, the position, the rotation and the scaling.
Store the first 2 selected object’s properties and then assign them to each other. But whatever I do one object will move and scale etc but the other will stay just where it is e.g. using 2 cubes would result in 2 cubes in exactly the same place, with same rotation and scale. I feel I must be doing something obviously stupid, so any help is appreciated.
Tried it. Same behavior. Apparently the object.location etc updates after you move the object. So once you move the first object, when you go to move the second, it wants to move it…nowhere. Interesting.
You only ever need one set of temp variables when you swap. I’m typing on my phone so forgive me for not giving the full example… But after you make the first set of copies you can assign directly to ob1.* from ob2.*
I am pretty sure you’ll still need all 6 .copy()s, though.
You only ever need one set of temp variables when you swap. I’m typing on my phone so forgive me for not giving the full example… But after you make the first set of copies you can assign directly to ob1.* from ob2.*
Yeah, this is the way I first did it, only changed to 2 sets of variables when it wasn’t working, changed back now though.
you could also change the mesh name
and it would take the other mesh shape!
but need to make a copy of object to keep the original shape anyway !
That’s a nice solution, I just felt there should have been a way to do it without adding extra objects.