types.vala 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570
  1. /*
  2. * Copyright (c) 2012-2025 Daniele Bartolini et al.
  3. * SPDX-License-Identifier: GPL-3.0-or-later
  4. */
  5. namespace Crown
  6. {
  7. const string OBJECT_TYPE_ACTOR = "actor";
  8. const string OBJECT_TYPE_ANIMATION_FRAME = "animation_frame";
  9. const string OBJECT_TYPE_ANIMATION_STATE_MACHINE = "animation_state_machine";
  10. const string OBJECT_TYPE_BLOOM = "bloom";
  11. const string OBJECT_TYPE_CAMERA = "camera";
  12. const string OBJECT_TYPE_COLLIDER = "collider";
  13. const string OBJECT_TYPE_FILE = "file";
  14. const string OBJECT_TYPE_FOG = "fog";
  15. const string OBJECT_TYPE_FONT = "font";
  16. const string OBJECT_TYPE_FONT_GLYPH = "font_glyph";
  17. const string OBJECT_TYPE_GLOBAL_LIGHTING = "global_lighting";
  18. const string OBJECT_TYPE_LEVEL = "level";
  19. const string OBJECT_TYPE_LIGHT = "light";
  20. const string OBJECT_TYPE_MATERIAL = "material";
  21. const string OBJECT_TYPE_MESH = "mesh";
  22. const string OBJECT_TYPE_MESH_ANIMATION = "mesh_animation";
  23. const string OBJECT_TYPE_MESH_BONE = "mesh_bone";
  24. const string OBJECT_TYPE_MESH_RENDERER = "mesh_renderer";
  25. const string OBJECT_TYPE_MESH_SKELETON = "mesh_skeleton";
  26. const string OBJECT_TYPE_MOVER = "mover";
  27. const string OBJECT_TYPE_NODE_ANIMATION = "node_animation";
  28. const string OBJECT_TYPE_NODE_TRANSITION = "node_transition";
  29. const string OBJECT_TYPE_SCRIPT = "script";
  30. const string OBJECT_TYPE_SOUND = "sound";
  31. const string OBJECT_TYPE_SOUND_SOURCE = "sound_source";
  32. const string OBJECT_TYPE_SPRITE = "sprite";
  33. const string OBJECT_TYPE_SPRITE_ANIMATION = "sprite_animation";
  34. const string OBJECT_TYPE_SPRITE_FRAME = "sprite_frame";
  35. const string OBJECT_TYPE_SPRITE_RENDERER = "sprite_renderer";
  36. const string OBJECT_TYPE_STATE_MACHINE = "state_machine";
  37. const string OBJECT_TYPE_STATE_MACHINE_NODE = "state_machine_node";
  38. const string OBJECT_TYPE_STATE_MACHINE_VARIABLE = "state_machine_variable";
  39. const string OBJECT_TYPE_TEXTURE = "texture";
  40. const string OBJECT_TYPE_TONEMAP = "tonemap";
  41. const string OBJECT_TYPE_TRANSFORM = "transform";
  42. const string OBJECT_TYPE_UNIT = "unit";
  43. // UI order reference table:
  44. //
  45. // spatial 500
  46. // rendering 1000
  47. // global_lighti 1001
  48. // camera 1100
  49. // light 1101
  50. // mesh 1102
  51. // sprite 1103
  52. // fog 1104
  53. // physics 2000
  54. // collider 2100
  55. // actor 2101
  56. // mover 2102
  57. // animation 3000
  58. // state_machine 3100
  59. // scripting 7000
  60. // lua_script 7100
  61. // post-processing 9000
  62. // bloom 9100
  63. // tonemap 9900
  64. public static void node_name_enum_callback(InputField enum_property, InputEnum combo, Project project)
  65. {
  66. try {
  67. string? path = ResourceId.path(OBJECT_TYPE_MESH, (string?)enum_property.union_value());
  68. Mesh mesh = Mesh.load_from_path(project, path);
  69. combo.clear();
  70. foreach (var node in mesh._nodes)
  71. combo.append(node, node);
  72. } catch (JsonSyntaxError e) {
  73. loge(e.message);
  74. }
  75. }
  76. public static void class_enum_callback(InputField property_enum, InputEnum combo, Project project)
  77. {
  78. try {
  79. string path = ResourceId.path("physics_config", "global");
  80. Hashtable global = SJSON.load_from_path(project.absolute_path(path));
  81. combo.clear();
  82. if (global.has_key("actors")) {
  83. Hashtable obj = (Hashtable)global["actors"];
  84. foreach (var e in obj)
  85. combo.append(e.key, e.key);
  86. }
  87. } catch (JsonSyntaxError e) {
  88. loge(e.message);
  89. }
  90. }
  91. public static void collision_filter_enum_callback(InputField property_enum, InputEnum combo, Project project)
  92. {
  93. try {
  94. string path = ResourceId.path("physics_config", "global");
  95. Hashtable global = SJSON.load_from_path(project.absolute_path(path));
  96. combo.clear();
  97. if (global.has_key("collision_filters")) {
  98. Hashtable obj = (Hashtable)global["collision_filters"];
  99. foreach (var e in obj)
  100. combo.append(e.key, e.key);
  101. }
  102. } catch (JsonSyntaxError e) {
  103. loge(e.message);
  104. }
  105. }
  106. public static void material_enum_callback(InputField property_enum, InputEnum combo, Project project)
  107. {
  108. try {
  109. string path = ResourceId.path("physics_config", "global");
  110. Hashtable global = SJSON.load_from_path(project.absolute_path(path));
  111. combo.clear();
  112. if (global.has_key("materials")) {
  113. Hashtable obj = (Hashtable)global["materials"];
  114. foreach (var e in obj)
  115. combo.append(e.key, e.key);
  116. }
  117. } catch (JsonSyntaxError e) {
  118. loge(e.message);
  119. }
  120. }
  121. public static void create_object_types(Database database)
  122. {
  123. PropertyDefinition[] properties;
  124. properties =
  125. {
  126. PropertyDefinition()
  127. {
  128. type = PropertyType.VECTOR3,
  129. name = "data.position",
  130. },
  131. PropertyDefinition()
  132. {
  133. type = PropertyType.QUATERNION,
  134. name = "data.rotation",
  135. },
  136. PropertyDefinition()
  137. {
  138. type = PropertyType.VECTOR3,
  139. name = "data.scale",
  140. min = VECTOR3_ZERO,
  141. deffault = VECTOR3_ONE,
  142. },
  143. PropertyDefinition()
  144. {
  145. type = PropertyType.DOUBLE,
  146. name = "spawn_order",
  147. deffault = 0.0,
  148. hidden = true,
  149. not_serialized = true,
  150. },
  151. };
  152. database.create_object_type(OBJECT_TYPE_TRANSFORM
  153. , properties
  154. , 500
  155. , ObjectTypeFlags.UNIT_COMPONENT
  156. );
  157. properties =
  158. {
  159. PropertyDefinition()
  160. {
  161. type = PropertyType.RESOURCE,
  162. name = "data.mesh_resource",
  163. label = "Scene",
  164. resource_type = OBJECT_TYPE_MESH,
  165. deffault = "core/components/noop",
  166. },
  167. PropertyDefinition()
  168. {
  169. type = PropertyType.STRING,
  170. name = "data.geometry_name",
  171. label = "Node",
  172. editor = PropertyEditorType.ENUM,
  173. enum_property = "data.mesh_resource",
  174. enum_callback = node_name_enum_callback,
  175. deffault = "Noop",
  176. },
  177. PropertyDefinition()
  178. {
  179. type = PropertyType.RESOURCE,
  180. name = "data.material",
  181. resource_type = OBJECT_TYPE_MATERIAL,
  182. deffault = "core/components/noop",
  183. },
  184. PropertyDefinition()
  185. {
  186. type = PropertyType.BOOL,
  187. name = "data.visible",
  188. deffault = true,
  189. },
  190. PropertyDefinition()
  191. {
  192. type = PropertyType.BOOL,
  193. name = "data.cast_shadows",
  194. deffault = true
  195. },
  196. PropertyDefinition()
  197. {
  198. type = PropertyType.DOUBLE,
  199. name = "spawn_order",
  200. deffault = 1.0,
  201. hidden = true,
  202. not_serialized = true,
  203. },
  204. };
  205. database.create_object_type(OBJECT_TYPE_MESH_RENDERER
  206. , properties
  207. , 1102
  208. , ObjectTypeFlags.UNIT_COMPONENT
  209. , OBJECT_TYPE_TRANSFORM
  210. );
  211. properties =
  212. {
  213. PropertyDefinition()
  214. {
  215. type = PropertyType.RESOURCE,
  216. name = "data.sprite_resource",
  217. label = "Sprite",
  218. resource_type = OBJECT_TYPE_SPRITE,
  219. deffault = "core/components/noop",
  220. },
  221. PropertyDefinition()
  222. {
  223. type = PropertyType.RESOURCE,
  224. name = "data.material",
  225. resource_type = OBJECT_TYPE_MATERIAL,
  226. deffault = "core/components/noop",
  227. },
  228. PropertyDefinition()
  229. {
  230. type = PropertyType.DOUBLE,
  231. name = "data.layer",
  232. min = 0.0,
  233. max = 7.0,
  234. },
  235. PropertyDefinition()
  236. {
  237. type = PropertyType.DOUBLE,
  238. name = "data.depth",
  239. min = 0.0,
  240. max = (double)uint32.MAX,
  241. },
  242. PropertyDefinition()
  243. {
  244. type = PropertyType.BOOL,
  245. name = "data.visible",
  246. deffault = true,
  247. },
  248. PropertyDefinition()
  249. {
  250. type = PropertyType.BOOL,
  251. name = "data.flip_x",
  252. },
  253. PropertyDefinition()
  254. {
  255. type = PropertyType.BOOL,
  256. name = "data.flip_y",
  257. },
  258. PropertyDefinition()
  259. {
  260. type = PropertyType.DOUBLE,
  261. name = "spawn_order",
  262. deffault = 1.0,
  263. hidden = true,
  264. not_serialized = true,
  265. },
  266. };
  267. database.create_object_type(OBJECT_TYPE_SPRITE_RENDERER
  268. , properties
  269. , 1103
  270. , ObjectTypeFlags.UNIT_COMPONENT
  271. , OBJECT_TYPE_TRANSFORM
  272. );
  273. properties =
  274. {
  275. PropertyDefinition()
  276. {
  277. type = PropertyType.STRING,
  278. name = "data.type",
  279. editor = PropertyEditorType.ENUM,
  280. enum_values = { "directional", "omni", "spot" },
  281. deffault = "omni",
  282. },
  283. PropertyDefinition()
  284. {
  285. type = PropertyType.DOUBLE,
  286. name = "data.range",
  287. min = 0.0,
  288. deffault = 15.0,
  289. },
  290. PropertyDefinition()
  291. {
  292. type = PropertyType.DOUBLE,
  293. name = "data.intensity",
  294. min = 0.0,
  295. deffault = 500.0,
  296. },
  297. PropertyDefinition()
  298. {
  299. type = PropertyType.DOUBLE,
  300. name = "data.spot_angle",
  301. editor = PropertyEditorType.ANGLE,
  302. min = 0.0,
  303. max = 90.0,
  304. deffault = MathUtils.rad(45.0),
  305. },
  306. PropertyDefinition()
  307. {
  308. type = PropertyType.VECTOR3,
  309. name = "data.color",
  310. editor = PropertyEditorType.COLOR,
  311. min = VECTOR3_ZERO,
  312. max = VECTOR3_ONE,
  313. deffault = VECTOR3_ONE,
  314. },
  315. PropertyDefinition()
  316. {
  317. type = PropertyType.DOUBLE,
  318. name = "data.shadow_bias",
  319. min = 0.0,
  320. max = 1.0,
  321. deffault = 0.0004,
  322. },
  323. PropertyDefinition()
  324. {
  325. type = PropertyType.BOOL,
  326. name = "data.cast_shadows",
  327. deffault = true,
  328. },
  329. PropertyDefinition()
  330. {
  331. type = PropertyType.DOUBLE,
  332. name = "spawn_order",
  333. deffault = 1.0,
  334. hidden = true,
  335. not_serialized = true,
  336. },
  337. };
  338. database.create_object_type(OBJECT_TYPE_LIGHT
  339. , properties
  340. , 1101
  341. , ObjectTypeFlags.UNIT_COMPONENT
  342. , OBJECT_TYPE_TRANSFORM
  343. );
  344. properties =
  345. {
  346. PropertyDefinition()
  347. {
  348. type = PropertyType.STRING,
  349. name = "data.projection",
  350. editor = PropertyEditorType.ENUM,
  351. enum_values = { "orthographic", "perspective" },
  352. deffault = "perspective",
  353. },
  354. PropertyDefinition()
  355. {
  356. type = PropertyType.DOUBLE,
  357. name = "data.fov",
  358. label = "FOV",
  359. editor = PropertyEditorType.ANGLE,
  360. min = 0.0,
  361. max = 90.0,
  362. deffault = MathUtils.rad(45.0),
  363. },
  364. PropertyDefinition()
  365. {
  366. type = PropertyType.DOUBLE,
  367. name = "data.near_range",
  368. deffault = 0.01,
  369. },
  370. PropertyDefinition()
  371. {
  372. type = PropertyType.DOUBLE,
  373. name = "data.far_range",
  374. deffault = 1000.0,
  375. },
  376. PropertyDefinition()
  377. {
  378. type = PropertyType.DOUBLE,
  379. name = "spawn_order",
  380. deffault = 1.0,
  381. hidden = true,
  382. not_serialized = true,
  383. },
  384. };
  385. database.create_object_type(OBJECT_TYPE_CAMERA
  386. , properties
  387. , 1100
  388. , ObjectTypeFlags.UNIT_COMPONENT
  389. , OBJECT_TYPE_TRANSFORM
  390. );
  391. properties =
  392. {
  393. PropertyDefinition()
  394. {
  395. type = PropertyType.STRING,
  396. name = "data.source",
  397. editor = PropertyEditorType.ENUM,
  398. enum_values = { "mesh", "inline" },
  399. deffault = "mesh",
  400. },
  401. PropertyDefinition()
  402. {
  403. type = PropertyType.RESOURCE,
  404. name = "data.scene",
  405. resource_type = OBJECT_TYPE_MESH,
  406. deffault = "core/components/noop",
  407. },
  408. PropertyDefinition()
  409. {
  410. type = PropertyType.STRING,
  411. name = "data.name",
  412. label = "Node",
  413. editor = PropertyEditorType.ENUM,
  414. enum_property = "data.scene",
  415. enum_callback = node_name_enum_callback,
  416. deffault = "Noop",
  417. },
  418. PropertyDefinition()
  419. {
  420. type = PropertyType.STRING,
  421. name = "data.shape",
  422. editor = PropertyEditorType.ENUM,
  423. enum_values = { "sphere", "capsule", "box", "convex_hull", "mesh" },
  424. deffault = "box",
  425. },
  426. PropertyDefinition()
  427. {
  428. type = PropertyType.VECTOR3,
  429. name = "data.collider_data.position",
  430. },
  431. PropertyDefinition()
  432. {
  433. type = PropertyType.QUATERNION,
  434. name = "data.collider_data.rotation",
  435. },
  436. PropertyDefinition()
  437. {
  438. type = PropertyType.VECTOR3,
  439. name = "data.collider_data.half_extents", // Box only.
  440. min = VECTOR3_ZERO,
  441. deffault = Vector3(0.5, 0.5, 0.5),
  442. },
  443. PropertyDefinition()
  444. {
  445. type = PropertyType.DOUBLE,
  446. name = "data.collider_data.radius", // Sphere and capsule only.
  447. min = 0.0,
  448. deffault = 0.5,
  449. },
  450. PropertyDefinition()
  451. {
  452. type = PropertyType.DOUBLE,
  453. name = "data.collider_data.height", // Capsule only.
  454. min = 0.0,
  455. deffault = 1.0,
  456. },
  457. PropertyDefinition()
  458. {
  459. type = PropertyType.DOUBLE,
  460. name = "spawn_order",
  461. deffault = 1.0,
  462. hidden = true,
  463. not_serialized = true,
  464. },
  465. };
  466. database.create_object_type(OBJECT_TYPE_COLLIDER
  467. , properties
  468. , 2100
  469. , ObjectTypeFlags.UNIT_COMPONENT
  470. , OBJECT_TYPE_TRANSFORM
  471. );
  472. properties =
  473. {
  474. PropertyDefinition()
  475. {
  476. type = PropertyType.RESOURCE,
  477. name = "_global_physics_config",
  478. deffault = "global",
  479. resource_type = "physics_config",
  480. hidden = true,
  481. not_serialized = true,
  482. },
  483. PropertyDefinition()
  484. {
  485. type = PropertyType.STRING,
  486. name = "data.class",
  487. editor = PropertyEditorType.ENUM,
  488. enum_property = "_global_physics_config",
  489. enum_callback = class_enum_callback,
  490. deffault = "static",
  491. },
  492. PropertyDefinition()
  493. {
  494. type = PropertyType.STRING,
  495. name = "data.collision_filter",
  496. editor = PropertyEditorType.ENUM,
  497. enum_property = "_global_physics_config",
  498. enum_callback = collision_filter_enum_callback,
  499. deffault = "default",
  500. },
  501. PropertyDefinition()
  502. {
  503. type = PropertyType.STRING,
  504. name = "data.material",
  505. editor = PropertyEditorType.ENUM,
  506. enum_property = "_global_physics_config",
  507. enum_callback = material_enum_callback,
  508. deffault = "default",
  509. },
  510. PropertyDefinition()
  511. {
  512. type = PropertyType.DOUBLE,
  513. name = "data.mass",
  514. min = 0.0,
  515. deffault = 1.0,
  516. },
  517. PropertyDefinition()
  518. {
  519. type = PropertyType.BOOL,
  520. name = "data.lock_translation_x",
  521. },
  522. PropertyDefinition()
  523. {
  524. type = PropertyType.BOOL,
  525. name = "data.lock_translation_y",
  526. },
  527. PropertyDefinition()
  528. {
  529. type = PropertyType.BOOL,
  530. name = "data.lock_translation_z",
  531. },
  532. PropertyDefinition()
  533. {
  534. type = PropertyType.BOOL,
  535. name = "data.lock_rotation_x",
  536. },
  537. PropertyDefinition()
  538. {
  539. type = PropertyType.BOOL,
  540. name = "data.lock_rotation_y",
  541. },
  542. PropertyDefinition()
  543. {
  544. type = PropertyType.BOOL,
  545. name = "data.lock_rotation_z",
  546. },
  547. PropertyDefinition()
  548. {
  549. type = PropertyType.DOUBLE,
  550. name = "spawn_order",
  551. deffault = 2.0,
  552. hidden = true,
  553. not_serialized = true,
  554. },
  555. };
  556. database.create_object_type(OBJECT_TYPE_ACTOR
  557. , properties
  558. , 2101
  559. , ObjectTypeFlags.UNIT_COMPONENT
  560. , OBJECT_TYPE_TRANSFORM
  561. );
  562. properties =
  563. {
  564. PropertyDefinition()
  565. {
  566. type = PropertyType.RESOURCE,
  567. name = "data.script_resource",
  568. label = "Script",
  569. resource_type = "lua",
  570. deffault = "core/components/noop",
  571. },
  572. PropertyDefinition()
  573. {
  574. type = PropertyType.DOUBLE,
  575. name = "spawn_order",
  576. deffault = 1.0,
  577. hidden = true,
  578. not_serialized = true,
  579. },
  580. };
  581. database.create_object_type(OBJECT_TYPE_SCRIPT
  582. , properties
  583. , 7100
  584. , ObjectTypeFlags.UNIT_COMPONENT
  585. );
  586. properties =
  587. {
  588. PropertyDefinition()
  589. {
  590. type = PropertyType.RESOURCE,
  591. name = "data.state_machine_resource",
  592. label = "State Machine",
  593. resource_type = OBJECT_TYPE_STATE_MACHINE,
  594. deffault = "core/components/noop",
  595. },
  596. PropertyDefinition()
  597. {
  598. type = PropertyType.DOUBLE,
  599. name = "spawn_order",
  600. deffault = 3.0,
  601. hidden = true,
  602. not_serialized = true,
  603. },
  604. };
  605. database.create_object_type(OBJECT_TYPE_ANIMATION_STATE_MACHINE
  606. , properties
  607. , 3100
  608. , ObjectTypeFlags.UNIT_COMPONENT
  609. );
  610. properties =
  611. {
  612. PropertyDefinition()
  613. {
  614. type = PropertyType.STRING,
  615. name = "source",
  616. },
  617. };
  618. database.create_object_type(OBJECT_TYPE_SOUND, properties);
  619. properties =
  620. {
  621. PropertyDefinition()
  622. {
  623. type = PropertyType.VECTOR3,
  624. name = "position",
  625. },
  626. PropertyDefinition()
  627. {
  628. type = PropertyType.QUATERNION,
  629. name = "rotation",
  630. },
  631. PropertyDefinition()
  632. {
  633. type = PropertyType.RESOURCE,
  634. name = "name",
  635. resource_type = OBJECT_TYPE_SOUND,
  636. deffault = ""
  637. },
  638. PropertyDefinition()
  639. {
  640. type = PropertyType.DOUBLE,
  641. name = "range",
  642. min = 0.0,
  643. deffault = 10.0,
  644. },
  645. PropertyDefinition()
  646. {
  647. type = PropertyType.DOUBLE,
  648. name = "volume",
  649. min = 0.0,
  650. max = 1.0,
  651. deffault = 1.0,
  652. },
  653. PropertyDefinition()
  654. {
  655. type = PropertyType.BOOL,
  656. name = "loop",
  657. },
  658. PropertyDefinition()
  659. {
  660. type = PropertyType.STRING,
  661. name = "group",
  662. deffault = "music",
  663. },
  664. PropertyDefinition()
  665. {
  666. type = PropertyType.STRING,
  667. name = "editor.name",
  668. deffault = "sound",
  669. hidden = true,
  670. },
  671. };
  672. StringId64 sound_source_type = database.create_object_type(OBJECT_TYPE_SOUND_SOURCE, properties, 3.0);
  673. properties =
  674. {
  675. PropertyDefinition()
  676. {
  677. type = PropertyType.DOUBLE,
  678. name = "frame",
  679. min = 0.0
  680. },
  681. PropertyDefinition()
  682. {
  683. type = PropertyType.DOUBLE,
  684. name = "index",
  685. min = 0.0
  686. },
  687. };
  688. database.create_object_type(OBJECT_TYPE_ANIMATION_FRAME, properties);
  689. properties =
  690. {
  691. PropertyDefinition()
  692. {
  693. type = PropertyType.OBJECTS_SET,
  694. name = "frames",
  695. object_type = StringId64(OBJECT_TYPE_ANIMATION_FRAME),
  696. },
  697. PropertyDefinition()
  698. {
  699. type = PropertyType.DOUBLE,
  700. name = "frames_per_second",
  701. min = 0.0
  702. },
  703. };
  704. database.create_object_type(OBJECT_TYPE_SPRITE_ANIMATION, properties);
  705. properties =
  706. {
  707. PropertyDefinition()
  708. {
  709. type = PropertyType.DOUBLE,
  710. name = "index",
  711. min = 0.0,
  712. },
  713. PropertyDefinition()
  714. {
  715. type = PropertyType.STRING,
  716. name = "name",
  717. },
  718. PropertyDefinition()
  719. {
  720. type = PropertyType.VECTOR3,
  721. name = "pivot",
  722. },
  723. PropertyDefinition()
  724. {
  725. type = PropertyType.QUATERNION,
  726. name = "region",
  727. },
  728. };
  729. database.create_object_type(OBJECT_TYPE_SPRITE_FRAME, properties);
  730. properties =
  731. {
  732. PropertyDefinition()
  733. {
  734. type = PropertyType.OBJECTS_SET,
  735. name = "frames",
  736. object_type = StringId64(OBJECT_TYPE_SPRITE_FRAME),
  737. },
  738. PropertyDefinition()
  739. {
  740. type = PropertyType.DOUBLE,
  741. name = "width",
  742. min = 0.0
  743. },
  744. PropertyDefinition()
  745. {
  746. type = PropertyType.DOUBLE,
  747. name = "height",
  748. min = 0.0
  749. },
  750. };
  751. database.create_object_type(OBJECT_TYPE_SPRITE, properties);
  752. properties =
  753. {
  754. PropertyDefinition()
  755. {
  756. type = PropertyType.VECTOR3,
  757. name = "data.color",
  758. editor = PropertyEditorType.COLOR,
  759. min = VECTOR3_ZERO,
  760. max = VECTOR3_ONE,
  761. deffault = Vector3(0.83, 0.83, 0.83),
  762. },
  763. PropertyDefinition()
  764. {
  765. type = PropertyType.DOUBLE,
  766. name = "data.density",
  767. min = 0.0,
  768. deffault = 0.02
  769. },
  770. PropertyDefinition()
  771. {
  772. type = PropertyType.DOUBLE,
  773. name = "data.range_min",
  774. min = 0.0,
  775. },
  776. PropertyDefinition()
  777. {
  778. type = PropertyType.DOUBLE,
  779. name = "data.range_max",
  780. min = 0.0,
  781. deffault = 1000.0
  782. },
  783. PropertyDefinition()
  784. {
  785. type = PropertyType.DOUBLE,
  786. name = "data.sun_blend",
  787. min = 0.0,
  788. max = 1.0,
  789. },
  790. PropertyDefinition()
  791. {
  792. type = PropertyType.BOOL,
  793. name = "data.enabled",
  794. },
  795. PropertyDefinition()
  796. {
  797. type = PropertyType.DOUBLE,
  798. name = "spawn_order",
  799. deffault = 0.0,
  800. hidden = true,
  801. not_serialized = true,
  802. },
  803. };
  804. database.create_object_type(OBJECT_TYPE_FOG
  805. , properties
  806. , 1104
  807. , ObjectTypeFlags.UNIT_COMPONENT
  808. );
  809. properties =
  810. {
  811. PropertyDefinition()
  812. {
  813. type = PropertyType.RESOURCE,
  814. name = "_global_physics_config",
  815. deffault = "global",
  816. resource_type = "physics_config",
  817. hidden = true,
  818. not_serialized = true,
  819. },
  820. PropertyDefinition()
  821. {
  822. type = PropertyType.DOUBLE,
  823. name = "data.height",
  824. min = 0.0,
  825. deffault = 1.80,
  826. },
  827. PropertyDefinition()
  828. {
  829. type = PropertyType.DOUBLE,
  830. name = "data.radius",
  831. min = 0.0,
  832. deffault = 0.50,
  833. },
  834. PropertyDefinition()
  835. {
  836. type = PropertyType.DOUBLE,
  837. name = "data.max_slope_angle",
  838. editor = PropertyEditorType.ANGLE,
  839. min = 0.0,
  840. max = 90.0,
  841. deffault = MathUtils.rad(45.0f),
  842. },
  843. PropertyDefinition()
  844. {
  845. type = PropertyType.STRING,
  846. name = "data.collision_filter",
  847. editor = PropertyEditorType.ENUM,
  848. enum_property = "_global_physics_config",
  849. enum_callback = collision_filter_enum_callback,
  850. deffault = "default",
  851. },
  852. PropertyDefinition()
  853. {
  854. type = PropertyType.VECTOR3,
  855. name = "data.center",
  856. },
  857. PropertyDefinition()
  858. {
  859. type = PropertyType.DOUBLE,
  860. name = "spawn_order",
  861. deffault = 2.0,
  862. hidden = true,
  863. not_serialized = true,
  864. },
  865. };
  866. database.create_object_type(OBJECT_TYPE_MOVER
  867. , properties
  868. , 2102
  869. , ObjectTypeFlags.UNIT_COMPONENT
  870. , OBJECT_TYPE_TRANSFORM
  871. );
  872. properties =
  873. {
  874. PropertyDefinition()
  875. {
  876. type = PropertyType.RESOURCE,
  877. name = "data.skydome_map",
  878. label = "Skydome Map",
  879. resource_type = OBJECT_TYPE_TEXTURE,
  880. deffault = "core/units/skydome/skydome"
  881. },
  882. PropertyDefinition()
  883. {
  884. type = PropertyType.DOUBLE,
  885. name = "data.skydome_intensity",
  886. min = 0.0,
  887. deffault = 1.0,
  888. },
  889. PropertyDefinition()
  890. {
  891. type = PropertyType.VECTOR3,
  892. name = "data.ambient_color",
  893. editor = PropertyEditorType.COLOR,
  894. min = VECTOR3_ZERO,
  895. max = VECTOR3_ONE,
  896. },
  897. PropertyDefinition()
  898. {
  899. type = PropertyType.DOUBLE,
  900. name = "spawn_order",
  901. deffault = 0.0,
  902. hidden = true,
  903. not_serialized = true,
  904. },
  905. };
  906. database.create_object_type(OBJECT_TYPE_GLOBAL_LIGHTING
  907. , properties
  908. , 1001
  909. , ObjectTypeFlags.UNIT_COMPONENT
  910. );
  911. properties =
  912. {
  913. PropertyDefinition()
  914. {
  915. type = PropertyType.BOOL,
  916. name = "data.enabled",
  917. deffault = true,
  918. },
  919. PropertyDefinition()
  920. {
  921. type = PropertyType.DOUBLE,
  922. name = "data.threshold",
  923. min = 0.0,
  924. hidden = true
  925. },
  926. PropertyDefinition()
  927. {
  928. type = PropertyType.DOUBLE,
  929. name = "data.weight",
  930. min = 0.0,
  931. max = 1.0,
  932. deffault = 0.05,
  933. },
  934. PropertyDefinition()
  935. {
  936. type = PropertyType.DOUBLE,
  937. name = "data.intensity",
  938. min = 0.0,
  939. max = 2.0,
  940. deffault = 0.8,
  941. },
  942. PropertyDefinition()
  943. {
  944. type = PropertyType.DOUBLE,
  945. name = "spawn_order",
  946. deffault = 0.0,
  947. hidden = true,
  948. not_serialized = true,
  949. },
  950. };
  951. database.create_object_type(OBJECT_TYPE_BLOOM
  952. , properties
  953. , 9100
  954. , ObjectTypeFlags.UNIT_COMPONENT
  955. );
  956. properties =
  957. {
  958. PropertyDefinition()
  959. {
  960. type = PropertyType.STRING,
  961. name = "data.type",
  962. editor = PropertyEditorType.ENUM,
  963. enum_values = { "gamma", "reinhard", "filmic", "aces" },
  964. deffault = "reinhard",
  965. },
  966. PropertyDefinition()
  967. {
  968. type = PropertyType.DOUBLE,
  969. name = "spawn_order",
  970. deffault = 0.0,
  971. hidden = true,
  972. not_serialized = true,
  973. },
  974. };
  975. database.create_object_type(OBJECT_TYPE_TONEMAP
  976. , properties
  977. , 9900
  978. , ObjectTypeFlags.UNIT_COMPONENT
  979. );
  980. properties =
  981. {
  982. PropertyDefinition()
  983. {
  984. type = PropertyType.STRING,
  985. name = "editor.name",
  986. deffault = OBJECT_NAME_UNNAMED,
  987. },
  988. PropertyDefinition()
  989. {
  990. type = PropertyType.RESOURCE,
  991. name = "prefab",
  992. resource_type = OBJECT_TYPE_UNIT,
  993. deffault = null,
  994. },
  995. PropertyDefinition()
  996. {
  997. type = PropertyType.OBJECTS_SET,
  998. name = "children",
  999. object_type = StringId64(OBJECT_TYPE_UNIT),
  1000. },
  1001. #if false
  1002. PropertyDefinition()
  1003. {
  1004. type = PropertyType.OBJECTS_SET,
  1005. name = "components",
  1006. },
  1007. PropertyDefinition()
  1008. {
  1009. type = PropertyType.OBJECTS_SET,
  1010. name = "deleted_components",
  1011. },
  1012. PropertyDefinition()
  1013. {
  1014. type = PropertyType.OBJECTS_SET,
  1015. name = "modified_components",
  1016. },
  1017. PropertyDefinition()
  1018. {
  1019. type = PropertyType.OBJECTS_SET,
  1020. name = "deleted_children",
  1021. },
  1022. PropertyDefinition()
  1023. {
  1024. type = PropertyType.OBJECTS_SET,
  1025. name = "modified_children",
  1026. },
  1027. #endif /* if false */
  1028. };
  1029. StringId64 unit_type = database.create_object_type(OBJECT_TYPE_UNIT, properties);
  1030. properties =
  1031. {
  1032. PropertyDefinition()
  1033. {
  1034. type = PropertyType.RESOURCE,
  1035. name = "source",
  1036. resource_type = OBJECT_TYPE_MESH,
  1037. },
  1038. };
  1039. database.create_object_type(OBJECT_TYPE_MESH, properties);
  1040. properties =
  1041. {
  1042. PropertyDefinition()
  1043. {
  1044. type = PropertyType.RESOURCE,
  1045. name = "name",
  1046. label = "Animation",
  1047. resource_type = OBJECT_TYPE_MESH_ANIMATION,
  1048. },
  1049. PropertyDefinition()
  1050. {
  1051. type = PropertyType.STRING,
  1052. name = "weight",
  1053. }
  1054. };
  1055. StringId64 node_animation_type = database.create_object_type(OBJECT_TYPE_NODE_ANIMATION, properties);
  1056. database.set_aspect(node_animation_type
  1057. , StringId64("name")
  1058. , (out name, database, id) => {
  1059. string? anim_name = database.get_resource(id, "name");
  1060. name = anim_name == null ? "(None)" : GLib.Path.get_basename(anim_name);
  1061. });
  1062. properties =
  1063. {
  1064. PropertyDefinition()
  1065. {
  1066. type = PropertyType.STRING,
  1067. name = "event",
  1068. },
  1069. PropertyDefinition()
  1070. {
  1071. type = PropertyType.STRING,
  1072. name = "mode",
  1073. editor = PropertyEditorType.ENUM,
  1074. enum_values = { "immediate", "wait_until_end" },
  1075. },
  1076. PropertyDefinition()
  1077. {
  1078. type = PropertyType.REFERENCE,
  1079. object_type = StringId64(OBJECT_TYPE_STATE_MACHINE_NODE),
  1080. name = "to",
  1081. },
  1082. };
  1083. StringId64 node_transition_type = database.create_object_type(OBJECT_TYPE_NODE_TRANSITION, properties);
  1084. database.set_aspect(node_transition_type
  1085. , StringId64("name")
  1086. , (out name, database, id) => {
  1087. string node_name = "Unknown";
  1088. Guid to_node = database.get_reference(id, "to");
  1089. if (to_node != GUID_ZERO)
  1090. node_name = database.get_string(to_node, "name");
  1091. name = "To %s".printf(node_name);
  1092. });
  1093. properties =
  1094. {
  1095. PropertyDefinition()
  1096. {
  1097. type = PropertyType.STRING,
  1098. name = "name",
  1099. deffault = "New Node",
  1100. },
  1101. PropertyDefinition()
  1102. {
  1103. type = PropertyType.OBJECTS_SET,
  1104. name = "animations",
  1105. object_type = node_animation_type,
  1106. },
  1107. PropertyDefinition()
  1108. {
  1109. type = PropertyType.BOOL,
  1110. name = "loop",
  1111. },
  1112. PropertyDefinition()
  1113. {
  1114. type = PropertyType.STRING,
  1115. name = "speed",
  1116. },
  1117. PropertyDefinition()
  1118. {
  1119. type = PropertyType.OBJECTS_SET,
  1120. name = "transitions",
  1121. object_type = node_transition_type,
  1122. },
  1123. };
  1124. StringId64 state_machine_node_type = database.create_object_type(OBJECT_TYPE_STATE_MACHINE_NODE, properties);
  1125. properties =
  1126. {
  1127. PropertyDefinition()
  1128. {
  1129. type = PropertyType.STRING,
  1130. name = "name",
  1131. },
  1132. PropertyDefinition()
  1133. {
  1134. type = PropertyType.DOUBLE,
  1135. name = "value",
  1136. },
  1137. PropertyDefinition()
  1138. {
  1139. type = PropertyType.DOUBLE,
  1140. name = "min",
  1141. deffault = -1.0,
  1142. },
  1143. PropertyDefinition()
  1144. {
  1145. type = PropertyType.DOUBLE,
  1146. name = "max",
  1147. deffault = 1.0,
  1148. },
  1149. };
  1150. StringId64 state_machine_variable_type = database.create_object_type(OBJECT_TYPE_STATE_MACHINE_VARIABLE, properties);
  1151. properties =
  1152. {
  1153. PropertyDefinition()
  1154. {
  1155. type = PropertyType.REFERENCE,
  1156. object_type = StringId64(OBJECT_TYPE_STATE_MACHINE_NODE),
  1157. name = "initial_state",
  1158. },
  1159. PropertyDefinition()
  1160. {
  1161. type = PropertyType.OBJECTS_SET,
  1162. name = "states",
  1163. object_type = state_machine_node_type,
  1164. },
  1165. PropertyDefinition()
  1166. {
  1167. type = PropertyType.OBJECTS_SET,
  1168. name = "variables",
  1169. object_type = state_machine_variable_type,
  1170. },
  1171. PropertyDefinition()
  1172. {
  1173. type = PropertyType.STRING,
  1174. name = "animation_type",
  1175. deffault = OBJECT_TYPE_SPRITE_ANIMATION,
  1176. hidden = true,
  1177. },
  1178. PropertyDefinition()
  1179. {
  1180. type = PropertyType.RESOURCE,
  1181. name = "skeleton_name",
  1182. resource_type = OBJECT_TYPE_MESH_SKELETON,
  1183. },
  1184. };
  1185. database.create_object_type(OBJECT_TYPE_STATE_MACHINE, properties);
  1186. properties =
  1187. {
  1188. PropertyDefinition()
  1189. {
  1190. type = PropertyType.DOUBLE,
  1191. name = "editor.camera.orthographic_size",
  1192. deffault = Vector3(20, -20, 20).length(),
  1193. },
  1194. PropertyDefinition()
  1195. {
  1196. type = PropertyType.VECTOR3,
  1197. name = "editor.camera.position",
  1198. deffault = Vector3(20, -20, 20),
  1199. },
  1200. PropertyDefinition()
  1201. {
  1202. type = PropertyType.QUATERNION,
  1203. name = "editor.camera.rotation",
  1204. deffault = Quaternion.look(Vector3(-20, 20, -20).normalize(), Vector3(0.0, 0.0, 1.0)),
  1205. },
  1206. PropertyDefinition()
  1207. {
  1208. type = PropertyType.DOUBLE,
  1209. name = "editor.camera.target_distance",
  1210. deffault = Vector3(20, -20, 20).length(),
  1211. },
  1212. PropertyDefinition()
  1213. {
  1214. type = PropertyType.DOUBLE,
  1215. name = "editor.camera.view_type",
  1216. deffault = (double)CameraViewType.PERSPECTIVE,
  1217. },
  1218. PropertyDefinition()
  1219. {
  1220. type = PropertyType.OBJECTS_SET,
  1221. name = "sounds",
  1222. object_type = sound_source_type,
  1223. },
  1224. PropertyDefinition()
  1225. {
  1226. type = PropertyType.OBJECTS_SET,
  1227. name = "units",
  1228. object_type = unit_type,
  1229. },
  1230. PropertyDefinition()
  1231. {
  1232. type = PropertyType.RESOURCE,
  1233. name = "skydome_unit",
  1234. resource_type = OBJECT_TYPE_UNIT,
  1235. deffault = "core/units/skydome/skydome",
  1236. },
  1237. };
  1238. database.create_object_type(OBJECT_TYPE_LEVEL, properties);
  1239. properties =
  1240. {
  1241. PropertyDefinition()
  1242. {
  1243. type = PropertyType.DOUBLE,
  1244. name = "cp",
  1245. min = 0.0,
  1246. },
  1247. PropertyDefinition()
  1248. {
  1249. type = PropertyType.DOUBLE,
  1250. name = "width",
  1251. min = 0.0,
  1252. },
  1253. PropertyDefinition()
  1254. {
  1255. type = PropertyType.DOUBLE,
  1256. name = "height",
  1257. min = 0.0,
  1258. },
  1259. PropertyDefinition()
  1260. {
  1261. type = PropertyType.DOUBLE,
  1262. name = "x",
  1263. min = 0.0,
  1264. },
  1265. PropertyDefinition()
  1266. {
  1267. type = PropertyType.DOUBLE,
  1268. name = "x_advance",
  1269. min = 0.0,
  1270. },
  1271. PropertyDefinition()
  1272. {
  1273. type = PropertyType.DOUBLE,
  1274. name = "x_offset",
  1275. min = 0.0,
  1276. },
  1277. PropertyDefinition()
  1278. {
  1279. type = PropertyType.DOUBLE,
  1280. name = "y",
  1281. min = 0.0,
  1282. },
  1283. PropertyDefinition()
  1284. {
  1285. type = PropertyType.DOUBLE,
  1286. name = "y_offset",
  1287. min = 0.0,
  1288. },
  1289. };
  1290. database.create_object_type(OBJECT_TYPE_FONT_GLYPH, properties);
  1291. properties =
  1292. {
  1293. PropertyDefinition()
  1294. {
  1295. type = PropertyType.OBJECTS_SET,
  1296. name = "glyphs",
  1297. object_type = StringId64(OBJECT_TYPE_FONT_GLYPH),
  1298. },
  1299. PropertyDefinition()
  1300. {
  1301. type = PropertyType.DOUBLE,
  1302. name = "font_size",
  1303. min = 0.0,
  1304. },
  1305. PropertyDefinition()
  1306. {
  1307. type = PropertyType.DOUBLE,
  1308. name = "size",
  1309. min = 0.0,
  1310. },
  1311. };
  1312. database.create_object_type(OBJECT_TYPE_FONT, properties);
  1313. properties =
  1314. {
  1315. PropertyDefinition()
  1316. {
  1317. type = PropertyType.STRING,
  1318. name = "source",
  1319. },
  1320. PropertyDefinition()
  1321. {
  1322. type = PropertyType.STRING,
  1323. name = "stack_name",
  1324. },
  1325. PropertyDefinition()
  1326. {
  1327. type = PropertyType.RESOURCE,
  1328. name = "target_skeleton",
  1329. resource_type = OBJECT_TYPE_MESH_SKELETON,
  1330. },
  1331. };
  1332. database.create_object_type(OBJECT_TYPE_MESH_ANIMATION, properties);
  1333. properties =
  1334. {
  1335. PropertyDefinition()
  1336. {
  1337. type = PropertyType.STRING,
  1338. name = "name",
  1339. },
  1340. PropertyDefinition()
  1341. {
  1342. type = PropertyType.OBJECTS_SET,
  1343. name = "children",
  1344. object_type = StringId64(OBJECT_TYPE_MESH_BONE),
  1345. },
  1346. };
  1347. database.create_object_type(OBJECT_TYPE_MESH_BONE, properties);
  1348. properties =
  1349. {
  1350. PropertyDefinition()
  1351. {
  1352. type = PropertyType.STRING,
  1353. name = "source",
  1354. },
  1355. PropertyDefinition()
  1356. {
  1357. type = PropertyType.OBJECTS_SET,
  1358. name = "skeleton",
  1359. object_type = StringId64(OBJECT_TYPE_MESH_BONE),
  1360. },
  1361. };
  1362. database.create_object_type(OBJECT_TYPE_MESH_SKELETON, properties);
  1363. properties =
  1364. {
  1365. PropertyDefinition()
  1366. {
  1367. type = PropertyType.STRING,
  1368. name = "source",
  1369. },
  1370. PropertyDefinition()
  1371. {
  1372. type = PropertyType.BOOL,
  1373. name = "generate_mips",
  1374. deffault = true,
  1375. not_serialized = true,
  1376. },
  1377. PropertyDefinition()
  1378. {
  1379. type = PropertyType.BOOL,
  1380. name = "normal_map",
  1381. not_serialized = true,
  1382. },
  1383. PropertyDefinition()
  1384. {
  1385. type = PropertyType.STRING,
  1386. name = "output.android.format",
  1387. editor = PropertyEditorType.ENUM,
  1388. enum_values = { "BC1", "BC2", "BC3", "BC4", "BC5", "PTC14", "RGB8", "RGBA8" },
  1389. deffault = "BC1",
  1390. },
  1391. PropertyDefinition()
  1392. {
  1393. type = PropertyType.BOOL,
  1394. name = "output.android.generate_mips",
  1395. deffault = true,
  1396. },
  1397. PropertyDefinition()
  1398. {
  1399. type = PropertyType.DOUBLE,
  1400. name = "output.android.mip_skip_smallest",
  1401. },
  1402. PropertyDefinition()
  1403. {
  1404. type = PropertyType.BOOL,
  1405. name = "output.android.normal_map",
  1406. },
  1407. PropertyDefinition()
  1408. {
  1409. type = PropertyType.BOOL,
  1410. name = "output.android.linear",
  1411. },
  1412. PropertyDefinition()
  1413. {
  1414. type = PropertyType.BOOL,
  1415. name = "output.android.premultiply_alpha",
  1416. },
  1417. PropertyDefinition()
  1418. {
  1419. type = PropertyType.STRING,
  1420. name = "output.html5.format",
  1421. editor = PropertyEditorType.ENUM,
  1422. enum_values = { "BC1", "BC2", "BC3", "BC4", "BC5", "PTC14", "RGB8", "RGBA8" },
  1423. deffault = "BC1",
  1424. },
  1425. PropertyDefinition()
  1426. {
  1427. type = PropertyType.BOOL,
  1428. name = "output.html5.generate_mips",
  1429. deffault = true,
  1430. },
  1431. PropertyDefinition()
  1432. {
  1433. type = PropertyType.DOUBLE,
  1434. name = "output.html5.mip_skip_smallest",
  1435. },
  1436. PropertyDefinition()
  1437. {
  1438. type = PropertyType.BOOL,
  1439. name = "output.html5.normal_map",
  1440. },
  1441. PropertyDefinition()
  1442. {
  1443. type = PropertyType.BOOL,
  1444. name = "output.html5.linear",
  1445. },
  1446. PropertyDefinition()
  1447. {
  1448. type = PropertyType.BOOL,
  1449. name = "output.html5.premultiply_alpha",
  1450. },
  1451. PropertyDefinition()
  1452. {
  1453. type = PropertyType.STRING,
  1454. name = "output.linux.format",
  1455. editor = PropertyEditorType.ENUM,
  1456. enum_values = { "BC1", "BC2", "BC3", "BC4", "BC5", "PTC14", "RGB8", "RGBA8" },
  1457. deffault = "BC1",
  1458. },
  1459. PropertyDefinition()
  1460. {
  1461. type = PropertyType.BOOL,
  1462. name = "output.linux.generate_mips",
  1463. deffault = true,
  1464. },
  1465. PropertyDefinition()
  1466. {
  1467. type = PropertyType.DOUBLE,
  1468. name = "output.linux.mip_skip_smallest",
  1469. },
  1470. PropertyDefinition()
  1471. {
  1472. type = PropertyType.BOOL,
  1473. name = "output.linux.normal_map",
  1474. },
  1475. PropertyDefinition()
  1476. {
  1477. type = PropertyType.BOOL,
  1478. name = "output.linux.linear",
  1479. },
  1480. PropertyDefinition()
  1481. {
  1482. type = PropertyType.BOOL,
  1483. name = "output.linux.premultiply_alpha",
  1484. },
  1485. PropertyDefinition()
  1486. {
  1487. type = PropertyType.STRING,
  1488. name = "output.windows.format",
  1489. editor = PropertyEditorType.ENUM,
  1490. enum_values = { "BC1", "BC2", "BC3", "BC4", "BC5", "PTC14", "RGB8", "RGBA8" },
  1491. deffault = "BC1",
  1492. },
  1493. PropertyDefinition()
  1494. {
  1495. type = PropertyType.BOOL,
  1496. name = "output.windows.generate_mips",
  1497. deffault = true,
  1498. },
  1499. PropertyDefinition()
  1500. {
  1501. type = PropertyType.DOUBLE,
  1502. name = "output.windows.mip_skip_smallest",
  1503. },
  1504. PropertyDefinition()
  1505. {
  1506. type = PropertyType.BOOL,
  1507. name = "output.windows.normal_map",
  1508. },
  1509. PropertyDefinition()
  1510. {
  1511. type = PropertyType.BOOL,
  1512. name = "output.windows.linear",
  1513. },
  1514. PropertyDefinition()
  1515. {
  1516. type = PropertyType.BOOL,
  1517. name = "output.windows.premultiply_alpha",
  1518. },
  1519. };
  1520. database.create_object_type(OBJECT_TYPE_TEXTURE, properties);
  1521. }
  1522. } /* namespace Crown */