Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SceneKit Editor modifying duplicated element changes original element

Tags:

xcode

scenekit

In the SceneKit editor, if I copy a node, either using copy-paste or via option-drag, the resulting node is somehow "linked" to the original. Attempting to modify this new node in any way other than position changes the attributes of the original as well. This is infuriating, how do I "unlink" a duplicated node from the original?

UPDATE: Per request, here is a video of the behavior I am describing: https://www.dropbox.com/s/vtcom4iejjdtjv0/SceneKit%20Weirdness.mov?dl=0

like image 311
PopKernel Avatar asked Jul 07 '17 22:07

PopKernel


1 Answers

By Apple documents

However, it also means that changes to the objects attached to one node will affect other nodes that share the same attachments.

https://developer.apple.com/documentation/scenekit/scnnode/1408046-clone

When yor copiying node in editor it actually makes a clone node. I am not aware about the default values of geometries, but if the geometry specified as shared then all the similar clones will get changed when you are changing one of them.

In your case you just have to click the Unshare button to let the clones to use a distinct copy of the geometry. Which will not be affected by another node changes.

enter image description here

like image 61
ColdSteel Avatar answered Nov 07 '22 06:11

ColdSteel