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()