applying materials from another scene to objects in another

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 05 May 2013   #1
applying materials from another scene to objects in another

So I have character model. I saved it in separate file, and animated it some. after that I founded (working in old file) that I need to do some tweaking in the materials of model. how can I now replace materials in second file with materials from first one, WITHOUT replacing meshes via "merge" option?
 
Old 05 May 2013   #2
Originally Posted by Darth-Biomech: So I have character model. I saved it in separate file, and animated it some. after that I founded (working in old file) that I need to do some tweaking in the materials of model. how can I now replace materials in second file with materials from first one, WITHOUT replacing meshes via "merge" option?

If they have the same name, you can merge them and replace the old material. So what you could do is create a few boxes or other geometry with the materials you want to merge applied, and then just merge in those objects. When it asks if you want to use the scene or the merged material, say merged. It'll then update your material with the new version from the other file. Then you can just delete the boxes.

Edit: I just remembered, I have a script for creating a box with each material in the scene applied to it. Run this code...

for a in 1 to scenematerials.count do
	(
		--make a new box (by default this will be at 0,0,0)
		newbox = Box()
		-- name the box after the material
		newbox.name = scenematerials[a].name
		-- make it a 10x10x10 box
		newbox.width = 10
		newbox.length = 10
		newbox.height = 10
		-- move the box 15 x scene number (so first is at 0,0,0 the next is 15,0,0, then 30,0,0 etc. Because the boxes are 10x10x10, this leaves a 5 gap between them
		newbox.pos = [(15*a),0,0]
		-- apply the material to the box
		newbox.material = scenematerials[a]
		-- just a quick bit of info pumped into the maxscript listener
		format "MATERIAL BOX GENERATED FOR %\n" scenematerials[a].name
	)


It might save you some time.
__________________

 
Old 05 May 2013   #3
Xref the material from the first scene. Using xref mateial
http://forums.cgsociety.org/archive...p/t-773388.html
Or open first file create a temp library in Max 214, open second file and replace material...
__________________
Renderfarm hire available @ www.hotknife.co.uk
 
Old 05 May 2013   #4
Originally Posted by DanGrover: If they have the same name, you can merge them and replace the old material. So what you could do is create a few boxes or other geometry with the materials you want to merge applied, and then just merge in those objects. When it asks if you want to use the scene or the merged material, say merged. It'll then update your material with the new version from the other file. Then you can just delete the boxes.

Edit: I just remembered, I have a script for creating a box with each material in the scene applied to it. Run this code...

It might save you some time.

Thanks, pal. seems like a fine solution to me
 
Old 06 June 2013   #5
Originally Posted by DanGrover: Edit: I just remembered, I have a script for creating a box with each material in the scene applied to it. Run this code...

Can you hint me, what I should change in that code, to prevent it from crashing with
-- Unable to convert: Map #231:Camera Map Per Pixel  to type: Material <<

? It is nonessential materials for only this particular scene, if I can make script to ignore them, it will be fine too.
 
Old 07 July 2013   #6
It now barks on color correct map too... Please, I need help.
 
Old 07 July 2013   #7
Privet, kak dela?

If you're struggling with the script and the objects, materials in question isnt that many, then do it manually. From the file with correct materials, create couple of boxes any size and apply the correct materials to them

Save only the boxes. Now go into the file with the incorrect materials and merge in the boxes from the file you just created. If it asks you "use merged materials" or "use scene materials", then select "use merged materials" and make sure "Apply to all Duplicates" is unticked

I untick that option as I've heard people mention in the past that it only effects the 1st material and then for whatever reason skips the rest.

Now pick the materials from the merged boxes and apply it to your geometry.

It's a bit of a long way around, but it works.

Scripting and xref material is the better option, but sometimes depending on your scene setup, things dont always go as planned
__________________
Kind Regards,
Morné


Follow me now on my social Pages:
Twitter | Facebook | Google+ | YouTube
Scripts, Tips, Tricks & Tutorials on my Blog
 
Old 07 July 2013   #8
Originally Posted by Morne: Privet, kak dela?
It's a bit of a long way around, but it works.

When there is couple dozens materials in your character, "a bit long" is "a bit" understatement. I got awesome script by DanGrover that create boxes automatically, but if there is cameramapperpixel or color correction map somewhere, it crashes with error (and wouldnt work in any another scene until max restart), and I want to know how to fix it.
 
Old 07 July 2013   #9
How about the suggestion from Andrew "hotknife"?

That sounds the simplest and easiest solution?
__________________
Kind Regards,
Morné


Follow me now on my social Pages:
Twitter | Facebook | Google+ | YouTube
Scripts, Tips, Tricks & Tutorials on my Blog
 
Old 07 July 2013   #10
Originally Posted by Morne: How about the suggestion from Andrew "hotknife"?

That sounds the simplest and easiest solution?

I'll need to re-texture everything with xref materials, expect bugs, will be not able to do little tweaks for exact this scene and exact this lighting, as xrefs are read-only... script-box method is actually simplier.
 
Old 07 July 2013   #11
Originally Posted by Darth-Biomech: When there is couple dozens materials in your character, "a bit long" is "a bit" understatement. I got awesome script by DanGrover that create boxes automatically, but if there is cameramapperpixel or color correction map somewhere, it crashes with error (and wouldnt work in any another scene until max restart), and I want to know how to fix it.


Sorry about that, I only just saw this! Give me a few hours and I'll take a look at it... I've no idea why those two maps are considered to be materials (in theory the script doesn't deal with maps themselves at all - strange!) but it won't be difficult to make exceptions for those two (there may be more... who knows!)
__________________

 
Old 07 July 2013   #12
I can't seem to recreate this error at all. It works fine with camera map and CC materials for me. Could you maybe apply those specific problem materials to cubes and upload a max file of it? (No need for the actual maps to be included, obviously).
__________________

 
Old 07 July 2013   #13
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 01:42 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.