So, when changing the color of the simple cloned material (after collecting its color object), the original material gets it’s color changed too (of course).
I wonder if a new method deepClone() could clone recognized types? like:
@Override
public MatParam deepClone() {
try {
MatParam param = (MatParam) super.clone();
if(param.value instanceof ColorRGBA){ //added code
param.value = value.clone(); //added code
} //added code, other types could go here too
return param;
} catch (CloneNotSupportedException ex) {
throw new AssertionError();
}
}
or that is not as useful as I am thinking? and may cause memory overload issues?
So instead I should just clone and fix the things I want to be unique (like the color)?
Here is also the same context Cloned materials and parameter changes