1
$\begingroup$

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?

$\endgroup$
1
2
$\begingroup$

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
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.