TextureSection.qml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  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. Section {
  8. caption: qsTr("Texture")
  9. width: parent.width
  10. SectionLayout {
  11. PropertyLabel {
  12. text: qsTr("Source")
  13. tooltip: qsTr("Sets the location of an image file containing the data used by the texture.")
  14. }
  15. SecondColumnLayout {
  16. UrlChooser {
  17. backendValue: backendValues.source
  18. }
  19. ExpandingSpacer {}
  20. }
  21. PropertyLabel {
  22. text: qsTr("Source Item")
  23. tooltip: qsTr("Sets an item to be used as the source of the texture.")
  24. }
  25. SecondColumnLayout {
  26. ItemFilterComboBox {
  27. typeFilter: "QtQuick.Item"
  28. backendValue: backendValues.sourceItem
  29. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  30. + StudioTheme.Values.actionIndicatorWidth
  31. }
  32. ExpandingSpacer {}
  33. }
  34. PropertyLabel {
  35. text: qsTr("Texture Data")
  36. tooltip: qsTr("Sets a reference to a TextureData component which defines the contents and properties of raw texture data.")
  37. }
  38. SecondColumnLayout {
  39. ItemFilterComboBox {
  40. typeFilter: "QtQuick3D.TextureData"
  41. backendValue: backendValues.textureData
  42. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  43. + StudioTheme.Values.actionIndicatorWidth
  44. }
  45. ExpandingSpacer {}
  46. }
  47. PropertyLabel {
  48. text: qsTr("Scale")
  49. }
  50. SecondColumnLayout {
  51. SpinBox {
  52. minimumValue: 0
  53. maximumValue: 999999
  54. decimals: 2
  55. backendValue: backendValues.scaleU
  56. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  57. + StudioTheme.Values.actionIndicatorWidth
  58. }
  59. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  60. ControlLabel {
  61. text: "U"
  62. tooltip: qsTr("Sets how to scale the U texture coordinate when mapping to UV coordinates of a mesh.")
  63. }
  64. Spacer { implicitWidth: StudioTheme.Values.controlGap }
  65. SpinBox {
  66. minimumValue: 0
  67. maximumValue: 999999
  68. decimals: 2
  69. backendValue: backendValues.scaleV
  70. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  71. + StudioTheme.Values.actionIndicatorWidth
  72. }
  73. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  74. ControlLabel {
  75. text: "V"
  76. tooltip: qsTr("Sets how to scale the V texture coordinate when mapping to UV coordinates of a mesh.")
  77. }
  78. ExpandingSpacer {}
  79. }
  80. PropertyLabel {
  81. text: qsTr("Flip V")
  82. tooltip: qsTr("Sets the use of the vertically flipped coordinates.")
  83. }
  84. SecondColumnLayout {
  85. CheckBox {
  86. id: flipVcheckBox
  87. text: backendValues.flipV.valueToString
  88. backendValue: backendValues.flipV
  89. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  90. + StudioTheme.Values.actionIndicatorWidth
  91. }
  92. ExpandingSpacer {}
  93. }
  94. PropertyLabel {
  95. text: qsTr("Flip U")
  96. tooltip: qsTr("Sets the use of the horizontally flipped texture coordinates.")
  97. }
  98. SecondColumnLayout {
  99. CheckBox {
  100. id: flipUCheckBox
  101. text: backendValues.flipU.valueToString
  102. backendValue: backendValues.flipU
  103. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  104. + StudioTheme.Values.actionIndicatorWidth
  105. }
  106. ExpandingSpacer {}
  107. }
  108. PropertyLabel {
  109. text: qsTr("Auto Orientation")
  110. tooltip: qsTr("Sets if a texture transformation, such as flipping the V texture coordinate, is applied automatically for textures where this is typically relevant.")
  111. }
  112. SecondColumnLayout {
  113. CheckBox {
  114. id: autoOrientationCheckBox
  115. text: backendValues.autoOrientation.valueToString
  116. backendValue: backendValues.autoOrientation
  117. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  118. + StudioTheme.Values.actionIndicatorWidth
  119. }
  120. ExpandingSpacer {}
  121. }
  122. PropertyLabel {
  123. text: qsTr("Texture Mapping")
  124. tooltip: qsTr("Sets which method of mapping to use when sampling this texture.")
  125. }
  126. SecondColumnLayout {
  127. ComboBox {
  128. scope: "Texture"
  129. model: ["UV", "Environment", "LightProbe"]
  130. backendValue: backendValues.mappingMode
  131. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  132. + StudioTheme.Values.actionIndicatorWidth
  133. }
  134. }
  135. PropertyLabel {
  136. text: qsTr("U Tiling")
  137. tooltip: qsTr("Sets how the texture is mapped when the U scaling value is greater than 1.")
  138. }
  139. SecondColumnLayout {
  140. ComboBox {
  141. scope: "Texture"
  142. model: ["ClampToEdge", "MirroredRepeat", "Repeat"]
  143. backendValue: backendValues.tilingModeHorizontal
  144. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  145. + StudioTheme.Values.actionIndicatorWidth
  146. }
  147. ExpandingSpacer {}
  148. }
  149. PropertyLabel {
  150. text: qsTr("V Tiling")
  151. tooltip: qsTr("Sets how the texture is mapped when the V scaling value is greater than 1.")
  152. }
  153. SecondColumnLayout {
  154. ComboBox {
  155. scope: "Texture"
  156. model: ["ClampToEdge", "MirroredRepeat", "Repeat"]
  157. backendValue: backendValues.tilingModeVertical
  158. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  159. + StudioTheme.Values.actionIndicatorWidth
  160. }
  161. ExpandingSpacer {}
  162. }
  163. PropertyLabel {
  164. text: qsTr("UV Index")
  165. tooltip: qsTr("Sets the UV coordinate index used by this texture.")
  166. }
  167. SecondColumnLayout {
  168. SpinBox {
  169. minimumValue: 0
  170. maximumValue: 999999
  171. decimals: 0
  172. backendValue: backendValues.indexUV
  173. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  174. + StudioTheme.Values.actionIndicatorWidth
  175. }
  176. ExpandingSpacer {}
  177. }
  178. PropertyLabel {
  179. text: qsTr("UV Rotation")
  180. tooltip: qsTr("Sets the rotation of the texture around the pivot point.")
  181. }
  182. SecondColumnLayout {
  183. SpinBox {
  184. maximumValue: 999999
  185. minimumValue: -999999
  186. decimals: 0
  187. backendValue: backendValues.rotationUV
  188. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  189. + StudioTheme.Values.actionIndicatorWidth
  190. }
  191. ExpandingSpacer {}
  192. }
  193. PropertyLabel {
  194. text: qsTr("Position")
  195. }
  196. SecondColumnLayout {
  197. SpinBox {
  198. maximumValue: 999999
  199. minimumValue: -999999
  200. decimals: 2
  201. stepSize: 0.1
  202. backendValue: backendValues.positionU
  203. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  204. + StudioTheme.Values.actionIndicatorWidth
  205. }
  206. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  207. ControlLabel {
  208. text: "U"
  209. tooltip: qsTr("Sets the U coordinate mapping offset from left to right.")
  210. }
  211. Spacer { implicitWidth: StudioTheme.Values.controlGap }
  212. SpinBox {
  213. maximumValue: 999999
  214. minimumValue: -999999
  215. decimals: 2
  216. stepSize: 0.1
  217. backendValue: backendValues.positionV
  218. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  219. + StudioTheme.Values.actionIndicatorWidth
  220. }
  221. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  222. ControlLabel {
  223. text: "V"
  224. tooltip: qsTr("Sets the V coordinate mapping offset from bottom to top.")
  225. }
  226. ExpandingSpacer {}
  227. }
  228. PropertyLabel {
  229. text: qsTr("Pivot")
  230. }
  231. SecondColumnLayout {
  232. SpinBox {
  233. maximumValue: 999999
  234. minimumValue: -999999
  235. decimals: 2
  236. stepSize: 0.1
  237. backendValue: backendValues.pivotU
  238. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  239. + StudioTheme.Values.actionIndicatorWidth
  240. }
  241. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  242. ControlLabel {
  243. text: "U"
  244. tooltip: qsTr("Sets the pivot U position.")
  245. }
  246. Spacer { implicitWidth: StudioTheme.Values.controlGap }
  247. SpinBox {
  248. maximumValue: 999999
  249. minimumValue: -999999
  250. decimals: 2
  251. stepSize: 0.1
  252. backendValue: backendValues.pivotV
  253. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  254. + StudioTheme.Values.actionIndicatorWidth
  255. }
  256. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  257. ControlLabel {
  258. text: "V"
  259. tooltip: qsTr("Sets the pivot V position.")
  260. }
  261. ExpandingSpacer {}
  262. }
  263. PropertyLabel {
  264. text: qsTr("Generate Mipmaps")
  265. tooltip: qsTr("Sets if mipmaps are generated for textures that do not provide mipmap levels themselves.")
  266. }
  267. SecondColumnLayout {
  268. CheckBox {
  269. id: generateMipmapscheckBox
  270. text: backendValues.generateMipmaps.valueToString
  271. backendValue: backendValues.generateMipmaps
  272. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  273. + StudioTheme.Values.actionIndicatorWidth
  274. }
  275. ExpandingSpacer {}
  276. }
  277. PropertyLabel {
  278. text: qsTr("Mag Filter")
  279. tooltip: qsTr("Sets how the texture is sampled when a texel covers more than one pixel.")
  280. }
  281. SecondColumnLayout {
  282. ComboBox {
  283. scope: "Texture"
  284. model: ["None", "Nearest", "Linear"]
  285. backendValue: backendValues.magFilter
  286. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  287. + StudioTheme.Values.actionIndicatorWidth
  288. }
  289. ExpandingSpacer {}
  290. }
  291. PropertyLabel {
  292. text: qsTr("Min Filter")
  293. tooltip: qsTr("Sets how the texture is sampled when a texel covers more than one pixel.")
  294. }
  295. SecondColumnLayout {
  296. ComboBox {
  297. scope: "Texture"
  298. model: ["None", "Nearest", "Linear"]
  299. backendValue: backendValues.minFilter
  300. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  301. + StudioTheme.Values.actionIndicatorWidth
  302. }
  303. ExpandingSpacer {}
  304. }
  305. PropertyLabel {
  306. text: qsTr("Mip Filter")
  307. tooltip: qsTr("Sets how the texture mipmaps are sampled when a texel covers less than one pixel.")
  308. }
  309. SecondColumnLayout {
  310. ComboBox {
  311. scope: "Texture"
  312. model: ["None", "Nearest", "Linear"]
  313. backendValue: backendValues.mipFilter
  314. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  315. + StudioTheme.Values.actionIndicatorWidth
  316. }
  317. ExpandingSpacer {}
  318. }
  319. }
  320. }