I have a bpy.types.Panel where I have two buttons. The first button is 'test render' and second is 'final render'. I'd basically want to call the same operator class for both these buttons just that they will perform slightly different instructions.
I want to be able to access this as an argument in my bpy.types.Operator class. How would I do this?
Is there a way to pass the argument in the row operator? So that I can check that value in my operator class and based on that value set the values?
row.operator(TestOP.bl_idname, text="Test Render Settings", icon='PLAY')
So basically when I press the button for test render I should be able to check it in my operator and set the values accordingly.
Something like
class TestOP(bpy.types.Operator, rendertype: string):
bl_label = "Test Operator"
bl_idname = "op.test"
def execute(self, context):
if rendertype == "test":
bpy.context.scene.cycles.samples = 28
elif rendertype == "final":
bpy.context.scene.cycles.samples = 512
return {'FINISHED'}
I thought it would be possible to maybe pass some args in TestOP.bl_idname("testorfinal") but I'm not sure how I'm supposed to go about it.
Thanks in advance
