>: CG Forums on 3dtotal - The best forums for CG artists :.
threedy forums home
 


top-table-gradient
Go Back   3DTotal Forums > Archives > Archives > Scripting & coding
bottom-table-gradient

Reply
 
Thread Tools Display Modes
Old 02-12-2005, 05:16 AM   #1
projectironwill
Registered User
 
Join Date: Jun 2003
Location: Full Sail
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to projectironwill
Setting All Scene Material Maps Amounts

I'm new to both 3ds max 7 & MAXScript and I'm having trouble with creating a script to set all of the Material Map Amounts on all materials in a scene back to the default Map Amount values.


-- I want to step through each Material in the scene using a loop.

-- Change the Maps Amount for each material to the following:
meditMaterials[1].ambientMapAmount = 100
meditMaterials[1].diffuseMapAmount = 100
meditMaterials[1].specularMapAmount = 100
meditMaterials[1].specularLevelMapAmount = 100
meditMaterials[1].glossinessMapAmount = 100
meditMaterials[1].selfillumMapAmount = 100
meditMaterials[1].opacityMapAmount = 100
meditMaterials[1].filterMapAmount = 100
meditMaterials[1].bumpMapAmount = 30
meditMaterials[1].reflectionMapAmount = 100
meditMaterials[1].refractionMapAmount = 100
meditMaterials[1].displacementMapAmount = 100

-- Save the file
max file save


-- Open File Command to get the next file.
max file open

-- END OF SCRIPT


What is confusing me is the meditMaterials[#] IDs. I need to change all of the materials in the scene, not just using one ID.

This can be for Max 7 or 8.

Thanks for any help that can be provided.
projectironwill is offline   Reply With Quote
Old 24-12-2005, 06:57 PM   #2
limion
chld of darkness&betrayal
 
limion's Avatar
 
Join Date: Apr 2005
Location: Belgium
Posts: 633
Thanks: 0
Thanked 0 Times in 0 Posts
i'm not a max scriptor but i do know some c and java, so i hope i can help. i think you might want to look for a way to creat a standard loop in maxscrip( like repeat ... until..., do ... (while)... loop, for...next) then you just have to declare a variable and use that as the id.
an example (how it would be done in java):

for(int i=0;i++;i>10){
meditMaterials[i].ambientMapAmount = 100
}

hope this helps a bit.
__________________
my works:
* sketches
WIP:
* slug creature
* space ship
* first animation
limion is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 03:44 PM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
all images displayed on this site are copyright the original artists and may not be reproduced, copied or published elsewhere without their express permission