PDA

View Full Version : remove colorEntryList of a ramp URGENT PLEASE


thematt
03-09-2004, 01:00 PM
hello all I'm looking for a way to create a ramp with only one color entry in mel..so the way I found is to remove the entry.
weird enough it works if I select a Ramp and run that script :

string $ramp[] = `ls -sl`;
removeMultiInstance - break true ($ramp+".colorEntryList[0]");



but not inside a mel like this:


string $rampTest = `shadingNode - au ramp -n test`;
removeMultiInstance - break true ($rampTest+".colorEntryList[0]");


why ???
This is very important and must be finish tonight..
Anyone that would save my ass big time.:cry:

Thanks a lot anyone


BTW I use maya4..

alexx
03-09-2004, 01:34 PM
maya 5 seems to have the same problem..

as it seems the creation of the ramp is faster than the remove.

i tried an evalDeferred but that did not help as well :/

sorry

alexx

brubin
03-09-2004, 01:54 PM
string $rampTest = `shadingNode - au ramp -n test`;
removeMultiInstance - break true ($rampTest+".colorEntryList[0]");

works in 5.0.1...

HIH
s.

alexx
03-09-2004, 02:05 PM
so the red color is missing in the ramp when you execute that two lines?

for me not: maya 5.01 windows

please dont tell me you use OSX..

cheers

alexx

thematt
03-09-2004, 02:10 PM
Thanks a lot guys..
so I guess it's time for me to find a rope...

cheers

thematt
03-09-2004, 03:17 PM
Ok guys god must be on my side and doesn't want me to be quick out..because it now works!!! ..I have absolutly no idea why but inside my procedure it works fine...
very weird a least

thanks for the help.

alexx
03-09-2004, 03:25 PM
??

just putting that code in a proc does not help for me.

what exactely did you do and did you ask alias about that topic?

we had problems like that before and never reall solved them.

what have you done?
is there new code in between?

cheers

alexx

brubin
03-09-2004, 03:27 PM
@alexx
no, no mac-
still, i was wrong at first, the lines only work when you call'em one by one, but now i found the following lines to work as well:

string $rampTest = `shadingNode - au ramp -n test`;
setAttr "test.colorEntryList[0].position" 0;
setAttr "test.colorEntryList[0].color" -type double3 0 1 0 ;
setAttr "test.colorEntryList[1].position" 1;
setAttr "test.colorEntryList[1].color" -type double3 0 0 1 ;

HIH
s.

@thematt
like to see how that works in a procedure, can you post IT (or some examplary proc that shows HOW it works), please?
TIA
s.

thematt
03-09-2004, 04:43 PM
Yes exactly in my procedure i changed the color of one of the entry of the Ramp and of a sudden it worked...I guess it need something to update the code...

but it's very weird because if you try that you'll see an unexpected result..

string $rampTest = `shadingNode - au ramp -n test`;
removeMultiInstance - break true ($rampTest+".colorEntryList[0]");
setAttr ($rampTest +".colorEntryList[0].color") 1 1 1;


I guess it still bug in my code but since I only need one entry and I delete both i didn't realize.

So if you want two entry you'll have to recreate one..this is some of a bug !!!..at least there is a work around..

CGTalk Moderation
01-17-2006, 03:00 PM
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.