Maya Training

Introduction to Hard Surface Modeling

Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

Maya Training

Shading, Lighting and Rendering the Bedroom in MR

Maya Training

Robot volume one - Modeling with animation in mind

Maya Training

Spach-Alspaugh House the complete courseware

Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

New Maya Training

Robot Volume 02 - Hybrid Rigging
You are here > Home > SimplyMaya Community Forums
Loading

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 08-02-2010, 02:39 PM   #1
I-Iybrid
Simply Maya OG
 
I-Iybrid's Avatar
 
Join Date: Dec 2002
Location: Queensbury NY, US A
Posts: 1,438
Thanks: 2
Thanked 14 Times in 14 Posts
Default Adjusting transparency

As Im working on projects, I realized its a PITA to have to go into the material's properties, and adjust the transparency by hand. Is there an easier way to do this? Blendshape, MEL script, etc? Something that can be adjusted by a slider of some sort.

Its just annoying to have to change the transparency to something like 0.3, make a few adjustments according to my ref image, then go back in, and put it back to 0 once Im done..... thoughts?
__________________
- Hybrid
I-Iybrid is offline   Reply With Quote
Old 08-02-2010, 05:16 PM   #2
Lion`I
Registered User
 
Lion`I's Avatar
 
Join Date: Apr 2009
Posts: 136
Thanks: 1
Thanked 7 Times in 6 Posts
Default

Hi I-Iybrid, if i understand correctly u want 2 switch between a bit of transparency to full transparency with something easy to get 2 right

well i'm no expert but u can use the "Time Slider" by simply "set key" to the transparency attribute. frame 1 = 0 transparency, frame 5 = transparency 0.3

so just scratch over the Time Slider

Hope This Helps

__________________


Autume Challenge Nov 09


Moving Forward
Lion`I is offline   Reply With Quote
Old 08-02-2010, 09:31 PM   #3
I-Iybrid
Simply Maya OG
 
I-Iybrid's Avatar
 
Join Date: Dec 2002
Location: Queensbury NY, US A
Posts: 1,438
Thanks: 2
Thanked 14 Times in 14 Posts
Default

Never thought about key framing it.....good idea. I was hoping for more of a pop-up GUI window.... but the time slider idea would definately work.....
__________________
- Hybrid
I-Iybrid is offline   Reply With Quote
Old 08-02-2010, 09:58 PM   #4
stwert
EduSciVis-er
 
Join Date: Dec 2005
Location: Toronto
Posts: 3,371
Thanks: 74
Thanked 709 Times in 642 Posts
Default

Turn on and off X-ray mode. Under shading (I think) in the panel menu set.
stwert is offline   Reply With Quote
Old 09-02-2010, 10:20 PM   #5
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,982
Thanks: 33
Thanked 532 Times in 471 Posts
Default

Quick script I whipped together.

Code:
string $material = "lambert2";

global proc transSliderButton( string $HUD )
{
    undoInfo -swf true;

    float $value = `hudSliderButton -q -v $HUD`;

    setAttr ($material + ".transparency") -type double3 $value $value $value ;
}

hudSliderButton -s 5
                -b 5
                -vis 1
                -sl "Trans:"
                -value 0
                -type "float"
                -min -0
                -max 1
                -slw 50
                -vw 50
                -sln 100
                -bl "Close"
                -bw 60
                -bsh "rectangle"
                -brc "headsUpDisplay -remove HUDTransSliderButton"
                -sdc "transSliderButton( \"HUDTransSliderButton\" )"
                HUDTransSliderButton;
__________________
Imagination is more important than knowledge.
NextDesign is offline   Reply With Quote
Old 10-02-2010, 03:53 PM   #6
I-Iybrid
Simply Maya OG
 
I-Iybrid's Avatar
 
Join Date: Dec 2002
Location: Queensbury NY, US A
Posts: 1,438
Thanks: 2
Thanked 14 Times in 14 Posts
Default

NextDesign,

that script errors out on me. Says "$material" is an undeclared variable.

What am I doing wrong? lol
__________________
- Hybrid
I-Iybrid is offline   Reply With Quote
Old 10-02-2010, 05:12 PM   #7
ColdWave
Registered User
 
ColdWave's Avatar
 
Join Date: Sep 2006
Location: Bulgaria, Vidin
Posts: 1,305
Thanks: 1
Thanked 19 Times in 19 Posts
Default

The $material is defined outside the

"global proc transSliderButton( string $HUD )"

So it will not work ...

in the global... you must declare it

so the script will go like that

"


global proc transSliderButton( string $HUD )
{
string $material = "lambert2";

undoInfo -swf true;

float $value = `hudSliderButton -q -v $HUD`;

setAttr ($material + ".transparency") -type double3 $value $value $value ;
}

hudSliderButton -s 5
-b 5
-vis 1
-sl "Trans:"
-value 0
-type "float"
-min -0
-max 1
-slw 50
-vw 50
-sln 100
-bl "Close"
-bw 60
-bsh "rectangle"
-brc "headsUpDisplay -remove HUDTransSliderButton"
-sdc "transSliderButton( \"HUDTransSliderButton\" )"
HUDTransSliderButton;



I hope i helped
__________________
Life is all about friends, people and art with a lot of beer ^_^

Current Animator & Artist @ SToch Games

Previous work 3D artist/Animator @ :
www.xs-software.com
www.adasport.com

For cool tips&tricks follow me @ :

http://iyosifovblog.blogspot.com/
ColdWave is offline   Reply With Quote
Old 11-02-2010, 01:40 AM   #8
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,982
Thanks: 33
Thanked 532 Times in 471 Posts
Default

Ah, sorry about that. Yes, paste this script into your script editor, change "lambert2" to the name of your material, but make sure to keep the quotes, grab that line, and paste it into the function, and run it.

Good catch mate.
__________________
Imagination is more important than knowledge.

Last edited by NextDesign : 11-02-2010 at 01:43 AM.
NextDesign is offline   Reply With Quote
Old 11-02-2010, 01:48 AM   #9
ColdWave
Registered User
 
ColdWave's Avatar
 
Join Date: Sep 2006
Location: Bulgaria, Vidin
Posts: 1,305
Thanks: 1
Thanked 19 Times in 19 Posts
Default

I tried it . It works just fine i'll use it too. I was looking for something like that ...
__________________
Life is all about friends, people and art with a lot of beer ^_^

Current Animator & Artist @ SToch Games

Previous work 3D artist/Animator @ :
www.xs-software.com
www.adasport.com

For cool tips&tricks follow me @ :

http://iyosifovblog.blogspot.com/
ColdWave is offline   Reply With Quote
Old 11-02-2010, 06:22 PM   #10
I-Iybrid
Simply Maya OG
 
I-Iybrid's Avatar
 
Join Date: Dec 2002
Location: Queensbury NY, US A
Posts: 1,438
Thanks: 2
Thanked 14 Times in 14 Posts
Default

Thanks for the help, guys! Im JUST starting to get into MEL scripting, so when it errored out, I was like "ok...wtf do I do now?"

But yea, it works like a charm. Thanks for the script!

Quick question tho.... would it be possible to make that slider in a seperate window? So when you run the script, it opens up a new window, sort of like the blendshape editor.... If I knew more about scripting, I could do it myself. But...Im a putz when it comes to programming of any kind. Unless its Visual Basic...that I know ALITTLE of. lol
__________________
- Hybrid
I-Iybrid is offline   Reply With Quote

A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2015 SimplyMaya - vBulletin® Copyright © 2000-2015, Jelsoft Enterprises Ltd.