SimplyMaya Forums

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

Home / forum / Animation / Mel Scripts & Programming / Geometry Exporter to UnrealEd...
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 13-12-2003, 03:15 AM   #1
dave_baer
Moderator
 
dave_baer's Avatar
 
Join Date: Sep 2002
Location: Plantation, Florida
Posts: 1,568
Thanks: 0
Thanked 12 Times in 9 Posts
Default Geometry Exporter to UnrealEd...

Hey guys, got one for ya...

I've been learning UnrealEd, the editor used to make levels for the game UNREAL Tournament 2003. I've been following the video tutorials over at 3DBuzz but have come to an obstacle. I've copied, word for word, and script they wrote used to export geometry from Maya to UnrealEd. But there are two errors which I can't seem to trouble shoot. It appears, to me anyway, that the errors lie with a closed bracket - } - and an else variable. Below is the code as it appeared in the tutorial. See if any of you can get it to work.

Of course if you don't have UnrealEd, it won't export and will give you an error for it. But it's not necessary to have it to trouble shoot. Just see if you can get past the two errors I mentioned.

Thanks in advance.

**********************************************

//Declare my variables
string $myWindow = "exportAssist";
string $mainLayout = "cLayout";

//Check to see if the window exists
if (`window -ex $myWindow`)
deleteUI $myWindow;

//Create a window
window -wh 169 165 -mxb false -sizeable false -title "Static Mesh Exporter" $myWindow;

//Add layouts and controls.
frameLayout -l "";
columnLayout $mainLayout;
rowColumnLayout -nc 2 -cw 1 55;

text -l "MeshName:";
textField -text "changeMe" tMeshName;

text -l "Package:";
textField -text "myLevel" tPackage;

text -l "Group:";
textField tGroup;

text -l "Scale:";
floatField -pre 0 -v 16 fScale;

setParent $mainLayout;

separator -style none;
separator -w 165;
separator -style none;

button -w 155 -l "Export" -c "exportToMaya";

showWindow;

//Procedures

proc exportToMaya()
{

string $objSelected[] = `ls -sl`;
string $meshName = `textField -q -text tMeshName`;
string $sPackage = `textField -q -text tPackage`;
string $sGroup = `textField -q -text tGroup`;
float $fScale = `floatField -q -value fScale`;

if (size($objSelected)!=1)
{
confirmDialog -title "Selection Error" -message "Error in Selection!";
}
else
{

//Did the user Triangulate?
string $result = `confirmDialog -title "Confirm" -message "Did you Triangulate?"
-button "Yes" -button "No" -defaultButton "Yes"
-cancelButton "No" -dismissString "No"`;
if ($result == "No")
{
string $result = `confirmDialog -title "Confirm" -message "Triangulate Now?"
-button "Yes" -button "No" -defaultButton "Yes"
-cancelButton "No" -dismissString "No"`;
if ($result == "Yes")
{
polyPerformAction polyTriangulate f 0;
changeSelectMode -object;
select -r $objSelected[0]
}
}

//Does the set exist?
if (!`objExists $meshName`)
confirmDialog -message "Set Exists!";
else
{
$createSetResult = `sets -name $meshName`;
addAttr -ln scale -at double $meshName;
addAttr -ln package -dt "string" $meshName;
addAttr -ln group -dt "string" $meshName;
}

//Set the custom Attributes values
setAttr ($meshName + ".package") -type "string" $sPackage;
if ($sGroup)
{
setAttr ($meshName + ".group") -type "string" $sGroup;
}

setAttr ($meshName + ".scale") $fScale;

//Export to UnrealEd
eval ("unEditor mesh " + $meshName);
}
}

**********************************************
__________________
Dave Baer
Professor of Digital Arts
Digital Media Arts College
Boca Raton, Florida
dbaer@dmac.edu
dave_baer is offline   Reply With Quote
Old 14-12-2003, 05:32 PM   #2
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Well, I can't test this fully 'cause I don't have UT nor UnrealEd but it seems that you have a semicolon missing in the script.

select -r $objSelected[0]

should be

select -r $objSelected[0];
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
Old 15-12-2003, 04:20 AM   #3
dave_baer
Moderator
 
dave_baer's Avatar
 
Join Date: Sep 2002
Location: Plantation, Florida
Posts: 1,568
Thanks: 0
Thanked 12 Times in 9 Posts
Default

OMG! I can't believe I missed that! Thank dood. I was going nuts trying to figure that out.
__________________
Dave Baer
Professor of Digital Arts
Digital Media Arts College
Boca Raton, Florida
dbaer@dmac.edu
dave_baer is offline   Reply With Quote
Old 01-01-2004, 07:15 PM   #4
Chipper
Subscriber
 
Chipper's Avatar
 
Join Date: Jan 2003
Location: U.K.
Posts: 136
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found it much easier just to use the actorx plugin and "axmesh" command (in maya 4.5 or 5)...i did use the script first for the ple version of maya (shipped with game) and it worked oki except for the textures had to be flipped first horizontally an vertically before they mapped oki in unrealed.
Also using the script method you have to then add the texture to the mesh in unrealed by pointing to where you have put your imported texture...with the axmesh way it will appear textured right away in mesh browser if you have imported your textures previously to that of your mesh (if named properly).
Then theres the scaling thing although you can add to the script to tell it to multiply by sixteen to get scale right at export (even though you scale grid in maya as ueds)....and also this not a prob using the later method as it will scale to your grid settings correctly.
Hope that makes sense as i was previously making 3rd party levels for ut2003 but havent in a good while now.
__________________
"Hear That Thunder"!!
Chipper is offline   Reply With Quote
Old 01-01-2004, 07:46 PM   #5
dave_baer
Moderator
 
dave_baer's Avatar
 
Join Date: Sep 2002
Location: Plantation, Florida
Posts: 1,568
Thanks: 0
Thanked 12 Times in 9 Posts
Default

Thanks for the info, Chipper.

Nope. Haven't had any of those problems. Although I do have to point the textures to the right place, but I still have to do that with axmesh as well. Must be a bug or something. I can't get my same settings to load each time in UnrealEd. I always have to reload my imported mesh into the mesh browser. myLevel never shows up if I reload UnrealEd. Any ideas?
__________________
Dave Baer
Professor of Digital Arts
Digital Media Arts College
Boca Raton, Florida
dbaer@dmac.edu
dave_baer 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.