colladaImport.ed.gui 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698
  1. //--- OBJECT WRITE BEGIN ---
  2. %guiContent = new GuiControl(ColladaImportDlg,EditorGuiGroup) {
  3. isContainer = "1";
  4. Profile = "ToolsGuiDefaultProfile";
  5. HorizSizing = "width";
  6. VertSizing = "height";
  7. position = "0 0";
  8. Extent = "1024 768";
  9. MinExtent = "8 2";
  10. canSave = "1";
  11. Visible = "1";
  12. tooltipprofile = "ToolsGuiToolTipProfile";
  13. hovertime = "1000";
  14. canSaveDynamicFields = "0";
  15. new GuiWindowCtrl() {
  16. resizeWidth = "0";
  17. resizeHeight = "0";
  18. canMove = "1";
  19. canClose = "1";
  20. canMinimize = "0";
  21. canMaximize = "0";
  22. minSize = "50 50";
  23. closeCommand = "Canvas.popDialog(ColladaImportDlg);";
  24. EdgeSnap = "1";
  25. text = "";
  26. Margin = "0 0 0 0";
  27. Padding = "0 0 0 0";
  28. AnchorTop = "1";
  29. AnchorBottom = "0";
  30. AnchorLeft = "1";
  31. AnchorRight = "0";
  32. isContainer = "1";
  33. Profile = "ToolsGuiWindowProfile";
  34. HorizSizing = "center";
  35. VertSizing = "center";
  36. position = "254 136";
  37. Extent = "516 447";
  38. MinExtent = "8 8";
  39. canSave = "1";
  40. Visible = "1";
  41. Accelerator = "escape";
  42. tooltipprofile = "ToolsGuiToolTipProfile";
  43. hovertime = "1000";
  44. internalName = "window";
  45. canSaveDynamicFields = "0";
  46. new GuiControl() {
  47. isContainer = "1";
  48. Profile = "ToolsGuiDefaultProfile";
  49. HorizSizing = "width";
  50. VertSizing = "height";
  51. position = "8 24";
  52. Extent = "238 417";
  53. MinExtent = "8 2";
  54. canSave = "1";
  55. Visible = "1";
  56. tooltipprofile = "ToolsGuiToolTipProfile";
  57. hovertime = "1000";
  58. canSaveDynamicFields = "0";
  59. new GuiScrollCtrl() {
  60. willFirstRespond = "1";
  61. hScrollBar = "dynamic";
  62. vScrollBar = "dynamic";
  63. lockHorizScroll = "0";
  64. lockVertScroll = "0";
  65. constantThumbHeight = "0";
  66. childMargin = "0 0";
  67. mouseWheelScrollSpeed = "-1";
  68. Margin = "0 0 0 0";
  69. Padding = "0 0 0 0";
  70. AnchorTop = "1";
  71. AnchorBottom = "0";
  72. AnchorLeft = "1";
  73. AnchorRight = "0";
  74. isContainer = "1";
  75. Profile = "ToolsGuiScrollProfile";
  76. HorizSizing = "right";
  77. VertSizing = "bottom";
  78. position = "0 3";
  79. Extent = "238 366";
  80. MinExtent = "8 2";
  81. canSave = "1";
  82. Visible = "1";
  83. tooltipprofile = "ToolsGuiToolTipProfile";
  84. hovertime = "1000";
  85. canSaveDynamicFields = "1";
  86. new GuiTreeViewCtrl(ColladaImportTreeView) {
  87. tabSize = "16";
  88. textOffset = "2";
  89. fullRowSelect = "0";
  90. itemHeight = "21";
  91. destroyTreeOnSleep = "0";
  92. MouseDragging = "0";
  93. MultipleSelections = "0";
  94. DeleteObjectAllowed = "0";
  95. DragToItemAllowed = "0";
  96. ClearAllOnSingleSelection = "1";
  97. showRoot = "1";
  98. internalNamesOnly = "0";
  99. objectNamesOnly = "0";
  100. useInspectorTooltips = "0";
  101. tooltipOnWidthOnly = "0";
  102. compareToObjectID = "1";
  103. canRenameObjects = "1";
  104. renameInternal = "0";
  105. isContainer = "1";
  106. Profile = "ToolsGuiTreeViewProfile";
  107. HorizSizing = "width";
  108. VertSizing = "height";
  109. position = "1 1";
  110. Extent = "74 63";
  111. MinExtent = "8 2";
  112. canSave = "1";
  113. Visible = "1";
  114. tooltipprofile = "ToolsGuiToolTipProfile";
  115. hovertime = "1000";
  116. canSaveDynamicFields = "0";
  117. };
  118. };
  119. };
  120. new GuiControl() {
  121. isContainer = "1";
  122. Profile = "ToolsGuiDefaultProfile";
  123. HorizSizing = "width";
  124. VertSizing = "height";
  125. position = "254 24";
  126. Extent = "254 417";
  127. MinExtent = "8 2";
  128. canSave = "1";
  129. Visible = "1";
  130. tooltipprofile = "ToolsGuiToolTipProfile";
  131. hovertime = "1000";
  132. canSaveDynamicFields = "0";
  133. new GuiBitmapBorderCtrl() {
  134. isContainer = "1";
  135. Profile = "ToolsGuiGroupBorderProfile";
  136. HorizSizing = "right";
  137. VertSizing = "bottom";
  138. position = "0 3";
  139. Extent = "254 60";
  140. MinExtent = "8 8";
  141. canSave = "1";
  142. Visible = "1";
  143. tooltipprofile = "ToolsGuiToolTipProfile";
  144. hovertime = "1000";
  145. canSaveDynamicFields = "0";
  146. new GuiTextCtrl() {
  147. text = "Nodes";
  148. maxLength = "1024";
  149. Margin = "0 0 0 0";
  150. Padding = "0 0 0 0";
  151. AnchorTop = "1";
  152. AnchorBottom = "0";
  153. AnchorLeft = "1";
  154. AnchorRight = "0";
  155. isContainer = "0";
  156. Profile = "ToolsGuiTextRightProfile";
  157. HorizSizing = "right";
  158. VertSizing = "bottom";
  159. position = "42 2";
  160. Extent = "32 16";
  161. MinExtent = "8 2";
  162. canSave = "1";
  163. Visible = "1";
  164. tooltipprofile = "ToolsGuiToolTipProfile";
  165. hovertime = "1000";
  166. canSaveDynamicFields = "0";
  167. };
  168. new GuiTextCtrl() {
  169. text = "";
  170. maxLength = "1024";
  171. Margin = "0 0 0 0";
  172. Padding = "0 0 0 0";
  173. AnchorTop = "1";
  174. AnchorBottom = "0";
  175. AnchorLeft = "1";
  176. AnchorRight = "0";
  177. isContainer = "0";
  178. Profile = "ToolsGuiTextProfile";
  179. HorizSizing = "right";
  180. VertSizing = "bottom";
  181. position = "90 2";
  182. Extent = "60 16";
  183. MinExtent = "8 2";
  184. canSave = "1";
  185. Visible = "1";
  186. tooltipprofile = "ToolsGuiToolTipProfile";
  187. hovertime = "1000";
  188. internalName = "nodes";
  189. canSaveDynamicFields = "0";
  190. };
  191. new GuiTextCtrl() {
  192. text = "Meshes";
  193. maxLength = "1024";
  194. Margin = "0 0 0 0";
  195. Padding = "0 0 0 0";
  196. AnchorTop = "1";
  197. AnchorBottom = "0";
  198. AnchorLeft = "1";
  199. AnchorRight = "0";
  200. isContainer = "0";
  201. Profile = "ToolsGuiTextRightProfile";
  202. HorizSizing = "right";
  203. VertSizing = "bottom";
  204. position = "36 22";
  205. Extent = "38 16";
  206. MinExtent = "8 2";
  207. canSave = "1";
  208. Visible = "1";
  209. tooltipprofile = "ToolsGuiToolTipProfile";
  210. hovertime = "1000";
  211. canSaveDynamicFields = "0";
  212. };
  213. new GuiTextCtrl() {
  214. text = "";
  215. maxLength = "1024";
  216. Margin = "0 0 0 0";
  217. Padding = "0 0 0 0";
  218. AnchorTop = "1";
  219. AnchorBottom = "0";
  220. AnchorLeft = "1";
  221. AnchorRight = "0";
  222. isContainer = "0";
  223. Profile = "ToolsGuiTextProfile";
  224. HorizSizing = "right";
  225. VertSizing = "bottom";
  226. position = "90 22";
  227. Extent = "60 16";
  228. MinExtent = "8 2";
  229. canSave = "1";
  230. Visible = "1";
  231. tooltipprofile = "ToolsGuiToolTipProfile";
  232. hovertime = "1000";
  233. internalName = "meshes";
  234. canSaveDynamicFields = "0";
  235. };
  236. new GuiTextCtrl() {
  237. text = "Polygons";
  238. maxLength = "1024";
  239. Margin = "0 0 0 0";
  240. Padding = "0 0 0 0";
  241. AnchorTop = "1";
  242. AnchorBottom = "0";
  243. AnchorLeft = "1";
  244. AnchorRight = "0";
  245. isContainer = "0";
  246. Profile = "ToolsGuiTextRightProfile";
  247. HorizSizing = "right";
  248. VertSizing = "bottom";
  249. position = "132 22";
  250. Extent = "47 16";
  251. MinExtent = "8 2";
  252. canSave = "1";
  253. Visible = "1";
  254. tooltipprofile = "ToolsGuiToolTipProfile";
  255. hovertime = "1000";
  256. canSaveDynamicFields = "0";
  257. };
  258. new GuiTextCtrl() {
  259. text = "";
  260. maxLength = "1024";
  261. Margin = "0 0 0 0";
  262. Padding = "0 0 0 0";
  263. AnchorTop = "1";
  264. AnchorBottom = "0";
  265. AnchorLeft = "1";
  266. AnchorRight = "0";
  267. isContainer = "0";
  268. Profile = "ToolsGuiTextProfile";
  269. HorizSizing = "right";
  270. VertSizing = "bottom";
  271. position = "193 22";
  272. Extent = "60 16";
  273. MinExtent = "8 2";
  274. canSave = "1";
  275. Visible = "1";
  276. tooltipprofile = "ToolsGuiToolTipProfile";
  277. hovertime = "1000";
  278. internalName = "polygons";
  279. canSaveDynamicFields = "0";
  280. };
  281. new GuiTextCtrl() {
  282. text = "Materials";
  283. maxLength = "1024";
  284. Margin = "0 0 0 0";
  285. Padding = "0 0 0 0";
  286. AnchorTop = "1";
  287. AnchorBottom = "0";
  288. AnchorLeft = "1";
  289. AnchorRight = "0";
  290. isContainer = "0";
  291. Profile = "ToolsGuiTextRightProfile";
  292. HorizSizing = "right";
  293. VertSizing = "bottom";
  294. position = "135 2";
  295. Extent = "44 16";
  296. MinExtent = "8 2";
  297. canSave = "1";
  298. Visible = "1";
  299. tooltipprofile = "ToolsGuiToolTipProfile";
  300. hovertime = "1000";
  301. canSaveDynamicFields = "0";
  302. };
  303. new GuiTextCtrl() {
  304. text = "";
  305. maxLength = "1024";
  306. Margin = "0 0 0 0";
  307. Padding = "0 0 0 0";
  308. AnchorTop = "1";
  309. AnchorBottom = "0";
  310. AnchorLeft = "1";
  311. AnchorRight = "0";
  312. isContainer = "0";
  313. Profile = "ToolsGuiTextProfile";
  314. HorizSizing = "right";
  315. VertSizing = "bottom";
  316. position = "193 2";
  317. Extent = "60 16";
  318. MinExtent = "8 2";
  319. canSave = "1";
  320. Visible = "1";
  321. tooltipprofile = "ToolsGuiToolTipProfile";
  322. hovertime = "1000";
  323. internalName = "Materials";
  324. canSaveDynamicFields = "0";
  325. };
  326. new GuiTextCtrl() {
  327. text = "Lights";
  328. maxLength = "1024";
  329. Margin = "0 0 0 0";
  330. Padding = "0 0 0 0";
  331. AnchorTop = "1";
  332. AnchorBottom = "0";
  333. AnchorLeft = "1";
  334. AnchorRight = "0";
  335. isContainer = "0";
  336. Profile = "ToolsGuiTextRightProfile";
  337. HorizSizing = "right";
  338. VertSizing = "bottom";
  339. position = "23 41";
  340. Extent = "52 16";
  341. MinExtent = "8 2";
  342. canSave = "1";
  343. Visible = "1";
  344. tooltipprofile = "ToolsGuiToolTipProfile";
  345. hovertime = "1000";
  346. canSaveDynamicFields = "0";
  347. };
  348. new GuiTextCtrl() {
  349. text = "";
  350. maxLength = "1024";
  351. Margin = "0 0 0 0";
  352. Padding = "0 0 0 0";
  353. AnchorTop = "1";
  354. AnchorBottom = "0";
  355. AnchorLeft = "1";
  356. AnchorRight = "0";
  357. isContainer = "0";
  358. Profile = "ToolsGuiTextProfile";
  359. HorizSizing = "right";
  360. VertSizing = "bottom";
  361. position = "91 41";
  362. Extent = "60 16";
  363. MinExtent = "8 2";
  364. canSave = "1";
  365. Visible = "1";
  366. tooltipprofile = "ToolsGuiToolTipProfile";
  367. hovertime = "1000";
  368. internalName = "lights";
  369. canSaveDynamicFields = "0";
  370. };
  371. new GuiTextCtrl() {
  372. text = "Animations";
  373. maxLength = "1024";
  374. Margin = "0 0 0 0";
  375. Padding = "0 0 0 0";
  376. AnchorTop = "1";
  377. AnchorBottom = "0";
  378. AnchorLeft = "1";
  379. AnchorRight = "0";
  380. isContainer = "0";
  381. Profile = "ToolsGuiTextRightProfile";
  382. HorizSizing = "right";
  383. VertSizing = "bottom";
  384. position = "127 41";
  385. Extent = "52 16";
  386. MinExtent = "8 2";
  387. canSave = "1";
  388. Visible = "1";
  389. tooltipprofile = "ToolsGuiToolTipProfile";
  390. hovertime = "1000";
  391. canSaveDynamicFields = "0";
  392. };
  393. new GuiTextCtrl() {
  394. text = "";
  395. maxLength = "1024";
  396. Margin = "0 0 0 0";
  397. Padding = "0 0 0 0";
  398. AnchorTop = "1";
  399. AnchorBottom = "0";
  400. AnchorLeft = "1";
  401. AnchorRight = "0";
  402. isContainer = "0";
  403. Profile = "ToolsGuiTextProfile";
  404. HorizSizing = "right";
  405. VertSizing = "bottom";
  406. position = "191 41";
  407. Extent = "60 16";
  408. MinExtent = "8 2";
  409. canSave = "1";
  410. Visible = "1";
  411. tooltipprofile = "ToolsGuiToolTipProfile";
  412. hovertime = "1000";
  413. internalName = "animations";
  414. canSaveDynamicFields = "0";
  415. };
  416. };
  417. new GuiBitmapBorderCtrl() {
  418. isContainer = "1";
  419. Profile = "ToolsGuiGroupBorderProfile";
  420. HorizSizing = "right";
  421. VertSizing = "bottom";
  422. position = "0 68";
  423. Extent = "254 153";
  424. MinExtent = "8 8";
  425. canSave = "1";
  426. Visible = "1";
  427. tooltipprofile = "ToolsGuiToolTipProfile";
  428. hovertime = "1000";
  429. canSaveDynamicFields = "0";
  430. new GuiTextCtrl() {
  431. text = "LOD";
  432. maxLength = "1024";
  433. Margin = "0 0 0 0";
  434. Padding = "0 0 0 0";
  435. AnchorTop = "1";
  436. AnchorBottom = "0";
  437. AnchorLeft = "1";
  438. AnchorRight = "0";
  439. isContainer = "0";
  440. Profile = "ToolsGuiTextRightProfile";
  441. HorizSizing = "right";
  442. VertSizing = "bottom";
  443. position = "59 6";
  444. Extent = "22 16";
  445. MinExtent = "8 2";
  446. canSave = "1";
  447. Visible = "1";
  448. tooltipprofile = "ToolsGuiToolTipProfile";
  449. hovertime = "1000";
  450. canSaveDynamicFields = "0";
  451. };
  452. new GuiPopUpMenuCtrl() {
  453. maxPopupHeight = "200";
  454. sbUsesNAColor = "0";
  455. reverseTextList = "0";
  456. bitmapBounds = "16 16";
  457. text = "DetectDTS";
  458. maxLength = "1024";
  459. Margin = "0 0 0 0";
  460. Padding = "0 0 0 0";
  461. AnchorTop = "1";
  462. AnchorBottom = "0";
  463. AnchorLeft = "1";
  464. AnchorRight = "0";
  465. isContainer = "0";
  466. Profile = "ToolsGuiPopUpMenuProfile";
  467. HorizSizing = "right";
  468. VertSizing = "bottom";
  469. position = "97 6";
  470. Extent = "92 18";
  471. MinExtent = "8 2";
  472. canSave = "1";
  473. Visible = "1";
  474. tooltipprofile = "ToolsGuiToolTipProfile";
  475. ToolTip = "Method used to determine LOD for meshes in the model";
  476. hovertime = "1000";
  477. internalName = "lodType";
  478. canSaveDynamicFields = "0";
  479. };
  480. new GuiTextEditCtrl() {
  481. historySize = "0";
  482. password = "0";
  483. tabComplete = "0";
  484. sinkAllKeyEvents = "0";
  485. passwordMask = "*";
  486. text = "";
  487. maxLength = "1024";
  488. Margin = "0 0 0 0";
  489. Padding = "0 0 0 0";
  490. AnchorTop = "1";
  491. AnchorBottom = "0";
  492. AnchorLeft = "1";
  493. AnchorRight = "0";
  494. isContainer = "0";
  495. Profile = "ToolsGuiTextEditProfile";
  496. HorizSizing = "right";
  497. VertSizing = "bottom";
  498. position = "196 6";
  499. Extent = "49 18";
  500. MinExtent = "8 2";
  501. canSave = "1";
  502. Visible = "1";
  503. tooltipprofile = "ToolsGuiToolTipProfile";
  504. ToolTip = "Detail size for all meshes in this model (when LOD type is SingleSize)";
  505. hovertime = "1000";
  506. internalName = "singleDetailSize";
  507. canSaveDynamicFields = "0";
  508. };
  509. new GuiTextCtrl() {
  510. text = "Materials Prefix";
  511. maxLength = "1024";
  512. Margin = "0 0 0 0";
  513. Padding = "0 0 0 0";
  514. AnchorTop = "1";
  515. AnchorBottom = "0";
  516. AnchorLeft = "1";
  517. AnchorRight = "0";
  518. isContainer = "0";
  519. Profile = "ToolsGuiTextRightProfile";
  520. HorizSizing = "right";
  521. VertSizing = "bottom";
  522. position = "11 32";
  523. Extent = "73 16";
  524. MinExtent = "8 2";
  525. canSave = "1";
  526. Visible = "1";
  527. tooltipprofile = "ToolsGuiToolTipProfile";
  528. hovertime = "1000";
  529. canSaveDynamicFields = "0";
  530. };
  531. new GuiTextEditCtrl() {
  532. historySize = "0";
  533. password = "0";
  534. tabComplete = "0";
  535. sinkAllKeyEvents = "0";
  536. passwordMask = "*";
  537. maxLength = "1024";
  538. Margin = "0 0 0 0";
  539. Padding = "0 0 0 0";
  540. AnchorTop = "1";
  541. AnchorBottom = "0";
  542. AnchorLeft = "1";
  543. AnchorRight = "0";
  544. isContainer = "0";
  545. Profile = "ToolsGuiTextEditProfile";
  546. HorizSizing = "right";
  547. VertSizing = "bottom";
  548. position = "97 32";
  549. Extent = "148 18";
  550. MinExtent = "8 2";
  551. canSave = "1";
  552. Visible = "1";
  553. AltCommand = "ColladaImportTreeView.refresh(\"materials\");";
  554. tooltipprofile = "ToolsGuiToolTipProfile";
  555. hovertime = "1000";
  556. internalName = "materialPrefix";
  557. canSaveDynamicFields = "0";
  558. };
  559. new GuiTextCtrl() {
  560. text = "Import Nodes";
  561. maxLength = "1024";
  562. Margin = "0 0 0 0";
  563. Padding = "0 0 0 0";
  564. AnchorTop = "1";
  565. AnchorBottom = "0";
  566. AnchorLeft = "1";
  567. AnchorRight = "0";
  568. isContainer = "0";
  569. Profile = "ToolsGuiTextRightProfile";
  570. HorizSizing = "right";
  571. VertSizing = "bottom";
  572. position = "13 58";
  573. Extent = "72 16";
  574. MinExtent = "8 2";
  575. canSave = "1";
  576. Visible = "1";
  577. tooltipprofile = "ToolsGuiToolTipProfile";
  578. hovertime = "1000";
  579. canSaveDynamicFields = "0";
  580. };
  581. new GuiTextEditCtrl() {
  582. historySize = "0";
  583. password = "0";
  584. tabComplete = "0";
  585. sinkAllKeyEvents = "0";
  586. passwordMask = "*";
  587. maxLength = "1024";
  588. Margin = "0 0 0 0";
  589. Padding = "0 0 0 0";
  590. AnchorTop = "1";
  591. AnchorBottom = "0";
  592. AnchorLeft = "1";
  593. AnchorRight = "0";
  594. isContainer = "0";
  595. Profile = "ToolsGuiTextEditProfile";
  596. HorizSizing = "right";
  597. VertSizing = "bottom";
  598. position = "97 58";
  599. Extent = "148 18";
  600. MinExtent = "8 2";
  601. canSave = "1";
  602. Visible = "1";
  603. AltCommand = "ColladaImportTreeView.refresh(\"nodes\");";
  604. tooltipprofile = "ToolsGuiToolTipProfile";
  605. hovertime = "1000";
  606. internalName = "alwaysImport";
  607. canSaveDynamicFields = "0";
  608. };
  609. new GuiTextCtrl() {
  610. text = "Ignore Nodes";
  611. maxLength = "1024";
  612. Margin = "0 0 0 0";
  613. Padding = "0 0 0 0";
  614. AnchorTop = "1";
  615. AnchorBottom = "0";
  616. AnchorLeft = "1";
  617. AnchorRight = "0";
  618. isContainer = "0";
  619. Profile = "ToolsGuiTextRightProfile";
  620. HorizSizing = "right";
  621. VertSizing = "bottom";
  622. position = "20 82";
  623. Extent = "65 16";
  624. MinExtent = "8 2";
  625. canSave = "1";
  626. Visible = "1";
  627. tooltipprofile = "ToolsGuiToolTipProfile";
  628. hovertime = "1000";
  629. canSaveDynamicFields = "0";
  630. };
  631. new GuiTextEditCtrl() {
  632. historySize = "0";
  633. password = "0";
  634. tabComplete = "0";
  635. sinkAllKeyEvents = "0";
  636. passwordMask = "*";
  637. maxLength = "1024";
  638. Margin = "0 0 0 0";
  639. Padding = "0 0 0 0";
  640. AnchorTop = "1";
  641. AnchorBottom = "0";
  642. AnchorLeft = "1";
  643. AnchorRight = "0";
  644. isContainer = "0";
  645. Profile = "ToolsGuiTextEditProfile";
  646. HorizSizing = "right";
  647. VertSizing = "bottom";
  648. position = "97 82";
  649. Extent = "148 18";
  650. MinExtent = "8 2";
  651. canSave = "1";
  652. Visible = "1";
  653. AltCommand = "ColladaImportTreeView.refresh(\"nodes\");";
  654. tooltipprofile = "ToolsGuiToolTipProfile";
  655. hovertime = "1000";
  656. internalName = "neverImport";
  657. canSaveDynamicFields = "0";
  658. };
  659. new GuiTextCtrl() {
  660. text = "Import Meshes";
  661. maxLength = "1024";
  662. Margin = "0 0 0 0";
  663. Padding = "0 0 0 0";
  664. AnchorTop = "1";
  665. AnchorBottom = "0";
  666. AnchorLeft = "1";
  667. AnchorRight = "0";
  668. isContainer = "0";
  669. Profile = "ToolsGuiTextRightProfile";
  670. HorizSizing = "right";
  671. VertSizing = "bottom";
  672. position = "13 106";
  673. Extent = "72 16";
  674. MinExtent = "8 2";
  675. canSave = "1";
  676. Visible = "1";
  677. tooltipprofile = "ToolsGuiToolTipProfile";
  678. hovertime = "1000";
  679. canSaveDynamicFields = "0";
  680. };
  681. new GuiTextEditCtrl() {
  682. historySize = "0";
  683. password = "0";
  684. tabComplete = "0";
  685. sinkAllKeyEvents = "0";
  686. passwordMask = "*";
  687. maxLength = "1024";
  688. Margin = "0 0 0 0";
  689. Padding = "0 0 0 0";
  690. AnchorTop = "1";
  691. AnchorBottom = "0";
  692. AnchorLeft = "1";
  693. AnchorRight = "0";
  694. isContainer = "0";
  695. Profile = "ToolsGuiTextEditProfile";
  696. HorizSizing = "right";
  697. VertSizing = "bottom";
  698. position = "97 106";
  699. Extent = "148 18";
  700. MinExtent = "8 2";
  701. canSave = "1";
  702. Visible = "1";
  703. AltCommand = "ColladaImportTreeView.refresh(\"nodes\");";
  704. tooltipprofile = "ToolsGuiToolTipProfile";
  705. hovertime = "1000";
  706. internalName = "alwaysImportMesh";
  707. canSaveDynamicFields = "0";
  708. };
  709. new GuiTextCtrl() {
  710. text = "Ignore Meshes";
  711. maxLength = "1024";
  712. Margin = "0 0 0 0";
  713. Padding = "0 0 0 0";
  714. AnchorTop = "1";
  715. AnchorBottom = "0";
  716. AnchorLeft = "1";
  717. AnchorRight = "0";
  718. isContainer = "0";
  719. Profile = "ToolsGuiTextRightProfile";
  720. HorizSizing = "right";
  721. VertSizing = "bottom";
  722. position = "13 130";
  723. Extent = "72 16";
  724. MinExtent = "8 2";
  725. canSave = "1";
  726. Visible = "1";
  727. tooltipprofile = "ToolsGuiToolTipProfile";
  728. hovertime = "1000";
  729. canSaveDynamicFields = "0";
  730. };
  731. new GuiTextEditCtrl() {
  732. historySize = "0";
  733. password = "0";
  734. tabComplete = "0";
  735. sinkAllKeyEvents = "0";
  736. passwordMask = "*";
  737. maxLength = "1024";
  738. Margin = "0 0 0 0";
  739. Padding = "0 0 0 0";
  740. AnchorTop = "1";
  741. AnchorBottom = "0";
  742. AnchorLeft = "1";
  743. AnchorRight = "0";
  744. isContainer = "0";
  745. Profile = "ToolsGuiTextEditProfile";
  746. HorizSizing = "right";
  747. VertSizing = "bottom";
  748. position = "97 130";
  749. Extent = "148 18";
  750. MinExtent = "8 2";
  751. canSave = "1";
  752. Visible = "1";
  753. AltCommand = "ColladaImportTreeView.refresh(\"nodes\");";
  754. tooltipprofile = "ToolsGuiToolTipProfile";
  755. hovertime = "1000";
  756. internalName = "neverImportMesh";
  757. canSaveDynamicFields = "0";
  758. };
  759. };
  760. new GuiBitmapBorderCtrl() {
  761. isContainer = "1";
  762. Profile = "ToolsGuiGroupBorderProfile";
  763. HorizSizing = "right";
  764. VertSizing = "bottom";
  765. position = "0 226";
  766. Extent = "254 105";
  767. MinExtent = "8 8";
  768. canSave = "1";
  769. Visible = "1";
  770. tooltipprofile = "ToolsGuiToolTipProfile";
  771. hovertime = "1000";
  772. canSaveDynamicFields = "0";
  773. new GuiCheckBoxCtrl() {
  774. useInactiveState = "0";
  775. text = " Override up_axis";
  776. groupNum = "-1";
  777. buttonType = "ToggleButton";
  778. useMouseEvents = "0";
  779. isContainer = "0";
  780. Profile = "ToolsGuiCheckBoxProfile";
  781. HorizSizing = "right";
  782. VertSizing = "bottom";
  783. position = "11 7";
  784. Extent = "102 13";
  785. MinExtent = "8 2";
  786. canSave = "1";
  787. Visible = "1";
  788. Command = "ColladaImportDlg.updateOverrideUpAxis($ThisControl.getValue());";
  789. tooltipprofile = "ToolsGuiToolTipProfile";
  790. ToolTip = "Overrides the <up_axis> specified in the DAE file";
  791. hovertime = "1000";
  792. internalName = "overrideUpAxis";
  793. canSaveDynamicFields = "0";
  794. };
  795. new GuiPopUpMenuCtrl() {
  796. maxPopupHeight = "200";
  797. sbUsesNAColor = "0";
  798. reverseTextList = "0";
  799. bitmapBounds = "16 16";
  800. maxLength = "1024";
  801. Margin = "0 0 0 0";
  802. Padding = "0 0 0 0";
  803. AnchorTop = "1";
  804. AnchorBottom = "0";
  805. AnchorLeft = "1";
  806. AnchorRight = "0";
  807. isContainer = "0";
  808. Profile = "ToolsGuiPopUpMenuProfile";
  809. HorizSizing = "right";
  810. VertSizing = "bottom";
  811. position = "151 6";
  812. Extent = "66 18";
  813. MinExtent = "8 2";
  814. canSave = "1";
  815. Visible = "1";
  816. tooltipprofile = "ToolsGuiToolTipProfile";
  817. hovertime = "1000";
  818. internalName = "upAxis";
  819. canSaveDynamicFields = "0";
  820. };
  821. new GuiCheckBoxCtrl() {
  822. useInactiveState = "0";
  823. text = " Override scale";
  824. groupNum = "-1";
  825. buttonType = "ToggleButton";
  826. useMouseEvents = "0";
  827. isContainer = "0";
  828. Profile = "ToolsGuiCheckBoxProfile";
  829. HorizSizing = "right";
  830. VertSizing = "bottom";
  831. position = "11 27";
  832. Extent = "92 13";
  833. MinExtent = "8 2";
  834. canSave = "1";
  835. Visible = "1";
  836. Command = "ColladaImportDlg.updateOverrideScale($ThisControl.getValue());";
  837. tooltipprofile = "ToolsGuiToolTipProfile";
  838. ToolTip = "Overrides the <unit> scale specified in the DAE file";
  839. hovertime = "1000";
  840. internalName = "overrideScale";
  841. canSaveDynamicFields = "0";
  842. };
  843. new GuiTextEditCtrl() {
  844. historySize = "0";
  845. password = "0";
  846. tabComplete = "0";
  847. sinkAllKeyEvents = "0";
  848. passwordMask = "*";
  849. text = "";
  850. maxLength = "1024";
  851. Margin = "0 0 0 0";
  852. Padding = "0 0 0 0";
  853. AnchorTop = "1";
  854. AnchorBottom = "0";
  855. AnchorLeft = "1";
  856. AnchorRight = "0";
  857. isContainer = "0";
  858. Profile = "ToolsGuiTextEditProfile";
  859. HorizSizing = "right";
  860. VertSizing = "bottom";
  861. position = "151 27";
  862. Extent = "66 18";
  863. MinExtent = "8 2";
  864. canSave = "1";
  865. Visible = "1";
  866. tooltipprofile = "ToolsGuiToolTipProfile";
  867. hovertime = "1000";
  868. internalName = "scale";
  869. canSaveDynamicFields = "0";
  870. };
  871. new GuiCheckBoxCtrl() {
  872. useInactiveState = "0";
  873. text = " Ignore bone scaling";
  874. groupNum = "-1";
  875. buttonType = "ToggleButton";
  876. useMouseEvents = "0";
  877. isContainer = "0";
  878. Profile = "ToolsGuiCheckBoxProfile";
  879. HorizSizing = "right";
  880. VertSizing = "bottom";
  881. position = "11 48";
  882. Extent = "114 13";
  883. MinExtent = "8 2";
  884. canSave = "1";
  885. Visible = "1";
  886. tooltipprofile = "ToolsGuiToolTipProfile";
  887. ToolTip = "Ignores <scale> elements within <node>s to fix issues with some models";
  888. hovertime = "1000";
  889. internalName = "ignoreNodeScale";
  890. canSaveDynamicFields = "0";
  891. };
  892. new GuiCheckBoxCtrl() {
  893. useInactiveState = "0";
  894. text = " Center model";
  895. groupNum = "-1";
  896. buttonType = "ToggleButton";
  897. useMouseEvents = "0";
  898. isContainer = "0";
  899. Profile = "ToolsGuiCheckBoxProfile";
  900. HorizSizing = "right";
  901. VertSizing = "bottom";
  902. position = "11 67";
  903. Extent = "82 13";
  904. MinExtent = "8 2";
  905. canSave = "1";
  906. Visible = "1";
  907. tooltipprofile = "ToolsGuiToolTipProfile";
  908. ToolTip = "Translates model so the origin is at the center";
  909. hovertime = "1000";
  910. internalName = "adjustCenter";
  911. canSaveDynamicFields = "0";
  912. };
  913. new GuiCheckBoxCtrl() {
  914. useInactiveState = "0";
  915. text = " Floor model";
  916. groupNum = "-1";
  917. buttonType = "ToggleButton";
  918. useMouseEvents = "0";
  919. isContainer = "0";
  920. Profile = "ToolsGuiCheckBoxProfile";
  921. HorizSizing = "right";
  922. VertSizing = "bottom";
  923. position = "151 67";
  924. Extent = "72 13";
  925. MinExtent = "8 2";
  926. canSave = "1";
  927. Visible = "1";
  928. tooltipprofile = "ToolsGuiToolTipProfile";
  929. ToolTip = "Translates model so the origin is at the bottom";
  930. hovertime = "1000";
  931. internalName = "adjustFloor";
  932. canSaveDynamicFields = "0";
  933. };
  934. new GuiCheckBoxCtrl() {
  935. useInactiveState = "0";
  936. text = " Force update materials.cs";
  937. groupNum = "-1";
  938. buttonType = "ToggleButton";
  939. useMouseEvents = "0";
  940. isContainer = "0";
  941. Profile = "ToolsGuiCheckBoxProfile";
  942. HorizSizing = "right";
  943. VertSizing = "bottom";
  944. position = "11 86";
  945. Extent = "148 13";
  946. MinExtent = "8 2";
  947. canSave = "1";
  948. Visible = "1";
  949. tooltipprofile = "ToolsGuiToolTipProfile";
  950. ToolTip = "Forces update of materials.cs (even if Materials already exist)";
  951. hovertime = "1000";
  952. internalName = "forceUpdateMaterials";
  953. canSaveDynamicFields = "0";
  954. };
  955. };
  956. new GuiBitmapBorderCtrl() {
  957. isContainer = "1";
  958. Profile = "ToolsGuiGroupBorderProfile";
  959. HorizSizing = "right";
  960. VertSizing = "bottom";
  961. position = "0 338";
  962. Extent = "254 24";
  963. MinExtent = "8 8";
  964. canSave = "1";
  965. Visible = "1";
  966. tooltipprofile = "ToolsGuiToolTipProfile";
  967. hovertime = "1000";
  968. canSaveDynamicFields = "0";
  969. new GuiCheckBoxCtrl() {
  970. useInactiveState = "0";
  971. text = " Add lights to scene";
  972. groupNum = "-1";
  973. buttonType = "ToggleButton";
  974. useMouseEvents = "0";
  975. isContainer = "0";
  976. Profile = "ToolsGuiCheckBoxProfile";
  977. HorizSizing = "right";
  978. VertSizing = "bottom";
  979. position = "11 5";
  980. Extent = "148 13";
  981. MinExtent = "8 2";
  982. canSave = "1";
  983. Visible = "1";
  984. tooltipprofile = "ToolsGuiToolTipProfile";
  985. ToolTip = "Loads the lights from the DAE file and adds them to the current scene.";
  986. hovertime = "1000";
  987. internalName = "loadLights";
  988. canSaveDynamicFields = "0";
  989. };
  990. };
  991. new GuiButtonCtrl() {
  992. text = "Load from .cfg";
  993. groupNum = "-1";
  994. buttonType = "PushButton";
  995. useMouseEvents = "0";
  996. isContainer = "0";
  997. Profile = "ToolsGuiButtonProfile";
  998. HorizSizing = "right";
  999. VertSizing = "bottom";
  1000. position = "11 368";
  1001. Extent = "86 22";
  1002. MinExtent = "8 2";
  1003. canSave = "1";
  1004. Visible = "1";
  1005. Command = "ColladaImportDlg.readDtsConfig();";
  1006. tooltipprofile = "ToolsGuiToolTipProfile";
  1007. hovertime = "1000";
  1008. canSaveDynamicFields = "0";
  1009. };
  1010. new GuiButtonCtrl() {
  1011. text = "Save to .cfg";
  1012. groupNum = "-1";
  1013. buttonType = "PushButton";
  1014. useMouseEvents = "0";
  1015. isContainer = "0";
  1016. Profile = "ToolsGuiButtonProfile";
  1017. HorizSizing = "right";
  1018. VertSizing = "bottom";
  1019. position = "11 395";
  1020. Extent = "86 22";
  1021. MinExtent = "8 2";
  1022. canSave = "1";
  1023. Visible = "1";
  1024. Command = "ColladaImportDlg.writeDtsConfig();";
  1025. tooltipprofile = "ToolsGuiToolTipProfile";
  1026. hovertime = "1000";
  1027. canSaveDynamicFields = "0";
  1028. };
  1029. new GuiButtonCtrl() {
  1030. text = "OK";
  1031. groupNum = "-1";
  1032. buttonType = "PushButton";
  1033. useMouseEvents = "0";
  1034. isContainer = "0";
  1035. Profile = "ToolsGuiButtonProfile";
  1036. HorizSizing = "right";
  1037. VertSizing = "bottom";
  1038. position = "159 368";
  1039. Extent = "86 22";
  1040. MinExtent = "8 2";
  1041. canSave = "1";
  1042. Visible = "1";
  1043. Command = "ColladaImportDlg.onOK();";
  1044. tooltipprofile = "ToolsGuiToolTipProfile";
  1045. ToolTip = "Load the COLLADA model";
  1046. hovertime = "1000";
  1047. canSaveDynamicFields = "0";
  1048. };
  1049. new GuiButtonCtrl() {
  1050. text = "Cancel";
  1051. groupNum = "-1";
  1052. buttonType = "PushButton";
  1053. useMouseEvents = "0";
  1054. isContainer = "0";
  1055. Profile = "ToolsGuiButtonProfile";
  1056. HorizSizing = "right";
  1057. VertSizing = "bottom";
  1058. position = "159 395";
  1059. Extent = "86 22";
  1060. MinExtent = "8 2";
  1061. canSave = "1";
  1062. Visible = "1";
  1063. Command = "ColladaImportDlg.onCancel();";
  1064. tooltipprofile = "ToolsGuiToolTipProfile";
  1065. ToolTip = "Exit without loading the COLLADA model";
  1066. hovertime = "1000";
  1067. canSaveDynamicFields = "0";
  1068. };
  1069. };
  1070. };
  1071. };
  1072. //--- OBJECT WRITE END ---
  1073. new GuiControl(ColladaImportProgress,EditorGuiGroup) {
  1074. isContainer = "1";
  1075. Profile = "ToolsGuiDefaultProfile";
  1076. HorizSizing = "width";
  1077. VertSizing = "height";
  1078. position = "0 0";
  1079. Extent = "1024 768";
  1080. MinExtent = "8 8";
  1081. canSave = "1";
  1082. Visible = "1";
  1083. tooltipprofile = "ToolsGuiToolTipProfile";
  1084. hovertime = "1000";
  1085. canSaveDynamicFields = "0";
  1086. new GuiWindowCtrl() {
  1087. internalName = "window";
  1088. resizeWidth = "0";
  1089. resizeHeight = "0";
  1090. canMove = "1";
  1091. canClose = "0";
  1092. canMinimize = "0";
  1093. canMaximize = "0";
  1094. minSize = "50 50";
  1095. EdgeSnap = "1";
  1096. text = "Importing cowboy.dae";
  1097. Margin = "0 0 0 0";
  1098. Padding = "0 0 0 0";
  1099. AnchorTop = "1";
  1100. AnchorBottom = "0";
  1101. AnchorLeft = "1";
  1102. AnchorRight = "0";
  1103. isContainer = "1";
  1104. Profile = "ToolsGuiWindowProfile";
  1105. HorizSizing = "center";
  1106. VertSizing = "center";
  1107. position = "362 338";
  1108. Extent = "300 92";
  1109. MinExtent = "48 92";
  1110. canSave = "1";
  1111. Visible = "1";
  1112. tooltipprofile = "ToolsGuiToolTipProfile";
  1113. hovertime = "1000";
  1114. canSaveDynamicFields = "0";
  1115. new GuiProgressBitmapCtrl() {
  1116. internalName = "progressBar";
  1117. maxLength = "1024";
  1118. Margin = "0 0 0 0";
  1119. Padding = "0 0 0 0";
  1120. AnchorTop = "1";
  1121. AnchorBottom = "0";
  1122. AnchorLeft = "1";
  1123. AnchorRight = "0";
  1124. isContainer = "1";
  1125. Profile = "ToolsGuiRLProgressBitmapProfile";
  1126. HorizSizing = "width";
  1127. VertSizing = "bottom";
  1128. position = "10 34";
  1129. Extent = "280 24";
  1130. MinExtent = "8 8";
  1131. canSave = "1";
  1132. Visible = "1";
  1133. tooltipprofile = "ToolsGuiToolTipProfile";
  1134. hovertime = "1000";
  1135. canSaveDynamicFields = "0";
  1136. };
  1137. new GuiTextCtrl() {
  1138. internalName = "progressText";
  1139. maxLength = "1024";
  1140. Margin = "0 0 0 0";
  1141. Padding = "0 0 0 0";
  1142. AnchorTop = "1";
  1143. AnchorBottom = "0";
  1144. AnchorLeft = "1";
  1145. AnchorRight = "0";
  1146. isContainer = "0";
  1147. Profile = "ToolsGuiTextProfile";
  1148. HorizSizing = "width";
  1149. VertSizing = "bottom";
  1150. position = "10 62";
  1151. Extent = "280 16";
  1152. MinExtent = "8 2";
  1153. canSave = "1";
  1154. Visible = "1";
  1155. tooltipprofile = "ToolsGuiToolTipProfile";
  1156. hovertime = "1000";
  1157. canSaveDynamicFields = "0";
  1158. };
  1159. };
  1160. };
  1161. function ColladaImportTreeView::onDefineIcons(%this)
  1162. {
  1163. // Set the tree view icon indices and texture paths
  1164. %this._imageNone = 0;
  1165. %this._imageNode = 1;
  1166. %this._imageMesh = 2;
  1167. %this._imageMaterial = 3;
  1168. %this._imageLight = 4;
  1169. %this._imageAnimation = 5;
  1170. %this._imageExNode = 6;
  1171. %this._imageExMaterial = 7;
  1172. %icons = ":" @ // no icon
  1173. "tools/gui/images/ColladaImport/iconNode:" @ // normal node
  1174. "tools/gui/images/ColladaImport/iconMesh:" @ // mesh
  1175. "tools/gui/images/ColladaImport/iconMaterial:" @ // new material
  1176. "tools/gui/images/ColladaImport/iconLight:" @ // light
  1177. "tools/gui/images/ColladaImport/iconAnimation:" @ // sequence
  1178. "tools/gui/images/ColladaImport/iconIgnoreNode:" @ // ignored node
  1179. "tools/gui/images/ColladaImport/iconExistingMaterial"; // existing material
  1180. %this.buildIconTable( %icons );
  1181. }
  1182. function ColladaImportDlg::showDialog(%this, %shapePath, %cmd)
  1183. {
  1184. %this.path = %shapePath;
  1185. %this.cmd = %cmd;
  1186. // Only allow loading lights if creating a new scene object
  1187. %canLoadLights = (strstr(%this.cmd, "EWCreatorWindow.create") != -1);
  1188. // Check for an existing TSShapeConstructor object. Need to exec the script
  1189. // manually as the DAE resource may not have been loaded yet
  1190. %csPath = filePath(%this.path) @ "/" @ fileBase(%this.path) @ ".cs";
  1191. if (isFile(%csPath))
  1192. exec(%csPath);
  1193. %this.constructor = ShapeEditor.findConstructor(%this.path);
  1194. // Only show the import dialog if required. Note that 'enumColladaScene' will
  1195. // fail if the COLLADA file is missing, or a cached.dts is available.
  1196. $collada::forceLoadDAE = EditorSettings.value("forceLoadDAE");
  1197. if ( (fileExt(%shapePath) $= ".dts") ||
  1198. !enumColladaForImport(%shapePath, ColladaImportTreeView) )
  1199. {
  1200. eval(%cmd);
  1201. $collada::forceLoadDAE = false;
  1202. // Load lights from the DAE if possible
  1203. if (%canLoadLights && (%this.constructor > 0) && (%this.constructor.loadLights == 1))
  1204. %this.loadLights();
  1205. return;
  1206. }
  1207. $collada::forceLoadDAE = false;
  1208. // Initialise GUI
  1209. ColladaImportTreeView.onDefineIcons();
  1210. %this-->window.text = "COLLADA Import:" SPC %this.path;
  1211. %this-->upAxis.clear();
  1212. %this-->upAxis.add("X_AXIS", 1);
  1213. %this-->upAxis.add("Y_AXIS", 2);
  1214. %this-->upAxis.add("Z_AXIS", 3);
  1215. %this-->lodType.clear();
  1216. %this-->lodType.add("DetectDTS", 1);
  1217. %this-->lodType.add("SingleSize", 2);
  1218. %this-->lodType.add("TrailingNumber", 3);
  1219. %this-->loadLights.setActive(%canLoadLights);
  1220. // Set model details
  1221. %this-->nodes.setText(ColladaImportTreeView._nodeCount);
  1222. %this-->meshes.setText(ColladaImportTreeView._meshCount);
  1223. %this-->polygons.setText(ColladaImportTreeView._polygonCount);
  1224. %this-->materials.setText(ColladaImportTreeView._materialCount);
  1225. %this-->lights.setText(ColladaImportTreeView._lightCount);
  1226. %this-->animations.setText(ColladaImportTreeView._animCount);
  1227. %this.updateOverrideUpAxis(false);
  1228. %this.updateOverrideScale(false);
  1229. if (%this.constructor > 0)
  1230. {
  1231. if (%this.constructor.upAxis !$= "DEFAULT")
  1232. {
  1233. %this-->upAxis.setText(%this.constructor.upAxis);
  1234. %this.updateOverrideUpAxis(true);
  1235. }
  1236. if (%this.constructor.unit > 0)
  1237. {
  1238. %this-->scale.setText(%this.constructor.unit);
  1239. %this.updateOverrideScale(true);
  1240. }
  1241. %this-->lodType.setText(%this.constructor.lodType);
  1242. %this-->singleDetailSize.setText(%this.constructor.singleDetailSize);
  1243. %this-->materialPrefix.setText(%this.constructor.matNamePrefix);
  1244. %this-->alwaysImport.setText(strreplace(%this.constructor.alwaysImport, "\t", ";"));
  1245. %this-->neverImport.setText(strreplace(%this.constructor.neverImport, "\t", ";"));
  1246. %this-->alwaysImportMesh.setText(strreplace(%this.constructor.alwaysImportMesh, "\t", ";"));
  1247. %this-->neverImportMesh.setText(strreplace(%this.constructor.neverImportMesh, "\t", ";"));
  1248. %this-->ignoreNodeScale.setStateOn(%this.constructor.ignoreNodeScale);
  1249. %this-->adjustCenter.setStateOn(%this.constructor.adjustCenter);
  1250. %this-->adjustFloor.setStateOn(%this.constructor.adjustFloor);
  1251. %this-->forceUpdateMaterials.setStateOn(%this.constructor.forceUpdateMaterials);
  1252. %this-->loadLights.setStateOn(%this.constructor.loadLights);
  1253. }
  1254. else
  1255. {
  1256. // Default settings
  1257. %this-->lodType.setText("DetectDTS");
  1258. %this-->singleDetailSize.setText("2");
  1259. %this-->materialPrefix.setText("");
  1260. %this-->alwaysImport.setText("");
  1261. %this-->neverImport.setText("");
  1262. %this-->alwaysImportMesh.setText("");
  1263. %this-->neverImportMesh.setText("");
  1264. %this-->ignoreNodeScale.setStateOn(0);
  1265. %this-->adjustCenter.setStateOn(0);
  1266. %this-->adjustFloor.setStateOn(0);
  1267. %this-->forceUpdateMaterials.setStateOn(0);
  1268. %this-->loadLights.setStateOn(0);
  1269. }
  1270. Canvas.pushDialog(%this);
  1271. ColladaImportTreeView.refresh("all");
  1272. }
  1273. function ColladaImportDlg::readDtsConfig(%this)
  1274. {
  1275. %filename = filePath( %this.path ) @ "/" @ fileBase( %this.path ) @ ".cfg";
  1276. %filename2 = filePath( %this.path ) @ "/" @ "dtsScene.cfg";
  1277. %fo = new FileObject();
  1278. if ( %fo.openForRead( %filename ) || %fo.openForRead( %filename2 ) )
  1279. {
  1280. %alwaysImport = "";
  1281. %neverImport = "";
  1282. %mode = "none";
  1283. while ( !%fo.isEOF() )
  1284. {
  1285. %line = trim( %fo.readLine() );
  1286. if ( %line $= "AlwaysExport:" ) // Start of the AlwaysExport list
  1287. %mode = "always";
  1288. else if ( %line $= "NeverExport:" ) // Start of the NeverExport list
  1289. %mode = "never";
  1290. else if ( startswith( %line, "+" ) || startswith( %line, "-" ) ) // Boolean parameters (not supported)
  1291. %mode = "none";
  1292. else if ( startswith( %line, "=" ) ) // Float and integer parameters (not supported)
  1293. %mode = "none";
  1294. else if ( !startswith( %line, "//" ) ) // Non-commented lines
  1295. {
  1296. switch$ (%mode)
  1297. {
  1298. case "always":
  1299. %alwaysImport = %alwaysImport TAB %line;
  1300. case "never":
  1301. %neverImport = %neverImport TAB %line;
  1302. }
  1303. }
  1304. }
  1305. %fo.close();
  1306. %alwaysImport = strreplace( trim( %alwaysImport ), "\t", ";" );
  1307. %neverImport = strreplace( trim( %neverImport ), "\t", ";" );
  1308. %this-->alwaysImport.setText( %alwaysImport );
  1309. %this-->neverImport.setText( %neverImport );
  1310. }
  1311. else
  1312. {
  1313. error( "Failed to open " @ %filename @ " or " @ %filename2 @ " for reading" );
  1314. }
  1315. %fo.delete();
  1316. }
  1317. function ColladaImportDlg::writeDtsConfig(%this)
  1318. {
  1319. %filename = filePath( %this.path ) @ "/" @ fileBase( %this.path ) @ ".cfg";
  1320. %fo = new FileObject();
  1321. if ( %fo.openForWrite( %filename ) )
  1322. {
  1323. // AlwaysImport
  1324. %fo.writeLine("AlwaysExport:");
  1325. %alwaysImport = trim( strreplace( %this-->alwaysImport.getText(), ";", "\t" ) );
  1326. %count = getFieldCount( %alwaysImport );
  1327. for (%i = 0; %i < %count; %i++)
  1328. %fo.writeLine( getField( %alwaysImport, %i ) );
  1329. %fo.writeLine("");
  1330. // NeverImport
  1331. %fo.writeLine("NeverExport:");
  1332. %neverImport = trim( strreplace( %this-->neverImport.getText(), ";", "\t" ) );
  1333. %count = getFieldCount( %neverImport );
  1334. for (%i = 0; %i < %count; %i++)
  1335. %fo.writeLine( getField( %neverImport, %i ) );
  1336. %fo.writeLine("");
  1337. %fo.close();
  1338. }
  1339. else
  1340. {
  1341. error( "Failed to open " @ %filename @ " for writing" );
  1342. }
  1343. %fo.delete();
  1344. }
  1345. function ColladaImportDlg::updateOverrideUpAxis(%this, %override)
  1346. {
  1347. %this-->overrideUpAxis.setStateOn(%override);
  1348. %this-->upAxis.setActive(%override);
  1349. if (!%override)
  1350. %this-->upAxis.setText(ColladaImportTreeView._upAxis);
  1351. }
  1352. function ColladaImportDlg::updateOverrideScale(%this, %override)
  1353. {
  1354. %this-->overrideScale.setStateOn(%override);
  1355. %this-->scale.setActive(%override);
  1356. if (!%override)
  1357. %this-->scale.setText(ColladaImportTreeView._unit);
  1358. }
  1359. function ColladaImportTreeView::refresh(%this, %what)
  1360. {
  1361. %shapeRoot = %this.getFirstRootItem();
  1362. %materialsRoot = %this.getNextSibling(%shapeRoot);
  1363. %animRoot = %this.getNextSibling(%materialsRoot);
  1364. // Refresh nodes
  1365. if ((%what $= "all") || (%what $= "nodes"))
  1366. {
  1367. // Indicate whether nodes will be ignored on import
  1368. %this._alwaysImport = strreplace(ColladaImportDlg-->alwaysImport.getText(), ";", "\t");
  1369. %this._neverImport = strreplace(ColladaImportDlg-->neverImport.getText(), ";", "\t");
  1370. %this._alwaysImportMesh = strreplace(ColladaImportDlg-->alwaysImportMesh.getText(), ";", "\t");
  1371. %this._neverImportMesh = strreplace(ColladaImportDlg-->neverImportMesh.getText(), ";", "\t");
  1372. %this.refreshNode(%this.getChild(%shapeRoot));
  1373. }
  1374. // Refresh materials
  1375. if ((%what $= "all") || (%what $= "materials"))
  1376. {
  1377. %matPrefix = ColladaImportDlg-->materialPrefix.getText();
  1378. %id = %this.getChild(%materialsRoot);
  1379. while (%id > 0)
  1380. {
  1381. %baseName = %this.getItemValue(%id);
  1382. %name = %matPrefix @ %baseName;
  1383. // Indicate whether material name is already mapped
  1384. %this.editItem(%id, %name, %baseName);
  1385. %mapped = getMaterialMapping(%name);
  1386. if (%mapped $= "")
  1387. {
  1388. %this.setItemTooltip(%id, "A new material will be mapped to this name");
  1389. %this.setItemImages(%id, %this._imageMaterial, %this._imageMaterial);
  1390. }
  1391. else
  1392. {
  1393. %this.setItemTooltip(%id, %mapped SPC "is already mapped to this material name");
  1394. %this.setItemImages(%id, %this._imageExMaterial, %this._imageExMaterial);
  1395. }
  1396. %id = %this.getNextSibling(%id);
  1397. }
  1398. }
  1399. // Refresh animations
  1400. if ((%what $= "all") || (%what $= "animations"))
  1401. {
  1402. %id = %this.getChild(%animRoot);
  1403. while (%id > 0)
  1404. {
  1405. %this.setItemImages(%id, %this._imageAnim, %this._imageAnim);
  1406. %id = %this.getNextSibling(%id);
  1407. }
  1408. }
  1409. }
  1410. function ColladaImportTreeView::refreshNode(%this, %id)
  1411. {
  1412. while (%id > 0)
  1413. {
  1414. switch$ (%this.getItemValue(%id))
  1415. {
  1416. case "mesh":
  1417. // Check if this mesh will be ignored on import
  1418. if (strIsMatchMultipleExpr(%this._alwaysImportMesh, %this.getItemText(%id)) ||
  1419. !strIsMatchMultipleExpr(%this._neverImportMesh, %this.getItemText(%id)) )
  1420. {
  1421. %this.setItemTooltip(%id, "");
  1422. %this.setItemImages(%id, %this._imageMesh, %this._imageMesh);
  1423. }
  1424. else
  1425. {
  1426. %this.setItemTooltip(%id, "This mesh will be ignored on import");
  1427. %this.setItemImages(%id, %this._imageExNode, %this._imageExNode);
  1428. }
  1429. case "light":
  1430. %this.setItemImages(%id, %this._imageLight, %this._imageLight);
  1431. case "node":
  1432. // Check if this node will be ignored on import
  1433. if (strIsMatchMultipleExpr(%this._alwaysImport, %this.getItemText(%id)) ||
  1434. !strIsMatchMultipleExpr(%this._neverImport, %this.getItemText(%id)) )
  1435. {
  1436. %this.setItemTooltip(%id, "");
  1437. %this.setItemImages(%id, %this._imageNode, %this._imageNode);
  1438. }
  1439. else
  1440. {
  1441. %this.setItemTooltip(%id, "This node will be ignored on import");
  1442. %this.setItemImages(%id, %this._imageExNode, %this._imageExNode);
  1443. }
  1444. }
  1445. // recurse through children and siblings
  1446. %this.refreshNode(%this.getChild(%id));
  1447. %id = %this.getNextSibling(%id);
  1448. }
  1449. }
  1450. function ColladaImportDlg::onCancel(%this)
  1451. {
  1452. Canvas.popDialog(%this);
  1453. ColladaImportTreeView.clear();
  1454. }
  1455. function ColladaImportDlg::onOK(%this)
  1456. {
  1457. Canvas.popDialog(%this);
  1458. ColladaImportTreeView.clear();
  1459. // Need to create a TSShapeConstructor object if any settings are not
  1460. // at the default values
  1461. if ((%this-->overrideUpAxis.getValue() != 0) ||
  1462. (%this-->overrideScale.getValue() != 0) ||
  1463. (%this-->lodType.getText() !$= "DetectDTS") ||
  1464. (%this-->singleDetailSize.getText() !$= "2") ||
  1465. (%this-->materialPrefix.getText() !$= "") ||
  1466. (%this-->alwaysImport.getText() !$= "") ||
  1467. (%this-->neverImport.getText() !$= "") ||
  1468. (%this-->alwaysImportMesh.getText() !$= "") ||
  1469. (%this-->neverImportMesh.getText() !$= "") ||
  1470. (%this-->ignoreNodeScale.getValue() != 0) ||
  1471. (%this-->adjustCenter.getValue() != 0) ||
  1472. (%this-->adjustFloor.getValue() != 0) ||
  1473. (%this-->forceUpdateMaterials.getValue() != 0) ||
  1474. (%this-->loadLights.getValue() != 0))
  1475. {
  1476. if (%this.constructor <= 0)
  1477. {
  1478. // Create a new TSShapeConstructor object
  1479. %this.constructor = ShapeEditor.createConstructor(%this.path);
  1480. }
  1481. }
  1482. if (%this.constructor > 0)
  1483. {
  1484. // Store values from GUI
  1485. if (%this-->overrideUpAxis.getValue())
  1486. %this.constructor.upAxis = %this-->upAxis.getText();
  1487. else
  1488. %this.constructor.upAxis = "DEFAULT";
  1489. if (%this-->overrideScale.getValue())
  1490. %this.constructor.unit = %this-->scale.getText();
  1491. else
  1492. %this.constructor.unit = -1;
  1493. %this.constructor.lodType = %this-->lodType.getText();
  1494. %this.constructor.singleDetailSize = %this-->singleDetailSize.getText();
  1495. %this.constructor.matNamePrefix = %this-->materialPrefix.getText();
  1496. %this.constructor.alwaysImport = strreplace(%this-->alwaysImport.getText(), ";", "\t");
  1497. %this.constructor.neverImport = strreplace(%this-->neverImport.getText(), ";", "\t");
  1498. %this.constructor.alwaysImportMesh = strreplace(%this-->alwaysImportMesh.getText(), ";", "\t");
  1499. %this.constructor.neverImportMesh = strreplace(%this-->neverImportMesh.getText(), ";", "\t");
  1500. %this.constructor.ignoreNodeScale = %this-->ignoreNodeScale.getValue();
  1501. %this.constructor.adjustCenter = %this-->adjustCenter.getValue();
  1502. %this.constructor.adjustFloor = %this-->adjustFloor.getValue();
  1503. %this.constructor.forceUpdateMaterials = %this-->forceUpdateMaterials.getValue();
  1504. %this.constructor.loadLights = %this-->loadLights.getValue();
  1505. // Save new settings to file
  1506. ShapeEditor.saveConstructor( %this.constructor );
  1507. }
  1508. // Load the shape (always from the DAE)
  1509. $collada::forceLoadDAE = true;
  1510. eval(%this.cmd);
  1511. $collada::forceLoadDAE = false;
  1512. // Optionally load the lights from the DAE as well (only if adding a new shape
  1513. // to the scene)
  1514. if (%this-->loadLights.getValue())
  1515. %this.loadLights();
  1516. }
  1517. function ColladaImportDlg::loadLights(%this)
  1518. {
  1519. // Get the ID of the last object added
  1520. %obj = MissionGroup.getObject(MissionGroup.getCount()-1);
  1521. // Create a new SimGroup to hold the model and lights
  1522. %group = new SimGroup();
  1523. loadColladaLights(%this.path, %group, %obj);
  1524. // Delete the SimGroup if no lights were found. Otherwise, add the model to
  1525. // the group as well.
  1526. if (%group.getCount() > 0)
  1527. {
  1528. %group.add(%obj);
  1529. %group.bringToFront(%obj);
  1530. MissionGroup.add(%group);
  1531. if (EditorTree.isVisible())
  1532. {
  1533. EditorTree.removeItem(EditorTree.findItemByObjectId(%obj));
  1534. EditorTree.buildVisibleTree(true);
  1535. }
  1536. }
  1537. else
  1538. {
  1539. %group.delete();
  1540. }
  1541. }
  1542. function updateTSShapeLoadProgress(%progress, %msg)
  1543. {
  1544. // Check if the loading GUI is visible and use that instead of the
  1545. // separate import progress GUI if possible
  1546. if ( isObject(LoadingGui) && LoadingGui.isAwake() )
  1547. {
  1548. // Save/Restore load progress at the start/end of the import process
  1549. if ( %progress == 0 )
  1550. {
  1551. ColladaImportProgress.savedProgress = LoadingProgress.getValue();
  1552. ColladaImportProgress.savedText = LoadingProgressTxt.getValue();
  1553. ColladaImportProgress.msgPrefix = "Importing " @ %msg;
  1554. %msg = "Reading file into memory...";
  1555. }
  1556. else if ( %progress == 1.0 )
  1557. {
  1558. LoadingProgress.setValue( ColladaImportProgress.savedProgress );
  1559. LoadingProgressTxt.setValue( ColladaImportProgress.savedText );
  1560. }
  1561. %msg = ColladaImportProgress.msgPrefix @ ": " @ %msg;
  1562. %progressCtrl = LoadingProgress;
  1563. %textCtrl = LoadingProgressTxt;
  1564. }
  1565. else
  1566. {
  1567. // Show/Hide gui at the start/end of the import process
  1568. if ( %progress == 0 )
  1569. {
  1570. ColladaImportProgress-->window.text = "Importing" SPC %msg;
  1571. %msg = "Reading file into memory...";
  1572. Canvas.pushDialog(ColladaImportProgress);
  1573. }
  1574. else if ( %progress == 1.0 )
  1575. {
  1576. Canvas.popDialog(ColladaImportProgress);
  1577. }
  1578. %progressCtrl = ColladaImportProgress-->progressBar;
  1579. %textCtrl = ColladaImportProgress-->progressText;
  1580. }
  1581. // Update progress indicators
  1582. if (%progress == 0)
  1583. {
  1584. %progressCtrl.setValue(0.001);
  1585. %textCtrl.setText(%msg);
  1586. }
  1587. else if (%progress != 1.0)
  1588. {
  1589. %progressCtrl.setValue(%progress);
  1590. %textCtrl.setText(%msg);
  1591. }
  1592. Canvas.repaint(33);
  1593. }
  1594. // Convert all COLLADA models that match the given pattern (defaults to *) to DTS
  1595. function convertColladaModels(%pattern)
  1596. {
  1597. // Force loading the COLLADA file (to ensure cached DTS is updated)
  1598. $collada::forceLoadDAE = true;
  1599. %fullPath = findFirstFile("*.dae");
  1600. while (%fullPath !$= "")
  1601. {
  1602. // Check if this file is inside the given path
  1603. %fullPath = makeRelativePath(%fullPath, getMainDotCSDir());
  1604. if ((%pattern $= "") || strIsMatchMultipleExpr(%pattern, %fullPath))
  1605. {
  1606. // Load the model by creating a temporary TSStatic
  1607. echo("Converting " @ %fullPath @ " to DTS...");
  1608. %temp = new TSStatic() {
  1609. shapeName = %fullPath;
  1610. collisionType = "None";
  1611. };
  1612. %temp.delete();
  1613. }
  1614. %fullPath = findNextFile("*.dae");
  1615. }
  1616. $collada::forceLoadDAE = false;
  1617. }