getMeshVertexFormat.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. return {
  2. summary = 'Get the vertex format of a mesh.',
  3. description = [[
  4. Returns the vertex format of a mesh. The vertex format defines the properties associated with
  5. each vertex (position, color, etc.), including their types and binary data layout.
  6. ]],
  7. arguments = {
  8. mesh = {
  9. type = 'number',
  10. description = 'The index of a mesh.'
  11. }
  12. },
  13. returns = {
  14. format = {
  15. type = 'table',
  16. description = 'The vertex format of the mesh.'
  17. }
  18. },
  19. variants = {
  20. {
  21. arguments = { 'mesh' },
  22. returns = { 'format' }
  23. }
  24. },
  25. notes = [[
  26. The format is given as a table of vertex attributes. Each attribute is a table containing the
  27. following:
  28. { name, type, components, blob, offset, stride }
  29. - The `name` will be a `DefaultAttribute`.
  30. - The `type` will be an `AttributeType`.
  31. - The `component` count will be 1-4.
  32. - The `blob` is an index of one of the Blobs in the model (see `ModelData:getBlob`).
  33. - The `offset` is a byte offset from the start of the Blob where the attribute's data starts.
  34. - The `stride` is the number of bytes between consecutive values.
  35. ]],
  36. related = {
  37. 'ModelData:getMeshIndexFormat'
  38. }
  39. }