Maya Training

Introduction to Hard Surface Modeling

Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

Maya Training

Shading, Lighting and Rendering the Bedroom in MR

Maya Training

Robot volume one - Modeling with animation in mind

Maya Training

Spach-Alspaugh House the complete courseware

Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

New Maya Training

Robot Volume 02 - Hybrid Rigging
You are here > Home > SimplyMaya Community Forums
Loading

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 13-12-2003, 04: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, 06: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, 05: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, 08: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, 08: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

A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2015 SimplyMaya - vBulletin® Copyright © 2000-2015, Jelsoft Enterprises Ltd.