Home Getting Started Forum Video Training Points Download Gallery
Forum Links:
Simply Maya User Community : Powered by vBulletin version 2.3.5 Simply Maya User Community > Lounges > Maya Basics & Newbie Forum > Need some help with course assignment
  Last Thread   Next Thread
Author
Thread Post New Thread    Post A Reply
Stannoman
Newbie Member

Registered: Apr 2009
Location:
Posts: 28

Need some help with course assignment

Hello folks, I started a new study program this week, with a modeling course. We're basicly given an assignment already, while most of us have never touched Maya, and had to learn some of the basics in a 1.5 hour during lecture, we feel quite left in the dark, though it is understandable as the school wants us to learn by ourselves as much as possible. So I started to work on the assignment, but am stuck now. We basicly have to follow certain steps, but we lack the details on how to. (The tutorials we are given are really really basic and not useful for me).

The assignment contains that we disassemble and scan a carton box of any kind, crop the image (so the carton fits exactly on the canvas, (no white borders)). The next step is to put this image on a plane as reference and basicly create the shape of the silhouette by tracing the shape with the create polygon tool. Then we had to actually project the image (the scan of the disassembled carton) on the newly created mesh, after a lot of fiddling in the Create UV's menu, I managed to project the image of the carton, on the mesh.

However, I have no idea on how to complete the next steps, wich are described only vaguely (to me). The steps, quoted from my assignment description are:

j. Project UVs on carton (done)
k. Make shader
l. Attach carton scan as map
m. Apply shader to model

I am not sure what is meant by these steps, hopefully someone can explain what these steps mean, and how to commence them. It will also allow me to help my co-students further.

Thanks in advance.

Report this post to a moderator | IP: Logged

Old Post 08-09-2010 06:51 PM
Stannoman is online now Click Here to See the Profile for Stannoman Click here to Send Stannoman a Private Message Click Here to Email Stannoman Find more posts by Stannoman Add Stannoman to your buddy list Edit/Delete Message Reply w/Quote
Ozgalis
Senior Member

Registered: Dec 2008
Location: Crystal Lake, Illinois
Posts: 163

Make Shader - if your familiar with the hypershade open this if not go window > rendering editor > hypershade, on the left side you will see a bunch of materials (blinn, phone, lambert, etc. These are your basic materials, each one has different properties and are useful for different types of materials. Wood, Metal, etc) left click on any of those.

When you have made a shader (material) double left click on it, this will bring up your Attribute Editor (may have to minimize the hypershade) there should be an option for color with a slider and to the right of the slider a checker box looking icon, click on that and it should bring up an option box. Find Image and bring in the scan of your carton. (This step just brings your texture and applies it to a material that you choose)

After doing that you can either right click on the object you modeled and go down to apply shader and than find the one you just made..or middle mouse drag the shader from the hypershade to the object.

If you did the UV's right it should place your scan (texture) in the right place.

Hope this helps.

Last edited by Ozgalis on 08-09-2010 at 07:32 PM

Report this post to a moderator | IP: Logged

Old Post 08-09-2010 07:26 PM
Ozgalis is offline Click Here to See the Profile for Ozgalis Click here to Send Ozgalis a Private Message Click Here to Email Ozgalis Find more posts by Ozgalis Add Ozgalis to your buddy list Edit/Delete Message Reply w/Quote
Dango77
Grand Master of the 32 bit floating point technique....Hiiiya!

Registered: Mar 2009
Location: London
Posts: 787

Hold your right mouse button over the object and select "assign new material", choose a blinn or lambert from the following menu, open up the attributes editor and click on the little black and white checkered box to the righthand side of "color", select "file" from the next menu, then back in the attributes editor next to image name selct the folder and browse to your image of the carton, should be okay from there.

If there's any other problems hopefully someone else can help as I'm off out for the evening, good luck!

*edit*

Oops, looks like Ozgalis got in there at the same time as me...lol. Either way will work.

__________________

Virtual City Challenge Apr 09

Spaceship Challenge June 09

3dartistsonline Gallery

Last edited by Dango77 on 08-09-2010 at 07:31 PM

Report this post to a moderator | IP: Logged

Old Post 08-09-2010 07:29 PM
Dango77 is offline Click Here to See the Profile for Dango77 Click here to Send Dango77 a Private Message Click Here to Email Dango77 Find more posts by Dango77 Add Dango77 to your buddy list Edit/Delete Message Reply w/Quote
Stannoman
Newbie Member

Registered: Apr 2009
Location:
Posts: 28

Ok thank you guys, was easier than I imagined it to be hehe, anyway, due to me fiddling around a lot with hypershade and such, I probably changed some setting somewhere and now I can't simply even project an image correctly on a simple plane anymore! So I guess I will have to reset my settings, by deleting some prefs file, will look into that now, then continue with the information you guys gave me.

Report this post to a moderator | IP: Logged

Old Post 08-09-2010 09:07 PM
Stannoman is online now Click Here to See the Profile for Stannoman Click here to Send Stannoman a Private Message Click Here to Email Stannoman Find more posts by Stannoman Add Stannoman to your buddy list Edit/Delete Message Reply w/Quote
Mayaniac
may-A-nee-ACK

Registered: Nov 2007
Location: Derby
Posts: 1039

Re: Need some help with course assignment

quote:
Originally posted by Stannoman
...we feel quite left in the dark, though it is understandable as the school wants us to learn by ourselves as much as possible.


So, how much tuition are you paying these idiots to tell you to go learn it yourself?

Not having a go at you... but theres far too much of this going on now days. You learn just as much, if not more, on your own than you do with most of these courses. Plus you're not left at the end of it all with £40,000 of debt, and you still don't know what's going on.

__________________
-Steve

"Your weapons are no match for ours! People of Mars, surrender!"
"Um, this isn't Mars. This is Earth."
"Earth? Earth-with-nuclear-weapons Earth?"
"Yes."
[long pause] "Friend!!"

Report this post to a moderator | IP: Logged

Old Post 08-09-2010 11:04 PM
Mayaniac is offline Click Here to See the Profile for Mayaniac Click here to Send Mayaniac a Private Message Find more posts by Mayaniac Add Mayaniac to your buddy list Edit/Delete Message Reply w/Quote
bullet1968
Fastest Surveyor in Perth.

Registered: Feb 2010
Location: Australia
Posts: 1086

Sadly I agree with Steve....I have the exact same problem re-teaching uni or TAFE Surveyors...how to be Surveyors...and no I didnt go to school..I learnt in the field.

Stanno I cant understand how or why they really want you to do this?? Texturing is obviously a progression in the overall art of 3D. I would have assumed they would be teaching you modelling basics first up....without those even a good artist will flounder.

I am glad that there is a site like this (one of the best by far) where you can get a lot of help from good people. I wont re-invent the wheel but I use Dango's method (by trail and error) but am learning the hypershade is good for complex mixing of substance. (more so you can see whats going on in the Hyper window etc)

Can I ask is this program PART of something larger and they are trying to compress the learning process for this reason? If so I would question..as Steve said..the end result mate?? I only do it part time (yes you can tell LOL) but I reckon I have learnt more from the guys (and girls mmwwaa) here than I would get from a powercourse/shortcourse.

For image planes there are some here I believe and GOOGLE is your best mate (well for me anyway). There are some good free and easy tutorials for this.

I dont know mud from clay but break it down. I dont know what they are doing but HOW or WHAT is the image meant to look like. Are you doing 2D with create poly then extrude etc? If it is simply to learn mapping do as Dango or Oz said. Then apply the shade to the model. Remember to press 6 to apply/see the image on your model mate. I think 5 provides the shade and 6 proje cts it to the model...something similar anyway.

Post some images of what you are trying to achieve..

cheers bullet

__________________
bullet1968

"A Darkness at Sethanon", a book I aspire to model some of the charcters and scenes

Report this post to a moderator | IP: Logged

Old Post 09-09-2010 01:25 PM
bullet1968 is offline Click Here to See the Profile for bullet1968 Click here to Send bullet1968 a Private Message Find more posts by bullet1968 Add bullet1968 to your buddy list Edit/Delete Message Reply w/Quote
Stannoman
Newbie Member

Registered: Apr 2009
Location:
Posts: 28

The course is part of a complete study program, International Game Architecture and Design.

I got an update for you guys, (lol)

For another class we have to form up with programmers, and start working on a concept for a game. Something we are trying to work out at the moment, is to export our maya files, to .mdl files, as these extentions are required to use the models in A8 Gamestudio, the school provided us a converter, but it only works with an outdated version of maya. And when I tried asking the gamelab professor for help, he said he's not gonna help us, and that this is part of our research and learning curve.. ARRGH.

I will continue trying to find a converter/exporter, but no luck so far.

BTW: Thanks for the help so far, it turned out that I already did the steps I wrote down... I am just not used to the termology yet so it is often not clear to me what they mean.

Alright, I found a Mel script, think I am supposed to use this to export my maya model into .mdl

though I have no clue how it works as I have 0 knowledge on coding. Here is the script:

quote:
global proc shelf_Export () { global string $gBuffStr; global string $gBuffStr0; global string $gBuffStr1; shelfButton -enableCommandRepeat 1 -enable 1 -width 34 -height 34 -manage 1 -visible 1 -preventOverride 0 -align "center" -label "//mdl5-ascii exporter (c) 2003 thomas oppl\r\n\r\n//////////////////..." -labelOffset 0 -font "tinyBoldLabelFont" -image "C:/Documents and Settings/igadmin/My Documents/maya/8.0/prefs/shelves/maya_3dgame32.bmp" -image1 "C:/Documents and Settings/igadmin/My Documents/maya/8.0/prefs/shelves/maya_3dgame32.bmp" -style "iconOnly" -marginWidth 1 -marginHeight 1 -command "//mdl5-ascii exporter (c) 2003 thomas oppl\r\n\r\n//////////////////////////////////////////\r\n\r\nglobal int $tf_aindex=0;\r\n\r\nglobal string $tf_anames[]; clear $tf_anames;\r\n\r\nglobal string $tf_aframes[]; clear $tf_aframes;\r\n\r\n\r\n\r\nprint $tf_anames;\r\n\r\n\r\n\r\nproc int bc_add()\r\n\r\n{\r\n\r\n\tglobal int $tf_aindex;\r\n\r\n\tglobal string $tf_anames[]; \r\n\r\n\tglobal string $tf_aframes[];\r\n\r\n\r\n\r\n\t$tf_aindex++;\r\n\
r\n\tsetParent RCL2;\r\n\r\n\t$tf_anames[$tf_aindex]=`textField`;
\r\n\r\n\t$tf_aframes[$tf_aindex]=`textField`;\r\n
\r\n\treturn 1;\r\n\r\n}\r\n\r\n\r\n\r\nproc int bc_remove()\r\n\r\n{\r\n\r\n\tglobal int $tf_aindex;\r\n\r\n\tglobal string $tf_anames[];\r\n\r\n\tglobal string $tf_aframes[];\r\n\r\n\r\n\r\n\tif($tf_aindex>0)\r\n\r\n\t{\r\n\r\n\t\tdeleteUI $tf_anames[$tf_aindex];\r\n\r\n\t\tdeleteUI $tf_aframes[$tf_aindex];\r\n\r\n\t\ttext -l \"\" t_temp; deleteUI t_temp;\r\n\r\n\t\t$tf_aindex--;\r\n\r\n\t}\r\n\r\n\treturn 1;\r\n\r\n}\r\n\r\n\r\n\r\nproc int bc_load()\r\n\r\n{\r\n\r\n\tfileBrowserDialog -m 0 -fc \"load_animlist\" -an \"load\";\r\n\r\n\treturn 1;\r\n\r\n}\r\n\r\n\r\n\r\nproc int bc_save()\r\n\r\n{\r\n\r\n\tfileBrowserDialog -m 1 -fc \"save_animlist\" -an \"save\";\r\n\r\n\treturn 1;\r\n\r\n}\r\n\r\n\r\n\r\nproc int bc_browse()\r\n\r\n{\r\n\r\n\tfileBrowserDialog -m 4 -fc \"set_path\" -an \"browse\";\r\n\r\n\treturn 1;\r\n\r\n}\r\n\r\n\r\n\r\nproc int set_path(string $filename, string $fileType)\r\n\r\n{\r\n\r\n\ttextField -e -tx $filename tf_path;\r\n\r\n\treturn 1;\r\n\r\n}\r\n\r\n\r\n\r\nproc int load_animlist(string $filename, string $fileType)\r\n\r\n{\r\n\r\n\tglobal int $tf_aindex;\r\n\r\n\tglobal string $tf_anames[]; \r\n\r\n\tglobal string $tf_aframes[];\r\n\r\n\r\n\r\n\twhile($tf_aindex>=0)\r\n\r\n\t{\r\n\r\n\t\tdeleteUI $tf_anames[$tf_aindex];\r\n\r\n\t\tdeleteUI $tf_aframes[$tf_aindex];\r\n\r\n\t\ttext -l \"\" t_temp; deleteUI t_temp;\r\n\r\n\t\t$tf_aindex--;\r\n\r\n\t}\r\n\r\n\t$fileid=`fopen $filename \"r\"`;\r\n\r\n\tsetParent RCL2;\r\n\r\n\twhile(!`feof $fileid`)\r\n\r\n\t{\r\n\r\n\t\t$tf_aindex++;\r\n\
r\n\t\t$fname=`fgetline $fileid`;\r\n\r\n\t\t$tf_anames[$tf_aindex]=`textF
ield -tx $fname`;\r\n\r\n\t\t$fframes=`fgetline $fileid`;\r\n\r\n\t\t$tf_aframes[$tf_aindex]=`text
Field -tx $fframes`;\r\n\r\n\t}\r\n\r\n\tfclose $fileid;\r\n\r\n\treturn 1;\r\n\r\n}\r\n\r\n\r\n\r\nproc int save_animlist(string $filename, string $fileType)\r\n\r\n{\r\n\r\n\tglobal int $tf_aindex;\r\n\r\n\tglobal string $tf_anames[]; \r\n\r\n\tglobal string $tf_aframes[];\r\n\r\n\r\n\r\n\t$fileid=`fopen $filename \"w\"`;\r\n\r\n\tfor($i=0;$i<=$tf_aindex;$i++)\r\n\r\n\t{\r\n\r\n\t\tstring $fname=eval(\"textField -q -tx \"+$tf_anames[$i]);\r\n\r\n\t\tstring $fframes=eval(\"textField -q -tx \"+$tf_aframes[$i]);\r\n\r\n\t\tfprint $fileid ($fname+\"\\n\"+$fframes);\r\n\r\n\t\tif($i!=$tf_aindex)fprint $fileid (\"\\n\");\r\n\r\n\t}\r\n\r\n\tfclose $fileid;\r\n\r\n\treturn 1;\r\n\r\n}\r\n\r\n\r\n\r\nproc int update_progress(int $value, int $max_value, string $status)\r\n\r\n{\r\n\r\n\tfloat $divisor=(float)$max_value/(float)100;\r\n\r\n\tfloat $percent=(float)$value/$divisor;\r\n\r\n\tprogressWindow -e -pr $value -st ((int)$percent+\"% \"+$status);\r\n\r\n\treturn 1;\r\n\r\n}\r\n\r\n\r\n\r\nproc int bc_export()\r\n\r\n{\r\n\r\n\tflushUndo;\r\n\r\n\t
undoInfo -state off;\r\n\r\n\r\n\r\n\tglobal int $tf_aindex;\r\n\r\n\tglobal string $tf_anames[];\r\n\r\n\tglobal string $tf_aframes[];\r\n\r\n\r\n\r\n\tfloat $scale=`floatField -q -v ff_scale`;\r\n\r\n\tstring $path=`textField -q -tx tf_path`;\r\n\r\n\tstring $filename=`substitute \"(\\\\\\\\)+$\" $path \"\"`+\"\\\\model.txt\";\r\n\r\n\tstring $anim_names[];\r\n\r\n\tint $export_frames[];\r\n\r\n\tint $export_frames_nameindex[];\r\n\r\n\tint $export_frames_namecount[];\r\n\r\n\tint $count=0;\r\n\r\n\tint $ai=0;\r\n\r\n\tint $efi=0;\r\n\r\n\r\n\r\n\t//----------------------------------------fetch animations from textfields\r\n\r\n\twhile($ai< =$tf_aindex)\r\n\r\n\t{\r\n\r\n\t\t$anim_names[$ai
]=eval(\"textField -q -tx \"+$tf_anames[$ai]);\r\n\r\n\t\t\tif(match(\"[a-zA-Z0-9]+\",$anim_names[$ai])==\"\")//----------------------------------------------------------------warning\r\n\r\n\t\t\t{\r\n\r\n\t\t\t\tstring $message=\"empty animation name field!\";\r\n\r\n\t\t\t\tprogressWindow -ep; confirmDialog -t \"warning\" -m $message -b \"ok\";\tundoInfo -state on; error $message;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(`size $anim_names[$ai]`>14)//--------------------------------------------------------------------------------warning\r\n\r\n\t\t\t{\r\n\r\n\t\t\t\tstring $message=\"animation name has more than 14 characters!\"; \r\n\r\n\t\t\t\tprogressWindow -ep; confirmDialog -t \"warning\" -m $message -b \"ok\";\tundoInfo -state on; error $message;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(match(\" +\",$anim_names[$ai])!=\"\")//--------------------------------------------------------------------------warning\r\n\r\n\t\t\t{\r\n\r\n\t\t\t\tstring $message=\"animation name contains spaces!\"; \r\n\r\n\t\t\t\tprogressWindow -ep; confirmDialog -t \"warning\" -m $message -b \"ok\";\tundoInfo -state on; error $message;\r\n\r\n\t\t\t}\r\n\r\n\t\tstring $tempstring=eval(\"textField -q -tx \"+$tf_aframes[$ai]);\r\n\r\n\t\t\tif(match(\"[0-9]+\",$tempstring)==\"\")//---------------------------------------------------------------------------warning\r\n\r\n\t\t\t{\r\n\r\n\t\t\t\tstring $message=\"error in animation frames field!\";\r\n\r\n\t\t\t\tprogressWindow -ep; confirmDialog -t \"warning\" -m $message -b \"ok\";\tundoInfo -state on; error $message;\r\n\r\n\t\t\t}\r\n\r\n\t\tint $frame;\r\n\r\n\t\tint $namecount=0;\r\n\r\n\t\tfor($frame in return_intarray($tempstring))\r\n\r\n\t\t{\r\n\r\n
\t\t\t$export_frames[$efi]=$frame;\r\n\r\n\t\t\t$e
xport_frames_nameindex[$efi]=$ai;\r\n\r\n\t\t\t$ex
port_frames_namecount[$efi]=$namecount;\r\n\r\n\t\
t\t$namecount++;\r\n\r\n\t\t\t$efi++;\r\n\r\n\t\t}
\r\n\r\n\t\t$ai++;\r\n\r\n\t}\r\n\r\n\r\n\r\n\t//----------------------------------------evaluate selected object\r\n\r\n\tstring $object[]=`ls -tr -sl`;\r\n\r\n\t\tif($object[0]==\"\")//---------------------------------------------------------------------------------------------------warning\r\n\r\n\t\t{\r\n\r\n\t\t\tstring $message=\"no object selected!\"; \r\n\r\n\t\t\tprogressWindow -ep; confirmDialog -t \"warning\" -m $message -b \"ok\";\tundoInfo -state on; error $message;\r\n\r\n\t\t}\r\n\r\n\tstring $cmd;\r\n\r\n\t$cmd=(\"polyEvaluate -v\");\r\n\r\n\tint $numverts[]=eval($cmd);\r\n\r\n\t$cmd=(\"polyEvaluate -uv\");\r\n\r\n\tint $numuvs[]=eval($cmd);\r\n\r\n\t$cmd=(\"polyEvaluate -t\");\r\n\r\n\tint $numtris[]=eval($cmd);\r\n\r\n\r\n\r\n\tint $numframes=size($export_frames);\r\n\r\n\tint $current_frame=0;\r\n\r\n\tcurrentTime $export_frames[$current_frame];\r\n\r\n\r\n\r\n\ti
nt $progress=0;\r\n\r\n\tfloat $step=1;\r\n\r\n\tint $max_progress=$numframes+$numuvs[0]+(2*$numtris[0]
)+($numverts[0]*$numframes);\r\n\r\n\tprogressWind
ow -t \"exporting mdl5-ascii file...\" -pr $progress -st \"0%\" -ii false -min 0 -max $max_progress;\r\n\r\n\t\r\n\r\n\t//----------------------------------------open file\r\n\r\n\t$fileid=`fopen $filename \"w\"`;\r\n\r\n\t\tif($fileid==0)//-------------------------------------------------------------------------------------------------------warning\r\n\r\n\t\t{\r\n\r\n\t\t\tstring $message=\"directory does not exist!\"; \r\n\r\n\t\t\tprogressWindow -ep; confirmDialog -t \"warning\" -m $message -b \"ok\";\tundoInfo -state on; error $message;\r\n\r\n\t\t}\r\n\r\n\t\r\n\r\n\t//----------------------------------------find global bounding box\r\n\r\n\t$cmd=(\"polyEvaluate -b\");\r\n\r\n\tfloat $gbb[]=eval($cmd);\r\n\r\n\twhile ($current_frame<$numframes)\r\n\r\n\t{\t\r\n\r\n\t\t$cmd=(\"polyEvaluate -b\");\r\n\r\n\t\tfloat $bb[]=eval($cmd);\r\n\r\n\t\r\n\r\n\t\tif ($bb[0]<$gbb[0]){$gbb[0]=$bb[0];}\r\n\r\n\t\tif ($bb[1]>$gbb[1]){$gbb[1]=$bb[1];}\r\n\r\n\t\tif ($bb[2]<$gbb[2]){$gbb[2]=$bb[2];}\r\n\r\n\t\tif ($bb[3]>$gbb[3]){$gbb[3]=$bb[3];}\r\n\r\n\t\tif ($bb[4]<$gbb[4]){$gbb[4]=$bb[4];}\r\n\r\n\t\tif ($bb[5]> $gbb[5]){$gbb[5]=$bb[5];}\r\n\r\n\r\n\r\n\t\t$curr
ent_frame++;\t\r\n\r\n\t\tcurrentTime $export_frames[$current_frame];\r\n\r\n\r\n\r\n\t\
tupdate_progress($progress++,$max_progress,\"finding globalboundingbox...\" );\r\n\r\n\r\n\r\n\t}\r\n\r\n\t$current_frame=0;\r
\n\r\n\tcurrentTime $export_frames[$current_frame];\r\n\r\n\r\n\r\n\t//----------------------------------------write header\r\n\r\n\tfprint $fileid \"globalboundingbox\\n\";\r\n\r\n\tfprint $fileid ((-$gbb[1])+\" \"+$gbb[4]+\" \"+$gbb[2]+\" \"+(-$gbb[0])+\" \"+$gbb[5]+\" \"+$gbb[3]+\"\\n\");\r\n\r\n\tfprint $fileid (\"numverts\\n\"+$numverts[0]+\"\\n\");\r\n\r\n\tfprint $fileid (\"numtris\\n\"+$numtris[0]+\"\\n\");\r\n\r\n\tfprint $fileid (\"numuvs\\n\"+$numuvs[0]+\"\\n\");\r\n\r\n\tfprint $fileid (\"numframes\\n\"+$numframes+\"\\n\");\r\n\r\n\tfprint $fileid (\"scale\\n\"+$scale+\"\\n\");\r\n\r\n\r\n\r\n\t//----------------------------------------write uvcoordinates\r\n\r\n\tfprint $fileid \"uvcoordinates\\n\";\r\n\r\n\t$step=$numuvs[0]/10;if($step< 1)$step=1;\r\n\r\n\t$count=0;\r\n\r\n\twhile($coun
t<$numuvs[0])\r\n\r\n\t{\t\r\n\r\n\t\tfloat $uv[]=`polyEditUV -q -u -v ($object[0]+\".map[\"+$count+\"]\")`;\r\n\r\n\t\tfprint $fileid ($uv[0]+\" \"+$uv[1]+\"\\n\");\r\n\r\n\t\t\tif($uv[0]>1.001||$uv[0]<-0.001||$uv[1]>1.001||$uv[1]<-0.001)//--------------------------------------------------warning\r\n\r\n\t\t\t{\r\n\r\n\t\t\t\tstring $message=\"some uvcoordinates are outside 0 and 1 texture space!\";\r\n\r\n\t\t\t\tfclose $fileid; system(\"shell del \"+$filename);\r\n\r\n\t\t\t\tprogressWindow -ep; confirmDialog -t \"warning\" -m $message -b \"ok\";\tundoInfo -state on; error $message;\r\n\r\n\t\t\t}\r\n\r\n\t\t$count++;\r\n\
r\n\r\n\r\n\t\tif($count%$step==0)update_progress(
$progress+=$step,$max_progress,\"writing uvcoordinates...\");\r\n\r\n\r\n\r\n\t}\r\n\r\n\r\n\r\n\t//----------------------------------------write triangles\r\n\r\n\tfprint $fileid \"triangles\\n\";\r\n\r\n\t$step=$numtris[0]/10;if($step< 1)$step=1;\r\n\r\n\t$count=0;\r\n\r\n\twhile($coun
t<$numtris[0])\r\n\r\n\t{\r\n\r\n\t\tstring $tempstringarray[]=`polyInfo -fv ($object[0]+\".f[\"+$count+\"]\")`;\r\n\r\n\t\tint $list[]=return_intarray($tempstringarray[0]);\r\n\
r\n\t\t\tif(size($list)>4)//---------------------------------------------------------------------------------------------warning\r\n\r\n\t\t\t{\r\n\r\n\t\t\t\tstring $message=\"model is not triangulated!\";\r\n\r\n\t\t\t\tfclose $fileid; system(\"shell del \"+$filename);\r\n\r\n\t\t\t\tprogressWindow -ep; confirmDialog -t \"warning\" -m $message -b \"ok\";\tundoInfo -state on; error $message;\r\n\r\n\t\t\t}\r\n\r\n\t\tfprint $fileid ($list[1]+\" \"+$list[2]+\" \"+$list[3]+\"\\n\" );\r\n\r\n\t\t$count++;\r\n\r\n\r\n\r\n\t\tif($cou
nt%$step==0)update_progress($progress+=$step,$max_
progress,\"writing triangles...\");\r\n\r\n\r\n\r\n\t}\r\n\r\n\r\n\r\n\t//----------------------------------------write uvtriangles\r\n\r\n\tfprint $fileid \"uvtriangles\\n\";\r\n\r\n\t$count=0;\r\n\r\n\twhile($count<$numtris[0])\r\n\r\n\t{\r\n\r\n\t\tstring $tempstringarray[]=`polyInfo -fv ($object[0]+\".f[\"+$count+\"]\")`;\r\n\r\n\t\tint $list[]=return_intarray($tempstringarray[0]);\r\n\
r\n\t\tfor($i=1;$i<4;$i++)\r\n\r\n {\r\n\r\n\t\t\tstring $vf=$object[0]+\".vtxFace[\"+$list[$i]+\"][\"+$list[0]+\"]\";\r\n\r\n\t\t\tstring $tempstringarray[]=`polyListComponentConversion -fromVertexFace -toUV $vf`;\r\n\r\n\t\t\tint $intarray[]=return_intarray($tempstringarray[0]);\
r\n\r\n\t\t\tfprint $fileid ($intarray[size($intarray)-1]+\" \"); //faster with $tempstring?\r\n\r\n\t\t}\r\n\r\n\t\tfprint $fileid (\"\\n\" );\r\n\r\n\t\t$count++;\r\n\r\n\r\n\r\n\t\tif($cou
nt%$step==0)update_progress($progress+=$step,$max_
progress,\"writing uvtriangles...\");\r\n\r\n\r\n\r\n\t}\r\n\r\n\r\n\r\n\t//----------------------------------------write animation frames\r\n\r\n\t$step=$numverts[0]/5;if($step<1)$step=1;\r\n\r\n\twhile($current_frame<$numframes)\r\n\r\n\t{\r\n\r\n\t//----------------------------------------frame name\r\n\r\n\t\tstring $tempstring=$anim_names[$export_frames_nameindex[$
current_frame]]+$export_frames_namecount[$current_
frame];\r\n\r\n\t\tfprint $fileid ($tempstring+\"\\n\");\r\n\r\n\t//----------------------------------------bounding box\r\n\r\n\t\tfprint $fileid \"boundingbox\\n\";\r\n\r\n\t \t$cmd=(\"polyEvaluate -b\");\r\n\r\n\t\tfloat $bb[]=eval($cmd);\r\n\r\n\t\tfprint $fileid ((-$bb[1])+\" \"+$bb[4]+\" \"+$bb[2]+\" \"+(-$bb[0])+\" \"+$bb[5]+\" \"+$bb[3]+\"\\n\");\r\n\r\n\t//----------------------------------------vertices+normals\r\n\r\n\t\tfprint $fileid \"vertices+normals\\n\";\r\n\r\n\t\t$count=0;\t\r\n\r\n\t\twhile($count<$numverts[0])\r\n\r\n\t\t{\r\n\r\n\t\t\tfloat $vtx[]=`pointPosition ($object[0]+\".vtx[\"+$count+\"]\")`;\r\n\r\n\t\t\tfprint $fileid (-$vtx[0]+\" \"+$vtx[2]+\" \"+$vtx[1]+\" \");\r\n\r\n\t\t\tfloat $x[]=`polyNormalPerVertex -q -x ($object[0]+\".vtx[\"+$count+\"]\")`;\r\n\r\n\t\t\tfprint $fileid ($x[0]+\" \");\r\n\r\n\t\t\tfloat $z[]=`polyNormalPerVertex -q -z ($object[0]+\".vtx[\"+$count+\"]\")`;\r\n\r\n\t\t\tfprint $fileid (-$z[0]+\" \");\r\n\r\n\t\t\tfloat $y[]=`polyNormalPerVertex -q -y ($object[0]+\".vtx[\"+$count+\"]\")`;\r\n\r\n\t\t\tfprint $fileid (-$y[0]+\"\\n\" );\r\n\r\n\t\t\t$count++;\r\n\r\n\r\n\r\n\t\t\tif(
$count%$step==0)update_progress($progress+=$step,$
max_progress,\"writing frame \"+$tempstring+\"...\" );\r\n\r\n\r\n\r\n\t\t}\r\n\r\n\t\t$current_frame+
+;\r\n\r\n\t\tcurrentTime $export_frames[$current_frame];\r\n\r\n\t}\r\n\r\n
\t\r\n\r\n\t//----------------------------------------close file\r\n\r\n\tfclose $fileid;\r\n\r\n\r\n\r\n\tprogressWindow -ep;\r\n\r\n\tconfirmDialog -t \"export done!\" -m \"export done!\" -b \"ok\" -db \"ok\" -ds \"ok\" -p exporterwindow;\r\n\r\n\r\n\r\n\tundoInfo -state on;\r\n\r\n\treturn 1;\r\n\r\n}\r\n\r\n\r\n\r\nproc int[] return_intarray(string $intstring)\r\n\r\n{\r\n\r\n\tint $intarray[];\r\n\r\n\tint $i=0;\r\n\r\n\twhile(match(\"[0-9]+\",$intstring)!=\"\")\r\n\r\n\t{\r\n\r\n\t\t$intarray[$i]=match(\"[0-9]+\",$intstring);\r\n\r\n\t\t$intstring=`substitute \"[0-9]+\" $intstring \"\"`;\r\n\r\n\t\t$i++;\r\n\r\n\t}\r\n\r\n\treturn $intarray;\r\n\r\n}\r\n\r\n\r\n\r\nproc int create_gui()\r\n\r\n{\r\n\r\n\tglobal int $tf_aindex;\r\n\r\n\tglobal string $tf_anames[];\r\n\r\n\tglobal string $tf_aframes[];\r\n\r\n\tif(`window -exists exporterwindow`)deleteUI exporterwindow;\r\n\r\n\twindow -wh 512 384 -te 100 -le 100 -s false -t \"maya mdl5-ascii exporter\" exporterwindow;\r\n\r\n\trowColumnLayout -nr 2 -rh 1 250 -rh 2 125 RCL1;\r\n\r\n\t\tscrollLayout -hst 0 -p RCL1 SL1;\r\n\r\n\t\t\trowColumnLayout -nc 2 -cw 1 85 -cw 2 385 -p SL1 RCL2;\r\n\r\n\t\t\t\ttext -l \"animation name\" tx1;\r\n\r\n\t\t\t\ttext -l \"animation frames\" tx2;\r\n\r\n\t\t\t\t$tf_anames[$tf_aindex]=`textFi
eld -tx \"walk\" `;\r\n\r\n\t\t\t\t$tf_aframes[$tf_aindex]=`textFie
ld -tx \"2 4 6 8 10 12\"`;\r\n\r\n\t\tcolumnLayout -p RCL1 CL1;\r\n\r\n\t\t\trowLayout -nc 4 -cw4 60 60 60 60 -p CL1 RL1;\r\n\r\n\t\t\t\tbutton -l \"add\" -w 60 -c \"bc_add()\";\r\n\r\n\t\t\t\tbutton -l \"remove\" -w 60 -c \"bc_remove()\";\r\n\r\n\t\t\t\tbutton -l \"load\" -w 60 -c \"bc_load()\";\r\n\r\n\t\t\t\tbutton -l \"save\" -w 60 -c \"bc_save()\";\r\n\r\n\t\t\tsetParent CL1;\t\r\n\r\n\t\t\t\ttext -l \"\";\r\n\r\n\t\t\trowLayout -nc 2 -cw2 30 300 -p CL1 RL2;\r\n\r\n\t\t\t\ttext -l \"scale:\";\r\n\r\n\t\t\t\tfloatField -pre 4 -v 1 -min 0.1 -max 128 ff_scale;\r\n\r\n\t\t\trowLayout -nc 3 -cw3 30 414 60 -p CL1 RL3;\r\n\r\n\t\t\t\ttext -l \"path:\";\r\n\r\n\t\t\t\ttextField -tx \"e:\\\\\" -w 414 tf_path;\r\n\r\n\t\t\t\tbutton -l \"browse\" -w 60 -c \"bc_browse()\";\r\n\r\n\t\t\tsetParent CL1;\r\n\r\n\t\t\t\tbutton -l \"export mdl5-ascii file\" -w 504 -c \"bc_export()\";\r\n\r\n\tshowWindow exporterwindow;\r\n\r\n\treturn 1;\r\n\r\n}\r\n\r\n\r\n\r\ncreate_gui();" -actionIsSubstitute 0 ; }

Last edited by Stannoman on 09-09-2010 at 02:05 PM

Report this post to a moderator | IP: Logged

Old Post 09-09-2010 01:45 PM
Stannoman is online now Click Here to See the Profile for Stannoman Click here to Send Stannoman a Private Message Click Here to Email Stannoman Find more posts by Stannoman Add Stannoman to your buddy list Edit/Delete Message Reply w/Quote
All times are GMT. The time now is 02:05 PM. Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

< Contact Us - Home >

Powered by: vBulletin Version 2.3.5
Copyright ©2000 - 2010, Jelsoft Enterprises Limited.
Simply Maya 2009