7
$\begingroup$

I'm making an add-on that is supposed to take in a lot of user-decided configurations . I know I can create panels and stuff, but I'd prefer to create a configuration window that pops up and fills the entire screen, since there are too many options to select, and I also have to show some image thumbnails.

This new window can have all my configuration options laid out in any way I want, and can take any size, and has a close button. It can be opened using some hotkey or button when the user wants to use my add on.

Is something like this possible?

$\endgroup$
  • 1
    $\begingroup$ You could possibly create a separate program and run that from the blender add-on (os.system("some_executable.exe"). That program could have whatever interface you like (recommend PyQt for cross-platformness), and simply save the user's choices to a text file that the add-on then reads. But if most of the user's time is spent in blender using your tool, it'd be best if the entire interface is consistent and within blender. $\endgroup$ – Greg Zaal Dec 11 '14 at 13:09
7
$\begingroup$

Add-on's can their own user preferences.

http://www.blender.org/api/blender_python_api_2_72_release/bpy.types.AddonPreferences.html#bpy.types.AddonPreferences

This doesn't fill the entire window, but this is the intended way for your add-on to be configured.

$\endgroup$
4
$\begingroup$

The design you propose is not very blender-like. The way this should be are options under the addon box in User Preferences > Addons. This is how you implement it:

import bpy

class SomeAddonPrefs(bpy.types.AddonPreferences):
    bl_idname = __name__
    # here you define the addons customizable props
    some_prop = bpy.props.FloatProperty(default=1.0)

    # here you specify how they are drawn
    def draw(self, context):
        layout = self.layout
        layout.prop(self, "some_prop")

# and this is how you access those settings in your add-on code
some_prop = bpy.context.user_preferences.addons[__name__].preferences.some_prop

#for 2.80 use
some_prop = bpy.context.preferences.addons[__name__].preferences.some_prop

# classes needs to be registered of course
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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