PDA

View Full Version : problems using backface visibility option


Avatar
05-24-2002, 05:00 PM
hi there!

something that worries me since I started poly modeling with Maya (4.0 complete) is that I am not able to toggle the backface visibility option on and off as long as I am in component mode.

switching back to object mode every time I want to change backface mode really slows me down quite a bit. Is there a way to make backface mode switchable in component mode ? or maybe a different approach: is there another fast way to avoid selecting the wrong vertices ?

thx in advance!

(btw I switched from max to maya last week and from my first impressions I`d say that polygonal modeling may be mayas weakest point in comparison to max... but maybe thats just me =))

-wT-
05-24-2002, 06:58 PM
Oh CHRIST!! Wrote a milelong reply and got a page telling me I wrote too much, and go back and change it... and EMPTY page...ARGH!!!

Ok, so basicully, I got fed up with the crappy options too, and made my first MEL script ever, and am very proud of it (Applause!applause!) ;)
It works by first saving your current selection to a string, then going to object mode, changing the backface culling settings, going back to component mode and again selecting the stuff written to the string! Brillinat! :thumbsup:
It works (propably) with everykind of a selection, and does nothing (ofcourse) if a wrong type of thing is selected. To make it work, you have to add the code to your userSetup.mel file ("my documents/maya/4.0/scripts", if it's not there, create one), then you can run it by simply writing "ToggelBackfaceCulling;" to your commandline, or by making a MEL button out of it, or whatever you want to ;)

And true, I think Maya's polygon tools are quite weak too, and I'm planning on continuing to create more of thesekind of MEL scripts to help polymodeling.

Good luck, and I hope this script helps you!


global proc doTheBackfaceToggling ()
{
string $meshSurfaces[] = `ls -sl`;
int $isNotCulled[] = `polyOptions -q -bc $meshSurfaces`;
int $index = 0;

for ( $surface in $meshSurfaces )
{
if ( $isNotCulled[$index] )
{
polyOptions -wbc $surface;
}
else
{
polyOptions -bc $surface;
}
$index++;
}
}

global proc ToggelBackfaceCulling ()

{
string $selectionLista[] = `ls -sl`;

selectMode -component;
selectMode -object;

doTheBackfaceToggling;
changeSelectMode -component;

select -add $selectionLista;
}


Edit: Oopsie, there was a typo in the script... my mistake, but fixed now :)

iC4
05-24-2002, 07:15 PM
I would say it this way: maya comes with not enough tools, but you can create every tool you want really fast, and if you have the tools you want it's better than every program out there :)

just my opinion...

Avatar
05-25-2002, 08:32 AM
thx guys!

brilliant script -wT-

from what you say it sounds like it would be a good idea to learn the mel stuff (I didn`t even think about that till now cuz in max it wasn`t that important to write any scripts and I am not much into programming)

are there any good resources for mel scripts on the net ? (maybe someone already transfered the brilliant mesh tools and cstools from max to maya)


I`ve also been thinking about creating my stuff with nurbs and then converting these to polys afterwards. Doing the cleanup manually to get some nice low poly models. Not sure if that would be possible since tesselation levels for NURBS seem to be pretty high from what I`ve seen so far.

iC4
05-25-2002, 10:31 AM
first the mel reference which comes with maya is pretty good

http://www.ewertb.com/maya/mel/index.html

here are some examples

and if you are looking for scripts that allready exists go to www.highend3d.com

-wT-
05-25-2002, 05:01 PM
Yeah Avatar, I just recently (about a month ago) had my first look at the MEL manual, after reading so much about it's power, and damn it's cool! And it's especially nice that it's very similiar to C, which I've learned the basics of, so MEL was quite easy for me to understand. I'm nowhere good at it yet though, it took almost two days to do that script :) (And most of it is just copied from other Maya's default scripts, altered abit and put together)
And don't worry Avatar, I'm not too much into programming either, haven't learned C/C++ too much because I feel it's kinda boring before you start to be good enough to do something really interesting. MEL seems to be enough interesting to learn though.
Too bad the meshtools haven't been transferred directly, and that's what I've been planning on doing for the past few weeks, just need to learn MEL abit better, that connect tool would really help alot!

And the only propblem with MEL is the lack of good free tutorials/books, which you can find for almost any other language just by using google. The Maya's manual explains the basics of the language, and then just instructs to look at other scripts to learn from. Nice 500 page book about MEL would be really nice in my bookshelf ;)

Darrell Croswell
05-25-2002, 07:41 PM
DUDE!!!!!!!!!!!!!!!!
MEL IS AWESOME, BUT WHAT THE HELLL!!!!!!!!!!!!!!!!
while you are in component mode just simply use your attribute editor....

under the settings for your mesh there is a toggle button for backface culling...(off,partial, and full)...and right above it there are options to toggle your verticies backface culling!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

dont worry about messing with mel (not to say that these other guys are wrong but you know)

-wT-
05-25-2002, 10:44 PM
There's a button's like that too? Thanks for informing us Darrell :)

But it's still not too quick way, you still have to open the attribute editor, and look for the button everytime you want to change it. I've assigned my small script to a marking menu button, so I can change it with a simple mouseclick :)
Ofcourse you could make it a hotkey, and change it with a simple push of a key

Darrell Croswell
05-25-2002, 11:00 PM
i know what you mean...im jsut so untechnical...and more intuitive i guess....never really even touched a comp until about 4 years ago...so writing scripts is still a bitch for me...hahahaha

i usually just make the attribute editor open on the side of the screen (by changing my preferences) in place of the channel box and keep it there while modelling or texturing.

while on the subject, can anyone tell me how to make a script that i downloaded work properly???

i have no problem opening it, but i dont know where to highlight it or whenre to save it to, and when i drag it to my toolbar it never works!!!!!!!!!!!ahhhhhhhhh!

thanks

Avatar
06-02-2002, 09:22 AM
your script works great -wt-

...but somehow it only works in vertice mode. it doesn`t seem to do the trick in edge or face mode. could you somehow implement that in your script, please ? (I tried to look into it myself but gave up on it after about a minute =))

thx!

-wT-
06-02-2002, 04:36 PM
I've noticed it too, seems that if you change from object- to component mode with "selectMode -xxxxx", it will always default to vertex selection mode. But it still works doesn't it? It's just changes the selection mode to vertex.

I'll see what I can do, and will propably post updated script later today.

-wT-
06-02-2002, 06:02 PM
Ok here's the updated script. Now it keeps the selection mode, along with the last selected components, like in the first place.

Just copy the whole MEL file to your "username/maya/4.0/scripts" directory, or if you already have one there, then open my MEL and copy the stuff from it to the other one you have already.

Enjoy! :cool:

PS. Remember to take the .txt off from the end of the file! It's just there so I can attach it to here.

Neil
06-02-2002, 08:46 PM
I had the same issues a while ago, and asked the same question. The normal answer i got was to download the CPL tool plugin for maya. It will make a floating window and has a bunch of modeling options in it.

Try it out.

CGTalk Moderation
01-13-2006, 06:00 AM
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.