i found this forum very lively, thats why i made post here, can anyone help me? why i’m not getting any reply?
i’m new in maya… i have my FYP in 3D modeling…
The core idea is that i have to create human models dynamically, on user input, like user when tells his/her body measurements, then i have to show him his very own dummy. i browsed internet and found out mel to b a solution (in my opinion) and now i did some practice …but got stuck at one place, i’m making 3 cylinders in mel (just to see if the tech works) then took input from user in webpage and called a function test, that resides in a separate mel file, but in this function there is a line that throws error when it gets launched in maya. here are all my files.
1) test.htm
<html>
<head>
<TITLE>Make your own dummy...</TITLE>
<object width="550" height="400">
<param name="movie" value="MTB.swf">
<embed src="MTB.swf" width="550" height="400">
</embed>
</object>
<SCRIPT language="JavaScript">
function js_test()
{
var top =document.test_form.top.value;
var mid =document.test_form.mid.value;
var bottom =document.test_form.bottom.value;
var mel_url = "mel://test("+top + ", " +mid + ", " +bottom + ")/";
location = mel_url;
}
</SCRIPT>
</HEAD>
<BODY>
<a href="http://www.melscripting.com/">
go to melscripting.com
</a><p>
<FORM name="test_form" onSubmit="js_test(); return false;">
<B>enter your figure: </B>
<p>
<b>Top:</b>
<INPUT type="text" name="top" size="30"><P>
<b>Mid </b>
<INPUT type="text" name="mid" size="30"><P>
<b>Bottom </b>
<INPUT type="text" name="bottom" size="30"><P>
<INPUT type="submit" value="test">
</FORM>
</BODY>
</HTML>
2)make_web_test.mel
proc string get_path_url_test()
{
string $path_to_proc="whatIs make_web_test";
string $path_parts[];
string $lead_in = "Mel procedure found in:";
string $path_url = "file:/";
int $i;
$path_url = $path_url + substring($path_to_proc,(size($lead_in) + 1),size($path_to_proc));
tokenize $path_url "/" $path_parts;
$path_url = "";
for ($i = 0; $i < (size($path_parts) -1); $i++)
{
$path_url = $path_url + $path_parts[$i] + "/";
}
return $path_url;
}
global proc make_web_test()
{
string $myurl = (get_path_url_test() + "test.htm");
print ($myurl + "
");
string $myWindow ="window -widthHeight 800 600";
columnLayout;
webBrowser -url $myurl;
showWindow $myWindow;
}
3)make_js_web_test.mel
proc string get_path_url_test()
{
string $path_to_proc = "whatIs make_js_web_test";
string $path_parts[];
string $lead_in = "Mel procedure found in: ";
string $path_url = "file:/";
int $i;
$path_url = $path_url + substring($path_to_proc,(size($lead_in) + 1),size($path_to_proc));
tokenize $path_url "/" $path_parts;
$path_url = "";
for ($i=0; $i<(size($path_parts)- 1); $i++)
{
$path_url=$path_url+ $path_parts[$i]+ "/";
}
return $path_url;
}
three_parts_ryt();
global proc test(float $top, float $mid, float $bottom)
{
$top=$top/8.333;
$mid=$mid/8.333;
$bottom=$bottom/8.333
//ive tried many scripts to make cylinders, but anything i try, it //throws error down here at these lines
polyCylinder -axis 0 5.034248 0 -height 3 -name "pCylinder1" -radius 2.0 -sx 12 -sy 1 -sz 1;
polyCylinder -axis 0 5.034248 0 -height 3 -name "pCylinder2" -radius 2.0 -sx 12 -sy 1 -sz 1;
polyCylinder -axis 0 5.034248 0 -height 3 -name "pCylinder3" -radius 2.0 -sx 12 -sy 1 -sz 1;
select -r pCylinder1 ;
scale -r $bottom 2.068992 $bottom ;
select -r pCylinder2 ;
scale -r $mid 2.068992 $mid;
select -r pCylinder3 ;
scale -r $top 2.068992 $top;
}
global proc browserBack()
{
global string $myWebBrowser;
webBrowser -e -back $myWebBrowser;
}
global proc browserForward()
{
global string $myWebBrowser;
webBrowser -e -forward $myWebBrowser;
}
global proc browserHome()
{
global string $myWebBrowser;
webBrowser -e -home $myWebBrowser;
}
global proc make_js_web_test()
{
global string $myWebBrowser;
string $myurl = (get_path_url() + "test.htm");
print ($myurl + "
");
window -width 800 -height 632 -title "Make some spheres";
columnLayout;
rowLayout -numberOfColumns 3 -columnWidth3 32 32 32 -columnAlign 1 "right" -columnAttach 1 "both" 0 -columnAttach 2 "both" 0 -columnAttach 3 "both" 0;
iconTextButton -c "browserBack()" -image "back.JPG";
iconTextButton -c "browserForward()" -image "forward.JPG";
iconTextButton -c "browserHome()" -image "homepage.JPG";
setParent ..;
$myWebBrowser = "webBrowser -url $myurl";
showWindow;
}
HELP!!!
ive tried many things, but i guess my approach aint right… thats why i get stupid errors, any function that i make, that has to change the position of cylinders along with creating them, it dznt create the cylinders… i totally have no idea whats wrong…