Hey, I just tried to alter the Duplicate Comp script so that it moves all the created Comps and Pre-Comps into a new folder which can be Named in the Dialog. I was able to create a new folder during the copying process but the new comps won't be copied over. This is my first test so I don't know all the ins and outs of the tool and which nodes to use.
Also the folder that gets created refers to a specific folder I have always in my project but this isn't too universal so I guess it would be better to have the option for the user to determin the folder where everything is copied over manually or maybe just next to where the original was located.
I have attached my current state so maybe someone can help here.
thank you for your request! I just added a variant of the comp duplicator to the community library which has a target bin option. You find it at
Comps/Duplicate/Comp Duplicator With Target Bin Option
Here is the code with some explanation:
Your code was already a step in the right direction with the loop over the precomps, but inside the loop you need to retrieve from the precomp layer the actual project item of the precomp (i.e. source item attribute) and then move this to the target bin. It also got a bit more complex with the two if-conditions, since I wanted to make sure that only precomps which actually have been duplicated are moved (and depending on the options chosen in the UI it is possible that no precomps or only unlocked precomp are duplicated).
thanks so much for taking the time to get it working and also explaining it so good.
So that I understand it better, the set attribute function is the one I would need if I want to move something in the project folder? I thought it was for defining/renaming a variable I than would recall to do something with it.