SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Home / forum / Lounges / Maya Basics & Newbie Lounge / Adjusting transparency
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 08-02-2010, 01: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, 04: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, 08: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, 08:58 PM   #4
stwert
EduSciVis-er
 
Join Date: Dec 2005
Location: Toronto
Posts: 3,373
Thanks: 74
Thanked 710 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, 09:20 PM   #5
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,988
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, 02: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, 04:12 PM   #7
ColdWave
Registered User
 
ColdWave's Avatar
 
Join Date: Sep 2006
Location: Bulgaria, Vidin
Posts: 1,309
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
__________________
Art Director
www.sevenbullsgames.com
ColdWave is offline   Reply With Quote
Old 11-02-2010, 12:40 AM   #8
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,988
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 12:43 AM.
NextDesign is offline   Reply With Quote
Old 11-02-2010, 12:48 AM   #9
ColdWave
Registered User
 
ColdWave's Avatar
 
Join Date: Sep 2006
Location: Bulgaria, Vidin
Posts: 1,309
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 ...
__________________
Art Director
www.sevenbullsgames.com
ColdWave is offline   Reply With Quote
Old 11-02-2010, 05: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
New Thread

« Previous Thread | Next Thread »

Thread Tools

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

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.