http://3d-kstudio.com/3ds-max-plugins-scripts/trackscripts/#CopyMaterial…
There's some brilliant script in the Track's pack that copies material and modifiers (with Shift+click) from one object to another within one file.
Could there be a similar tool that does the same between objects in separate files?
Thank you in advance.
Comments (20)
Comment policy
gone testing
first off it works!
I need your clarification:
If, Say I have 2 shortcuts:
1. 'R'- to copy mat+mod
2. 'T'- pastes the donor's mat+mod, keeps receiver's old mat name
2a.(Alt+Shift+T, Shift+T DO THE SAME, AM I CORRECT?)
2b. Alt+T - pastes mat ONLY, keeps receiver's old mat name.
What I noticed, the script tentatively inserts the donor's mesh, which sometimes could be huge and time consuming. could this mesh be substituted with say simple box
(mat+mod holder)?
Once again, salute!
.
After 4 hours I have to go at work. When I go back home(after 24h shift) i will modify the script.
In the listenre will be printed what is happen - the mats or mats+mods are transmited to the receivers.
Now I think all those key combinations just mess the things up. What do you think?
May be it'd be better to keep simple key hit for mat+mod+the old mat's name preserving,
AND hitting ALT+users key would pop-up the tiny window with following options (with combo boxes to check\uncheck:
1. keep the donor's mat name
2. don't transfer mods.
3. materials purging\instancing (tough one?):
a.instance all mats with the same name by inserted one;
b.instance all mats with the same maps\values by inserted one
BTW if the script could pick-up the isolated member of Multi\SubObject mat and do p.3
it'd be awesome.
Thank you for attention.
.
I don't have much time, but try this:
When you dun the PASTE script it will create RC menu so you have to choose what action to be done. Feel free to change the names of the RC menu so you can undestand better what it will do.
man it's fantastic, many thanks!
RC menu suites the best, but may be you could still ADD the possibility to the first option (mat+mod+old name) get executed with Cntl+key (just because it will be choosen in 90% of the cases)?
Once again, many thanks!
.
When you run the script:
- click in the viewport will perform mat+mod+old mat name
- shift+click will invoke the rc menu
fantastic script,- put it into your pack! and sorry if I tortured you too much :)
hm.. I can't make it work the new way- still only RC menu. What Am I Doing Wrong?
.
Assign a hotkey to run the script
Press the hotkey
click anywehere in the screen.
If you have selected objects the script will transfer mat+mods+old mat names.
If you shift+click the RC menu will appear.
it's OK now:)
May be it would help you to shorten the things..
Alex, the author of original script helped me to cook alternative version that keeps original mat name:
in TrackScripts.mcr, find the fragment
MacroScript CopyMat category:"Track" tooltip:"Copy Material and Modifiers" Icon:#("Material_Modifiers",3)(
in the function the line
for i in selobjs do i.material=obj.material
to be replaced with:
for i in selobjs do
(
local oldName = i.material.Name
i.material = obj.material
i.material.Name = oldName
)
---
It worked well, but what I didn't like in this alternative (please pay attention to this case) is the Error pop-ups when the receiver had no
material (and it's name of course) before mat switching.
Thank you, Miauu once again
.
Test the scripts. I have made some changes to the Copy_ script. The saved object will be saved with unique name, so when you use the Paste script there will be no problems when you have object with the same name in the scene(there is a built-in solution for cases like this, but they will works on max2011+).
The Paste script works as follows:
- run it and click anywhere in the viewport. The Alt and Alt+Shift keys will works as is described in the code.
Mate, it works precisely as expected! Amazing, thank you so much!
Now the routine of revisions (I import models from Sketchup) will be much more easier.
Thought about some polishing:
1. IF ADDITIONALLY , the ALT key will be used, so the object-receiver would get the mat, but preserve its original mat name (only name!)
2. IF ADDITIONALLY , the ALT+SHIFT key will be used, so the receiver object would preserve its original mat name (only name!) and receive mat+UVW.
NB: If there's no mat upon the receiver the script, the shouldn't be the Error pop-up.
Is it possible?
---
Once again, thank you!
.
Now you can't use Alt, Shift or Ctrl to achieve different results because the script is a macro and if you run it with hotkey then the keyboard kyes can't be used. Tommorow I will ty to add what you have asked and will change the way of how the script works so you can use it with a hotkey.
@fajar: No, it's overcomplicated, I dreamt about something elegant, fluent and easy like eye dropper. Essentially the Track's script is ideal (the main limitation it works within one file).
@miauu My bad :( by saying modifiers I meant UVW mod. So is my humble request doable?
Thank you in advance.
.
You will have two instances of 3dsMax running at the same time or the situation is different?
Yep, 2 (BTW are 2+ instances of 3ds max problem?) Windows of Max will be open side by side.
This is how I see this tool :
1. In file A, select object-donator and hit shortcut (i.e. Cntl+C for mat copy only, Cntl+Shift+C for copying mat+UVW mod)
2. In file B,select object and hit shortcut (i.e. Cntl+V for mat paste only, Cntl+Shift+V for pasting mat+UVW mod)
3. Profit..
BTW may be it will also help:
http://www.scriptspot.com/3ds-max/scripts/copy-and-paste-objects
http://www.scriptspot.com/3ds-max/scripts/copypaste-material-to-file
Use them constantly
.
Test the scripts below. I just combined(with little modification) the Track's and Christopher Grant's scripts.
the way to do it , may be make little box dummy object then copy selected object material & modifier to box dummy and save node those box and then load the box dummy to another file then apply to desired object on those file [file 2]
.
There is one thing tht you should to know - you can't copy the Edit Poly modifier. The script will add is as a modifier to the new object, but it will be as new modifier. All changes to geometry that the original Edit Poly mod has made to the object will not be applied to the new object(where the copy is applyed).