Changeset 2235 for GTP/trunk/App
- Timestamp:
- 03/12/07 14:06:28 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/GTPSceneExport.mel
r2219 r2235 146 146 eval ("ogreExport" + $options); 147 147 } 148 148 149 149 fclose $fileId; 150 151 int $exportPathMapMaterials = `checkBox -query -value ExportPMMat`; 152 if($exportPathMapMaterials) 153 { 154 string $materialFile = (`textField -query -text PMMatFile`); 155 string $materialFileName = encodeString(toNativePath($outputDir + $materialFile)); 156 157 $PMMatfileId = `fopen $materialFileName "w"`; 158 159 fprint $PMMatfileId "<materials>\n"; 160 161 string $materials[] = `ls -type lambert`; 162 for($i = 0; $i < size($materials); $i++) 163 { 164 select $materials[$i]; 165 fprint $PMMatfileId ("<material name=\"" + $materials[$i] +"\" "); 166 string $textureFiles[] = `listConnections -t file`; 167 if(size($textureFiles) > 0) 168 { 169 select $textureFiles[0]; 170 $textureName = `getAttr .fileTextureName`; 171 fprint $PMMatfileId ("texture=\"" + basename($textureName, "") + "\" "); 172 } 173 else 174 { 175 float $baseColor[] = `getAttr .color`; 176 string $colorString = $baseColor[0] + " " + $baseColor[1] + " " + $baseColor[2]; 177 fprint $PMMatfileId ("color=\"" + $colorString + "\" "); 178 } 179 fprint $PMMatfileId "/>\n"; 180 } 181 fprint $PMMatfileId "</materials>\n"; 182 fclose $PMMatfileId; 183 } 150 184 } 151 185 … … 179 213 int $exportPM = `checkBox -q -v ExportPMAttr`; 180 214 text -edit -enable $exportPM PMPathLabel; 181 textField -edit -enable $exportPM PMPath; 215 textField -edit -enable $exportPM PMPath; 216 217 int $exportPMMat = `checkBox -q -v ExportPMMat`; 218 text -edit -enable $exportPMMat PMMatFileLabel; 219 textField -edit -enable $exportPMMat PMMatFile; 182 220 } 183 221 … … 185 223 { 186 224 string $sceneFile = `file -query -sceneName`; 225 string $sceneDir = dirname($sceneFile); 187 226 string $mayaFile = basename($sceneFile, "." + fileExtension($sceneFile)); 188 227 if($mayaFile == "") … … 217 256 -parent GTPGeneralControlsLayout 218 257 -width 305 258 -text $sceneDir 219 259 OutputDirectory; 220 260 text … … 333 373 -text "prm" 334 374 PMPath; 335 375 checkBox 376 -parent PathMapControlsLayout 377 -value false 378 -changeCommand "formatGTPExportUI" 379 -label "Export Path Map Materials" 380 ExportPMMat; 381 text 382 -parent PathMapControlsLayout 383 -label "Path Map Material File" 384 -enable false 385 PMMatFileLabel; 386 textField 387 -parent PathMapControlsLayout 388 -width 305 389 -enable false 390 -text ($mayaFile + ".materials") 391 PMMatFile; 336 392 button 337 393 -parent GTPSceneExportMainLayout
Note: See TracChangeset
for help on using the changeset viewer.