Skip to content

[p5.strands] Auto-return input objects if omitted #7994

@davepagurek

Description

@davepagurek

Right now, many (but not all!) shader hooks involve taking in a struct, modifying it, then returning it, e.g.:

  getObjectInputs((inputs) => {
    inputs.position.x += 10;
    return inputs;
  })

We could make it so that if the input and return types are the same, if your hook callback doesn't already return something, we automatically return the input object, making this ok:

  getObjectInputs((inputs) => {
    inputs.position.x += 10;
  })

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions