global proc b3deo_enableTransparencyControls (int $x) { floatField -e -en $x alphaThreshold; optionMenu -e -en $x alphaTest; } global proc b3deo_controlUpdate (string $whichControl,int $value) { if ($whichControl=="transparencyMode") { $x= `optionMenu -q -sl transparencyMode`; if ($x==7) b3deo_enableTransparencyControls(0); else b3deo_enableTransparencyControls(1); } else if ($whichControl=="textures") { if ($value<0) $value=`checkBox -q -v textures`; checkBox -e -en $value convertSolid; checkBox -e -en $value useOriginal; checkBox -e -en $value txOverwrite; checkBox -e -en $value textureHiQuality; intSliderGrp -e -en $value textureXRes; intSliderGrp -e -en $value textureYRes; } else if ($whichControl=="flipbook") { if ($value<0) $value=`checkBox -q -v flipbook`; intField -e -en $value flipbookStartFrame; intField -e -en $value flipbookEndFrame; intField -e -en $value flipbookFPS; } } global proc int b3dExportOptions (string $parent,string $action,string $initialSettings,string $resultCallback) { int $result; if ($action=="post") { $currentOptions = $initialSettings; setParent $parent; columnLayout -rs 10 -cal "left" -adj true; frameLayout -mh 10 -mw 10 -bv true -cll true -bs "etchedIn" -l "Export Options"; columnLayout -adj true -cal "left"; rowLayout -nc 5 -cl5 "left" "left" "left" "left" "left" -ad5 1; text -label "Export Components:"; checkBox -l "Colors" colors; checkBox -l "Normals" normals; checkBox -l "UVs" uvs; checkBox -l "Tangents" tangents; setParent ..; checkBox -l "Output Verbose Tags" verbose; checkBox -l "Re-use Materials" reuseMaterials; checkBox -l "Export Lightmaps" -ofc "checkBox -e -en false lightmapsNoLighting" -onc "checkBox -e -en true lightmapsNoLighting" lightmaps; checkBox -l " disable dynamic lighting" lightmapsNoLighting; setParent ..; setParent ..; frameLayout -mh 10 -mw 10 -bv true -cll true -bs "etchedIn" -l "Performer Loader Options"; columnLayout -adj true -cal "left"; checkBox -l "Backface Culling" backfaceculling; checkBox -en false -l "Convert to .pfb" convert2pfb; checkBox -l "Wireframe" wireframe; checkBox -l "Use pfdGeoBuilder Functions" useBuilder; checkBox -l "Convert to TriStrips" tristrips; checkBox -l "Use Units" units; setParent ..; setParent ..; frameLayout -mh 10 -mw 10 -bv true -cll true -bs "etchedIn" -l "Transparency"; columnLayout -adj true -cal "left"; rowLayout -nc 2 -cl2 "left" "left" -cw2 150 150; text -label "Transparency Mode"; optionMenu -cc "b3deo_controlUpdate (\"transparencyMode\",1)" transparencyMode; menuItem -label "On"; menuItem -label "Best"; menuItem -label "Fast"; menuItem -label "Alpha Blend"; menuItem -label "Multisample Alpha"; menuItem -label "Multisample Alpha Mask"; menuItem -label "Off"; setParent ..; rowLayout -nc 2 -cl2 "left" "left" -cw2 150 150; text -label "Alpha Test"; optionMenu -en false alphaTest; menuItem -label "Always"; menuItem -label "="; menuItem -label ">="; menuItem -label ">"; menuItem -label "<="; menuItem -label "<"; menuItem -label "!="; menuItem -label "Never"; menuItem -label "Off"; setParent ..; rowLayout -nc 2 -cl2 "left" "left" -cw2 150 150; text -label "Alpha Threshold:"; floatField -minValue 0 -maxValue 1 -en false alphaThreshold; setParent ..; setParent ..; optionMenu -e -sl 7 transparencyMode ; optionMenu -e -sl 4 alphaTest; setParent ..; frameLayout -mh 10 -mw 10 -bv true -cll true -bs "etchedIn" -l "Hierarchy"; columnLayout -adj false -cal left; radioButtonGrp -l "Hierarchy:" -nrb 4 -la4 "Full" "Static" "Flattened" "At Origin" hierarchy; setParent ..; setParent ..; frameLayout -mh 10 -mw 10 -bv true -cll true -bs "etchedIn" -l "Textures"; columnLayout -adj false -cal left; checkBox -l "Include Textures" -v true -onc "b3deo_controlUpdate(\"textures\",1)" -ofc "b3deo_controlUpdate(\"textures\",0)" textures; checkBox -en true -l "Convert Procedural Textures to File Textures" convertSolid; checkBox -en true -l "Use Original File for File Textures" useOriginal; checkBox -en false -l "Convert to .pfi" convertPfi; checkBox -en true -l "Overwrite Existing Texture Files" txOverwrite; checkBox -en false -l "Bake Lighting into Textures" bakeLighting; checkBox -l "Display Textures in Full Color Mode" textureHiQuality; intSliderGrp -l "X Tex Res" -field true -max 10000 -fmx 4096 -v 256 textureXRes; intSliderGrp -l "Y Tex Res" -field true -max 10000 -fmx 4096 -v 256 textureYRes; setParent ..; setParent ..; frameLayout -mh 10 -mw 10 -bv true -cll true -bs "etchedIn" -l "Animation"; columnLayout -adj true -cal left; checkBox -l "Flipbook Animation" -v false -onc "b3deo_controlUpdate(\"flipbook\",1)" -ofc "b3deo_controlUpdate(\"flipbook\",0)" flipbook; rowLayout -nc 2 -cl2 "left" "left" -cw2 150 150; text -label "Start Frame:"; intField -en false -v 0 flipbookStartFrame; setParent ..; rowLayout -nc 2 -cl2 "left" "left" -cw2 150 150; text -label "End Frame:"; intField -en false -v 0 flipbookEndFrame; setParent ..; rowLayout -nc 2 -cl2 "left" "left" -cw2 150 150; text -label "FPS:"; intField -en false -v 30 flipbookFPS; setParent ..; setParent ..; setParent ..; setParent ..; string $optionList[]; string $optionBreakDown[]; string $pair; string $n; string $v; int $isCheckbox; if (size($currentOptions)>0) { tokenize($currentOptions, ";", $optionList); for ($pair in $optionList) { tokenize($pair, "=", $optionBreakDown); $n=$optionBreakDown[0]; $v=$optionBreakDown[1]; $isCheckbox = `checkBox -exists $n`; $isIntField = `intField -exists $n`; if ($isCheckbox) { $x="checkBox -e -v " + $v + " " + $n; eval($x); } else if ($isIntField) { $x="intField -e -v ((int) " + $v + ") " + $n; eval($x); } else { switch ($n) { case "textureXRes": intSliderGrp -e -v ((int) $v) textureXRes; break; case "textureYRes": intSliderGrp -e -v ((int) $v) textureYRes; break; case "hierarchy": radioButtonGrp -e -sl ((int) $v) hierarchy; break; case "transparencyMode": optionMenu -e -sl ((int) $v) transparencyMode; break; case "alphaTest": optionMenu -e -sl ((int) $v) alphaTest; break; case "alphaThreshold": floatField -e -v ((float) $v) alphaThreshold; break; } } } } b3deo_controlUpdate("textures",-1); b3deo_controlUpdate("transparencyMode",-1); b3deo_controlUpdate("flipbook",-1); $result=1; } else if ($action=="query") { $currentOptions=""; string $checkboxes[]={"colors","normals","uvs","tangents","verbose","reuseMaterials","lightmaps","lightmapsNoLighting", "backfaceculling","convert2pfb","wireframe","useBuilder","tristrips","textures","convertSolid", "useOriginal","convertPfi","txOverwrite","bakeLighting","textureHiQuality","flipbook","units" }; string $menus[]={"transparencyMode","alphaTest"}; string $sliders[]={"textureXRes","textureYRes"}; string $radiobuttons[]={"hierarchy"}; string $floatfields[]={"alphaThreshold"}; string $intfield[]={"flipbookStartFrame","flipbookEndFrame","flipbookFPS"}; for ($c in $checkboxes) { $currentOptions+= $c+"="+`checkBox -q -v $c` + ";"; } for ($c in $menus) { $currentOptions+= $c+"="+`optionMenu -q -sl $c` + ";"; } for ($c in $radiobuttons) { $currentOptions+= $c+"="+`radioButtonGrp -q -sl $c` + ";"; } for ($c in $sliders) { $currentOptions+= $c+"="+`intSliderGrp -q -v $c` + ";"; } for ($c in $floatfields) { $currentOptions+= $c+"="+`floatField -q -v $c` + ";"; } for ($c in $intfield) { $currentOptions+= $c+"="+`intField -q -v $c` + ";"; } eval($resultCallback+" \""+$currentOptions+"\""); $result=1; } else $result=0; return $result; }