If I put a slider on a panel in the ‘user settings’ for an addon, how do I make that same slider appear on a panel in, for example, the 3D view? Is this possible?
I tried to do it with a different slider, but I’m having panel draw context problems when I try to retrieve the value of the ‘user settings’ slider and set another slider on a panel in the 3D view to the same value.
I thought it was something like that. I couldn’t quite get it though.
This was for my ‘Script Runner’ addon. It now gives you the option of settings, but not saving, the number of displayed scripts from the panel.
Also, I took your advice and replaced that loud, glaring, red-icon.
Funny, I wanted the other one, but my tired eyes couldn’t find it in the sea of icons displayed in the ‘All icons’ addon.
I looked again and it was there of course.
class ScriptRunnerAddonPreferences(AddonPreferences):
bl_idname = __name__
num_scripts = IntProperty(name="Number of Scripts",
description = "Set to the number of scripts to display in the panel", min = 1, max = 10, default = 2)
def draw(self, context):
user_settings = bpy.context.user_preferences.addons[__name__].preferences
layout = self.layout
row.label("Number of Script Slots to Display:")
row = layout.row()
row.prop(self, "num_scripts", text="Scripts", slider = False)