Can you change properties of one MeshInstance to another?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By percy1000

If for example I have a blue sphere MeshInstance and a red cube, can I change the sphere to the shape and look of the box?
I’ve tried something like this:

    get_node("BlueSphere/MeshInstance").set_mesh(get_node("RedCube/MeshInstance").get_mesh())
 get_node("BlueSphere/MeshInstance").set_surface_material(0,get_node("RedCube/MeshInstance").get_surface_material(0))

And although I can then read the properties, eg albedo, of the Blue Sphere (which I now want to look like a red cube), it doesn’t appear in the scene. I think I’m either missing some step(s) or conceptually this is not an ok thing to do.

:bust_in_silhouette: Reply From: Footurist

This is actually a valid way to go about this. Try again and fiddle with it, there’s probably something with your specific scene. As soon as you retrieve a value with a getter, it is just a value seperate from the source object, because the function returned the value to you. And you can set the value of a property to any given value as long as it matches its data type.

Once you said it’s a valid method, I dug around a bit and found the missing object way out in space because the (imported) object I’m copying has a huge translation to bring it back to (0,0,0). So thank you very much for your help.
As far as I can tell, there’s no way to move the origin in the editor, but I can work round this.

percy1000 | 2018-03-10 19:13