ParticleEmitter3DSection.qml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  1. // Copyright (C) 2021 The Qt Company Ltd.
  2. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
  3. import QtQuick 2.15
  4. import QtQuick.Layouts 1.15
  5. import HelperWidgets 2.0
  6. import StudioTheme 1.0 as StudioTheme
  7. Column {
  8. width: parent.width
  9. Section {
  10. caption: qsTr("Particle Emitter")
  11. width: parent.width
  12. SectionLayout {
  13. PropertyLabel {
  14. text: qsTr("System")
  15. tooltip: qsTr("Sets the ParticleSystem3D for the emitter. If system is direct parent of the emitter, this property does not need to be defined.")
  16. }
  17. SecondColumnLayout {
  18. ItemFilterComboBox {
  19. typeFilter: "QtQuick3D.Particles3D.ParticleSystem3D"
  20. backendValue: backendValues.system
  21. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  22. + StudioTheme.Values.actionIndicatorWidth
  23. }
  24. ExpandingSpacer {}
  25. }
  26. PropertyLabel {
  27. text: qsTr("Emit Bursts")
  28. tooltip: qsTr("Sets a list of EmitBurst3D elements to declaratively define bursts.")
  29. Layout.alignment: Qt.AlignTop
  30. Layout.topMargin: 5
  31. }
  32. SecondColumnLayout {
  33. EditableListView {
  34. backendValue: backendValues.emitBursts
  35. model: backendValues.emitBursts.expressionAsList
  36. Layout.fillWidth: true
  37. typeFilter: "QtQuick3D.Particles3D.EmitBurst3D"
  38. onAdd: function(value) { backendValues.emitBursts.idListAdd(value) }
  39. onRemove: function(idx) { backendValues.emitBursts.idListRemove(idx) }
  40. onReplace: function (idx, value) { backendValues.emitBursts.idListReplace(idx, value) }
  41. }
  42. ExpandingSpacer {}
  43. }
  44. PropertyLabel {
  45. text: qsTr("Velocity")
  46. tooltip: qsTr("Sets a starting velocity for emitted particles.")
  47. }
  48. SecondColumnLayout {
  49. ItemFilterComboBox {
  50. typeFilter: "QQuick3DParticleDirection"
  51. backendValue: backendValues.velocity
  52. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  53. + StudioTheme.Values.actionIndicatorWidth
  54. }
  55. ExpandingSpacer {}
  56. }
  57. PropertyLabel {
  58. text: qsTr("Particle")
  59. tooltip: qsTr("Sets the logical particle which this emitter emits.")
  60. }
  61. SecondColumnLayout {
  62. ItemFilterComboBox {
  63. typeFilter: "QtQuick3D.Particles3D.Particle3D"
  64. backendValue: backendValues.particle
  65. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  66. + StudioTheme.Values.actionIndicatorWidth
  67. }
  68. ExpandingSpacer {}
  69. }
  70. PropertyLabel {
  71. text: qsTr("Enabled")
  72. tooltip: qsTr("If enabled is set to false, this emitter will not emit any particles.")
  73. }
  74. SecondColumnLayout {
  75. CheckBox {
  76. id: enabledCheckBox
  77. text: backendValues.enabled.valueToString
  78. backendValue: backendValues.enabled
  79. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  80. + StudioTheme.Values.actionIndicatorWidth
  81. }
  82. ExpandingSpacer {}
  83. }
  84. PropertyLabel {
  85. text: qsTr("Shape")
  86. tooltip: qsTr("Sets optional shape for the emitting area.")
  87. }
  88. SecondColumnLayout {
  89. ItemFilterComboBox {
  90. typeFilter: "QQuick3DParticleAbstractShape"
  91. backendValue: backendValues.shape
  92. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  93. + StudioTheme.Values.actionIndicatorWidth
  94. }
  95. ExpandingSpacer {}
  96. }
  97. PropertyLabel {
  98. text: qsTr("Emit Rate")
  99. tooltip: qsTr("Sets the constant emitting rate in particles per second.")
  100. }
  101. SecondColumnLayout {
  102. SpinBox {
  103. minimumValue: 0
  104. maximumValue: 999999
  105. decimals: 2
  106. backendValue: backendValues.emitRate
  107. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  108. + StudioTheme.Values.actionIndicatorWidth
  109. }
  110. ExpandingSpacer {}
  111. }
  112. PropertyLabel {
  113. text: qsTr("Life Span")
  114. tooltip: qsTr("Sets the lifespan of a single particle in milliseconds.")
  115. }
  116. SecondColumnLayout {
  117. SpinBox {
  118. minimumValue: 0
  119. maximumValue: 999999
  120. decimals: 0
  121. backendValue: backendValues.lifeSpan
  122. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  123. + StudioTheme.Values.actionIndicatorWidth
  124. }
  125. ExpandingSpacer {}
  126. }
  127. PropertyLabel {
  128. text: qsTr("Life Span Variation")
  129. tooltip: qsTr("Sets the lifespan variation of a single particle in milliseconds.")
  130. }
  131. SecondColumnLayout {
  132. SpinBox {
  133. minimumValue: -999999
  134. maximumValue: 999999
  135. decimals: 0
  136. backendValue: backendValues.lifeSpanVariation
  137. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  138. + StudioTheme.Values.actionIndicatorWidth
  139. }
  140. ExpandingSpacer {}
  141. }
  142. PropertyLabel {
  143. text: qsTr("Particle Scale")
  144. tooltip: qsTr("Sets the scale multiplier of the particles at the beginning")
  145. }
  146. SecondColumnLayout {
  147. SpinBox {
  148. minimumValue: -999999
  149. maximumValue: 999999
  150. decimals: 2
  151. backendValue: backendValues.particleScale
  152. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  153. + StudioTheme.Values.actionIndicatorWidth
  154. }
  155. ExpandingSpacer {}
  156. }
  157. PropertyLabel {
  158. text: qsTr("Particle End Scale")
  159. tooltip: qsTr("Sets the scale multiplier of the particles at the end of particle lifeSpan.")
  160. }
  161. SecondColumnLayout {
  162. SpinBox {
  163. minimumValue: -999999
  164. maximumValue: 999999
  165. decimals: 2
  166. backendValue: backendValues.particleEndScale
  167. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  168. + StudioTheme.Values.actionIndicatorWidth
  169. }
  170. ExpandingSpacer {}
  171. }
  172. PropertyLabel {
  173. text: qsTr("Scale Variation")
  174. tooltip: qsTr("Sets the scale variation of the particles.")
  175. }
  176. SecondColumnLayout {
  177. SpinBox {
  178. minimumValue: -999999
  179. maximumValue: 999999
  180. decimals: 2
  181. backendValue: backendValues.particleScaleVariation
  182. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  183. + StudioTheme.Values.actionIndicatorWidth
  184. }
  185. ExpandingSpacer {}
  186. }
  187. PropertyLabel {
  188. text: qsTr("End Scale Variation")
  189. tooltip: qsTr("Sets the scale variation of the particles in the end.")
  190. }
  191. SecondColumnLayout {
  192. SpinBox {
  193. minimumValue: -999999
  194. maximumValue: 999999
  195. decimals: 2
  196. backendValue: backendValues.particleEndScaleVariation
  197. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  198. + StudioTheme.Values.actionIndicatorWidth
  199. }
  200. ExpandingSpacer {}
  201. }
  202. PropertyLabel {
  203. text: qsTr("Depth Bias")
  204. tooltip: qsTr("Sets the depth bias of the emitter. Depth bias is added to the object distance from camera when sorting objects.")
  205. }
  206. SecondColumnLayout {
  207. SpinBox {
  208. minimumValue: -999999
  209. maximumValue: 999999
  210. decimals: 2
  211. backendValue: backendValues.depthBias
  212. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  213. + StudioTheme.Values.actionIndicatorWidth
  214. }
  215. ExpandingSpacer {}
  216. }
  217. }
  218. }
  219. Section {
  220. width: parent.width
  221. caption: qsTr("Particle Rotation")
  222. ColumnLayout {
  223. spacing: StudioTheme.Values.transform3DSectionSpacing
  224. SectionLayout {
  225. PropertyLabel {
  226. text: qsTr("Rotation")
  227. tooltip: qsTr("Sets the rotation of the particles in the beginning. Rotation is defined as degrees in euler angles.")
  228. }
  229. SecondColumnLayout {
  230. SpinBox {
  231. minimumValue: -9999999
  232. maximumValue: 9999999
  233. decimals: 2
  234. backendValue: backendValues.particleRotation_x
  235. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  236. + StudioTheme.Values.actionIndicatorWidth
  237. }
  238. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  239. ControlLabel {
  240. text: "X"
  241. color: StudioTheme.Values.theme3DAxisXColor
  242. }
  243. ExpandingSpacer {}
  244. }
  245. PropertyLabel {}
  246. SecondColumnLayout {
  247. SpinBox {
  248. minimumValue: -9999999
  249. maximumValue: 9999999
  250. decimals: 2
  251. backendValue: backendValues.particleRotation_y
  252. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  253. + StudioTheme.Values.actionIndicatorWidth
  254. }
  255. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  256. ControlLabel {
  257. text: "Y"
  258. color: StudioTheme.Values.theme3DAxisYColor
  259. }
  260. ExpandingSpacer {}
  261. }
  262. PropertyLabel {}
  263. SecondColumnLayout {
  264. SpinBox {
  265. minimumValue: -9999999
  266. maximumValue: 9999999
  267. decimals: 2
  268. backendValue: backendValues.particleRotation_z
  269. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  270. + StudioTheme.Values.actionIndicatorWidth
  271. }
  272. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  273. ControlLabel {
  274. text: "Z"
  275. color: StudioTheme.Values.theme3DAxisZColor
  276. }
  277. ExpandingSpacer {}
  278. }
  279. }
  280. SectionLayout {
  281. PropertyLabel {
  282. text: qsTr("Variation")
  283. tooltip: qsTr("Sets the rotation variation of the particles in the beginning. Rotation variation is defined as degrees in euler angles.")
  284. }
  285. SecondColumnLayout {
  286. SpinBox {
  287. minimumValue: -9999999
  288. maximumValue: 9999999
  289. decimals: 2
  290. backendValue: backendValues.particleRotationVariation_x
  291. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  292. + StudioTheme.Values.actionIndicatorWidth
  293. }
  294. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  295. ControlLabel {
  296. text: "X"
  297. color: StudioTheme.Values.theme3DAxisXColor
  298. }
  299. ExpandingSpacer {}
  300. }
  301. PropertyLabel {}
  302. SecondColumnLayout {
  303. SpinBox {
  304. minimumValue: -9999999
  305. maximumValue: 9999999
  306. decimals: 2
  307. backendValue: backendValues.particleRotationVariation_y
  308. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  309. + StudioTheme.Values.actionIndicatorWidth
  310. }
  311. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  312. ControlLabel {
  313. text: "Y"
  314. color: StudioTheme.Values.theme3DAxisYColor
  315. }
  316. ExpandingSpacer {}
  317. }
  318. PropertyLabel {}
  319. SecondColumnLayout {
  320. SpinBox {
  321. minimumValue: -9999999
  322. maximumValue: 9999999
  323. decimals: 2
  324. backendValue: backendValues.particleRotationVariation_z
  325. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  326. + StudioTheme.Values.actionIndicatorWidth
  327. }
  328. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  329. ControlLabel {
  330. text: "Z"
  331. color: StudioTheme.Values.theme3DAxisZColor
  332. }
  333. ExpandingSpacer {}
  334. }
  335. }
  336. SectionLayout {
  337. PropertyLabel {
  338. text: qsTr("Velocity")
  339. tooltip: qsTr("Sets the rotation velocity of the particles in the beginning. Rotation velocity is defined as degrees per second in euler angles.")
  340. }
  341. SecondColumnLayout {
  342. SpinBox {
  343. minimumValue: -9999999
  344. maximumValue: 9999999
  345. decimals: 2
  346. backendValue: backendValues.particleRotationVelocity_x
  347. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  348. + StudioTheme.Values.actionIndicatorWidth
  349. }
  350. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  351. ControlLabel {
  352. text: "X"
  353. color: StudioTheme.Values.theme3DAxisXColor
  354. }
  355. ExpandingSpacer {}
  356. }
  357. PropertyLabel {}
  358. SecondColumnLayout {
  359. SpinBox {
  360. minimumValue: -9999999
  361. maximumValue: 9999999
  362. decimals: 2
  363. backendValue: backendValues.particleRotationVelocity_y
  364. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  365. + StudioTheme.Values.actionIndicatorWidth
  366. }
  367. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  368. ControlLabel {
  369. text: "Y"
  370. color: StudioTheme.Values.theme3DAxisYColor
  371. }
  372. ExpandingSpacer {}
  373. }
  374. PropertyLabel {}
  375. SecondColumnLayout {
  376. SpinBox {
  377. minimumValue: -9999999
  378. maximumValue: 9999999
  379. decimals: 2
  380. backendValue: backendValues.particleRotationVelocity_z
  381. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  382. + StudioTheme.Values.actionIndicatorWidth
  383. }
  384. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  385. ControlLabel {
  386. text: "Z"
  387. color: StudioTheme.Values.theme3DAxisZColor
  388. }
  389. ExpandingSpacer {}
  390. }
  391. }
  392. SectionLayout {
  393. PropertyLabel {
  394. text: qsTr("Velocity Variation")
  395. tooltip: qsTr("Sets the rotation velocity variation of the particles. Rotation velocity variation is defined as degrees per second in euler angles.")
  396. }
  397. SecondColumnLayout {
  398. SpinBox {
  399. minimumValue: -9999999
  400. maximumValue: 9999999
  401. decimals: 2
  402. backendValue: backendValues.particleRotationVelocityVariation_x
  403. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  404. + StudioTheme.Values.actionIndicatorWidth
  405. }
  406. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  407. ControlLabel {
  408. text: "X"
  409. color: StudioTheme.Values.theme3DAxisXColor
  410. }
  411. ExpandingSpacer {}
  412. }
  413. PropertyLabel {}
  414. SecondColumnLayout {
  415. SpinBox {
  416. minimumValue: -9999999
  417. maximumValue: 9999999
  418. decimals: 2
  419. backendValue: backendValues.particleRotationVelocityVariation_y
  420. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  421. + StudioTheme.Values.actionIndicatorWidth
  422. }
  423. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  424. ControlLabel {
  425. text: "Y"
  426. color: StudioTheme.Values.theme3DAxisYColor
  427. }
  428. ExpandingSpacer {}
  429. }
  430. PropertyLabel {}
  431. SecondColumnLayout {
  432. SpinBox {
  433. minimumValue: -9999999
  434. maximumValue: 9999999
  435. decimals: 2
  436. backendValue: backendValues.particleRotationVelocityVariation_z
  437. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  438. + StudioTheme.Values.actionIndicatorWidth
  439. }
  440. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  441. ControlLabel {
  442. text: "Z"
  443. color: StudioTheme.Values.theme3DAxisZColor
  444. }
  445. ExpandingSpacer {}
  446. }
  447. }
  448. }
  449. }
  450. }