PDA

View Full Version : Editing createBlendShapePanelMenu.mel


Haider of Sweden
10-13-2005, 01:33 PM
Hey dudes

I was trying to tweak the createBlendShapePanelMenu.mel-file to change the width of the input box in Horizontal orientation mode, so that they become a little wider.

Anyone who has good eye to find it quickly? I didnt manage to find what to be tweaked

Thanx!

Haider of Sweden
10-18-2005, 01:05 PM
Ok then, here comes some more research, but still I havent figured out any solution. Strange, it seems like the code is well hidden.

Here are some links about this issue:
http://forums.cgsociety.org/showthread.php?t=71378 <- This explains how to tweak the width afterwards. Not perfect, I tell you why.
http://www.highend3d.com/maya/downloads/mel_scripts/interface_display/2398.html <- This is the script itself, adjustBlend, for tweaking the width of the textField.


Now, the main issue was 1) To change the default width from 50 to something else. That would help us all quite fast.
2) Would be, if 1 isnt possible, to tweak adjustBlend so that it can handle all the blendShape nodes at once, not one and one.

3) If its not possible to tweak adjustBlend, then maybe someone could tell me how to make a small loop-code, that checks which blendshape nodes are available, creates an array, and the runs adjustBlend() for each and every object (node) in the array.

Finally, I would try to implent this code from 3, somewhere, so that everytime the blendShape editor openes, you can see a correct width. Am I smart or not? Nope, if so, I would have solved it years ago :cry:

stallion151
11-08-2005, 09:11 PM
i edited this script to work on multiple blendshapes.

// ************************************************** ******************************
//
// This routine will change the size of the name field in the Blend Shape Editor
//
//
// Usage:
//
// 1) source the mel script file in the command line:
// source adjustBlend.mel
//
// 2) select blendshape node (click on select button in BlendShape Editor
//
// 3) type in the command line:
// adjustBlend(100);
//
// (where 100 is the size of the blend shape name field)
//
// Author: Paul Mikulecky (paul@lostpencil.com) - use at own risk, distribute freely
// Edited : Mark Serena - added a for loop for multiple blendshapes selected.
// ************************************************** ******************************

global proc adjustBlend (int $size)
{
string $mypnl[] = `getPanel -type blendShapePanel`;
if (size($mypnl) == 0)
{
print "No BlendShape Editor is open\n";
}
else
{
for ($i=0; $i<`size($mypnl)`; $i++)
{
string $mytgt[] = `selectedNodes`;
for ($each in $mytgt)
{
if (`objectType -isType "blendShape" $each`)
{
int $count = 0;
string $allcontrols[] = `lsUI -type control`;
for ($j=0;$j<=`size($allcontrols)`;++$j)
{
if (`gmatch $allcontrols[$j] "*tgtLabel*"`)
{
if ($allcontrols[$j] == $each +"_tgtLabel"+$count)
{
string $myx = $each +"_tgtLabel"+$count;
textField -e -w $size $myx;
$count++;
}
}
}
}
else
print "Please select the blendshape node \n";

}
}
}
}

stallion151
11-08-2005, 09:13 PM
that will work on multiple selected...i'll have another go this weekend to make do more of the things you suggested.
good day sir.

Haider of Sweden
11-09-2005, 11:23 AM
Hey Stallion, thanx - I gotta check it as soon as possible. Thanx so far

Haider of Sweden
11-15-2005, 01:16 PM
Hey there.

Thanx again Stallion - however, being able to (needing to) select the blendShape nodes isnt good enough.
There should be a possibility to automate the selection of all BlendShape nodes.
If that can be done, this code can be implanted with the adjustBlend.

stallion151
11-15-2005, 10:07 PM
here ya go haider....

simply override your adjustBlend script with this one and then go into
C:\Program Files\Alias\Maya6.5\scripts\others and look for "createBlendShapePanelMenu.mel"

create a backup of this and then copy mine over that....

i've created a window and a dropdown for globally adjust all blendshapes...

let me know how it goes. :)

Haider of Sweden
11-16-2005, 12:18 PM
Hey Stallion, great stuff

Somekind of mindreading, huh? I was thinking about adding a submenu for quicker access. However, it seems to require a "source adjustBlend.mel" to run - maybe the source-row should be implented into the createBlendShapePanelMenu.mel-file?
edit: what about saving AdjustBlendUIWindowProc as a separate mel-file with the same filename?

I was thinking about something else.
Its boring, to run the adjustBlend everytime you open the window.
This is what I did.
Immediately after the row inside createBlendShapePanelMenu.mel
string $ma[] = `menuBarLayout -q -menuArray $panelControl`;

I wrote
blendShapeMenuCmd $panel bseMIHoriz;
adjustBlend(150);

It works great, even with the view-presets on the left side (below the toolbox).


And one final idea that could be considered together with your submenu-tweak.
The script itself could add a value in one of the prefs-files. So everytime adjustBlend will run, you wont need to write (100), because it reads the value your tweak did add into the prefs-file. A default value could be written the first time, eg 100. Next time you make a change with your UI, the value inside that prefs-file is being changed.

what do you think?

Haider of Sweden
01-16-2006, 03:10 PM
Stallions nice solution was very helpful.

However, I wonder if its possible to tweak the performBlendShapeAdd so that also here, a adjustBlend(150); can be embedded.

Thing is, that when you create a blendshape, you gotta run adjustBlend manually once again, so that the new one also has the new size.
So maybe a tweak would solve it?

CGTalk Moderation
01-16-2006, 03:10 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.