global proc defineIHM()
{
//Test exist window Exporter Orealia, if yes delete window
if (window -exists ExporterOrealia
)
{
deleteUI ExporterOrealia;
}
//Path of scene directory
string $sceneFile = `file -query -sceneName`;
string $sceneDir = dirname($sceneFile);
string $fileBrowserCommand = "fileBrowser \"fileBrowserCallbackFunc\" \"Booooyah!!\" \"\" 1";
//Window definition
string $ExporterOrealia = `window -menuBar true -rtf true -title "Exporter Orealia" ExporterOrealia`;
//Create ScrollLayout Materials
string $scrollLayout = `scrollLayout
-parent ExporterOrealia
-horizontalScrollBarThickness 16
-verticalScrollBarThickness 16`;
columnLayout ColLayout;
setParent ..;
int $top, $left, $value[2];
$value = `scrollLayout -query -scrollAreaValue $scrollLayout`;
$top = $value[0];
$left = $value[1];
//Window menu
menu -label "File" -tearOff true;
menuItem -label "Quit" -command ("deleteUI -window " + $ExporterOrealia) ;
menu -label "Help" -helpMenu true;
menuItem -label "About Application..." -command present;
string $tabs = tabLayout -p ColLayout -innerMarginWidth 5 -innerMarginHeight 5
;
columnLayout
-parent $tabs
ExporterOrealiaLayout;
setParent ..;
//Directory layout
frameLayout
-parent ExporterOrealiaLayout
-width 500
-label "Common Parameters"
-collapsable true
CommonFrame;
setParent ..;
columnLayout
-parent CommonFrame
-columnAttach "left" 20
CommonLayout;
setParent ..;
rowLayout
-parent CommonLayout
-numberOfColumns 2
-columnAttach 1 "both" 0
-columnAttach 2 "both" 0
-columnWidth 2 350
RowCommonLayout1;
setParent ..;
text
-parent RowCommonLayout1
-label "Current Directory"
SceneDirectoryLabel;
setParent ..;
textField
-parent RowCommonLayout1
-width 305
-editable false
SceneDirectory;
setParent ..;
textField -edit -fileName $sceneDir SceneDirectory;
rowLayout
-parent CommonLayout
-numberOfColumns 2
-columnAttach 1 "both" 0
-columnAttach 2 "both" 0
-columnWidth 2 350
RowCommonLayout2;
setParent ..;
text
-parent RowCommonLayout2
-label "Output Directory"
OutputDirectoryLabel;
setParent ..;
textField
-parent RowCommonLayout2
-width 305
OutputDirectory;
setParent ..;
//Export Scene Frame
columnLayout
-p $tabs
-columnAttach "left" 20
ExportSceLayout;
setParent ..;
frameLayout
-p ExportSceLayout
-width 500
-collapsable true
-label "Export Scene"
ExportSceneFrame;
setParent ..;
columnLayout
-parent ExportSceneFrame
-columnAttach "left" 20
ExportSceneLayout;
setParent ..;
//Export object not visble yes/no
checkBox
-parent ExportSceneLayout
-value true
-enable true
-label "Visibility off"
visibilityOff;
setParent ..;
//Create camera menu
// Variable
string $listeCamera[] = `listCameras `; // camera list
int $k; //compteur
$nbCamera=size($listeCamera); // number of camera
optionMenu
-parent ExportSceneLayout
-label "Camera Default"
mycamlisthere;
string $itemSelect;
//Loop to build menu
for($k=0 ; $k<size($listeCamera) ; $k++)
{
optionMenu -cc "cameraSelect" -e mycamlisthere;
menuItem $listeCamera[$k];
}
setParent ..;
//Export mesh option
frameLayout
-p ExportSceLayout
-width 500
-collapsable true
-label "Export Mesh"
ExportMeshFrame;
setParent ..;
columnLayout
-parent ExportMeshFrame
-columnAttach "left" 20
ExportMeshLayout;
setParent ..;
// create summit to hold the output file name with a browse button
textFieldButtonGrp
-parent ExportMeshLayout
-cw3 100 320 50
-label "OgreXMLConverter"
-text "" -bl "Browse"
-bc $fileBrowserCommand
textFieldGroupJobby;
//HDR Light option
frameLayout
-p ExportSceLayout
-width 500
-collapsable true
-label "HDR Lights (script)"
ExportHDRFrame;
setParent ..;
columnLayout
-parent ExportHDRFrame
-columnAttach "left" 20
ExportHDRLayout;
setParent ..;
// create summit to hold the hdr file name with a browse button
textFieldButtonGrp
-parent ExportHDRLayout
-cw3 100 320 50
-label "HDR Script"
-text "" -bl "Browse"
-bc $fileBrowserCommand
textFieldGroupHDR;
button
-parent ExportSceLayout
-label "Export Scene"
-command Export
ExportSceneButton;
setParent ..;
//Export Material Frame
columnLayout
-p $tabs
-columnAttach "left" 20
ExportMatLayout;
setParent ..;
frameLayout
-parent ExportMatLayout
-width 500
-collapsable true
-label "Export Material"
ExportMaterialFrame;
setParent ..;
columnLayout
-parent ExportMaterialFrame
-columnAttach "left" 20
ExportMaterialLayout;
setParent ..;
checkBox
-parent ExportMaterialLayout
-value true
-label "Export Materials"
//-onCommand enable
exportMaterialBox;
setParent ..;
//Export Texture Frame
frameLayout
-parent ExportMatLayout
-width 500
-collapsable true
-label "Export Texture"
ExportTextureFrame;
setParent ..;
columnLayout
-parent ExportTextureFrame
-enable true
-columnAttach "left" 20
ExportTextureLayout;
setParent ..;
checkBox
-parent ExportTextureLayout
-value false
-enable true
-label "Export Diffuse Map (color)"
exportDiffuseMap;
setParent ..;
checkBox
-parent ExportTextureLayout
-enable true
-value false
-label "Export Bump Map"
exportBumpMap;
setParent ..;
checkBox
-parent ExportTextureLayout
-enable true
-value false
-label "Export Reflection Map"
exportReflectionMap;
setParent ..;
//Menu of choice file format
optionMenu
-parent ExportTextureLayout
-enable true
-label "Format fichier"
fileFormat;
optionMenu -e fileFormat;
menuItem "tga";
menuItem "png";
menuItem "tif";
menuItem "jpg";
menuItem "bmp";
setParent ..;
//Surface sampler option
frameLayout
-parent ExportMatLayout
-width 500
-collapsable true
-label "Surface Sampler"
SurfaceSamplerFrame;
setParent ..;
columnLayout
-parent SurfaceSamplerFrame
-enable true
-columnAttach "left" 20
ColSamplerLayout;
setParent ..;
optionMenu
-parent ColSamplerLayout
-enable true
-label "Map Space"
MapSpace;
optionMenu -e MapSpace;
menuItem "Tangent Space";
menuItem "Object Space";
setParent ..;
rowLayout
-parent ColSamplerLayout
-numberOfColumns 2
-columnAttach 1 "both" 0
-columnAttach 2 "both" 0
-columnWidth 2 80
RowSamplerLayout1;
setParent ..;
text
-parent RowSamplerLayout1
-label "Map Width"
textSamplerWidth;
setParent ..;
intField
-parent RowSamplerLayout1
-width 10
-value 512
-editable true
SamplerWidth;
setParent ..;
rowLayout
-parent ColSamplerLayout
-numberOfColumns 2
-columnAttach 1 "both" 0
-columnAttach 2 "both" 0
-columnWidth 2 80
RowSamplerLayout2;
setParent ..;
text
-parent RowSamplerLayout2
-label "Map Height"
textSamplerHeight;
setParent ..;
intField
-parent RowSamplerLayout2
-width 10
-value 512
-editable true
SamplerHeight;
setParent ..;
//Bake Texture option
frameLayout
-parent ExportMatLayout
-width 500
-collapsable true
-label "Bake Texture"
BakeTextureFrame;
setParent ..;
columnLayout
-parent BakeTextureFrame
-enable true
-columnAttach "left" 20
ColTextureLayout;
setParent ..;
checkBox
-parent ColTextureLayout
-enable true
-value false
-label "Anti-Alias"
antiAlias;
setParent ..;
optionMenu
-parent ColTextureLayout
-enable true
-label "Backgroud Mode"
backgroundMode;
optionMenu -e backgroundMode;
menuItem "Shader Default";
menuItem "Custom Color";
menuItem "Extend Edge Color";
setParent ..;
attrColorSliderGrp
-parent ColTextureLayout
-label "Background Color"
-showButton false
backgroundColor;
checkBox
-parent ColTextureLayout
-enable true
-value true
-label "Fill Texture Seams"
fillTextureSeams;
setParent ..;
checkBox
-parent ColTextureLayout
-enable true
-value false
-label "Bake Using Virtual Plane"
bakeUsingVirtualPlane;
setParent ..;
checkBox
-parent ColTextureLayout
-enable true
-value false
-label "Bake Transparency"
bakeTransparency;
setParent ..;
rowLayout
-parent ColTextureLayout
-numberOfColumns 2
-columnAttach 1 "both" 0
-columnAttach 2 "both" 0
-columnWidth 2 80
RowBakeTextureLayout1;
setParent ..;
text
-parent RowBakeTextureLayout1
-label "Resolution X"
textResolutionX;
setParent ..;
intField
-parent RowBakeTextureLayout1
-width 10
-value 512
-editable true
ResolutionX;
setParent ..;
rowLayout
-parent ColTextureLayout
-numberOfColumns 2
-columnAttach 1 "both" 0
-columnAttach 2 "both" 0
-columnWidth 2 80
RowBakeTextureLayout2;
setParent ..;
text
-parent RowBakeTextureLayout2
-label "Resolution Y"
textResolutionY;
setParent ..;
intField
-parent RowBakeTextureLayout2
-width 10
-value 512
-editable true
ResolutionY;
setParent ..;
//Button export material
button
-parent ExportMatLayout
-enable true
-label "Export Materials"
- command exportMaterials
ExportMaterialButton;
setParent ..;
//Export Animation Frame
columnLayout
-p $tabs
-columnAttach "left" 20
ExportAnimLayout;
setParent ..;
frameLayout
-p ExportAnimLayout
-width 500
-collapsable true
-label "Export Animation"
ExportAnimationFrame;
setParent ..;
columnLayout
-parent ExportAnimationFrame
-columnAttach "left" 20
ExportAnimationLayout;
setParent ..;
checkBox
-parent ExportAnimationLayout
-value false
-enable true
-label "Group Animation"
exportAnimationGroup;
setParent ..;
//Bake animation option
frameLayout
-parent ExportAnimLayout
-width 500
-collapsable true
-label "Bake Animation"
BakeAnimationFrame;
setParent ..;
columnLayout
-parent BakeAnimationFrame
-enable true
-columnAttach "left" 20
BakeAnimationLayout;
setParent ..;
checkBox
-parent BakeAnimationLayout
-enable true
-value false
-label "Control Points"
controlPoints;
setParent ..;
checkBox
-parent BakeAnimationLayout
-enable true
-value true
-label "Keep Unbaked Keys"
keepUnbakedKeys;
setParent ..;
//Simplify Animation option
frameLayout
-parent ExportAnimLayout
-width 500
-collapsable true
-label "Simplify Animation"
SimplifyFrame;
setParent ..;
columnLayout
-parent SimplifyFrame
-columnAttach "left" 20
SimplifyLayout;
setParent ..;
rowLayout
-parent SimplifyLayout
-numberOfColumns 3
-columnAttach 1 "both" 0
-columnAttach 2 "both" 0
-columnAttach 3 "both" 0
-columnWidth 2 80
RowAnimationLayout0;
setParent ..;
text
-parent RowAnimationLayout0
-label "Simplify Method"
SimplifyMethod;
radioCollection SimplifyMethod;
radioButton
-parent RowAnimationLayout0
-label "Classic"
ClassicButton;
radioButton
-parent RowAnimationLayout0
-label "Dense Data"
-sl
denseDataButton;
//Determine the time tolerance value
rowLayout
-parent SimplifyLayout
-numberOfColumns 2
-columnAttach 1 "both" 0
-columnAttach 2 "both" 0
-columnWidth 1 40
RowAnimationLayout1;
setParent ..;
floatField
-parent RowAnimationLayout1
-minValue 0.0
-maxValue 10.0
-precision 2
-value 0.05
valueTimeTolerance;
setParent ..;
text
-parent RowAnimationLayout1
-label "Time Tolerance"
textTimeTolerance;
setParent ..;
//Determine the time tolerance value
rowLayout
-parent SimplifyLayout
-numberOfColumns 2
-columnAttach 1 "both" 0
-columnAttach 2 "both" 0
-columnWidth 1 40
RowAnimationLayout2;
setParent ..;
floatField
-parent RowAnimationLayout2
-minValue 0.0
-maxValue 10.0
-precision 2
-value 0.01
valueTolerance;
setParent ..;
text
-parent RowAnimationLayout2
-label "Value Tolerance"
textTimeTolerance;
setParent ..;
//Execute export animation
button
-parent ExportAnimLayout
-label "Export Animation"
- command exportAnim
ExportAnimationButton;
setParent ..;
//Create onglets
tabLayout
-edit
-tabLabel "ExporterOrealiaLayout" "Common Parameters"
-tabLabel "ExportSceLayout" "Option Scene"
-tabLabel "ExportMatLayout" "Materials/Texture"
-tabLabel "ExportAnimLayout" "Animation"
$tabs;
showWindow $ExporterOrealia;
}
Disable the red text if checkbox green = false???