Accessing Scene Materials

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
  08 August 2003
Accessing Scene Materials

i'll be damned if I can find it in the maxscript help

I'm trying to write a pretty simple tool
to switch between 80% opacity and 100% opacity of a certain material in the scene, but i can't seem to find how i access that material via script other then using meditmaterial.
I'm sure there has got to be another way that makes you less dependant on the material editor right ??

this is the script

Quote:
rollout MatOpac "OpacitySwitcher" width:140
(
button btn80 "Set to 080% Opacity" width:125
button btn100 "Set to 100% Opacity" width:125
on btn80 pressed do
(
insert proper access to "metal" (the name of the material) here
)
)
createDialog MatOpac


Any help with this is appreciated.

And i need to check if we can have some vbcode for code, cause this ofcourse sucks hehe it would've been nice to keep it in nice coding layout.

cheers all.
__________________
eqko
 
  08 August 2003
hey equi

try this:

------------------------------------------
rollout MatOpac "OpacitySwitcher" width:140
(
button btn80 "Set to 080% Opacity" width:125
button btn100 "Set to 100% Opacity" width:125
on btn80 pressed do scenematerials["metal"].opacity = 80
on btn100 pressed do scenematerials["metal"].opacity = 100
)
createDialog MatOpac
------------------------------------------

cheers!
Martijn
 
  08 August 2003
or, without using 'scenematerials' :

------------------------------------------
for obj in objects where obj.material != undefined do
(
if obj.material.name == "metal" then (
obj.material.opacity = 80
exit
)
)
------------------------------------------


Martijn
 
  08 August 2003
thx buddy
__________________
eqko
 
  01 January 2006
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 06:55 PM.


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