Step property in IntProperty not working.

I’m trying to make a button in the property shelf which allows a user to input a number or click on the left and right arrows to increase or decrease its value. I thought you could change this default (arrows increasing or decreasing) value using the step option but it’s not working. For instance, when clicking on the right arrow of the value, I would like it to increase by 256, but it keeps only incrementing or decrementing by 1. Here’s the code. Any ideas?:


import bpy


#Define properties and store them into a PropertyGroup 
#class for easy registration at the bottom.
class propertySettings(bpy.types.PropertyGroup):
    bpy.types.WindowManager.imgSize = bpy.props.IntProperty(
    name="New Layer Size",
    description = "The size of the next layer you add (width and height) will be this",
    default = 1024, 
    min = 24,
    step = 256)


#Draw the addon into the Property Shelf    
class myPaint(bpy.types.Panel):
    bl_label = "Layers"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    
    #Make addon specific to Texture Paint mode
    @classmethod
    def poll(cls, context):
        return (context.image_paint_object)
    
    def draw(self, context):
        
        layout = self.layout
        
        row = layout.row()
        row.prop(context.window_manager, "imgSize")



#Registration
classes = [propertySettings, myPaint]


def register():
    for c in classes:
        bpy.utils.register_class(c)


def unregister():
    for c in classes:
        bpy.utils.unregister_class(c)


if __name__ == "__main__":
    register()

IntProperty does not support it, it seems. But you can use a trick:


bpy.types.WindowManager.imgSize = bpy.props.FloatProperty(
    name="New Layer Size",
    description="The size of the next layer you add (width and height) will be this",
    default=1024, 
    min=24,
    precision=0,
    step=25600
)

FloatProperty supports step, and we can set the precision to 0 to hide the decimal places. Make sure you round it to int if necessary, as it’s still a float internally and may not work otherwise under certain circumstances (e.g. range doesn’t support floats).

The step value is given in 100th btw!

Cool! Works great. Thanks.

Just to wrap this up for anyone who might come across this, to basically treat a FloatProperty() like an IntProperty(), follow the tips presented by CoDEmanX and then wherever you’re using the property later in your script just inclose it in a round(). So in this case, whenever I needed to access the value provided by the user for this button I use:

myValue = round(bpy.context.window_manager.imgSize)