1

want to have button for apply transformations, but when I tried this code, it just doesn't work :(

layout.operator("object.transform_apply(location=False, rotation=True, scale=True)"), text="Reset Trasforms")

can someone please help me?

David
  • 49,291
  • 38
  • 159
  • 317
ifranckie
  • 11
  • 1

1 Answers1

2

When adding an operator to a layout, you should only add the API path, e.g. "object.transform_apply". Any parameters can be configured after if you store layout.operator in a variable:

operator = layout.operator("object.transform_apply", text="Reset Transforms")
operator.location = False
operator.rotation = True
operator.scale = True
Ray Mairlot
  • 29,192
  • 11
  • 103
  • 125