Duplicate layer structure

Duplicate layer structure

Anonymous
Not applicable
5,740 Views
13 Replies
Message 1 of 14

Duplicate layer structure

Anonymous
Not applicable

 

Is there some way to duplicate a layer structure with it's childen objects?

 

I have an architectural project, and I created a layer structure to manage my elements easier. Also , the elements have some boolean operations connection on them. For example, my boolean operands are on a separate layer.

 

I'd like to create one or more alternative version of the model, so I'd like to duplicate all the objects, and I'd like to maintain the layer structure as well (maybe append a "copy" ending to each layer name).

So what is the method for this? If I simply create a copy of all the objects, the boolean associations get maintained, but I won't be able to switch between alternatives A or B, because the duplicated objects will be on the same layer as the original objects. If I copy the objects layer by layer, the boolean references might disassociate with each other.

 

Any ideas? Thanks!

Accepted solutions (1)
5,741 Views
13 Replies
Replies (13)
Message 2 of 14

PixelWindChill
Contributor
Contributor

Doesn't seem possible within 3DS Max but has anyone made a script in the last year that will duplicate a layer and it's contents (clone)?

0 Likes
Message 3 of 14

RobH2
Advisor
Advisor
Accepted solution

Here's a script I found and used a few years ago. I forgot about it so I haven't tried it in Max 2022 or 2023. If you use it be sure you back up your ENU before doing so in case it causes issues. However, when I used it, it worked great. 

 

 


Rob Holmes

EESignature

------------------------------------------------------------------------------------------------------------------------------------------
3ds Max (2023-2025), V-Ray 6.2, Ryzen 9 3950-X Processor, DDR 4 128MB, Gigabyte Aorus X570 Master motherboard, Sabrent Rocket NVMe 4.0 M.2 drives, NVidia RTX 4090, Space Pilot Pro, Windows 11 Pro x64, Tri-Monitor, Cintiq 13HD, Windows 11 x64
------------------------------------------------------------------------------------------------------------------------------------------
Message 4 of 14

PixelWindChill
Contributor
Contributor

Thank you, I will give it a go and report back.

0 Likes
Message 5 of 14

PixelWindChill
Contributor
Contributor

That worked like a charm and is going to save me a ton of time organizing a very messing file. FYI - This worked in 21.
@RobH2  Cheers brother -Thanks again and have a great NY!

Message 6 of 14

RobH2
Advisor
Advisor

Excellent news. I recall that it worked great when I used it on the project I needed it for. I may reinstall it now that you've tested it for me.

 

My pleasure...glad it's useful. Wish I knew who wrote it to give them kudos but glad it's working. 

 

You have a great Holiday and New Year's as well... Cheers...:)


Rob Holmes

EESignature

------------------------------------------------------------------------------------------------------------------------------------------
3ds Max (2023-2025), V-Ray 6.2, Ryzen 9 3950-X Processor, DDR 4 128MB, Gigabyte Aorus X570 Master motherboard, Sabrent Rocket NVMe 4.0 M.2 drives, NVidia RTX 4090, Space Pilot Pro, Windows 11 Pro x64, Tri-Monitor, Cintiq 13HD, Windows 11 x64
------------------------------------------------------------------------------------------------------------------------------------------
Message 7 of 14

matysJUSPV
Observer
Observer

Is there a change it will work in max 2022?

0 Likes
Message 8 of 14

RobH2
Advisor
Advisor

I would think so. In fact, I've had it since 2019 so I used it with Max 2020 and forward.

 

Just try it. If it works, well, it works. Right?

 

Just back up your ENU folder and save it. I do that by copying the existing one and renaming the copy to 'ENU_Good_Bak' in the same folder. If the script does not work, reset your ENU by deleting the existing one and launch Max (knowing that you've saved that copy of it as a backup) and Max will build a brand new ENU. Now see if the script works. If not still, then close Max and delete that ENU and bring your backup back by deleting the extra name characters back to just 'ENU' and relaunch Max and you'll be where you started. The script is still not installed but at least you know nothing is messed up by trying. 


Rob Holmes

EESignature

------------------------------------------------------------------------------------------------------------------------------------------
3ds Max (2023-2025), V-Ray 6.2, Ryzen 9 3950-X Processor, DDR 4 128MB, Gigabyte Aorus X570 Master motherboard, Sabrent Rocket NVMe 4.0 M.2 drives, NVidia RTX 4090, Space Pilot Pro, Windows 11 Pro x64, Tri-Monitor, Cintiq 13HD, Windows 11 x64
------------------------------------------------------------------------------------------------------------------------------------------
Message 9 of 14

RobH2
Advisor
Advisor

I just tested it in Max 2024 and it works fine.  I also tested in Max 2022 and it works fine as well.

 

It's a little confusing on how to get it going. If you just select a layer name you'd think it would just duplicate that layer. But it does nothing and you feel like it doesn't work at all because nothing opens, errors or anything. Just nodda...  

 

But if you open the script and look at it, you'll see that it appears that you need to select something. I'm not a coder but I've gotten used to just peeking at a script and maybe being able to figure out something useful. In this case, it seems to ask for a selection and that is in fact the case. You need to actually select everything in that layer and then run the script and it will work. 


Rob Holmes

EESignature

------------------------------------------------------------------------------------------------------------------------------------------
3ds Max (2023-2025), V-Ray 6.2, Ryzen 9 3950-X Processor, DDR 4 128MB, Gigabyte Aorus X570 Master motherboard, Sabrent Rocket NVMe 4.0 M.2 drives, NVidia RTX 4090, Space Pilot Pro, Windows 11 Pro x64, Tri-Monitor, Cintiq 13HD, Windows 11 x64
------------------------------------------------------------------------------------------------------------------------------------------
Message 10 of 14

matysJUSPV
Observer
Observer

Thank guys for the comments. All seems to work indeed for 2022.

It would have been nicer if the copied layer didn't have any additional numbers within in the layer so that the objects are an exact copy including names ... but hey 😉

 

0 Likes
Message 11 of 14

RobH2
Advisor
Advisor

You might be able to open the script and modify it just a bit so it doesn't add the additionl bits onto the name. 


Rob Holmes

EESignature

------------------------------------------------------------------------------------------------------------------------------------------
3ds Max (2023-2025), V-Ray 6.2, Ryzen 9 3950-X Processor, DDR 4 128MB, Gigabyte Aorus X570 Master motherboard, Sabrent Rocket NVMe 4.0 M.2 drives, NVidia RTX 4090, Space Pilot Pro, Windows 11 Pro x64, Tri-Monitor, Cintiq 13HD, Windows 11 x64
------------------------------------------------------------------------------------------------------------------------------------------
Message 12 of 14

RobH2
Advisor
Advisor

That's a function of Max. You can have objects with identical names but you can't have Layers with identical names. Max just won't permit that. So you have to add something to the new layer. You can open the script and in the first function you can change what that is if you want to customize it. 


Rob Holmes

EESignature

------------------------------------------------------------------------------------------------------------------------------------------
3ds Max (2023-2025), V-Ray 6.2, Ryzen 9 3950-X Processor, DDR 4 128MB, Gigabyte Aorus X570 Master motherboard, Sabrent Rocket NVMe 4.0 M.2 drives, NVidia RTX 4090, Space Pilot Pro, Windows 11 Pro x64, Tri-Monitor, Cintiq 13HD, Windows 11 x64
------------------------------------------------------------------------------------------------------------------------------------------
Message 13 of 14

RobH2
Advisor
Advisor

You might want to send the script over the the 'Scripting' forum section and ask someone to modify it for you so that it keeps the exact names of the newly created objects. There are some savvy gurus over there. 


Rob Holmes

EESignature

------------------------------------------------------------------------------------------------------------------------------------------
3ds Max (2023-2025), V-Ray 6.2, Ryzen 9 3950-X Processor, DDR 4 128MB, Gigabyte Aorus X570 Master motherboard, Sabrent Rocket NVMe 4.0 M.2 drives, NVidia RTX 4090, Space Pilot Pro, Windows 11 Pro x64, Tri-Monitor, Cintiq 13HD, Windows 11 x64
------------------------------------------------------------------------------------------------------------------------------------------
Message 14 of 14

matysJUSPV
Observer
Observer

great idea 😉

 

0 Likes