+Layer::Handle
+Layer_Duplicate::clone(const GUID& deriv_guid)const
+{
+ printf("cloning layer duplicate\n");
+ Layer::Handle ret = (Layer::Handle)Layer_Composite::clone(deriv_guid);
+
+ const DynamicParamList &dpl = dynamic_param_list();
+ DynamicParamList::const_iterator iter = dpl.find("index");
+
+ // if we have a dynamic "index" parameter, make a new one in the clone
+ // it's not good to have two references to the same index valuenode,
+ // or nested duplicatations cause an infinite loop
+ if (iter != dpl.end())
+ ret->connect_dynamic_param(iter->first,iter->second->clone(deriv_guid));
+
+ return ret;
+}
+