/* ----------------------------------------------------------------------------- This source file is part of OpenSpace3D For the latest info, see http://www.openspace3d.com Copyright (c) 2012 I-maginer This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, or go to http://www.gnu.org/copyleft/lesser.txt ----------------------------------------------------------------------------- */ fun cbCloseEdit(p)= let p -> [ctrltexture ctrlobjname ctrlmatname ctrlmattech ctrlmatpass ctrlmattex ctrlwidth ctrlheight ctrlposx ctrlposy ctrlxpercent ctrlypercent ctrlwpercent ctrlhpercent ctrlxoffset ctrlyoffset ctrlwoffset ctrlhoffset ctrlxalign ctrlyalign ctrlbackground ctrllcamindex ctrllautomat ctrllfx ctrllfy ctrllcx ctrllcy ctrlrcamindex ctrlrautomat ctrlrfx ctrlrfy ctrlrcx ctrlrcy ctrlcammode ctrlipd ctrlcamsize ctrlautosize ctrltouchfocus ctrltorch ctrlmatrixmode ctrlopacity ctrlinit ctrlshow] in let getEdCtrlCheckState ctrltexture -> istexture in let getEdCtrlTextLineValue ctrlobjname -> objname in let getSelectedEdCtrlSelect ctrlmatname -> matname in let getSelectedEdCtrlSelectPos ctrlmattech -> technique in let getSelectedEdCtrlSelectPos ctrlmatpass -> pass in let getSelectedEdCtrlSelectPos ctrlmattex -> texture in let ftoi getEdCtrlFloatValue ctrlposx -> posx in let ftoi getEdCtrlFloatValue ctrlposy -> posy in let ftoi getEdCtrlFloatValue ctrlwidth -> width in let ftoi getEdCtrlFloatValue ctrlheight -> height in let getEdCtrlCheckState ctrlxpercent -> xpercent in let getEdCtrlCheckState ctrlypercent -> ypercent in let getEdCtrlCheckState ctrlwpercent -> wpercent in let getEdCtrlCheckState ctrlhpercent -> hpercent in let ftoi getEdCtrlFloatValue ctrlxoffset -> xoffset in let ftoi getEdCtrlFloatValue ctrlyoffset -> yoffset in let ftoi getEdCtrlFloatValue ctrlwoffset -> woffset in let ftoi getEdCtrlFloatValue ctrlhoffset -> hoffset in let getSelectedEdCtrlSelectPos ctrlxalign -> xalign in let getSelectedEdCtrlSelectPos ctrlyalign -> yalign in let getEdCtrlCheckState ctrlbackground -> background in let ftoi getEdCtrlFloatValue ctrlopacity -> opacity in let getSelectedEdCtrlSelectPos ctrlcammode -> cammode in let ftoi getEdCtrlFloatValue ctrllcamindex -> lcamindex in let getEdCtrlCheckState ctrllautomat -> lautomat in let getEdCtrlFloatValue ctrllfx -> lfx in let getEdCtrlFloatValue ctrllfy -> lfy in let getEdCtrlFloatValue ctrllcx -> lcx in let getEdCtrlFloatValue ctrllcy -> lcy in let ftoi getEdCtrlFloatValue ctrlrcamindex -> rcamindex in let getEdCtrlCheckState ctrlrautomat -> rautomat in let getEdCtrlFloatValue ctrlrfx -> rfx in let getEdCtrlFloatValue ctrlrfy -> rfy in let getEdCtrlFloatValue ctrlrcx -> rcx in let getEdCtrlFloatValue ctrlrcy -> rcy in let getEdCtrlFloatValue ctrlipd -> ipd in let getSelectedEdCtrlSelectPos ctrlcamsize -> camsize in let getEdCtrlCheckState ctrlautosize -> autosize in let getEdCtrlCheckState ctrltouchfocus -> touchfocus in let getEdCtrlCheckState ctrltorch -> torch in let getSelectedEdCtrlSelectPos ctrlmatrixmode -> matrixmode in let getEdCtrlCheckState ctrlinit -> init in let getEdCtrlCheckState ctrlshow -> show in ["istexture" itoa istexture]:: ["object" objname]:: ["material" matname]:: ["technique" itoa technique]:: ["pass" itoa pass]:: ["texture" itoa texture]:: ["posx" itoa posx]:: ["posy" itoa posy]:: ["width" itoa width]:: ["height" itoa height]:: ["xpercent" itoa xpercent]:: ["ypercent" itoa ypercent]:: ["wpercent" itoa wpercent]:: ["hpercent" itoa hpercent]:: ["xoffset" itoa xoffset]:: ["yoffset" itoa yoffset]:: ["woffset" itoa woffset]:: ["hoffset" itoa hoffset]:: ["xalign" itoa xalign]:: ["yalign" itoa yalign]:: ["background" itoa background]:: ["opacity" itoa opacity]:: ["cammode" itoa cammode]:: ["lcamindex" itoa lcamindex]:: ["lautomat" itoa lautomat]:: ["lfx" ftoa lfx]:: ["lfy" ftoa lfy]:: ["lcx" ftoa lcx]:: ["lcy" ftoa lcy]:: ["rcamindex" itoa rcamindex]:: ["rautomat" itoa rautomat]:: ["rfx" ftoa rfx]:: ["rfy" ftoa rfy]:: ["rcx" ftoa rcx]:: ["rcy" ftoa rcy]:: ["ipd" ftoa ipd]:: ["camsize" itoa camsize]:: ["autosize" itoa autosize]:: ["touchfocus" itoa touchfocus]:: ["torch" itoa torch]:: ["matrixmode" itoa matrixmode]:: ["init" itoa init]:: ["show" itoa show]:: nil;; fun fillMaterialTextureSelector(viewstr, ctrlselect, mat, tech, pass)= if mat == nil then nil else let V3DgetDefaultSession viewstr -> sessionstr in let SO3MaterialNumberOfTexturesByTechniqueAndPass mat tech pass -> size in let 0 -> i in let nil -> lmatname in ( while i < size do ( let SO3MaterialTextureUnitGetNameByIndex mat tech pass i -> matname in set lmatname = lcat lmatname matname::nil; set i = i + 1; ); fillEdCtrlSelect ctrlselect lmatname; ); 0;; fun cbMatPassName(ctrlstr, pos, elem, p)= let p -> [inst viewstr group ctrlmatname ctrlmattech ctrlmattex] in let getSelectedEdCtrlSelectPos ctrlmattech -> tech in let getSelectedEdCtrlSelect ctrlmatname -> matname in let V3DgetDefaultSession viewstr -> sessionstr in let if matname != nil then SO3SceneGetMaterial (V3DgetSession sessionstr) group matname else nil -> mat in fillMaterialTextureSelector viewstr ctrlmattex mat tech pos; 0;; fun fillMaterialPassSelector(viewstr, p, mat, tech)= let p -> [ctrlselect ctrlmatname ctrlmattech ctrlmattex] in if mat == nil then nil else let V3DgetDefaultSession viewstr -> sessionstr in let SO3MaterialNumberOfPassesByTechnique mat tech -> size in let 0 -> i in let nil -> lmatname in ( while i < size do ( let SO3MaterialPassGetNameByIndex mat tech i -> matname in let if (!strcmp matname "") then (itoa i) else matname -> matname in set lmatname = lcat lmatname matname::nil; set i = i + 1; ); fillEdCtrlSelect ctrlselect lmatname; fillMaterialTextureSelector viewstr ctrlmattex mat tech 0; ); 0;; fun cbMatTechniqueName(ctrlstr, pos, elem, p)= let p -> [inst viewstr group ctrlmatname ctrlmatpass ctrlmattex] in let getSelectedEdCtrlSelect ctrlmatname -> matname in let V3DgetDefaultSession viewstr -> sessionstr in let if matname != nil then SO3SceneGetMaterial (V3DgetSession sessionstr) group matname else nil -> mat in fillMaterialPassSelector viewstr [ctrlmatpass ctrlmatname ctrlstr ctrlmattex] mat pos; 0;; fun fillMaterialTechSelector(viewstr, p, mat)= let p -> [ctrlselect ctrlmatname ctrlmatpass ctrlmattex] in if mat == nil then nil else let V3DgetDefaultSession viewstr -> sessionstr in let SO3MaterialNumberOfTechniques mat -> size in let 0 -> i in let nil -> lmatname in ( while i < size do ( let SO3MaterialTechniqueGetNameByIndex mat i -> matname in set lmatname = lcat lmatname matname::nil; set i = i + 1; ); fillEdCtrlSelect ctrlselect lmatname; fillMaterialPassSelector viewstr [ctrlmatpass ctrlmatname ctrlselect ctrlmattex] mat 0; ); 0;; fun cbMatName(ctrlstr, pos, elem, p)= let p -> [inst viewstr group ctrlmattech ctrlmatpass ctrlmattex] in let V3DgetDefaultSession viewstr -> sessionstr in let if elem != nil then SO3SceneGetMaterial (V3DgetSession sessionstr) group elem else nil -> mat in fillMaterialTechSelector viewstr [ctrlmattech ctrlstr ctrlmatpass ctrlmattex] mat; 0;; fun fillMaterialSelector(viewstr, p, objname)= let p -> [inst ctrlselect ctrlmattech ctrlmatpass ctrlmattex] in if objname == nil then nil else let V3DgetDefaultSession viewstr -> sessionstr in let SO3SceneGetObject (V3DgetSession sessionstr) objname -> obj in let SO3EntityGetResourceGroup obj -> group in let SO3EntityMaterialList obj -> lmat in let nil -> lmatname in ( setEdCtrlSelectCb ctrlselect mkfun4 @cbMatName [inst viewstr group ctrlmattech ctrlmatpass ctrlmattex]; setEdCtrlSelectCb ctrlmattech mkfun4 @cbMatTechniqueName [inst viewstr group ctrlselect ctrlmatpass ctrlmattex]; setEdCtrlSelectCb ctrlmatpass mkfun4 @cbMatPassName [inst viewstr group ctrlselect ctrlmattech ctrlmattex]; let sizelist lmat -> size in let 0 -> i in while i < size do ( let nth_list lmat i -> mat in let SO3MaterialGetName mat -> matname in set lmatname = lcat lmatname matname::nil; set i = i + 1; ); fillEdCtrlSelect ctrlselect lmatname; fillMaterialTechSelector viewstr [ctrlmattech ctrlselect ctrlmatpass ctrlmattex] (SO3SceneGetMaterial (V3DgetSession sessionstr) group (hd lmatname)); ); 0;; fun cbSelectObj(val, type, p)= let p -> [inst winstr viewstr ctrlobjname ctrlmatname ctrlmattech ctrlmatpass ctrlmattex] in let V3DgetDefaultSession viewstr -> sessionstr in let SO3SceneGetObject (V3DgetSession sessionstr) val -> obj in if obj == nil then nil else ( setEdCtrlTextLineValue ctrlobjname val; fillMaterialSelector viewstr [inst ctrlmatname ctrlmattech ctrlmatpass ctrlmattex] val; ); 0;; fun cbCloseRes(ctrlbtn)= setEdCtrlButtonEnable ctrlbtn 1; 0;; fun cbBtnPickObj(ctrlbtn, p)= let p -> [inst winstr viewstr ctrlobjname ctrlmatname ctrlmattech ctrlmatpass ctrlmattex objname] in ( setEdCtrlButtonEnable ctrlbtn 0; dlgSelectPluginInstanceResource inst winstr iTypeEntity objname mkfun3 @cbSelectObj [inst winstr viewstr ctrlobjname ctrlmatname ctrlmattech ctrlmatpass ctrlmattex] mkfun1 @cbCloseRes ctrlbtn 0; ); 0;; fun cbCheckTexture(ctrl, state, p)= let p -> [pickbtn ctrlposx ctrlxpercent ctrlxalign ctrlposy ctrlypercent ctrlyalign ctrlwpercent ctrlhpercent ctrlxoffset ctrlyoffset ctrlwoffset ctrlhoffset ctrlmatname ctrlmattech ctrlmatpass ctrlmattex ctrlbackground] in if state then ( setEdCtrlFloatEnable ctrlposx 0; setEdCtrlFloatEnable ctrlposy 0; setEdCtrlCheckEnable ctrlxpercent 0; setEdCtrlCheckEnable ctrlypercent 0; setEdCtrlSelectEnable ctrlxalign 0; setEdCtrlSelectEnable ctrlyalign 0; setEdCtrlCheckEnable ctrlwpercent 0; setEdCtrlCheckEnable ctrlhpercent 0; setEdCtrlFloatEnable ctrlxoffset 0; setEdCtrlFloatEnable ctrlyoffset 0; setEdCtrlFloatEnable ctrlwoffset 0; setEdCtrlFloatEnable ctrlhoffset 0; setEdCtrlCheckEnable ctrlbackground 0; setEdCtrlSelectEnable ctrlmatname 1; setEdCtrlSelectEnable ctrlmattech 1; setEdCtrlSelectEnable ctrlmatpass 1; setEdCtrlSelectEnable ctrlmattex 1; setEdCtrlButtonEnable pickbtn 1; ) else ( setEdCtrlFloatEnable ctrlposx 1; setEdCtrlFloatEnable ctrlposy 1; setEdCtrlCheckEnable ctrlxpercent 1; setEdCtrlCheckEnable ctrlypercent 1; setEdCtrlSelectEnable ctrlxalign 1; setEdCtrlSelectEnable ctrlyalign 1; setEdCtrlCheckEnable ctrlwpercent 1; setEdCtrlCheckEnable ctrlhpercent 1; setEdCtrlFloatEnable ctrlxoffset (getEdCtrlCheckState ctrlxpercent); setEdCtrlFloatEnable ctrlyoffset (getEdCtrlCheckState ctrlypercent); setEdCtrlFloatEnable ctrlwoffset (getEdCtrlCheckState ctrlwpercent); setEdCtrlFloatEnable ctrlhoffset (getEdCtrlCheckState ctrlhpercent); setEdCtrlCheckEnable ctrlbackground 1; setEdCtrlSelectEnable ctrlmatname 0; setEdCtrlSelectEnable ctrlmattech 0; setEdCtrlSelectEnable ctrlmatpass 0; setEdCtrlSelectEnable ctrlmattex 0; setEdCtrlButtonEnable pickbtn 0; ); 0;; fun cbRefreshBtnSpec(pickbtn, p)= let p -> [ctrlobjname ctrlmatname ctrlmattech ctrlmatpass ctrlmattex] in ( setEdCtrlTextLineValue ctrlobjname ""; fillEdCtrlSelect ctrlmatname nil; fillEdCtrlSelect ctrlmattech nil; fillEdCtrlSelect ctrlmatpass nil; fillEdCtrlSelect ctrlmattex nil; ); 0;; fun cbPercentCheck(ctrlstr, state, ctrlfloat)= setEdCtrlFloatEnable ctrlfloat state; 0;; fun cbCamMode(ctrlstr, pos, elem, p)= let p -> [ctrlrcamindex ctrlrautomat ctrlrfx ctrlrfy ctrlrcx ctrlrcy] in let getEdCtrlCheckState ctrlrautomat -> auto in ( setEdCtrlFloatEnable ctrlrcamindex (pos == 0); setEdCtrlCheckEnable ctrlrautomat (pos == 0); setEdCtrlFloatEnable ctrlrfx ((pos == 0) && !auto); setEdCtrlFloatEnable ctrlrfy ((pos == 0) && !auto); setEdCtrlFloatEnable ctrlrcx ((pos == 0) && !auto); setEdCtrlFloatEnable ctrlrcy ((pos == 0) && !auto); ); 0;; fun cbAutoCheck(ctrlstr, state, p)= let p -> [ctrlcammode ctrlfx ctrlfy ctrlcx ctrlcy] in let if (ctrlcammode == nil) then 0 else getSelectedEdCtrlSelectPos ctrlcammode -> pos in ( setEdCtrlFloatEnable ctrlfx ((pos == 0) && !state); setEdCtrlFloatEnable ctrlfy ((pos == 0) && !state); setEdCtrlFloatEnable ctrlcx ((pos == 0) && !state); setEdCtrlFloatEnable ctrlcy ((pos == 0) && !state); ); 0;; fun dynamicedit(ewinstr, inst, viewstr, applybtn)= let [455 525] -> [iw ih] in let 10 -> ypos in ( let (getPluginInstanceParam inst "object") -> objname in let (getPluginInstanceParam inst "material") -> matname in let atoi (getPluginInstanceParam inst "technique") -> technique in let if technique == nil then 0 else technique -> technique in let atoi (getPluginInstanceParam inst "pass") -> pass in let if pass == nil then 0 else pass -> pass in let atoi (getPluginInstanceParam inst "texture") -> texture in let if texture == nil then 0 else texture -> texture in let atoi (getPluginInstanceParam inst "istexture") -> istexture in let if istexture == nil then 0 else istexture -> istexture in let atoi (getPluginInstanceParam inst "xpercent") -> xpercent in let if xpercent == nil then 0 else xpercent -> xpercent in let atoi (getPluginInstanceParam inst "xalign") -> xalign in let if xalign == nil then 0 else xalign -> xalign in let atoi (getPluginInstanceParam inst "posx") -> posx in let if posx == nil then 0 else posx -> posx in let atoi (getPluginInstanceParam inst "ypercent") -> ypercent in let if ypercent == nil then 0 else ypercent -> ypercent in let atoi (getPluginInstanceParam inst "yalign") -> yalign in let if yalign == nil then 0 else yalign -> yalign in let atoi (getPluginInstanceParam inst "posy") -> posy in let if posy == nil then 0 else posy -> posy in let atoi (getPluginInstanceParam inst "wpercent") -> wpercent in let if wpercent == nil then 1 else wpercent -> wpercent in let atoi (getPluginInstanceParam inst "width") -> width in let if width == nil then 100 else width -> width in let atoi (getPluginInstanceParam inst "hpercent") -> hpercent in let if hpercent == nil then 1 else hpercent -> hpercent in let atoi (getPluginInstanceParam inst "height") -> height in let if height == nil then 100 else height -> height in let atoi (getPluginInstanceParam inst "xoffset") -> xoffset in let if xoffset == nil then 0 else xoffset -> xoffset in let atoi (getPluginInstanceParam inst "yoffset") -> yoffset in let if yoffset == nil then 0 else yoffset -> yoffset in let atoi (getPluginInstanceParam inst "woffset") -> woffset in let if woffset == nil then 0 else woffset -> woffset in let atoi (getPluginInstanceParam inst "hoffset") -> hoffset in let if hoffset == nil then 0 else hoffset -> hoffset in let atoi (getPluginInstanceParam inst "background") -> background in let if (background == nil) then 1 else background -> background in let atoi (getPluginInstanceParam inst "opacity") -> opacity in let if opacity == nil then 100 else opacity -> opacity in let atoi (getPluginInstanceParam inst "cammode") -> cammode in let if cammode == nil then 0 else cammode -> cammode in let atof (getPluginInstanceParam inst "ipd") -> ipd in let if (ipd == nil) then 6.5 else ipd -> ipd in let atoi (getPluginInstanceParam inst "camsize") -> camsize in let if camsize == nil then 1 else camsize -> camsize in let atoi (getPluginInstanceParam inst "autosize") -> autosize in let if (autosize == nil) then 1 else autosize -> autosize in let atoi (getPluginInstanceParam inst "touchfocus") -> touchfocus in let if (touchfocus == nil) then 1 else touchfocus -> touchfocus in let atoi (getPluginInstanceParam inst "torch") -> torch in let if (torch == nil) then 0 else torch -> torch in let atoi (getPluginInstanceParam inst "lcamindex") -> lcamindex in let if lcamindex == nil then 0 else lcamindex -> lcamindex in let atoi (getPluginInstanceParam inst "lautomat") -> lautomat in let if lautomat == nil then 1 else lautomat -> lautomat in let atof (getPluginInstanceParam inst "lfx") -> lfx in let if lfx == nil then 640.0 else lfx -> lfx in let atof (getPluginInstanceParam inst "lfy") -> lfy in let if lfy == nil then 640.0 else lfy -> lfy in let atof (getPluginInstanceParam inst "lcx") -> lcx in let if lcx == nil then 320.0 else lcx -> lcx in let atof (getPluginInstanceParam inst "lcy") -> lcy in let if lcy == nil then 240.0 else lcy -> lcy in let atoi (getPluginInstanceParam inst "rcamindex") -> rcamindex in let if rcamindex == nil then 0 else rcamindex -> rcamindex in let atoi (getPluginInstanceParam inst "rautomat") -> rautomat in let if rautomat == nil then 1 else rautomat -> rautomat in let atof (getPluginInstanceParam inst "rfx") -> rfx in let if rfx == nil then 640.0 else rfx -> rfx in let atof (getPluginInstanceParam inst "rfy") -> rfy in let if rfy == nil then 640.0 else rfy -> rfy in let atof (getPluginInstanceParam inst "rcx") -> rcx in let if rcx == nil then 320.0 else rcx -> rcx in let atof (getPluginInstanceParam inst "rcy") -> rcy in let if rcy == nil then 240.0 else rcy -> rcy in let atoi (getPluginInstanceParam inst "init") -> init in let if (init == nil) then 1 else init -> init in let atoi (getPluginInstanceParam inst "show") -> show in let if (show == nil) then 1 else show -> show in let atoi (getPluginInstanceParam inst "matrixmode") -> matrixmode in let if (matrixmode == nil) then 0 else matrixmode -> matrixmode in ( if !istexture then nil else set ih = ih + 160; if (cammode > 0) then nil else set ih = ih + 135; setEdWindowSize ewinstr iw ih; let crEdFrameWindow _channel ewinstr 0 0 iw 175 EDWIN_RESIZE_MW nil (loc "OS3DSTCAPTURE_0007") (loc "OS3DSTCAPTURE_0014") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 155 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlLabel winstr 10 ((set ypos = 10) + 2) 160 20 (loc "OS3DSTCAPTURE_0040") nil -> labelcammode in let crEdCtrlSelect winstr 180 ypos (iw - 230) 120 EDWIN_RESIZE_MW -> ctrlcammode in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DSTCAPTURE_0046") nil -> labelipd in let crEdCtrlFloat winstr 180 ypos 100 20 ipd 0.0 100.0 0.1 4 nil EDWIN_RESIZE_MW -> ctrlipd in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (strcat (loc "OS3DSTCAPTURE_0004") " ") nil -> labelcamsize in let crEdCtrlSelect winstr 180 ypos 100 120 CB_AHSCROLL -> ctrlcamsize in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) (iw - 20) 20 (loc "OS3DSTCAPTURE_0038") EDWIN_RESIZE_MW -> ctrlautosize in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) (iw - 20) 20 (loc "OS3DSTCAPTURE_0036") EDWIN_RESIZE_MW -> ctrltouchfocus in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) (iw - 20) 20 (loc "OS3DSTCAPTURE_0039") EDWIN_RESIZE_MW -> ctrltorch in let crEdFrameWindow _channel ewinstr 0 0 iw 155 EDWIN_RESIZE_MW nil (loc "OS3DSTCAPTURE_0047") (loc "OS3DSTCAPTURE_0014") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 135 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlLabel winstr 10 ((set ypos = 10) + 2) 160 20 (loc "OS3DSTCAPTURE_0045") nil -> labellcindex in let crEdCtrlFloat winstr 180 ypos 100 20 itof lcamindex 0.0 128.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrllcamindex in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) (iw - 20) 20 (loc "OS3DSTCAPTURE_0049") EDWIN_RESIZE_MW -> ctrllautomat in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DSTCAPTURE_0050") nil -> labellmanual in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 90 20 (loc "OS3DSTCAPTURE_0051") nil -> labellfx in let crEdCtrlFloat winstr 110 ypos 80 20 lfx 0.0 10000.0 1.0 5 nil EDWIN_RESIZE_MW -> ctrllfx in let crEdCtrlLabel winstr 240 (ypos + 2) 60 20 (loc "OS3DSTCAPTURE_0052") nil -> labellfy in let crEdCtrlFloat winstr 305 ypos 80 20 lfy 0.0 10000.0 1.0 5 nil EDWIN_RESIZE_MW -> ctrllfy in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 90 20 (loc "OS3DSTCAPTURE_0053") nil -> labelcfx in let crEdCtrlFloat winstr 110 ypos 80 20 lcx 0.0 10000.0 1.0 5 nil EDWIN_RESIZE_MW -> ctrllcx in let crEdCtrlLabel winstr 240 (ypos + 2) 60 20 (loc "OS3DSTCAPTURE_0054") nil -> labellcy in let crEdCtrlFloat winstr 305 ypos 80 20 lcy 0.0 10000.0 1.0 5 nil EDWIN_RESIZE_MW -> ctrllcy in let crEdFrameWindowEx _channel ewinstr 0 0 iw 155 EDWIN_RESIZE_MW nil (loc "OS3DSTCAPTURE_0048") (loc "OS3DSTCAPTURE_0014") (cammode > 0) -> winfrm in let crEdWindow _channel winfrm 0 18 iw 135 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlLabel winstr 10 ((set ypos = 10) + 2) 160 20 (loc "OS3DSTCAPTURE_0045") nil -> labelrcindex in let crEdCtrlFloat winstr 180 ypos 100 20 itof rcamindex 0.0 128.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlrcamindex in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) (iw - 20) 20 (loc "OS3DSTCAPTURE_0049") EDWIN_RESIZE_MW -> ctrlrautomat in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DSTCAPTURE_0050") nil -> labelrmanual in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 90 20 (loc "OS3DSTCAPTURE_0051") nil -> labelrfx in let crEdCtrlFloat winstr 110 ypos 80 20 rfx 0.0 10000.0 1.0 5 nil EDWIN_RESIZE_MW -> ctrlrfx in let crEdCtrlLabel winstr 240 (ypos + 2) 60 20 (loc "OS3DSTCAPTURE_0052") nil -> labellfy in let crEdCtrlFloat winstr 305 ypos 80 20 rfy 0.0 10000.0 1.0 5 nil EDWIN_RESIZE_MW -> ctrlrfy in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 90 20 (loc "OS3DSTCAPTURE_0053") nil -> labelrcx in let crEdCtrlFloat winstr 110 ypos 80 20 rcx 0.0 10000.0 1.0 5 nil EDWIN_RESIZE_MW -> ctrlrcx in let crEdCtrlLabel winstr 240 (ypos + 2) 60 20 (loc "OS3DSTCAPTURE_0054") nil -> labelrcy in let crEdCtrlFloat winstr 305 ypos 80 20 rcy 0.0 10000.0 1.0 5 nil EDWIN_RESIZE_MW -> ctrlrcy in let crEdFrameWindowEx _channel ewinstr 0 0 iw 180 EDWIN_RESIZE_MW nil (loc "OS3DSTCAPTURE_0012") (loc "OS3DSTCAPTURE_0014") !istexture -> winfrm in let crEdWindow _channel winfrm 0 18 iw 160 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlCheck winstr 10 (set ypos = 10) 280 20 (loc "OS3DSTCAPTURE_0001") EDWIN_RESIZE_MW -> ctrltexture in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 170 20 (loc "OS3DSTCAPTURE_0017") nil -> labelobj in let crEdCtrlTextLine winstr 180 ypos 170 20 objname nil EDWIN_RESIZE_MW -> ctrlobjname in let crEdCtrlButton winstr 360 ypos 55 20 "..." nil -> pickbtn in let crEdCtrlButton winstr 420 ypos 35 20 "X" nil -> refreshobjname in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 170 20 (loc "OS3DSTCAPTURE_0011") nil -> labelmat in let crEdCtrlSelect winstr 180 ypos (iw - 180) 120 EDWIN_RESIZE_MW -> ctrlmatname in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 170 20 (loc "OS3DSTCAPTURE_0013") nil -> labeltech in let crEdCtrlSelect winstr 180 ypos (iw - 180) 120 EDWIN_RESIZE_MW -> ctrlmattech in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 170 20 (loc "OS3DSTCAPTURE_0028") nil -> labelpass in let crEdCtrlSelect winstr 180 ypos (iw - 180) 120 EDWIN_RESIZE_MW -> ctrlmatpass in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 170 20 (loc "OS3DSTCAPTURE_0020") nil -> labelpass in let crEdCtrlSelect winstr 180 ypos (iw - 180) 120 EDWIN_RESIZE_MW -> ctrlmattex in let crEdFrameWindowEx _channel ewinstr 0 0 iw 155 EDWIN_RESIZE_MW nil (loc "OS3DSTCAPTURE_0023") (loc "OS3DSTCAPTURE_0014") 1 -> winfrm in let crEdWindow _channel winfrm 0 18 iw 135 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlCheck winstr 10 (set ypos = 10) 280 20 (loc "OS3DSTCAPTURE_0026") EDWIN_RESIZE_MW -> ctrlbackground in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 90 20 (loc "OS3DSTCAPTURE_0021") nil -> labelx in let crEdCtrlFloat winstr 110 ypos 60 20 itof posx (-.10000.0) 10000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlposx in let crEdCtrlCheck winstr 180 ypos 40 20 "(%)" EDWIN_RESIZE_MW -> ctrlxpercent in let crEdCtrlLabel winstr 220 (ypos + 2) 60 20 (loc "OS3DSTCAPTURE_0018") nil -> labelxo in let crEdCtrlFloat winstr 285 ypos 60 20 itof xoffset (-.10000.0) 10000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlxoffset in let crEdCtrlSelect winstr 355 ypos 100 120 EDWIN_RESIZE_MW -> ctrlxalign in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 90 20 (loc "OS3DSTCAPTURE_0022") nil -> labely in let crEdCtrlFloat winstr 110 ypos 60 20 itof posy (-.10000.0) 10000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlposy in let crEdCtrlCheck winstr 180 ypos 40 20 "(%)" EDWIN_RESIZE_MW -> ctrlypercent in let crEdCtrlLabel winstr 220 (ypos + 2) 60 20 (loc "OS3DSTCAPTURE_0018") nil -> labelyo in let crEdCtrlFloat winstr 285 ypos 60 20 itof yoffset (-.10000.0) 10000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlyoffset in let crEdCtrlSelect winstr 355 ypos 100 120 EDWIN_RESIZE_MW -> ctrlyalign in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 90 20 (loc "OS3DSTCAPTURE_0030") nil -> labelw in let crEdCtrlFloat winstr 110 ypos 60 20 itof width 0.0 10000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlwidth in let crEdCtrlCheck winstr 180 ypos 40 20 "(%)" EDWIN_RESIZE_MW -> ctrlwpercent in let crEdCtrlLabel winstr 220 (ypos + 2) 60 20 (loc "OS3DSTCAPTURE_0018") nil -> labelwo in let crEdCtrlFloat winstr 285 ypos 60 20 itof woffset (-.10000.0) 10000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlwoffset in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 90 20 (loc "OS3DSTCAPTURE_0009") nil -> labelh in let crEdCtrlFloat winstr 110 ypos 60 20 itof height 0.0 10000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlheight in let crEdCtrlCheck winstr 180 ypos 40 20 "(%)" EDWIN_RESIZE_MW -> ctrlhpercent in let crEdCtrlLabel winstr 220 (ypos + 2) 60 20 (loc "OS3DSTCAPTURE_0018") nil -> labelho in let crEdCtrlFloat winstr 285 ypos 60 20 itof hoffset (-.10000.0) 10000.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlhoffset in let crEdFrameWindow _channel ewinstr 0 0 iw 135 EDWIN_RESIZE_MW nil (loc "OS3DSTCAPTURE_0016") (loc "OS3DSTCAPTURE_0014") -> winfrm in let crEdWindow _channel winfrm 0 18 iw 110 WN_CHILDINSIDE|WN_NOBORDER EDWIN_RESIZE_MW nil nil -> winstr in let crEdCtrlLabel winstr 10 ((set ypos = 10) + 2) 160 20 (loc "OS3DSTCAPTURE_0019") nil -> labelo in let crEdCtrlFloat winstr 180 ypos 100 20 itof opacity 0.0 100.0 1.0 0 nil EDWIN_RESIZE_MW -> ctrlopacity in let crEdCtrlLabel winstr 10 ((set ypos = ypos + 25) + 2) 160 20 (loc "OS3DSTCAPTURE_0032") nil -> labelmode in let crEdCtrlSelect winstr 180 ypos (iw - 230) 120 EDWIN_RESIZE_MW -> ctrlmatrixmode in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) (iw - 20) 20 (loc "OS3DSTCAPTURE_0006") EDWIN_RESIZE_MW -> ctrlinit in let crEdCtrlCheck winstr 10 (set ypos = ypos + 25) (iw - 20) 20 (loc "OS3DSTCAPTURE_0027") EDWIN_RESIZE_MW -> ctrlshow in let V3DgetDefaultSession viewstr -> sessionstr in let SO3SceneGetObject (V3DgetSession sessionstr) objname -> obj in let SO3EntityGetResourceGroup obj -> group in ( fillEdCtrlSelect ctrlcammode (loc "OS3DSTCAPTURE_0041")::(loc "OS3DSTCAPTURE_0042")::(loc "OS3DSTCAPTURE_0043")::(loc "OS3DSTCAPTURE_0044")::nil; selectEdCtrlSelectByPos ctrlcammode cammode; setEdCtrlSelectCb ctrlcammode mkfun4 @cbCamMode [ctrlrcamindex ctrlrautomat ctrlrfx ctrlrfy ctrlrcx ctrlrcy]; setEdCtrlCheckState ctrllautomat lautomat; setEdCtrlCheckState ctrlrautomat rautomat; setEdCtrlCheckCbState ctrllautomat mkfun3 @cbAutoCheck [nil ctrllfx ctrllfy ctrllcx ctrllcy]; setEdCtrlCheckCbState ctrlrautomat mkfun3 @cbAutoCheck [ctrlcammode ctrlrfx ctrlrfy ctrlrcx ctrlrcy]; if (cammode == 0) then nil else ( setEdCtrlFloatEnable ctrlrcamindex 0; setEdCtrlCheckEnable ctrlrautomat 0; ); setEdCtrlFloatEnable ctrllfx (!lautomat); setEdCtrlFloatEnable ctrllfy (!lautomat); setEdCtrlFloatEnable ctrllcx (!lautomat); setEdCtrlFloatEnable ctrllcy (!lautomat); setEdCtrlFloatEnable ctrlrfx (!rautomat && (cammode == 0)); setEdCtrlFloatEnable ctrlrfy (!rautomat && (cammode == 0)); setEdCtrlFloatEnable ctrlrcx (!rautomat && (cammode == 0)); setEdCtrlFloatEnable ctrlrcy (!rautomat && (cammode == 0)); fillEdCtrlSelect ctrlmatrixmode (loc "OS3DSTCAPTURE_0033")::(loc "OS3DSTCAPTURE_0034")::(loc "OS3DSTCAPTURE_0035")::nil; selectEdCtrlSelectByPos ctrlmatrixmode matrixmode; setEdCtrlCheckState ctrlinit init; setEdCtrlCheckState ctrlshow show; setEdCtrlCheckState ctrlautosize autosize; setEdCtrlCheckState ctrltouchfocus touchfocus; setEdCtrlCheckState ctrltorch torch; fillEdCtrlSelect ctrlxalign (loc "OS3DSTCAPTURE_0010")::(loc "OS3DSTCAPTURE_0005")::(loc "OS3DSTCAPTURE_0024")::nil; fillEdCtrlSelect ctrlyalign (loc "OS3DSTCAPTURE_0029")::(loc "OS3DSTCAPTURE_0005")::(loc "OS3DSTCAPTURE_0002")::nil; selectEdCtrlSelectByPos ctrlxalign xalign; selectEdCtrlSelectByPos ctrlyalign yalign; setEdCtrlCheckState ctrlbackground background; setEdCtrlCheckState ctrltexture istexture; setEdCtrlCheckState ctrlxpercent xpercent; setEdCtrlCheckState ctrlypercent ypercent; setEdCtrlCheckState ctrlwpercent wpercent; setEdCtrlCheckState ctrlhpercent hpercent; setEdCtrlCheckCbState ctrlxpercent mkfun3 @cbPercentCheck ctrlxoffset; setEdCtrlCheckCbState ctrlypercent mkfun3 @cbPercentCheck ctrlyoffset; setEdCtrlCheckCbState ctrlwpercent mkfun3 @cbPercentCheck ctrlwoffset; setEdCtrlCheckCbState ctrlhpercent mkfun3 @cbPercentCheck ctrlhoffset; fillMaterialSelector viewstr [inst ctrlmatname ctrlmattech ctrlmatpass ctrlmattex] objname; selectEdCtrlSelect ctrlmatname matname; let SO3SceneGetMaterial (V3DgetSession sessionstr) group matname -> mat in if mat == nil then nil else ( fillMaterialTechSelector viewstr [ctrlmattech ctrlmatname ctrlmatpass ctrlmattex] mat; selectEdCtrlSelectByPos ctrlmattech technique; fillMaterialPassSelector viewstr [ctrlmatpass ctrlmatname ctrlmattech ctrlmattex] mat technique; selectEdCtrlSelectByPos ctrlmatpass pass; fillMaterialTextureSelector viewstr ctrlmattex mat technique pass; selectEdCtrlSelectByPos ctrlmattex texture; ); setEdCtrlCheckCbState ctrltexture mkfun3 @cbCheckTexture [pickbtn ctrlposx ctrlxpercent ctrlxalign ctrlposy ctrlypercent ctrlyalign ctrlwpercent ctrlhpercent ctrlxoffset ctrlyoffset ctrlwoffset ctrlhoffset ctrlmatname ctrlmattech ctrlmatpass ctrlmattex ctrlbackground]; setEdCtrlButtonCb pickbtn mkfun2 @cbBtnPickObj [inst winstr viewstr ctrlobjname ctrlmatname ctrlmattech ctrlmatpass ctrlmattex objname]; setEdCtrlTextLineEnable ctrlobjname 0; setEdCtrlButtonCb refreshobjname mkfun2 @cbRefreshBtnSpec [ctrlobjname ctrlmatname ctrlmattech ctrlmatpass ctrlmattex]; fillEdCtrlSelect ctrlcamsize "320x240"::"640x480"::"1280x720"::"1920x1080"::nil; selectEdCtrlSelectByPos ctrlcamsize camsize; if istexture then ( setEdCtrlFloatEnable ctrlposx 0; setEdCtrlFloatEnable ctrlposy 0; setEdCtrlCheckEnable ctrlxpercent 0; setEdCtrlCheckEnable ctrlypercent 0; setEdCtrlSelectEnable ctrlxalign 0; setEdCtrlSelectEnable ctrlyalign 0; setEdCtrlCheckEnable ctrlwpercent 0; setEdCtrlCheckEnable ctrlhpercent 0; setEdCtrlFloatEnable ctrlxoffset 0; setEdCtrlFloatEnable ctrlyoffset 0; setEdCtrlFloatEnable ctrlwoffset 0; setEdCtrlFloatEnable ctrlhoffset 0; setEdCtrlCheckEnable ctrlbackground 0; setEdCtrlSelectEnable ctrlmatname 1; setEdCtrlSelectEnable ctrlmattech 1; setEdCtrlSelectEnable ctrlmatpass 1; setEdCtrlSelectEnable ctrlmattex 1; setEdCtrlButtonEnable pickbtn 1; ) else ( setEdCtrlFloatEnable ctrlposx 1; setEdCtrlFloatEnable ctrlposy 1; setEdCtrlCheckEnable ctrlxpercent 1; setEdCtrlCheckEnable ctrlypercent 1; setEdCtrlSelectEnable ctrlxalign 1; setEdCtrlSelectEnable ctrlyalign 1; setEdCtrlCheckEnable ctrlwpercent 1; setEdCtrlCheckEnable ctrlhpercent 1; setEdCtrlFloatEnable ctrlxoffset (getEdCtrlCheckState ctrlxpercent); setEdCtrlFloatEnable ctrlyoffset (getEdCtrlCheckState ctrlypercent); setEdCtrlFloatEnable ctrlwoffset (getEdCtrlCheckState ctrlwpercent); setEdCtrlFloatEnable ctrlhoffset (getEdCtrlCheckState ctrlhpercent); setEdCtrlCheckEnable ctrlbackground 1; setEdCtrlSelectEnable ctrlmatname 0; setEdCtrlSelectEnable ctrlmattech 0; setEdCtrlSelectEnable ctrlmatpass 0; setEdCtrlSelectEnable ctrlmattex 0; setEdCtrlButtonEnable pickbtn 0; ); [mkfun1 @cbCloseEdit [ctrltexture ctrlobjname ctrlmatname ctrlmattech ctrlmatpass ctrlmattex ctrlwidth ctrlheight ctrlposx ctrlposy ctrlxpercent ctrlypercent ctrlwpercent ctrlhpercent ctrlxoffset ctrlyoffset ctrlwoffset ctrlhoffset ctrlxalign ctrlyalign ctrlbackground ctrllcamindex ctrllautomat ctrllfx ctrllfy ctrllcx ctrllcy ctrlrcamindex ctrlrautomat ctrlrfx ctrlrfy ctrlrcx ctrlrcy ctrlcammode ctrlipd ctrlcamsize ctrlautosize ctrltouchfocus ctrltorch ctrlmatrixmode ctrlopacity ctrlinit ctrlshow] nil]; ); ); );;