Cloning an InstancedMesh changes its isEnabled state

When cloning a disabled InstancedMesh, I noticed that the clone will be enabled. Please see my playground.

Is this by design?

I believe there’s a PR (not sure if it has gone through) making the clone a new source.
May be this is related and then may be not.

@RaananW I guess you can answer this one, yes? Thx,

Well! Another philosophical question! :wink:

Actually, in this case it is very technicaly. disabled/enabled is not copied when cloning a mesh, since disabled is a private property and not considered a part of the state that will be copied. Enabled is true per default, and this is what you are seeing. We can discuss here what makes more sense - should disabled be copied or not? Will be happy to hear opinions both ways :wink:

Personally, I usually clone disabled nodes and expect them to be disabled. However, when serializing an object, we do store the enabled state. Adding the enabled state to cloning will break back-compat, so I am not sure we can change it, unless we consider it a bug

1 Like

I’d say, assuming we will eventually later consider the clone a new source, it would make sense that it also comes with its own defaults (and private property settings). My opinion only.

Since this is a matter of philosophy, and now knowing a little about BJS philosophy, I’d say let’s not make a breaking change for that. EZ for me to say that since I don’t really use clones from instances, rather the other way round :wink: And then again, my opinion only.

3 Likes

Thanks for clearing that up, @RaananW ! Just wanted to make sure we’re not dealing with a bug here. Basically we’re fine with the current behaviour.

1 Like